Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Apache/WSGI problems, but not on Django Dev Server
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Bobort  
View profile  
 More options May 6 2012, 5:54 pm
From: Bobort <matthew.p...@gmail.com>
Date: Sun, 6 May 2012 14:54:40 -0700 (PDT)
Local: Sun, May 6 2012 5:54 pm
Subject: Apache/WSGI problems, but not on Django Dev Server
Hello,

I have been scouring all over to figure out what is wrong with my
configuration, and it's probably something simple I have overlooked.
I'm developing a Django application that will run on Apache/mod_wsgi.
In my settings.py file, I set the DATABASES variable and the DEBUG
variable depending on if the website is running from the development
machine.

The code works as expected on the Django development server; DEBUG
gets FALSE.  However, it doesn't work as expected on the Apache/
mod_wsgi server; DEBUG gets TRUE.  What am I doing wrong?  Am I even
at the right group to ask this question?

Thank you very much!

This is what I have:

import socket
if socket.gethostname()=='IT':
    DEBUG = True
    DATABASES = {
        'default': {
                'NAME': 'dev_database',
                'ENGINE': 'sqlserver_ado',
                'HOST': 'server\\SQLSERVER',
                'USER': '',
                'PASSWORD': '',
                'OPTIONS': {
                    'provider': 'SQLOLEDB',
                    'use_mars': True,
                },
        }
    }
else:
    DEBUG = False
    DATABASES = {
        'default': {
                'NAME': 'live_database',
                'ENGINE': 'sqlserver_ado',
                'HOST': 'server\\SQLSERVER',
                'USER': '',
                'PASSWORD': '',
                'OPTIONS': {
                    'provider': 'SQLOLEDB',
                    'use_mars': True,
                },
        }
    }


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Graham Dumpleton  
View profile  
 More options May 6 2012, 8:01 pm
From: Graham Dumpleton <graham.dumple...@gmail.com>
Date: Mon, 7 May 2012 10:01:35 +1000
Local: Sun, May 6 2012 8:01 pm
Subject: Re: [modwsgi] Apache/WSGI problems, but not on Django Dev Server
You need to specify, with any error messages you get, what 'it doesn't
work as expected on the Apache/mod_wsgi server' means.

A few points to note.

1. Web application under Apache would run in a different user to when
you run it manually.
2. The Apache environment doesn't inherit environment variables from
your user account.
3. The user code runs as may not have access to directories you would
when run yourself.
4. The application will not have same working directory, so paths must
be absolute not relative.

Graham

On 7 May 2012 07:54, Bobort <matthew.p...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Matthew  
View profile  
 More options May 7 2012, 6:16 pm
From: Matthew <matthew.p...@gmail.com>
Date: Mon, 7 May 2012 15:16:51 -0700 (PDT)
Local: Mon, May 7 2012 6:16 pm
Subject: Re: [modwsgi] Apache/WSGI problems, but not on Django Dev Server

Hi Graham,

After spending days debugging this issue, I am a bit embarrassed to say
what the problem was, but I think it's a good idea to explain what happened
as a matter of completeness.

I had two django project folders established: one for the production and
one for the development.  I forgot to clean up the production project
folder to properly match the development project folder.  In the production
project folder, I had a settings.py file, but I also I had a settings
folder when I was experimenting with a different way of initializing
settings.  In that experiment, DEBUG was always TRUE in the __init__.py
file in the settings folder.  After deleting the settings folder, the
application worked as expected.

Thank you very much for all of your assistance in this matter!
--Matthew


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »