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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T07:15:32+00:00 2026-05-16T07:15:32+00:00

This is probably really simple. But I guess I’m too new to WSGI and

  • 0

This is probably really simple. But I guess I’m too new to WSGI and Django to get it on my own. I have a brand new shiny Django project on a Ubuntu virtual machine hosted in /var/www/mysite. The project was created with

django-admin startproject mysite

I’m following a WSGI tutorial to get it set up, so I created an ./apache folder, inside of which I placed this file, django.wsgi:

import os
import sys
os.environ['DJANGO_SETTINGS_MODULE'] = '/var/www/mysite/mysite.settings'

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

I then added this config line to the Apache configuration:

WSGIScriptAlias / /var/www/mysite/apache/django.wsgi

When I try to hit the site, nothing is returned. The connection just hangs. This is in my access.log:

192.168.2.116 - - [15/Aug/2010:14:09:02 -500] "GET / HTTP/1.1" 500 639 "-" "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8

So it’s hitting the site. But someone isn’t doing anything. There are no errors in the errors.log.

Anyone have any ideas?

  • 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-16T07:15:33+00:00Added an answer on May 16, 2026 at 7:15 am

    The blatant mistake in original question is that:

    os.environ['DJANGO_SETTINGS_MODULE'] = '/var/www/mysite/mysite.settings'
    

    would need to be:

    sys.path.append('/var/www')
    sys.path.append('/var/www/mysite')
    
    os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'
    

    That is, Django settings module must be a Python package path, NOT an absolute file system path. The accepted answer doesn’t even point that out and rather just gives another set of code to use with no explanation.

    Further, you need to set Python module search path, ie., sys.path, so that Python can find your settings file listed in that environment variable.

    Finally, if your browser was hanging you have done something else wrong as well, as what you did should have resulted in an error being returned and not the browser hanging. There would also have had to be an error in the Apache error log, so you are either looking in wrong place or don’t know what to look for.

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

Sidebar

Related Questions

This is probably a really simple question but I can't seem to get my
This probably something really simple, but I have never used CAShapeLayers before, I imported
I know this probably really simple but Im not sure what im doing wrong...
This is probably something really simple but for some reason I just can't seem
This is probably something really simple but I cant see what! Any images I
This is probably a really simple question but one I've never quite worked out
This is probably a really dumb question with a simple answer but... I am
This is probably very simple but it's really confusing me. When I implement the
This is probably something really simple, however I am quite new to PHP, and
I'm new to web programming in general so this is probably a really simple

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.