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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T07:48:33+00:00 2026-05-11T07:48:33+00:00

I’m having major problems getting Django working with my Apache configuration. I did not

  • 0

I’m having major problems getting Django working with my Apache configuration. I did not create the server, so I don’t have too much leeway as to how the server works. Essentially there are three virtual hosts:

board.site.org, students.site.org and insider.site.org

The insider.site.org is the main one I’m concerned with. I’m in charge of a small site underneath it (ideally at insider.site.org/tech). I decided to put my files separate from the original directory, as not to chance messing up something in there (since a non-python site is already in place). Anyway, my virtual hosts are defined in separate files in /etc/apache2/vhosts.d/

Here’s what the insider.site.org’s config looks like

insider.conf

LoadModule python_module /usr/lib64/apache2/mod_python.so  <VirtualHost 10.10.1.1:80> ServerName insider.site.org DocumentRoot /media/nss/VWEB/docs    <Directory /media/nss/VWEB/docs>       Options Indexes Multiviews       AllowOverride None       Order Allow,Deny       #Allow from 10.11.0.78       Allow from all    </Directory>  Alias /tech  /srv/www/Tech     <Directory /srv/www/Tech>       SetHandler python-program       PythonPath '['/srv/www/Tech'] + sys.path'       PythonHandler django.core.handlers.modpython       SetEnv DJANGO_SETTINGS_MODULE Tech.settings       PythonDebug On    </Directory>   Alias /media /srv/www/Media     <Directory /srv/www/Media>       SetHandler None    </Directory>  </VirtualHost> 
  • Note that when saying site.org, I’m referring to my site, not the actually ‘site.org’ web address.

Now, it seems like that should be right to me, but for some reason, accessing http://insider.site.org/tech/ gives me this error:

Mod_python error: ‘PythonHandler mod_python.publisher’

Traceback (most recent call last):

File ‘/usr/lib64/python2.4/site-packages/mod_python/apache.py’, line 299, in HandlerDispatch result = object(req)

File ‘/usr/lib64/python2.4/site-packages/mod_python/publisher.py’, line 98, in handler path=[path])

File ‘/usr/lib64/python2.4/site-packages/mod_python/apache.py’, line 454, in import_module f, p, d = imp.find_module(parts[i], path)

ImportError: No module named index

Whereas http://insider.site.org/tech (no trailing forward slash) results in a 403 error. I do have Django in this directory, but it simply isn’t getting executed (I have _ init _.py in all my directories under the tech folder, and this is a copy from my own personal computer (which ran off of the django test server)) so I don’t think that’s the problem. This is simply not working 🙁

Any help is appreciated, thanks.

  • 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. 2026-05-11T07:48:34+00:00Added an answer on May 11, 2026 at 7:48 am

    For your first problem, are you sure you have Django in the PythonPath you have specified? On my server, the list in my PythonPath includes the directory containing the top-level django directory, which itself contains the bin, contrib, admin, core, etc. directories, in addition to __init__.py. (Also make sure your Apache user has read and execute permissions for these files and directories, although I’m sure this is obvious.) This is my setup:

    <Location '/myapp'>    SetHandler python-program    PythonHandler django.core.handlers.modpython    SetEnv DJANGO_SETTINGS_MODULE LogFileAnalyzer.settings    PythonDebug on    PythonPath '['/srv/www/dir_containing_django_dir', '/srv/www/myapp_dir'] + sys.path' </Location> 

    Note that I’m using Location instead of Directory here, so your mileage may vary.

    For your second problem, that sounds like a problem for mod_rewrite. See here. You can let the server append the slash you need automatically by defining a rewrite rule:

    RewriteEngine  on RewriteBase    /~quux/ RewriteRule    ^foo$  foo/  [R] 

    Hope that helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 164k
  • Answers 164k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer EDIT: The OP goal was actually pretty unclear and I'm… May 12, 2026 at 12:28 pm
  • Editorial Team
    Editorial Team added an answer This article is quite nice about features of firebug :… May 12, 2026 at 12:28 pm
  • Editorial Team
    Editorial Team added an answer There's nothing which makes this pattern easier, and in fact… May 12, 2026 at 12:28 pm

Related Questions

I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I am currently running into a problem where an element is coming back from
Seemingly simple, but I cannot find anything relevant on the web. What is the
Does anyone know how can I replace this 2 symbol below from the string
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.