- Follow tutorial on How To Set Up Django with Postgres, Nginx, and Gunicorn on Ubuntu 22.04
- Also check helpful post Django deployment with Nginx and Gunicorn with Youtube Video
- Gotchas:
- ensure wsgi.py has correct DJANGO_SETTINGS_MODULE dotted path
- ensure that www-data can cd to user home directories:
- check if www-data has access
sudo -u www-data stat /home/username/location_to_static_files
- ensure www-data has access
sudo gpasswd -a www-data username
- check if www-data has access
-
Follow tutorial Deploying a Django application to Elastic Beanstalk
-
Gotchas:
- Don't forget to manually set environment variables on Elastic Beanstalk Environment Configuration
- DJANGO_ALLOWED_HOSTS
- DJANGO_SECRET_KEY
- DJANGO_SETTINGS_MODULE
- DJANGO_STATIC_ROOT
- Don't forget to manually set environment variables on Elastic Beanstalk Environment Configuration