Error:
django.core.exceptions.ImproperlyConfigured: Requested setting DEFAULT_INDEX_TABLESPACE, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.
Solution:
Add to the python file that reports the error:
import os,django
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project_name.settings") # project_name project name
django.setup()
Read More:
- [Solved] Django project locally Open Error: importerror: couldn’t import Django
- [Solved] Django Error: django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module.
- [Solved] from django.core.cache import cache Error
- [Solved] Django Configurate celery error: django.db.utils.DatabaseError
- [Solved] Python Django error: error: (1146, “Table ‘mydb.django_session’ doesn’t exist”)
- Python: Django exception when executing migrate operation: django.db.utils.OperationalError: (1051, “Unknown table’xxx’”)
- [Solved] django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module.Did you install mysqlclie
- Django Issues: TypeError: “Settings” object is irreversible
- [Solved] Python Project Error: django.core.exceptions.ImproperlyConfigured: WSGI application ‘WebTool.wsgi.application
- [Solved] Django.core.exceptions.ImproperlyConfigured: SQLite 3.9.0 or later is required (found 3.7.17).
- [Solved] Django backend processing Base64 file upload error
- [Solved] ValueError: Connection error, and we cannot find the requested files in the cached path…
- [Solved] Django Error: Attributeerror: ‘wsgirequest’ object has no attribute ‘is_ajax ‘
- Django WSGI protocol application, based on wsgiref module DIY a web framework
- Solve the error of panda index unalignable Boolean series provided as indexer
- [Solved] yolo Error: IndexError: invalid index to scalar variable.
- [Solved] Django Access to the backend error: Invalid block tag on line 98: ‘trans‘, expected ‘elif , ‘else‘或‘ endif. Did you forget
- Django Error: binascii.Error: Incorrect padding [How to Solve]
- [Solved] Django backend error: Assertion failed: (NSViewIsCurrentlyBuildingLayerTreeForDisplay()