close

[Solved] django.core.exceptions.ImproperlyConfigured: Requested setting USE_I18N, but settings are not configured

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error django.core.exceptions.ImproperlyConfigured: Requested setting USE_I18N, but settings are not configured in python. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How django.core.exceptions.ImproperlyConfigured: Requested setting USE_I18N, but settings are not configured Error Occurs?

Today I get the following error django.core.exceptions.ImproperlyConfigured: Requested setting USE_I18N, but settings are not configured in python.

How To Solve django.core.exceptions.ImproperlyConfigured: Requested setting USE_I18N, but settings are not configured Error ?

  1. How To Solve django.core.exceptions.ImproperlyConfigured: Requested setting USE_I18N, but settings are not configured Error ?

    To Solve django.core.exceptions.ImproperlyConfigured: Requested setting USE_I18N, but settings are not configured Error

    When you use Django, you have to tell it which settings you’re using. Do this by using an environment variable, DJANGO_SETTINGS_MODULE.

  2. django.core.exceptions.ImproperlyConfigured: Requested setting USE_I18N, but settings are not configured

    To Solve django.core.exceptions.ImproperlyConfigured: Requested setting USE_I18N, but settings are not configured Error

    When you use Django, you have to tell it which settings you’re using. Do this by using an environment variable, DJANGO_SETTINGS_MODULE.

Solution 1

You must define the relevant variable to show where you settings.py file lives:

export DJANGO_SETTINGS_MODULE=mysite.settings

This is the relevant docs entry:

When you use Django, you have to tell it which settings you’re using. Do this by using an environment variable, DJANGO_SETTINGS_MODULE.

The value of DJANGO_SETTINGS_MODULE should be in Python path syntax, e.g. mysite.settings. Note that the settings module should be on the Python import search path.

If you are using a virtualenv (which is the best practice), you can paste the relevant export command in the file <path-to-virtualenv>/bin/activate

Solution 2

I had this problem because I tried to import a django script after just typing

python

instead of

python manage.py shell

Duh!

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also, Read