wp_manage.py 1.0 KB

123456789101112131415161718192021222324252627
  1. #!/usr/bin/env python
  2. import site
  3. import os
  4. try:
  5. import wp_settings as settings# Assumed to be in the same directory.
  6. except ImportError:
  7. import sys
  8. sys.stderr.write("Error: Can't find the file '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" % __file__)
  9. sys.exit(1)
  10. if settings.DEBUG == False:
  11. activate_this = "/var/lib/virtualenvs/pbp/bin/activate_this.py"
  12. else:
  13. if os.path.exists('/home/powellc'):
  14. activate_this = "/home/powellc/.virtualenvs/pbp/bin/activate_this.py"
  15. else:
  16. activate_this = "/Users/powellc/.virtualenvs/pbp/bin/activate_this.py"
  17. execfile(activate_this, dict(__file__=activate_this))
  18. if settings.VIRTUALENV:
  19. site.addsitedir(settings.VIRTUALENV)
  20. from django.core.management import execute_manager
  21. if __name__ == "__main__":
  22. execute_manager(settings)