Tag Archives: django

How to Solve Error: [Errno 11001] getaddrinfo failed

When starting Django project, we encountered: error: [errno 11001] getaddrinfo failed error

You can run the following command in Ubuntu, but if you transfer the project to windows 10, there will be an error:

# --insecure argument to force django to process static files, when closing debug is added (--insecute)
python manage.py  runserver 0:8000 --insecure
# or
python manage.py  runserver 0:8000

Debug code in settings.py file

DEBUG = False
ALLOWED_HOSTS = ["*"]

Run the following command in Windows 10 to solve the problem

python manage.py runserver 0.0.0.0:8000 --insecute
# or
python manage.py runserver 0.0.0.0:8000

Requested setting INSTALLED_APPS, but settings are not configured. …..DJANGO_SETTINGS_MODULE…..

Python project exception (request to set installed application, but no settings configured). Before accessing settings, you must define the environment variable Django setting module, or call settings. Configure().) :

Requested setting  INSTALLED_APPS, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.

The solution is as follows:

(1)Run –&> EditConfigures

(2) Find an item in python (Python manage), and then modify the environment variables in it to add an item. The location of the key is Django_ SETTINGS_ Module value is your settingss