django and mod_python

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • bapolis@gmail.com

    #1

    django and mod_python

    Hi,

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

    EnvironmentErro r: Could not import DJANGO_SETTINGS _MODULE
    'accesshiphop.s ettings' (is it on sys.path?): No module named
    accesshiphop.se ttings

    Here's my httpd.conf:

    <Location "/public_html/myproject/">
    PythonPath "[r'c:/apache/public_html/myproject/']+sys.path"
    SetHandler python-program
    PythonHandler django.core.han dlers.modpython
    SetEnv DJANGO_SETTINGS _MODULE myproject.setti ngs
    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.

  • Robin Becker

    #2
    Re: django and mod_python

    bapolis@gmail.c om wrote:[color=blue]
    > Hi,
    >
    > I read the mod_python documentation on the Django site but I'm getting
    > this error:
    >
    > EnvironmentErro r: Could not import DJANGO_SETTINGS _MODULE
    > 'accesshiphop.s ettings' (is it on sys.path?): No module named
    > accesshiphop.se ttings
    >
    > Here's my httpd.conf:
    >
    > <Location "/public_html/myproject/">
    > PythonPath "[r'c:/apache/public_html/myproject/']+sys.path"
    > SetHandler python-program
    > PythonHandler django.core.han dlers.modpython
    > SetEnv DJANGO_SETTINGS _MODULE myproject.setti ngs
    > 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:"[/color]
    ......
    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.

    Comment

    • tgone

      #3
      Re: django and mod_python

      your suggestions worked. thanks.

      Comment

      • Bruno Desthuilliers

        #4
        Re: django and mod_python

        bapolis@gmail.c om a écrit :[color=blue]
        > Hi,
        >
        > I read the mod_python documentation on the Django site but I'm getting
        > this error:
        >
        > EnvironmentErro r: Could not import DJANGO_SETTINGS _MODULE
        > 'accesshiphop.s ettings' (is it on sys.path?): No module named
        > accesshiphop.se ttings
        >
        > Here's my httpd.conf:[/color]

        (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>

        Comment

        • Laurent Rahuel

          #5
          Re: django and mod_python

          Bruno Desthuilliers wrote:
          [color=blue]
          > bapolis@gmail.c om a écrit :[color=green]
          >> Hi,
          >>
          >> I read the mod_python documentation on the Django site but I'm getting
          >> this error:
          >>
          >> EnvironmentErro r: Could not import DJANGO_SETTINGS _MODULE
          >> 'accesshiphop.s ettings' (is it on sys.path?): No module named
          >> accesshiphop.se ttings
          >>
          >> Here's my httpd.conf:[/color]
          >
          > (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>[/color]

          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.

          Comment

          • bruno at modulix

            #6
            Re: django and mod_python

            Laurent Rahuel wrote:[color=blue]
            > Bruno Desthuilliers wrote:
            >
            >[color=green]
            >>bapolis@gmail .com a écrit :
            >>[color=darkred]
            >>>Hi,
            >>>
            >>>I read the mod_python documentation on the Django site but I'm getting
            >>>this error:
            >>>
            >>>EnvironmentE rror: Could not import DJANGO_SETTINGS _MODULE
            >>>'accesshipho p.settings' (is it on sys.path?): No module named
            >>>accesshiphop .settings
            >>>
            >>>Here's my httpd.conf:[/color]
            >>
            >>(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>[/color]
            >
            >
            > 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 ;-)[/color]

            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 'onurb@xiludom. gro'.split('@')])"

            Comment

            Working...