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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T09:25:58+00:00 2026-06-03T09:25:58+00:00

My computer runs Ubuntu 12.04 and I followed this tutorial to get started with

  • 0

My computer runs Ubuntu 12.04 and I followed this tutorial to get started with Django: http://blog.stannard.net.au/2010/12/11/installing-django-with-apache-and-mod_wsgi-on-ubuntu-10-04/

I tried to start in /srv/www/ my alex project by running this command sudo django-admin.py startproject alex

Then created apache folder and django.wsgi file (/srv/www/alex/apache/django.wsgi)

tree for /srv/www/alex/

.
├── apache
│   └── django.wsgi
├── alex
│   ├── __init__.py
│   ├── settings.py
│   ├── urls.py
│   └── wsgi.py
└── manage.py

2 directories, 6 files

alex apache site:

<VirtualHost *:80>

    ServerName alex.djangoserver
    DocumentRoot /srv/www/alex

    <Directory /srv/www/alex>
        Order allow,deny
        Allow from all
    </Directory>

    WSGIDaemonProcess alex.djangoserver processes=2 threads=15 display-name=%{GROUP}
    WSGIProcessGroup alex.djangoserver

    WSGIScriptAlias / /srv/www/alex/apache/django.wsgi

</VirtualHost>

The apache error log result:

[error] [client 127.0.0.1] mod_wsgi (pid=28076): Exception occurred processing WSGI script '/srv/www/floqq/alex/django.wsgi'.
[error] [client 127.0.0.1] Traceback (most recent call last):
[error] [client 127.0.0.1]   File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/wsgi.py", line 219, in __call__
[error] [client 127.0.0.1]     self.load_middleware()
[error] [client 127.0.0.1]   File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 39, in load_middleware
[error] [client 127.0.0.1]     for middleware_path in settings.MIDDLEWARE_CLASSES:
[error] [client 127.0.0.1]   File "/usr/local/lib/python2.7/dist-packages/django/utils/functional.py", line 184, in inner
[error] [client 127.0.0.1]     self._setup()
[error] [client 127.0.0.1]   File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 42, in _setup
[error] [client 127.0.0.1]     self._wrapped = Settings(settings_module)
[error] [client 127.0.0.1]   File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 95, in __init__
[error] [client 127.0.0.1]     raise ImportError("Could not import settings '%s' (Is it on sys.path?): %s" % (self.SETTINGS_MODULE, e))
[error] [client 127.0.0.1] ImportError: Could not import settings 'alex.settings' (Is it on sys.path?): No module named alex.settings

UPDATE

apache/django.wsgi

import os
import sys

path = '/srv/www'
if path not in sys.path:
    sys.path.insert(0, '/srv/www')

os.environ['DJANGO_SETTINGS_MODULE'] = 'alex.settings'

import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
  • 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-06-03T09:25:59+00:00Added an answer on June 3, 2026 at 9:25 am

    In your wsgi file you have:

    sys.path.insert(0, '/srv/www')
    
    os.environ['DJANGO_SETTINGS_MODULE'] = 'alex.settings'
    

    which will search for settings.py in /srv/www/alex/.

    That fails because, according to your posted tree, settings.py is in /srv/www/alex/alex/.

    So you have 3 options:

    1. change the inserted path
    2. change the directory sturcture, or
    3. refactor /srv/www/alex/ into a package containing alex.settings.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm developing an application in MVC3 ( http://www.colombiatrolley.com/sitrolley ). In my computer it runs
My local computer runs PHP 5.3.2, while my server runs 5.2.5. I get Parse
My GAE app runs fine from my computer, but when I upload it, I
I have an RMI program which runs fine on my computer, but when I
I have an MFC application that runs on my computer, but when I try
I am learning Computer Networking this semester, on which I find it quite interesting
My computer runs Windows 7 X64 Enterprise Edition. I need x86 mode for my
Linux-based (Ubuntu 11.10) Before my computer crashed I had a binary on my computer:
I have the following code which runs fine on my computer but fails online:
When I try to open the address http://www.syncml.org then I received this message :

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.