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 6368093
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:37:55+00:00 2026-05-25T00:37:55+00:00

I have a django application set up using mainly the admin interface with a

  • 0

I have a django application set up using mainly the admin interface with a few of my own views. Everything is working corrctly on the devlopment server on my local machine.

However on the production server, using Apache, and mod_wsgi, it is messing up the URLs when I issue a redirect statement in one of my views. Instead of going to

     www.hostname.com/wsgi/django/admin/myapp/myform.html

it goes to

     www.hostname.com/admin/myapp/myform.html

Apache doesn’t recognise anything under an admin folder, so I get an error.

So in my apache configuration I have the following, so that anything under wsgi/django gets sent to my app:

WSGIScriptAlias /wsgi/django /project/production/public/wsgi/django_eclipse/myapp.wsgi

In my problematic view I have the following:

return redirect('/admin/sequencing/load_flowcell?' + params )      

I can make this work, if I change the redirect to include the ‘/wsgi/django’ part, but this means I can’t keep the one on my development server the same. Is there a way in Django settings, or http.conf to set this so that my redirect automatically includes this part of the URL?

  • 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-25T00:37:57+00:00Added an answer on May 25, 2026 at 12:37 am

    EDIT: REAL FIX

    from django.core.urlresolvers import reverse, get_script_prefix
    ....
    #only of you absolutely HAVE to have a hardcoded url
    return redirect(get_script_prefix()+'admin/sequencing/load_flowcell?'+params )
    #better!
    return redirect(reverse('admin:index')+sequencing/load_flowcell?'+params )
    

    CAVEAT:
    https://docs.djangoproject.com/en/dev/howto/deployment/modpython/#basic-configuration

    <Location "/mysite/">
        SetHandler python-program
        PythonHandler django.core.handlers.modpython
        SetEnv DJANGO_SETTINGS_MODULE mysite.settings
        PythonOption django.root /mysite     <---- Make sure you have this
        PythonDebug On
    </Location>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a django application and I want to add my own auth validation
I have a Django application which prints out a pdf file. I would like
I was trying to set up cache for my Django application but it seems
I have a django application which is exposing a API whose url conf look
I created a django application with a user login/registration page. I am trying to
I have a usergroup called baseusers with a set of permissions I have added
I would like to build a mobile application with the following requirements: The mobile
I've been trying to teach myself to create and deploy Django apps. I've created
I want to use a different settings file in django -- specifically settings_prod --
I know that there are hundreds of pages written on Django v Rails, but

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.