manage.py 663 B

12345678910111213141516171819202122
  1. #!/usr/bin/env python
  2. """Django's command-line utility for administrative tasks."""
  3. import os
  4. import sys
  5. def main():
  6. """Run administrative tasks."""
  7. os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'project.settings')
  8. try:
  9. from django.core.management import execute_from_command_line
  10. except ImportError as exc:
  11. raise ImportError(
  12. "Couldn't import Django. Are you sure it's installed and "
  13. "available on your PYTHONPATH environment variable? Did you "
  14. "forget to activate a virtual environment?"
  15. ) from exc
  16. execute_from_command_line(sys.argv)
  17. if __name__ == '__main__':
  18. main()