My Django apps works well locally but when deployed on heroku gives this error:
Application error An error occurred in the application and your page could not be served. If you are the application owner, check your logs for details. You can do this from the Heroku CLI with the command
Some solutions on net said too run:
heroku run python manage.py createsuperuser
But this gives the error:
django.db.utils.ProgrammingError: relation "auth_user" does not exist
LINE 1: ...user"."is_active", "auth_user"."date_joined" FROM "auth_user...
Also:
You have 26 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): Finance, admin, auth, checklist, contenttypes, sessions, tasks.
Run 'python manage.py migrate' to apply them.
However I already ran the below lines multiple time on command prompt.
> python manage.py makemigrations
> python manage.py migrate
I have also added these lines to settings.py as some other solutions said:
import django_heroku
django_heroku.settings(locals())
I also tried deleting the app and setting it up again but the error persists. Also tried to delete all migrations and make new one, still the error persists. Also to note that it ran initially for 2-seconds properly even then i was unable to access even the admin login page.
I have also attached the log file below:
2020-06-26T18:45:17.912130+00:00 app[api]: Release v1 created by user shivam.sarda@workamp.co
2020-06-26T18:45:17.912130+00:00 app[api]: Initial release by user shivam.sarda@workamp.co
2020-06-26T18:45:18.027404+00:00 app[api]: Enable Logplex by user shivam.sarda@workamp.co
2020-06-26T18:45:18.027404+00:00 app[api]: Release v2 created by user shivam.sarda@workamp.co
2020-06-26T18:45:38.089573+00:00 heroku[router]: at=info code=H81 desc="Blank app" method=GET path="/" host=workamp.herokuapp.com request_id=025fd57e-8a24-4d55-83a1-bda87494d7af fwd="61.0.152.114" dyno= connect= service= status=502 bytes= protocol=http
2020-06-26T18:45:38.593100+00:00 heroku[router]: at=info code=H81 desc="Blank app" method=GET path="/favicon.ico" host=workamp.herokuapp.com request_id=4e8f013b-2d1e-4e35-9395-6cf84bcefa52 fwd="61.0.152.114" dyno= connect= service= status=502 bytes= protocol=http
2020-06-26T18:47:52.000000+00:00 app[api]: Build started by user shivam.sarda@workamp.co
2020-06-26T18:48:16.453424+00:00 heroku[router]: at=info code=H81 desc="Blank app" method=GET path="/" host=workamp.herokuapp.com request_id=f6720d5d-83b9-4bb8-9d06-3147002c0f14 fwd="61.0.152.114" dyno= connect= service= status=502 bytes= protocol=http
2020-06-26T18:48:16.820355+00:00 heroku[router]: at=info code=H81 desc="Blank app" method=GET path="/favicon.ico" host=workamp.herokuapp.com request_id=555a27f5-6fb8-468c-b3c0-f6ed9addee83 fwd="61.0.152.114" dyno= connect= service= status=502 bytes= protocol=http
2020-06-26T18:48:21.484767+00:00 heroku[router]: at=info code=H81 desc="Blank app" method=GET path="/admin" host=workamp.herokuapp.com request_id=8c540e59-b597-4526-a236-ab10b9b384f2 fwd="61.0.152.114" dyno= connect= service= status=502 bytes= protocol=http
2020-06-26T18:48:21.871906+00:00 heroku[router]: at=info code=H81 desc="Blank app" method=GET path="/favicon.ico" host=workamp.herokuapp.com request_id=8bd54546-7fe6-49b2-b704-259101829669 fwd="61.0.152.114" dyno= connect= service= status=502 bytes= protocol=http
2020-06-26T18:48:27.401632+00:00 heroku[router]: at=info code=H81 desc="Blank app" method=GET path="/admin" host=workamp.herokuapp.com request_id=de2a98ff-6bba-4751-938b-9177df48ffbc fwd="61.0.152.114" dyno= connect= service= status=502 bytes= protocol=http
2020-06-26T18:48:27.764216+00:00 heroku[router]: at=info code=H81 desc="Blank app" method=GET path="/favicon.ico" host=workamp.herokuapp.com request_id=edc10e97-22f4-4db3-b665-074d86ae041f fwd="61.0.152.114" dyno= connect= service= status=502 bytes= protocol=http
2020-06-26T18:49:47.989479+00:00 app[api]: Attach DATABASE (@ref:postgresql-graceful-72554) by user shivam.sarda@workamp.co
2020-06-26T18:49:47.989479+00:00 app[api]: Running release v3 commands by user shivam.sarda@workamp.co
2020-06-26T18:49:47.999116+00:00 app[api]: @ref:postgresql-graceful-72554 completed provisioning, setting DATABASE_URL. by user shivam.sarda@workamp.co
2020-06-26T18:49:47.999116+00:00 app[api]: Release v4 created by user shivam.sarda@workamp.co
2020-06-26T18:49:48.229248+00:00 app[api]: Deploy 94879a30 by user shivam.sarda@workamp.co
2020-06-26T18:49:48.229248+00:00 app[api]: Release v5 created by user shivam.sarda@workamp.co
2020-06-26T18:50:13.000000+00:00 app[api]: Build succeeded
2020-06-26T18:52:45.849109+00:00 app[api]: Starting process with command `python mnage.py createsuperuser` by user shivam.sarda@workamp.co
2020-06-26T18:52:57.950366+00:00 heroku[run.8772]: State changed from starting to up
2020-06-26T18:52:58.180376+00:00 heroku[run.8772]: Awaiting client
2020-06-26T18:52:58.218485+00:00 heroku[run.8772]: Starting process with command `python mnage.py createsuperuser`
2020-06-26T18:53:02.805473+00:00 heroku[run.8772]: Process exited with status 2
2020-06-26T18:53:02.859662+00:00 heroku[run.8772]: State changed from up to complete
2020-06-26T18:53:10.575518+00:00 app[api]: Starting process with command `python manage.py createsuperuser` by user shivam.sarda@workamp.co
2020-06-26T18:53:21.163902+00:00 heroku[run.7938]: State changed from starting to up
2020-06-26T18:53:21.176279+00:00 heroku[run.7938]: Awaiting client
2020-06-26T18:53:21.227318+00:00 heroku[run.7938]: Starting process with command `python manage.py createsuperuser`
2020-06-26T18:53:26.576213+00:00 heroku[run.7938]: Process exited with status 1
2020-06-26T18:53:26.613259+00:00 heroku[run.7938]: State changed from up to complete
2020-06-26T18:54:30.833570+00:00 app[api]: Starting process with command `python manage.py createsuperuser` by user shivam.sarda@workamp.co
2020-06-26T18:54:44.903222+00:00 heroku[run.9000]: State changed from starting to up
2020-06-26T18:54:45.163642+00:00 heroku[run.9000]: Awaiting client
2020-06-26T18:54:45.212756+00:00 heroku[run.9000]: Starting process with command `python manage.py createsuperuser`
2020-06-26T18:54:51.269365+00:00 heroku[run.9000]: Process exited with status 1
2020-06-26T18:54:51.303225+00:00 heroku[run.9000]: State changed from up to complete
2020-06-26T18:56:10.723168+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/admin" host=workamp.herokuapp.com request_id=1439c6f7-fcc1-4e07-bc5a-6510948e3e60 fwd="61.0.152.114" dyno= connect= service= status=503 bytes= protocol=http
2020-06-26T18:56:11.367850+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=workamp.herokuapp.com request_id=8723c392-013b-451e-be18-8cec27375f72 fwd="61.0.152.114" dyno= connect= service= status=503 bytes= protocol=http
2020-06-26T18:58:37.791124+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/admin" host=workamp.herokuapp.com request_id=fd1b6519-922a-4446-a8f8-7d4cc16953b7 fwd="61.0.152.114" dyno= connect= service= status=503 bytes= protocol=http
2020-06-26T18:58:38.358495+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=workamp.herokuapp.com request_id=5dc586e8-8cb9-4172-a949-819eddcf0815 fwd="61.0.152.114" dyno= connect= service= status=503 bytes= protocol=http
2020-06-26T18:59:36.034719+00:00 app[api]: Starting process with command `python manage.py runserver` by user shivam.sarda@workamp.co
2020-06-26T18:59:46.262281+00:00 heroku[run.1465]: Awaiting client
2020-06-26T18:59:46.289032+00:00 heroku[run.1465]: Starting process with command `python manage.py runserver`
2020-06-26T18:59:46.306117+00:00 heroku[run.1465]: State changed from starting to up
2020-06-26T19:00:12.547296+00:00 heroku[run.1465]: Process exited with status 0
2020-06-26T19:00:12.578053+00:00 heroku[run.1465]: State changed from up to complete
2020-06-26T19:03:21.985107+00:00 app[api]: Starting process with command `python manage.py createsuperuser` by user shivam.sarda@workamp.co
2020-06-26T19:03:36.839804+00:00 heroku[run.4525]: State changed from starting to up
2020-06-26T19:03:37.525536+00:00 heroku[run.4525]: Awaiting client
2020-06-26T19:03:37.582336+00:00 heroku[run.4525]: Starting process with command `python manage.py createsuperuser`
2020-06-26T19:03:45.362388+00:00 heroku[run.4525]: Process exited with status 1
2020-06-26T19:03:45.402386+00:00 heroku[run.4525]: State changed from up to complete
2020-06-26T19:03:55.830080+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/admin" host=workamp.herokuapp.com request_id=6b69664b-21de-4755-9191-0d6f6c79f4c9 fwd="61.0.152.114" dyno= connect= service= status=503 bytes= protocol=http
2020-06-26T19:03:56.513662+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=workamp.herokuapp.com request_id=1abcee5e-dfb3-41be-9c0b-057c15de5bc9 fwd="61.0.152.114" dyno= connect= service= status=503 bytes= protocol=http
^