Created
January 31, 2011 21:04
-
-
Save fadur/804810 to your computer and use it in GitHub Desktop.
two methods that write out conf files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def write_wsgi(): | |
| """docstring for write_wsgi""" | |
| file = open("%(apache_path)s/%(projectname)s.wsgi" % env, "w") | |
| file.write("import os, sys\nsys.path = ['%(path)s'] + sys.path\n\n\nos.environ['DJANGO_SETTINGS_MODULE'] = '%(projectname)s.settings'\n \n\nimport django.core.handlers.wsgi\napplication = django.core.handlers.wsgi.WSGIHandler()" % env) | |
| file.close() | |
| def write_conf(): | |
| """docstring for write_conf""" | |
| file = open("%(apache_path)s/%(projectname)s.conf" % env, "w") | |
| file.write("WSGIPythonHome '%(path)s'\nWSGIRestrictStdout Off\nWSGIDaemonProcess %(projectname)s\nWSGIProcessGroup %(projectname)s\n\n<VirtualHost *:80>\n ServerName %(projectname)s.local\n Alias /site_media/ '%(apache_path)s/public/site_media'\n<Directory '%(apache_path)s/public/site_media'>\n Order allow,deny\n Options Indexes\n Allow from all\n\n</Directory>\n\n\n\nAlias /media/ '%(path)s/lib/python2.6/site-packages/django/contrib/admin/media/'\n<Directory '%(path)s/python2.6/site-packages/django/contrib/admin/media/'>\n Order allow,deny \n Options Indexes \n Allow from all \n</Directory>\n\nWSGIScriptAlias / '%(apache_path)s/%(projectname)s.wsgi\n\n<Directory '%(apache_path)s'>\n Allow from all\n</Directory>\nErrorLog %(apache_path)s/logs/%(projectname)s-error_log\nTransferLog %(apache_path)s/logs/%(projectname)s-access_log\n</VirtualHost>" % env) | |
| file.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment