From 6d9b553248780ae57e43a945f9e704d1c9b91cea Mon Sep 17 00:00:00 2001 From: Michael Ziegler Date: Mon, 31 Aug 2009 21:58:36 +0200 Subject: [PATCH] I can't get auto detection to work properly, so this needs to be configured. :( --- pyweb/__init__.py | 14 -------------- pyweb/settings.py | 11 +++++++++-- 2 files changed, 9 insertions(+), 16 deletions(-) diff --git a/pyweb/__init__.py b/pyweb/__init__.py index fe70e3d..cab0bd4 100644 --- a/pyweb/__init__.py +++ b/pyweb/__init__.py @@ -12,17 +12,3 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. """ - -from django.core import signals - -def update_paths( **kwargs ): - from django.core.urlresolvers import get_script_prefix, reverse - from os.path import join - from django.conf import settings - settings.MEDIA_URL = join( get_script_prefix(), settings.MEDIA_URL[1:] ); - settings.ADMIN_MEDIA_PREFIX = join( get_script_prefix(), settings.ADMIN_MEDIA_PREFIX[1:] ); - settings.LOGIN_URL = reverse( "django.contrib.auth.views.login" ); - signals.request_started.disconnect( update_paths ); - -signals.request_started.connect( update_paths ); - diff --git a/pyweb/settings.py b/pyweb/settings.py index 1c721d5..84bd6a3 100644 --- a/pyweb/settings.py +++ b/pyweb/settings.py @@ -29,6 +29,10 @@ MUMBLE_DJANGO_ROOT = None; ## #MUMBLE_DJANGO_ROOT = '/home/mistagee/mumble-django'; ## #MUMBLE_DJANGO_ROOT = 'c:/web/mumble-django'; ## ## ## +## Root URL (the path in the VirtualHost: ## +MUMBLE_DJANGO_URL = '/'; ## +#MUMBLE_DJANGO_URL = '/mumble-django/'; ## +## ## ## For a basic installation, this is all you need to edit in ## ## this file, the rest will be handled automatically! ## ## ## @@ -116,10 +120,13 @@ USE_I18N = True MEDIA_ROOT = join( MUMBLE_DJANGO_ROOT, 'htdocs' ) # URL that handles the media served from MEDIA_ROOT. -MEDIA_URL = '/static/'; +MEDIA_URL = MUMBLE_DJANGO_URL+'static/' + +# URL to the login view +LOGIN_URL = MUMBLE_DJANGO_URL+'accounts/login/' # URL prefix for admin media -- CSS, JavaScript and images. -ADMIN_MEDIA_PREFIX = '/media/'; +ADMIN_MEDIA_PREFIX = MUMBLE_DJANGO_URL+'media/' # Make this unique, and don't share it with anybody. SECRET_KEY = 'u-mp185msk#z4%s(do2^5405)y5d!9adbn92)apu_p^qvqh10v'