45👍
I had a similar error message, but despite my suspicions, it had nothing to do with the Django update. If you have an error in settings (I had an empty SECRET_KEY value), then “django” will be the only app that gets loaded. I found the root of the problem by running python manage.py shell
and that quickly told me what’s wrong with the settings.
25👍
For those coming here from google, I resolved it through adding
'django.contrib.staticfiles',
to INSTALLED_APPS
- [Django]-How to override the default value of a Model Field from an Abstract Base Class
- [Django]-Django. TemplateDoesNotExist in case of a custom widget
- [Django]-Django static page?
9👍
If you change name or destanation of your settings.py file, you need to invoke your manage.py with key –settings.
- [Django]-Python vs C#/.NET — what are the key differences to consider for using one to develop a large web application?
- [Django]-Python string to Django timezone (aware datetime)
- [Django]-Http POST drops port in URL
2👍
I recently came across this issue.
First, in your question, INSTALLED_APPS
is missing a closing bracket… so check that isn’t the problem!
For me, the missing management commands was due to the MEDIA_URL
setting missing a trailing slash. For some reason, this caused all commands, except the base django commands, to be missing when I used ./manage.py --help
The way I discovered this was to run a base command, which informed me of the problem with my settings.py
file.
- [Django]-Django models ForeignKey on_delete attribute: full meaning?
- [Django]-Django excluding specific instances from queryset without using field lookup
- [Django]-How do I iterate over the options of a SelectField in a template?
1👍
Maybe it is caused by “TEMPLATE_CONTEXT_PROCESSORS” . The official documentation says:
Be careful when you override settings, especially when the default value is a non-empty tuple or dictionary, such as MIDDLEWARE_CLASSES and TEMPLATE_CONTEXT_PROCESSORS. Make sure you keep the components required by the features of Django you wish to use.
And I checked the default value at Django setting documentation It seems that you missed an options:
"django.core.context_processors.tz"
The whole list of default values are:
> ("django.contrib.auth.context_processors.auth",
"django.core.context_processors.debug",
"django.core.context_processors.i18n",
"django.core.context_processors.media",
"django.core.context_processors.static",
"django.core.context_processors.tz",
"django.contrib.messages.context_processors.messages")
And in my django project’s setting file, I didn’t find this value. SO I think maybe you do not need to override this value.
- [Django]-Django.request logger not propagated to root?
- [Django]-JQuery.getJSON doesn't trigger callback
- [Django]-How to save output from django call_command to a variable or file
- [Django]-Meaning of leading underscore in list of tuples used to define choice fields?
- [Django]-PermissionError with pip3
- [Django]-Handling race condition in model.save()
1👍
Most probably this is caused by due to the configuration in settings.py
file
you can run perform Django’s check to figure out the exact issue
python manage.py check --settings=test_settings
you can additionally specify the settings
file to check against.
- [Django]-Django testing: Test the initial value of a form field
- [Django]-Python MySQLDB: Get the result of fetchall in a list
- [Django]-Django, save ModelForm
0👍
give a closing bracket to your Installed apps and change the MEDIA_URL='/media'
to
MEDIA_URL='/media/'
see if it works
- [Django]-How to deal with "SubfieldBase has been deprecated. Use Field.from_db_value instead."
- [Django]-Django – How to rename a model field using South?
- [Django]-How to expose a property (virtual field) on a Django Model as a field in a TastyPie ModelResource
0👍
I had the same problem in Django 1.10.3. In my case, I forgot to register one app in my settings.py. Adding the name of the app in INSTALLED_APPS solves the problem.
- [Django]-Trying to make a PostgreSQL field with a list of foreign keys in Django
- [Django]-How to disable Django's invalid HTTP_HOST error?
- [Django]-Change model class name in Django admin interface
0👍
This might happen when environment variable DJANGO_SETTINGS_MODULE
is missing.
Run export DJANGO_SETTINGS_MODULE=<your settings module>
and see if it fix the problem.
- [Django]-In django, how do I sort a model on a field and then get the last item?
- [Django]-'collectstatic' command fails when WhiteNoise is enabled
- [Django]-How can I filter a Django query with a list of values?
0👍
I had same issue in Django 2.2.7 and found that command here:
(venv) lead@ip-XXX-XX-XX-XXX:~/Develop/dev_1_2/myproject$ python manage.py help
Type 'manage.py help <subcommand>' for help on a specific subcommand.
Available subcommands:
...
[django]
check
compilemessages
...
startapp
startproject
test
testserver
[sessions]
clearsessions
[staticfiles]
collectstatic
findstatic
runserver
because you can run this as:
python manage.py collectstatic
- [Django]-What's the cleanest, simplest-to-get running datepicker in Django?
- [Django]-Rendering JSON objects using a Django template after an Ajax call
- [Django]-Django REST Framework: 'BasePermissionMetaclass' object is not iterable
0👍
- Make sure settings.py file is present in the default location.
Or "python manage.py" knows the new settings.py file location.
For eg.
python manage.py collectstatic --settings=projectname.settings
- Make sure STATIC_ROOT is present in the settings.py file
For eg.
STATIC_ROOT = os.path.join(BASE_DIR, 'static/')
- [Django]-How can I get tox and poetry to work together to support testing multiple versions of a Python dependency?
- [Django]-Dlopen() failed to load a library: cairo / cairo-2
- [Django]-Django unit test without creating test database every time I run
0👍
For me, this was the result of using this in my settings:
import project.settings.base
instead of
from project.settings.base import *
- [Django]-Django – Render the <label> of a single form field
- [Django]-Startapp with manage.py to create app in another directory
- [Django]-Using Django auth UserAdmin for a custom user model