Config local env and install dependencies
py -m venv venv
.\venv\Scripts\activate
pip install black
pip install django
pip install psycopg2
pip install sqlalchemy
Start django project and app
django-admin startproject core .
py manage.py startapp crehana_store
py manage.py migrate
py manage.py createsuperuser
py manage.py runserver
Fix cors error https://dzone.com/articles/how-to-fix-django-cors-error
pip install django-cors-headers
https://developer.mozilla.org/es/docs/Learn/Server-side/Django/Deployment
- create Procfile with projectname.wsgi (core.wsgi)
- create Procfile.windows: web: python manage.py runserver
Install heroku dependencies and env variable package
pip install django-heroku
pip install gunicorn
pip install dj-database-url
pip install whitenoise
pip install django-environ
secret key as env variable https://medium.com/@natmakesthings/hiding-secret-key-in-django-deployment-on-heroku-59b9640819a
*check that .env is utf-8
After sucessful deploy to heroku: Delete local migrations if there are database errors
heroku local:run python manage.py makemigrations
heroku local:run python manage.py migrate
git push heroku master
Migrate on heroku
heroku run python manage.py migrate
heroku run python load_courses.py