diff mbox

[Branch,~linaro-validation/lava-server/trunk] Rev 325: Use mount points

Message ID 20111129200213.19830.5822.launchpad@ackee.canonical.com
State Accepted
Headers show

Commit Message

Zygmunt Krynicki Nov. 29, 2011, 8:02 p.m. UTC
------------------------------------------------------------
revno: 325
committer: Zygmunt Krynicki <zygmunt.krynicki@linaro.org>
branch nick: lava-server
timestamp: Tue 2011-11-29 16:14:01 +0100
message:
  Use mount points
modified:
  lava_server/settings/common.py
  lava_server/settings/debian.py
  lava_server/urls.py


--
lp:lava-server
https://code.launchpad.net/~linaro-validation/lava-server/trunk

You are subscribed to branch lp:lava-server.
To unsubscribe from this branch go to https://code.launchpad.net/~linaro-validation/lava-server/trunk/+edit-subscription
diff mbox

Patch

=== modified file 'lava_server/settings/common.py'
--- lava_server/settings/common.py	2011-11-28 17:33:20 +0000
+++ lava_server/settings/common.py	2011-11-29 15:14:01 +0000
@@ -82,18 +82,20 @@ 
 # Examples: "http://static.lawrence.com", "http://example.com/static/"
 STATIC_URL = "/static/"
 
+MOUNT_POINT = "/"
+
 # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
 # trailing slash.
 # Examples: "http://foo.com/media/", "/media/".
-ADMIN_MEDIA_PREFIX = "/static/admin/"
+ADMIN_MEDIA_PREFIX = MOUNT_POINT + "static/admin/"
 
 # The true outer url is /lava-server/
-LOGIN_REDIRECT_URL = "/"
+LOGIN_REDIRECT_URL = MOUNT_POINT + ""
 
 # URL of the login screen, has to be hard-coded like that for Django.
 # I cheat a little, using DATA_URL_PREFIX here is technically incorrect
 # but it seems better than hard-coding 'lava-server' yet again.
-LOGIN_URL = '/accounts/login/'
+LOGIN_URL = MOUNT_POINT + "accounts/login/"
 
 INSTALLED_APPS = [
     'django.contrib.auth',

=== modified file 'lava_server/settings/debian.py'
--- lava_server/settings/debian.py	2011-11-21 09:15:20 +0000
+++ lava_server/settings/debian.py	2011-11-29 15:14:01 +0000
@@ -8,6 +8,9 @@ 
 # Load application settings from django-debian integration package
 debian_settings = Settings("lava-server")
 
+# Load the mount point from settings file
+MOUNT_POINT = debian_settings.mount_point
+
 # Load default database from Debian integration
 DATABASES = {'default': debian_settings.default_database}
 
@@ -62,13 +65,11 @@ 
 # e-mail.
 SEND_BROKEN_LINK_EMAILS = debian_settings.SEND_BROKEN_LINK_EMAILS
 
-LOGIN_REDIRECT_URL = debian_settings.get_setting("LOGIN_REDIRECT_URL", LOGIN_REDIRECT_URL)
-
-# URL of the login screen, has to be hard-coded like that for Django.
-# I cheat a little, using DATA_URL_PREFIX here is technically incorrect
-# but it seems better than hard-coding 'lava-server' yet again.
-LOGIN_URL = debian_settings.get_setting("LOGIN_URL", LOGIN_URL)
-
+# URL of the login page 
+LOGIN_URL = debian_settings.LOGIN_REDIRECT_URL
+
+# URL of the page you get redirected to after logging in
+LOGIN_REDIRECT_URL = debian_settings.LOGIN_REDIRECT_URL
 
 # Load extensions
 loader.contribute_to_settings(locals(), debian_settings)

=== modified file 'lava_server/urls.py'
--- lava_server/urls.py	2011-11-28 17:33:20 +0000
+++ lava_server/urls.py	2011-11-29 15:14:01 +0000
@@ -34,38 +34,38 @@ 
 # Root URL patterns
 urlpatterns = patterns(
     '',
-    url(r'^$',
+    url(r'^{mount_point}$'.format(mount_point=settings.MOUNT_POINT),
         index,
         name='lava.home'),
-    url(r'^me/$',
+    url(r'^{mount_point}me/$'.fromat(mount_point=settings.MOUNT_POINT),
         me,
         name='lava.me'),
-    url(r'^version/$',
+    url(r'^{mount_point}version/$'.format(mount_point=settings.MOUNT_POINT),
         version,
         name='lava.version_details'),
-    url(r'^accounts/',
+    url(r'^{mount_point}accounts/'.format(mount_point=settings.MOUNT_POINT),
         include('django.contrib.auth.urls')),
-    url(r'^admin/',
+    url(r'^{mount_point}admin/'.format(mount_point=settings.MOUNT_POINT),
         include(admin.site.urls)),
-    url(r'^openid/',
+    url(r'^{mount_point}openid/'.format(mount_point=settings.MOUNT_POINT),
         include('django_openid_auth.urls')),
-    url(r'^RPC2/',
+    url(r'^{mount_point}RPC2/'.format(mount_point=settings.MOUNT_POINT),
         'linaro_django_xmlrpc.views.handler',
         name='lava.api_handler',
         kwargs={
             'mapper': loader.xmlrpc_mapper,
             'help_view': 'lava.api_help'}),
-    url(r'^api/help/$',
+    url(r'^{mount_point}api/help/$'.format(mount_point=settings.MOUNT_POINT),
         'linaro_django_xmlrpc.views.help',
         name='lava.api_help',
         kwargs={
             'mapper': loader.xmlrpc_mapper}),
-    url(r'^api/',
+    url(r'^{mount_point}api/'.format(mount_point=settings.MOUNT_POINT),
         include(api_urls.token_urlpatterns)),
     # XXX: This is not needed but without it linaro-django-xmlrpc tests fail
-    url(r'^api/',
+    url(r'^{mount_point}api/'.format(mount_point=settings.MOUNT_POINT),
         include(api_urls.default_mapper_urlpatterns)),
-    url(r'^utils/markitup/',
+    url(r'^{mount_point}utils/markitup/'.format(mount_point=settings.MOUNT_POINT),
         include('lava_markitup.urls')))