8👍
Thank you for those who checked my question.
My problem is solved as I run the following code.
export DJANGO_SETTINGS_MODULE=mysite.settings
I found it from Django documentation.
But I still did not find out what was the real problem.
It was something about my settings file. or multiple settings files
so, if anyone know the details, please describe it here. or in personal.
0👍
I think you should uncomment STATIC_ROOT inside your settings.py file and try this:
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
- [Django]-Override Model.save() for FileField handled by Boto — Django
- [Django]-Django 1.8 does not work on CentOs 6.5 server
- [Django]-Django connect mysql problem, NameError: name '_mysql' is not defined
- [Django]-Missing mysql.sock; yielding OperationalError: (2002, "Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)")
- [Django]-How to get a formatted DateTimeField value outside a Django template?
0👍
First of all please check if there is a folder in base directory named ‘static’; if yes, then make a little change in the following code, remove’/’ after static:
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
Secondly, make sure you have registered all the apps in the installed apps menu.
If the problem still persists, then try to run the following command: python manage.py shell
It should let you know where the problem is, if it’s in the settings.
- [Django]-How to query for distinct groups of entities which are joined via a self-referential many-to-many table?
- [Django]-What is the difference between permission_classes and authentication_classes in django rest framework generic API Views
0👍
Try with replacing STATIC_ROOT in settings.py file with the following:
STATIC_ROOT = '/static/'
and whenever you run the python3 manage.py collectstatic
command, make sure you are in the base directory where the manage.py file is located and there is a folder named static.