I had mistakenly deleted my migration folders for all my apps in my project. I therefore had to redo
migrate for each of those apps. When thence I try to access the specific areas with relational paths I get an error.
relation "libman_classbooks" does not exist
When I try to make some changes on the models, save and try to run
migrate. this does not go on well but returns.
django.db.utils.ProgrammingError: relation "libman_classbooks" does not exist.
I have been forced to guess that I need to manually create the tables in the database. Using CREATETABLE. I don’t know if this is the best option though.
So I think my option may be possible in development thro’ the pgAdmin, but what about in production? If CREATETABLE is the best option to take, how will I do it for the production database??. I already have data in my database which do not need interference.
- To resolve this issue, you have to comment
'django.contrib.admin'this line in setting.py in installed app section, and then run command
docker exec -it <db-container name or ID> psql -U postgresand check your database is exist or not if exist then Drop the DB and create new DB with same name.
- After creating DB again run docker-compose up Now it will work and again uncomment the line which was commented in settings.py
- Another approach In case if it is not working add this line in settings.py in installed app section
'app.apps.AppConfig'then run docker- compose up it will work for you.
Answered By – nikhil upadhyay