Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

274
Vistas
Environment variables works on Django's server but not on Apache server

When I use the environment variable in Django's server, it works.

SMTP_PASSWORD = os.environ["SMTP_PASSWORD"]

However, when I run the same code on Apache, it doesn't. The code os.environ["..."] just doesn't work.

I am using Windows 10, Python 3.9.5 and Django 3.2.4.

Any idea what is happening?

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

You can put environment variables in the apache config.

<VirtualHost hostname:443>
   ...
   SetEnv SMTP_PASSWORD smtp_password
   ...
</VirtualHost>

If you don't want to put sensitive information in apache config you can still include your environment variable in your files, to read it when the server is starting or you can store those variables in your database.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda