Skip to content

Commit

Permalink
Fixed #30003 -- Added usable entry point in default manage.py.
Browse files Browse the repository at this point in the history
  • Loading branch information
jpic authored and timgraham committed Dec 6, 2018
1 parent 4c7c608 commit 9453bc7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion django/conf/project_template/manage.py-tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()

0 comments on commit 9453bc7

Please sign in to comment.