cp_manage.py 1.0 KB

1234567891011121314151617181920212223242526272829303132
  1. #!/usr/bin/env python
  2. import site
  3. import os
  4. try:
  5. import cp_settings as settings # Assumed to be in the same directory.
  6. except ImportError:
  7. import sys
  8. sys.stderr.write(
  9. "Error: Can't find the file 'cp_settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings.development module.\n(If the file settings.development.py does indeed exist, it's causing an ImportError somehow.)\n"
  10. % __file__
  11. )
  12. sys.exit(1)
  13. if settings.DEBUG == False:
  14. activate_this = "/var/lib/virtualenvs/pbp/bin/activate_this.py"
  15. else:
  16. if os.path.exists("/home/powellc"):
  17. activate_this = "/home/powellc/.virtualenvs/pbp/bin/activate_this.py"
  18. else:
  19. activate_this = "/Users/powellc/.virtualenvs/pbp/bin/activate_this.py"
  20. execfile(activate_this, dict(__file__=activate_this))
  21. if settings.VIRTUALENV:
  22. site.addsitedir(settings.VIRTUALENV)
  23. from django.core.management import execute_manager
  24. if __name__ == "__main__":
  25. execute_manager(settings)