[Answer]-Loading existing project in django

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.

👤iMom0

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)

Leave a comment