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

340
Vistas
Can't seem to setup my Django project properly

I was trying the official tutorial of Django because I want to learn it. I run Archlinux 4.10.11-1 64 bits.

First, I created a folder named djangoapp where I set my virtual environment:

$ virtualenv djangoapp

I set my current directory to this folder, and then I activated it:

$ source bin/activate

And I installed Django after:

$ pip install django

Following the tutorial, I ran:

$ django-admin startproject djangoapp

And set my current directory to djangoapp, and ran:

$ python manage.py runserver

But I'm getting the following error:

django.core.exceptions.ImproperlyConfigured: Requested setting DEBUG, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.

Indeed, running env | grep DJANGO_SETTINGS_MODULE gets me the following result:

DJANGO_SETTINGS_MODULE=

So I tried to set it manually:

$ export DJANGO_SETTINGS_MODULE='djangoapp.settings'

Running $ python manage.py runserver now works, but $ django-admin help now gets me the following error:

ModuleNotFoundError: No module named 'djangoapp'

What did I do wrong? Thanks for your help!

PS: $ python --version gets me Python 3.6.1.

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

0

I think the docs could be a little clearer about this, but django-admin is typically only used for running django-admin startproject and manage.py is used for the rest e.g. ./manage.py runserver, ./manage.py migrate etc.

Deleting the DJANGO_SETTINGS_MODULE environment variable should allow you to run both ./manage.py * and django-admin startproject commands when inside the djangoapp folder.

I'm not sure how to do this on Archlinux, but something like unset DJANGO_SETTINGS_MODULE or set -e DJANGO_SETTINGS_MODULE should work.

Further info: you can think of manage.py as a wrapper around django-admin that automatically sets the PYTHONPATH and DJANGO_SETTINGS_MODULE environment variables. Therefore, once inside the project, you can just use ./manage.py rather than django-admin to run the management commands.

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