summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjpic <jpic@users.noreply.github.com>2018-12-06 20:45:40 +0100
committerTim Graham <timograham@gmail.com>2018-12-06 14:45:40 -0500
commit9453bc77f4968dc3a8167eadbf97759538133332 (patch)
treebbb537928aa6c7114fbc54dd8a7d5a043ddfc07a
parent4c7c608a1deee37055d4a2b8a71e34def04a2a1f (diff)
Fixed #30003 -- Added usable entry point in default manage.py.
-rwxr-xr-xdjango/conf/project_template/manage.py-tpl7
1 files changed, 6 insertions, 1 deletions
diff --git a/django/conf/project_template/manage.py-tpl b/django/conf/project_template/manage.py-tpl
index 48c9190f03..147e335e35 100755
--- a/django/conf/project_template/manage.py-tpl
+++ b/django/conf/project_template/manage.py-tpl
@@ -2,7 +2,8 @@
import os
import sys
-if __name__ == '__main__':
+
+def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', '{{ project_name }}.settings')
try:
from django.core.management import execute_from_command_line
@@ -13,3 +14,7 @@ if __name__ == '__main__':
"forget to activate a virtual environment?"
) from exc
execute_from_command_line(sys.argv)
+
+
+if __name__ == '__main__':
+ main()