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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:35:46+00:00 2026-05-27T13:35:46+00:00

I’m deploying my first ever Django project and I get the feeling I’m very

  • 0

I’m deploying my first ever Django project and I get the feeling I’m very close, but just need some help getting over the line. Here’s the problem:

My httpd.conf changes look like this:

WSGIScriptAlias / /home/miketnc/frontend/tncsite/wsgi.py
WSGIPythonPath /home/miketnc/frontend/tncsite

<Directory /home/miketnc/frontend/tncsite>
<Files wsgi.py>
Order deny,allow
Allow from all
</Files>
</Directory>

So far so good, the “hello world” script in wsgi.py runs just fine. The problem comes when I use the Django doc-recommended wsgi script:

import os, sys

sys.path.append('/home/miketnc/frontend/tncsite')
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "tncsite.settings")

from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()

This causes a 500 error:

File "/home/miketnc/frontend/tncsite/wsgi.py", line 10, in ?
mod_wsgi (pid=15494): Exception occurred processing WSGI script '/home/miketnc/frontend/tncsite/wsgi.py'.
mod_wsgi (pid=15494): Target WSGI script '/home/miketnc/frontend/tncsite/wsgi.py' cannot be loaded as Python module.

All of the support I’ve seen on the error relates back to bad installations in apache, not finding modules etc, which can’t be the case if “hello world” is running.

Any ideas?

UPDATE

After restarting on a fresh server, I’ve managed to move things forward slightly. The good news is that python and WSGI seem to be playing nice, the bad is that I’m now getting a different kind of 500 error.

The only error I’m getting back in the log is:
“[Mon Dec 05 18:22:45 2011] [error] [client ip] mod_wsgi (pid=19804): Exception occurred processing WSGI script ‘/home/miketnc/frontend/tncsite/apache/wsgi.py’.”

The Hello World script still runs fine, the trigger for the error is the final line:

application = django.core.handlers.wsgi.WSGIHandler()

I’ve set all directories containing the project from frontend/ down to 777 and I’ve added a daemon process as myself:

LoadModule wsgi_module /usr/local/apache/extramodules/mod_wsgi.so
AddHandler wsgi-script .wsgi

WSGIDaemonProcess miketnc processes=2 maximum-requests=500 threads=1
WSGIProcessGroup miketnc

WSGIScriptAlias / /home/miketnc/frontend/tncsite/apache/wsgi.py

<Directory /home/miketnc/frontend/tncsite>
<Files wsgi.py>
Order deny,allow
Allow from all
</Files>
</Directory>

Anyone please able to advise further on how to get this working?

  • 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-27T13:35:46+00:00Added an answer on May 27, 2026 at 1:35 pm

    Solved.

    I didn’t realise that the error log in Cpanel is a tiny fraction of the error log Apache outputs. Once I viewed the Apache logs, the problem was obvious. In this case it was MySQLdb not being set up properly.

    I worked through it, making some adjustments around .python-eggs, and all is now well.

    Thanks for the responses and in particular thank you Graham for the work you’ve put into WSGI.

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

Sidebar

Related Questions

I have just tried to save a simple *.rtf file with some websites and
I need to clean up various Word 'smart' characters in user input, including but
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
Seemingly simple, but I cannot find anything relevant on the web. What is the
I have a French site that I want to parse, but am running into
In my XML file chapters tag has more chapter tag.i need to display chapters
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this

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.