From patchwork Tue Nov 29 20:02:13 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zygmunt Krynicki X-Patchwork-Id: 5385 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 2512524017 for ; Tue, 29 Nov 2011 20:02:16 +0000 (UTC) Received: from mail-lpp01m010-f52.google.com (mail-lpp01m010-f52.google.com [209.85.215.52]) by fiordland.canonical.com (Postfix) with ESMTP id F3BEDA180D6 for ; Tue, 29 Nov 2011 20:02:15 +0000 (UTC) Received: by laah2 with SMTP id h2so1539196laa.11 for ; Tue, 29 Nov 2011 12:02:15 -0800 (PST) Received: by 10.152.104.1 with SMTP id ga1mr32128117lab.40.1322596935642; Tue, 29 Nov 2011 12:02:15 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.152.41.198 with SMTP id h6cs20610lal; Tue, 29 Nov 2011 12:02:15 -0800 (PST) Received: by 10.227.206.66 with SMTP id ft2mr5912379wbb.8.1322596933624; Tue, 29 Nov 2011 12:02:13 -0800 (PST) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id y80si139842weq.74.2011.11.29.12.02.13 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 29 Nov 2011 12:02:13 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) client-ip=91.189.90.7; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) smtp.mail=bounces@canonical.com Received: from ackee.canonical.com ([91.189.89.26]) by indium.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1RVTsb-0006Vu-BA for ; Tue, 29 Nov 2011 20:02:13 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id 49512E04BC for ; Tue, 29 Nov 2011 20:02:13 +0000 (UTC) MIME-Version: 1.0 X-Launchpad-Project: lava-server X-Launchpad-Branch: ~linaro-validation/lava-server/trunk X-Launchpad-Message-Rationale: Subscriber X-Launchpad-Branch-Revision-Number: 325 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-validation/lava-server/trunk] Rev 325: Use mount points Message-Id: <20111129200213.19830.5822.launchpad@ackee.canonical.com> Date: Tue, 29 Nov 2011 20:02:13 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="14404"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: 5b1189eea08cb4fd893737169eedf15d3ece64e3 ------------------------------------------------------------ revno: 325 committer: Zygmunt Krynicki 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 === 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')))