manage.py 802 B

12345678910111213141516171819202122
  1. #!/usr/bin/env python
  2. import os
  3. import sys
  4. if __name__ == "__main__":
  5. os.environ.setdefault("DJANGO_SETTINGS_MODULE", "todo.settings")
  6. try:
  7. from django.core.management import execute_from_command_line
  8. except ImportError:
  9. # The above import may fail for some other reason. Ensure that the
  10. # issue is really that Django is missing to avoid masking other
  11. # exceptions on Python 2.
  12. try:
  13. import django
  14. except ImportError:
  15. raise ImportError(
  16. "Couldn't import Django. Are you sure it's installed and "
  17. "available on your PYTHONPATH environment variable? Did you "
  18. "forget to activate a virtual environment?"
  19. )
  20. raise
  21. execute_from_command_line(sys.argv)