Skip to content
This repository was archived by the owner on Jul 14, 2025. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 6 additions & 15 deletions test_project/manage.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,16 @@
#!/usr/bin/env python

from __future__ import unicode_literals

import os
import sys

if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "test_project.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that the
# issue is really that Django is missing to avoid masking other
# exceptions on Python 2.
try:
import django # noqa
except ImportError:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
"available on your PYTHONPATH environment variable? Did you "
"forget to activate a virtual environment?"
)
raise
except ImportError as e:
raise ImportError(
"Failed to import Django. Make sure Django is installed and "
"available on your PYTHONPATH, or activate a virtual environment."
) from e

execute_from_command_line(sys.argv)