I'm trying to host my django site on an AWS EC2 instance using apache. I'm currently using http only and accessing via the EC2's IP address, but eventually plan to enable ssl with a custom domain.
I've managed to get the site up and running using the apache conf file below, but when I access it, my browser does not seem to be storing any cookies, which is interfering with the site's functioning. I am also unable to authenticate users. I have previously hosted on Heroku without encountering these errors. I don't believe this is apache related, because I also see the same issue when disabling apache, running 'python manage.py runserver 0.0.0.0:8000' and accessing the site at {{ip address}}:8000.
Apache conf file
<VirtualHost *:80>
ServerAdmin email@email.com
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
Alias /static /home/ubuntu/django-app/django-app/staticfiles
<Directory /home/ubuntu/django-app/django-app/staticfiles>
Require all granted
</Directory>
<Directory /home/ubuntu/django-app/django-app/django_app>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
WSGIPassAuthorization On
WSGIDaemonProcess django_site python-home=/home/ubuntu/django-app/venv python-path=/home/ubuntu/django-app/django-app
WSGIProcessGroup django_site
WSGIScriptAlias / /home/ubuntu/django-app/django-app/django_app/wsgi.py
</VirtualHost>
settings.py This file is lengthy, so I'll just post a summary of some of the values I've set that I believe are relevant based on prior research.
ALLOWED_HOSTS = ['{{EC2 IP Address}}']
SESSION_COOKIE_AGE = 604799
SESSION_COOKIES_SECURY = False
SECURE_SSL_REDIRECT = False
CSRF_COOKIE_SECURE = False