Fixed some deploy templates and settings.
authorŁukasz Rekucki <lrekucki@gmail.com>
Tue, 8 Jun 2010 11:20:26 +0000 (13:20 +0200)
committerŁukasz Rekucki <lrekucki@gmail.com>
Tue, 8 Jun 2010 11:20:26 +0000 (13:20 +0200)
deployment.py
redakcja.vhost.template
redakcja.wsgi.template
redakcja/settings/__init__.py

index 789d342..b989fc7 100644 (file)
@@ -67,6 +67,9 @@ class DeploySite(object):
     def update_app(self):
         pass
 
     def update_app(self):
         pass
 
+    def update_config(self):
+        pass
+
     def install_dependencies(self):
         pass
 
     def install_dependencies(self):
         pass
 
@@ -98,6 +101,8 @@ class WSGISite(DeploySite):
             self.env['WSGI_FILE'] = os.path.join(self.env['ROOT'], 'www',
                                         'wsgi', self.env['PROJECT_NAME']) + '.wsgi'
 
             self.env['WSGI_FILE'] = os.path.join(self.env['ROOT'], 'www',
                                         'wsgi', self.env['PROJECT_NAME']) + '.wsgi'
 
+        self.env['WSGI_DIR'] = os.path.dirname(self.env['WSGI_FILE'])
+
         if 'WSGI_SOURCE_FILE' not in self.env:
             self.env['WSGI_SOURCE_FILE'] = 'wsgi_app.template'
 
         if 'WSGI_SOURCE_FILE' not in self.env:
             self.env['WSGI_SOURCE_FILE'] = 'wsgi_app.template'
 
@@ -109,6 +114,8 @@ class WSGISite(DeploySite):
         os.system("touch %s" % self.env['WSGI_FILE'])
 
     def update_config(self):
         os.system("touch %s" % self.env['WSGI_FILE'])
 
     def update_config(self):
+        super(WSGISite, self).update_config()
+
         source = self.find_resource(self.env['WSGI_SOURCE_FILE'])
         self.render_template(source, self.env['WSGI_FILE'])
 
         source = self.find_resource(self.env['WSGI_SOURCE_FILE'])
         self.render_template(source, self.env['WSGI_FILE'])
 
@@ -142,5 +149,7 @@ class ApacheSite(DeploySite):
             self.env['VHOST_FILE'] = os.path.join(self.env['CONFIG_DIR'], self.env['PROJECT_NAME'] + '.vhost')
 
     def update_config(self):
             self.env['VHOST_FILE'] = os.path.join(self.env['CONFIG_DIR'], self.env['PROJECT_NAME'] + '.vhost')
 
     def update_config(self):
+        super(ApacheSite, self).update_config()
+
         source = self.find_resource(self.env['VHOST_SOURCE_FILE'])
         source = self.find_resource(self.env['VHOST_SOURCE_FILE'])
-        self.render_template(source, self.env['VHOST_CONFIG_FILE'])
+        self.render_template(source, self.env['VHOST_FILE'])
index 1d24c67..0c56cbd 100644 (file)
@@ -1,19 +1,18 @@
 <VirtualHost *:80>
     ServerName $DOMAIN
 <VirtualHost *:80>
     ServerName $DOMAIN
-    ServerAlias $DOMAIN_ALIASES
     ServerAdmin $ADMIN_EMAIL
 
     WSGIDaemonProcess $PROJECT_NAME user=$WSGI_USER group=$WSGI_USER processes=$WSGI_PROCESSES threads=$WSGI_THREADS display-name=%{GROUP}
     WSGIProcessGroup $PROJECT_NAME
 
     ServerAdmin $ADMIN_EMAIL
 
     WSGIDaemonProcess $PROJECT_NAME user=$WSGI_USER group=$WSGI_USER processes=$WSGI_PROCESSES threads=$WSGI_THREADS display-name=%{GROUP}
     WSGIProcessGroup $PROJECT_NAME
 
-    WSGIScriptAlias / $WSGI_TARGET
+    WSGIScriptAlias / $WSGI_FILE
     <Directory $WSGI_DIR>
         Order allow,deny
         allow from all
     </Directory>
 
     <Directory $WSGI_DIR>
         Order allow,deny
         allow from all
     </Directory>
 
-    Alias /media $MEDIA_ROOT
-    <Directory $MEDIA_ROOT >
+    Alias /media $MEDIA_DIR
+    <Directory $MEDIA_DIR>
         Order allow,deny
         Allow from all
     </Directory>
         Order allow,deny
         Allow from all
     </Directory>
index 6b772f3..d271fa1 100644 (file)
@@ -1,4 +1,4 @@
-#!$PYTHON
+#!$PYTHON_BIN
 import site
 site.addsitedir('$PYTHON_SITE')
 
 import site
 site.addsitedir('$PYTHON_SITE')
 
@@ -12,9 +12,9 @@ sys.stdout = sys.stderr
 
 # Add apps and lib directories to PYTHONPATH
 sys.path = [
 
 # Add apps and lib directories to PYTHONPATH
 sys.path = [
-    '$PROJECT_ROOT',
-       '$PROJECT_ROOT/lib',
-       '$PROJECT_ROOT/apps',
+    '$APP_DIR',
+       '$APP_DIR/lib',
+       '$APP_DIR/apps',
 ] + sys.path
 
 # Run Django
 ] + sys.path
 
 # Run Django
index 8be901a..d3f9d7c 100644 (file)
@@ -1,5 +1,5 @@
 from __future__ import absolute_import
 from __future__ import absolute_import
-from settings.common import *
+from .common import *
 
 DATABASE_ENGINE = 'sqlite3'    # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
 DATABASE_NAME = PROJECT_ROOT + '/dev.sqlite'             # Or path to database file if using sqlite3.
 
 DATABASE_ENGINE = 'sqlite3'    # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
 DATABASE_NAME = PROJECT_ROOT + '/dev.sqlite'             # Or path to database file if using sqlite3.