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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T11:46:20+00:00 2026-05-16T11:46:20+00:00

I would like to run a Django project on a server using virtualenv in

  • 0

I would like to run a Django project on a server using virtualenv in Apache using mod_python. Now I know that the recommended apache module to use is mod_wsgi, but I don’t want to install that for now.

The default python installation on the server is python2.4, which is used by some other website on the server. Because my project was built on python2.6 I installed it next to python2.4 in /usr/local/ using ‘make altinstall’.
I’ve used this website to setup my apache conf file: http://mydjangoblog.com/2009/03/30/django-mod_python-and-virtualenv/.

My question is: is there a way to specify that it (mod_python probably) should use python2.6 instead of python2.4?
If there is no way to run 2 python versions in one apache using mod_python, would it be possible using mod_wsgi? Or would it be possible in one apache installation with the other site using mod_python and me using mod_wsgi?

  • 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-16T11:46:21+00:00Added an answer on May 16, 2026 at 11:46 am

    No, you cannot do this. mod_python is pre-compiled with a particular Python version. If you wanted to change that version, you’d have to re-compile mod_python – and if you’re doing that, you might as well install mod_wsgi.

    It is possible with mod_wsgi, as that doesn’t embed an interpreter into Apache itself, so it doesn’t care what version you use. It’s quite easy to get virtualenv working with mod_wsgi – you just need to activate the virtualenv inside your .wsgi script:

    activate_this = os.path.join(path_to_my_site, "bin/activate_this.py")
    execfile(activate_this, dict(__file__=activate_this))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to run all my django tests using mercurial's precommit hook. Whenever
I have some initialization code that I would like Django to run once, when
I have a Makefile that starts a Django web server. I would like the
I have a django project with an existing db that I would really like
I'm running a django project using gunicorn, I'd like to run it using ssl,
I would like to run a jar file extracted from my java project to
I would like to run this script (embed drive list in a site) that
I would like to run a (extensive) query that produces one line of XML.
I'm using the django-jenkins plugin in my Django project and it seems that it
I would like to run some environment checks when my django process starts and

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.