django and mod_python

Discussion in 'Python' started by bapolis@gmail.com, Mar 5, 2006.

  1. Guest

    Hi,

    I read the mod_python documentation on the Django site but I'm getting
    this error:

    EnvironmentError: Could not import DJANGO_SETTINGS_MODULE
    'accesshiphop.settings' (is it on sys.path?): No module named
    accesshiphop.settings

    Here's my httpd.conf:

    <Location "/public_html/myproject/">
    PythonPath "[r'c:/apache/public_html/myproject/']+sys.path"
    SetHandler python-program
    PythonHandler django.core.handlers.modpython
    SetEnv DJANGO_SETTINGS_MODULE myproject.settings
    PythonDebug On
    </Location>

    Also, the Django site says "Also, if you've manually altered your
    PYTHONPATH to put your Django project on it, you'll need to tell
    mod_python:"

    I don't recall adding my project to my PYTHONPATH. Should I have done
    this? How do I do this?

    Thanks.
     
    , Mar 5, 2006
    #1
    1. Advertising

  2. Robin Becker Guest

    wrote:
    > Hi,
    >
    > I read the mod_python documentation on the Django site but I'm getting
    > this error:
    >
    > EnvironmentError: Could not import DJANGO_SETTINGS_MODULE
    > 'accesshiphop.settings' (is it on sys.path?): No module named
    > accesshiphop.settings
    >
    > Here's my httpd.conf:
    >
    > <Location "/public_html/myproject/">
    > PythonPath "[r'c:/apache/public_html/myproject/']+sys.path"
    > SetHandler python-program
    > PythonHandler django.core.handlers.modpython
    > SetEnv DJANGO_SETTINGS_MODULE myproject.settings
    > PythonDebug On
    > </Location>
    >
    > Also, the Django site says "Also, if you've manually altered your
    > PYTHONPATH to put your Django project on it, you'll need to tell
    > mod_python:"

    ......
    in my setup the PythonPath statement puts the folder containing
    myproject onto the PythonPath in your case that might be

    PythonPath "[r'c:/apache/public_html']+sys.path"

    also I place the SetEnv DJANGO_SETTINGS_MODULE .....
    before specifying the PythonHandler, but I am unsure if that is required
    (I guess it depends on exactly how apache sets up the location), but
    it's what I would do in a batch file for example.
     
    Robin Becker, Mar 5, 2006
    #2
    1. Advertising

  3. tgone Guest

    your suggestions worked. thanks.
     
    tgone, Mar 5, 2006
    #3
  4. a écrit :
    > Hi,
    >
    > I read the mod_python documentation on the Django site but I'm getting
    > this error:
    >
    > EnvironmentError: Could not import DJANGO_SETTINGS_MODULE
    > 'accesshiphop.settings' (is it on sys.path?): No module named
    > accesshiphop.settings
    >
    > Here's my httpd.conf:


    (snip - already answered)

    <OT>
    BTW, there's a django mailing-list, and IIRC a mod_python mailing-list
    too. When possible, post to the most specific(s) list(s).
    </OT>
     
    Bruno Desthuilliers, Mar 6, 2006
    #4
  5. Bruno Desthuilliers wrote:

    > a écrit :
    >> Hi,
    >>
    >> I read the mod_python documentation on the Django site but I'm getting
    >> this error:
    >>
    >> EnvironmentError: Could not import DJANGO_SETTINGS_MODULE
    >> 'accesshiphop.settings' (is it on sys.path?): No module named
    >> accesshiphop.settings
    >>
    >> Here's my httpd.conf:

    >
    > (snip - already answered)
    >
    > <OT>
    > BTW, there's a django mailing-list, and IIRC a mod_python mailing-list
    > too. When possible, post to the most specific(s) list(s).
    > </OT>


    Hi,

    There are also some wxpython, pyqt, ... mailing-list, iircc and you don't
    seem to bother requesters with not being at the right place ;-)

    Regards,

    Laurent.
     
    Laurent Rahuel, Mar 6, 2006
    #5
  6. Laurent Rahuel wrote:
    > Bruno Desthuilliers wrote:
    >
    >
    >> a écrit :
    >>
    >>>Hi,
    >>>
    >>>I read the mod_python documentation on the Django site but I'm getting
    >>>this error:
    >>>
    >>>EnvironmentError: Could not import DJANGO_SETTINGS_MODULE
    >>>'accesshiphop.settings' (is it on sys.path?): No module named
    >>>accesshiphop.settings
    >>>
    >>>Here's my httpd.conf:

    >>
    >>(snip - already answered)
    >>
    >><OT>
    >>BTW, there's a django mailing-list, and IIRC a mod_python mailing-list
    >>too. When possible, post to the most specific(s) list(s).
    >></OT>

    >
    >
    > Hi,
    >
    > There are also some wxpython, pyqt, ... mailing-list, iircc and you don't
    > seem to bother requesters with not being at the right place ;-)


    Laurent,

    I'm not here to bother anyone. The point here is that the OP's question
    is more about django/mod_python conf than about Python itself, so I
    *advise* him to post on one of these lists.

    --
    bruno desthuilliers
    python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
    p in ''.split('@')])"
     
    bruno at modulix, Mar 6, 2006
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sokolov Yura
    Replies:
    0
    Views:
    308
    Sokolov Yura
    Sep 8, 2005
  2. blbmdsmith
    Replies:
    1
    Views:
    669
    Graham Dumpleton
    Dec 14, 2006
  3. John Posner

    Question on Django and Django Book

    John Posner, Nov 13, 2010, in forum: Python
    Replies:
    0
    Views:
    338
    John Posner
    Nov 13, 2010
  4. eGenix Team: M.-A. Lemburg
    Replies:
    0
    Views:
    150
    eGenix Team: M.-A. Lemburg
    Jun 18, 2013
  5. Gary Roach
    Replies:
    0
    Views:
    149
    Gary Roach
    Jan 2, 2014
Loading...

Share This Page