-1
I’m starting my studies with Django and created an application called core within the name Django project django1. After finishing, I decided to deploy it to Heroku with the following step by step (with a git repository already started):
heroku login
heroku create nome-do-app --buildpack heroku/python
heroku git:remote -a nome-do-app
heroku config:set ALLOWED_HOSTS=(link do projeto)
DJANGO_SETTINGS_MODULE=django1.settings.heroku
SECRET_KEY=blablabla
DEBUG=False
Everything happened normally and the project was deployed, however Heroku simply cannot identify my app core on the list of INSTALLED_APPS of my project (even though she was there):
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'core', # tambem tentei o core.apps.CoreConfig
]
I realized that Heroku was not recognizing because at the time of the migrations, while Django recognizes all the installed apps, Heroku recognizes only the ones that come as standard from Jango:
Already deleted the app from Heroku and tried the same process a few times, but the same thing always happens: Heroku deploys the app but can’t "find" the app core to carry out the migrations.
Here are some prints that may be relevant: (base.py is the default Settings.py that Django generates. With this change, I’ve also made the necessary edits to the python asgi.py, wsgi.py, Manage.py, and base.py files myself.)
Project structure:
Structure of the app core:
Heroku.py file:
Procfile:
release: python3 manage.py migrate
web: gunicorn django1.wsgi --preload --log-file -
How should I proceed?
In
INSTALLED_APPS
instead of usingcore
, usenome_do_projeto.core
– Paulo Marques
@Paulomarques I just tried here, still don’t recognize :/
– Daniel Santos