Browse Source

auto-detect the script prefix path under which mumble-django is running

Natenom/support-murmur-13-1446181288462
Michael Ziegler 16 years ago
parent
commit
fcb4989bed
  1. 14
      pyweb/__init__.py

14
pyweb/__init__.py

@ -12,3 +12,17 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * 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
pf = get_script_prefix();
settings.MEDIA_URL = "%sstatic" % pf;
settings.ADMIN_MEDIA_PREFIX = "%smedia" % pf;
settings.LOGIN_URL = reverse( "django.contrib.auth.views.login" );
signals.request_started.disconnect( update_paths );
signals.request_started.connect( update_paths );
Loading…
Cancel
Save