django drop database postgres code example

Example 1: django drop database postgres

find . -path "*/migrations/*.py" -not -name "__init__.py" -delete
find . -path "*/migrations/*.pyc"  -delete

# Check status of files >
python3 manage.py showmigrations

create news migrations 

Enjoy:)

Example 2: django drop database postgres

find . -path "*/migrations/*.py" -not -name "__init__.py" -delete
find . -path "*/migrations/*.pyc"  -delete

# Check status of files >
python3 manage.py showmigrations

create news migrations 

Enjoy:)

Example 3: rebuild database from zero django postgres

sudo su postgres
psql
drop database your_database_name;
create database your_database_name with owner user_you_use_in_django;
\q
exit