Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

122
Visualizações
No cookies being stored when hosting Django Site on AWS EC2

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
over 4 years ago · Santiago Trujillo
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda