2013-03-19 23:54:25 +11:00
|
|
|
#!/usr/bin/env python
|
2019-12-07 21:37:30 +11:00
|
|
|
|
|
|
|
"""Django's command-line utility for administrative tasks."""
|
2013-03-19 23:54:25 +11:00
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
|
2019-12-07 21:37:30 +11:00
|
|
|
|
|
|
|
def main():
|
2013-03-19 23:54:25 +11:00
|
|
|
try:
|
2019-12-07 21:37:30 +11:00
|
|
|
import dpaste.settings.local
|
|
|
|
|
|
|
|
settings = "dpaste.settings.local"
|
2019-12-07 23:03:18 +11:00
|
|
|
sys.stdout.write("\n🧁 Using local.py settings file.\n")
|
2013-03-19 23:54:25 +11:00
|
|
|
except ImportError:
|
2019-12-07 21:37:30 +11:00
|
|
|
settings = "dpaste.settings.base"
|
|
|
|
sys.stdout.write(
|
2019-12-07 23:03:18 +11:00
|
|
|
"\n⚠️ local.py settings not found. Using default settings file.\n"
|
2019-12-07 21:37:30 +11:00
|
|
|
)
|
|
|
|
|
|
|
|
os.environ.setdefault("DJANGO_SETTINGS_MODULE", settings)
|
|
|
|
|
|
|
|
try:
|
|
|
|
from django.core.management import execute_from_command_line
|
|
|
|
except ImportError as exc:
|
|
|
|
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?"
|
|
|
|
) from exc
|
2013-03-19 23:54:25 +11:00
|
|
|
execute_from_command_line(sys.argv)
|
2019-12-07 21:37:30 +11:00
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
main()
|