0👍
✅
Just set the environment varible:
set DJANGO_SETTINGS_MODULE=MyLibrary.settings
python manage.py runserver
Or append --settings
like:
python manage.py runserver --settings=MyLibrary.settings
The details – Django docs.
1👍
Look in manage.py file:
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "FirstBlog.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
change this file:
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "MyLibrary.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
- [Answer]-DJANGO regular expression not match specific file extensions
- [Answer]-Save form fields as a draft DJANGO
- [Answer]-Django update field
- [Answer]-Django modelform saving resets object data
Source:stackexchange.com