0

I'm developing a simple app using Django. I am done with the development and I'm trying to push to Heroku server. I get this error if I try to create a superuser

You have 21 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): admin, auth, contenttypes, journpys, sessions.
Run 'python manage.py migrate' to apply them.
Traceback (most recent call last):`File "/app/.heroku/python/lib/python3.10/site-packages/django/db/backends/utils.py", line 89, in _execute
return self.cursor.execute(sql, params)
File "/app/.heroku/python/lib/python3.10/site-packages/django/db/backends/sqlite3/base.py", line 328, in execute`
return super().execute(query, params)
sqlite3.OperationalError: no such table: auth_user

I need help in fixing this error. Thanks.

All migrations have been done locally and using the Heroku run python manage.py migrate command with no issues. I have also looked at some articles on solutions to this error but none seemed to work.

Update: I resolved this by switching to PostgreSQL. This has been finally resolved.

1 Answers1

0

u need to Update Database Configuration in settings.py (at the bottom of the file) and after that excute this commant heroku run python manage.py migrate

checkout this link( read comments in this article as well ): enter link description here

  • I followed the directives from the link but still got this exception '_django.db.utils.OperationalError: no such table: auth_user_' – righteousness_wealth Jun 01 '23 at 13:59
  • you can try this as well, delete the **sqllite3** file and delete all of the files inside all of the migrations folders except ```__init__.py```, then run the ```makemigrations``` and ```migrate``` command again and then follow the instruction from the link again – Mohammad Hussein Rostami Jun 01 '23 at 14:20
  • Thank you for your response. I tried all these but they did not work. I fixed it by switching to Postgres. – righteousness_wealth Jun 05 '23 at 10:22