Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 523333
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T08:26:49+00:00 2026-05-13T08:26:49+00:00

My django site is served up with the following in Apache’s config: WSGIScriptAlias /studio

  • 0

My django site is served up with the following in Apache’s config:

WSGIScriptAlias /studio /django/studio/bin/django.wsgi

My urls.py looks like:

urlpatterns += patterns(
    'django.contrib',
    (r'^admin/', include(admin.site.urls)),
    (r'^accounts/login/$', 'auth.views.login'),
    (r'^accounts/logout/$', 'auth.views.logout'),
    )

…and yet:

[<a href="{% url admin:index %}">admin</a>]

…generates a link to /admin rather than /studio/admin.
Bizarrely, the urls within the admin interface itself are fine.

I’m using:

Python 2.5.2-3
Django 1.1.1
mod_wsgi  2.5-1~lenny1
apache2 2.2.9-10+lenny6

Can anyone tell me what I’m doing wrong?

cheers,

Chris

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T08:26:50+00:00Added an answer on May 13, 2026 at 8:26 am

    This is a bug in Django, see:

    http://code.djangoproject.com/ticket/12464

    The problem is that because Apache’s rewrite engine is on as a result of rewriting I need to do elsewhere in the virtual host, the SCRIPT_URL environment variable is set. But, when a request is made to /project through Apache, PATH_INFO is empty, which results in SCRIPT_NAME being incorrectly set as an empty string.

    Until this bug is fixed, inserting the following RewriteRule into the Apache configuration will safely work around the problem by ensuring that PATH_INFO is never empty.

    RewriteEngine On 
    RewriteRule ^/project$ /project/ [R]
    WSGIScriptAlias /project /django/project/bin/django.wsgi
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code in the urls.py in mysite project. /mysite/urls.py from django.conf.urls.defaults
I'm using nginx+fastcgi via unix socket to my django site. I'm using the following
I have setup the following in my urls.py: (r'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}) and my
I'm having trouble getting Apache/WSGI to use my VirtualEnv. I have added the following
I got my Apache Mod_WSGI and Django working following http://blog.stannard.net.au/2010/12/11/installing-django-with-apache-and-mod_wsgi-on-ubuntu-10-04/ with a twist that
Am experienced with Django, Apache, WSGI, MySql, etc. and have this environment setup and
from django.conf.urls import patterns, include, url from django.contrib import admin admin.autodiscover() urlpatterns = patterns('',
I'm in the process of moving a django site over to a new server.
We've got a server over which we're running a Django powered site. Since we
I have a django server that serves the basic site with user, auth etc

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.