1. Matthew Schinckel
  2. django-deploy

Commits

Matthew Schinckel  committed fcdd1e6

Initial import

  • Participants
  • Branches default

Comments (0)

Files changed (8)

File deploy/__init__.py

  • Ignore whitespace
Empty file added.

File deploy/management/__init__.py

  • Ignore whitespace
Empty file added.

File deploy/management/commands/__init__.py

  • Ignore whitespace
Empty file added.

File deploy/management/commands/mod_wsgi.py

View file
  • Ignore whitespace
+from django.template.loader import render_to_string
+from django.core.management.base import BaseCommand
+from django.conf import settings
+
+
+class Command(BaseCommand):
+    args = ""
+    
+    def handle(self, *args, **kwargs):
+        if 'staticmedia' in settings.INSTALLED_APPS:
+            from staticmedia import serverconf
+            aliases = serverconf.apache()
+        else:
+            aliases = None
+        data = [
+            {
+                'port':'80',
+                'servername':'my.rosterwithross.com',
+                'installpath':'/var/www/datamine',
+                'project':'rossweb',
+                'ssl_cert': None,
+                'staticmedia': aliases
+            }
+        ]
+        
+        for conf in data:
+            print render_to_string('deploy/apache_conf/mod_wsgi.conf', conf)

File deploy/templates/deploy/apache_conf/mod_python.conf

View file
  • Ignore whitespace
+<VirtualHost *:{{ port }}>
+    ServerName {{ servername }}
+    {% if ssl_cert %}
+    SSLEngine on
+    SSLCertificateFile {{ ssl_cert }}
+    {% endif %}
+    
+    <Location "/" >
+        PythonPath "['{{ installpath }}/{{ project }}'] + sys.path"
+        SetHandler mod_python
+        PythonHandler index
+        {% if ssl_cert %}
+        SSLRequireSSL
+        {% endif %}
+    </Location>
+    
+    ErrorLog "/var/log/apache2/{{ project }}-error.log"
+    
+</VirtualHost>

File deploy/templates/deploy/apache_conf/mod_wsgi.conf

View file
  • Ignore whitespace
+<VirtualHost *:{{ port }}>
+    ServerName {{ servername }}
+    DocumentRoot {{ installpath }}
+    {{ staticmedia|safe }}
+    Alias /media  "{{ installpath }}/{{ project }}/media"
+    {% if ssl_cert %}
+    SSLEngine On
+    SSLCertificateFile {{ ssl_cert }}
+    {% endif %}
+    WSGIPassAuthorization On
+    WSGIScriptAlias / {{ installpath }}/bin/apache_mod_wsgi_runner.py
+    
+    <Directory {{ installpath }}/{{ project }}/ >
+        Order deny,allow
+        Allow from all
+    </Directory>
+    
+    <Location "/media">
+        SetHandler default
+    </Location>
+    
+    ErrorLog /var/log/apache2/{{ project }}-error.log    
+</VirtualHost>

File deploy/templates/deploy/wsgi_conf/apache_mod_wsgi_runner.py

  • Ignore whitespace
Empty file added.

File setup.py

View file
  • Ignore whitespace
+from distutils.core import setup
+
+setup(
+    name = "django-deploy",
+    version = "1.0",
+    description = "Deployment helpers",
+    url = "http://bitbucket.org/schinckel/django-deploy/",
+    author = "Matthew Schinckel",
+    author_email = "matt@schinckel.net",
+    packages = [
+        "deploy",
+        'deploy.management',
+        'deploy.management.commands',
+        # 'deploy.templates',
+        # 'deploy.templates.deploy',
+        # 'deploy.templates.deploy.apache_conf',
+        # 'deploy.templates.deploy.wsgi_conf',
+    ],
+    classifiers = [
+        'Programming Language :: Python',
+        'License :: OSI Approved :: BSD License',
+        'Operating System :: OS Independent',
+        'Framework :: Django',
+    ],
+)