FAQ
This question is also on Stackoverflow http://goo.gl/LinMue but I thought
somene here may have an idea.


I have a Django 1.5, Python 2.7 site running under Apache with mod_wsgi on
a CentOS 6.4 server.

I have rebuilt this site using Django 1.6 and Python 3.3. Deploying it to
the same server and changing the paths in httpd.conf I get the subject
error. This new install works as expected using ./manage.py runserver.

Here are the two WSGI definitions from httpd.conf:

WSGIScriptAlias / /home/ccdgen/CCDGEN2/apache/wsgi.py
WSGIPythonPath
/home/ccdgen/CCDGEN2/ccdgen/ccdgen:/home/ccdgen/CCDGEN2/ccdgen:/home/ccdgen/CCDGEN2/lib/python3.3/site-packages<Directory
/home/ccdgen/CCDGEN2/ccdgen>
    <Files wsgi.py>
      Order allow,deny
      Allow from all
    </Files></Directory>
#WSGIScriptAlias /ccdgen
/home/ccdgen/CCDGEN/apache/wsgi.py#WSGIPythonPath
/home/ccdgen/CCDGEN/mlhim/ccdgen:/home/ccdgen/CCDGEN/mlhim:/home/ccdgen/CCDGEN/lib/python2.7/site-packages#<Directory
/home/ccdgen/CCDGEN/mlhim># <Files wsgi.py># Order allow,deny#
   Allow from all# </Files>#</Directory>

The wsgi.py file is the same on both installations:

import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mlhim.settings")from
django.core.wsgi import get_wsgi_application
application = get_wsgi_application()


----------------------------------------------------------------------------------------------

Thanks in advance for any ideas.

Cheers,
Tim


--
MLHIM VIP Signup: http://goo.gl/22B0U
============================================
Timothy Cook, MSc +55 21 94711995
MLHIM http://www.mlhim.org
Like Us on FB: https://www.facebook.com/mlhim2
Circle us on G+: http://goo.gl/44EV5
Google Scholar: http://goo.gl/MMZ1o
LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CA%2B%3DOU3XNi7-FGOCPnKS%2Bb6%3D-ueWbPMOWFXfOce663fn0YpjWwQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Начаров Михаил at Jan 17, 2014 at 3:52 am
    Hi Timothy,

    Note that your mod_wsgi module compiled for using python2.7. So what you
    need now is install(compile&install) mod_wsgi for python3 instead of the
    same module compiled for python2.7.
    On Debian you can do it by this command:
          $ sudo apt-get install libapache2-mod-wsgi-py3



    16.01.2014 16:34, Timothy W. Cook пишет:
    This question is also on Stackoverflow http://goo.gl/LinMue but I
    thought somene here may have an idea.


    I have a Django 1.5, Python 2.7 site running under Apache with
    mod_wsgi on a CentOS 6.4 server.

    I have rebuilt this site using Django 1.6 and Python 3.3. Deploying it
    to the same server and changing the paths in httpd.conf I get the
    subject error. This new install works as expected using ./manage.py
    runserver.

    Here are the two WSGI definitions from httpd.conf:
    WSGIScriptAlias/ /home/ccdgen/CCDGEN2/apache/wsgi.py
    WSGIPythonPath/home/ccdgen/CCDGEN2/ccdgen/ccdgen:/home/ccdgen/CCDGEN2/ccdgen:/home/ccdgen/CCDGEN2/lib/python3.3/site-packages
    <Directory/home/ccdgen/CCDGEN2/ccdgen>
    <Files wsgi.py>
    Order allow,deny
    Allowfrom all
    </Files>
    </Directory>

    #WSGIScriptAlias/ccdgen/home/ccdgen/CCDGEN/apache/wsgi.py
    #WSGIPythonPath/home/ccdgen/CCDGEN/mlhim/ccdgen:/home/ccdgen/CCDGEN/mlhim:/home/ccdgen/CCDGEN/lib/python2.7/site-packages
    #<Directory/home/ccdgen/CCDGEN/mlhim>
    # <Files wsgi.py>
    # Order allow,deny
    # Allowfrom all
    # </Files>
    #</Directory>|

    The wsgi.py file is the same on both installations:
    import os
    os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mlhim.settings")
    from django.core.wsgi import get_wsgi_application
    application= get_wsgi_application()|

    ----------------------------------------------------------------------------------------------

    Thanks in advance for any ideas.

    Cheers,
    Tim


    --
    MLHIM VIP Signup: http://goo.gl/22B0U
    ============================================
    Timothy Cook, MSc +55 21 94711995
    MLHIM http://www.mlhim.org
    Like Us on FB: https://www.facebook.com/mlhim2
    Circle us on G+: http://goo.gl/44EV5
    Google Scholar: http://goo.gl/MMZ1o
    LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook
    --
    You received this message because you are subscribed to the Google
    Groups "Django users" group.
    To unsubscribe from this group and stop receiving emails from it, send
    an email to django-users+unsubscribe@googlegroups.com.
    To post to this group, send email to django-users@googlegroups.com.
    Visit this group at http://groups.google.com/group/django-users.
    To view this discussion on the web visit
    https://groups.google.com/d/msgid/django-users/CA%2B%3DOU3XNi7-FGOCPnKS%2Bb6%3D-ueWbPMOWFXfOce663fn0YpjWwQ%40mail.gmail.com.
    For more options, visit https://groups.google.com/groups/opt_out.
    --
    You received this message because you are subscribed to the Google Groups "Django users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
    To post to this group, send email to django-users@googlegroups.com.
    Visit this group at http://groups.google.com/group/django-users.
    To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/52D8A90F.3040209%40gmail.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Timothy W. Cook at Jan 17, 2014 at 9:36 am

    On Fri, Jan 17, 2014 at 1:52 AM, Начаров Михаил wrote:

    Hi Timothy,

    Note that your mod_wsgi module compiled for using python2.7. So what you
    need now is install(compile&install) mod_wsgi for python3 instead of the
    same module compiled for python2.7.
    On Debian you can do it by this command:
    $ sudo apt-get install libapache2-mod-wsgi-py3


    Thanks, After some poking around, I did find that this was the problem.
      Now, recompiling it on CentOS (with Python 3 as an alternate install) was
    quite another trick. :-)

    Thanks.

    16.01.2014 16:34, Timothy W. Cook пишет:

    This question is also on Stackoverflow http://goo.gl/LinMue but I
    thought somene here may have an idea.


    I have a Django 1.5, Python 2.7 site running under Apache with mod_wsgi
    on a CentOS 6.4 server.

    I have rebuilt this site using Django 1.6 and Python 3.3. Deploying it to
    the same server and changing the paths in httpd.conf I get the subject
    error. This new install works as expected using ./manage.py runserver.

    Here are the two WSGI definitions from httpd.conf:

    WSGIScriptAlias / /home/ccdgen/CCDGEN2/apache/wsgi.py
    WSGIPythonPath /home/ccdgen/CCDGEN2/ccdgen/ccdgen:/home/ccdgen/CCDGEN2/ccdgen:/home/ccdgen/CCDGEN2/lib/python3.3/site-packages<Directory /home/ccdgen/CCDGEN2/ccdgen>
    <Files wsgi.py>
    Order allow,deny
    Allow from all
    </Files></Directory>
    #WSGIScriptAlias /ccdgen /home/ccdgen/CCDGEN/apache/wsgi.py#WSGIPythonPath /home/ccdgen/CCDGEN/mlhim/ccdgen:/home/ccdgen/CCDGEN/mlhim:/home/ccdgen/CCDGEN/lib/python2.7/site-pa
    ckages#<Directory /home/ccdgen/CCDGEN/mlhim># <Files wsgi.py># Order allow,deny# Allow from all# </Files>#</Directory>

    The wsgi.py file is the same on both installations:

    import os
    os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mlhim.settings")from django.core.wsgi import get_wsgi_application
    application = get_wsgi_application()



    ----------------------------------------------------------------------------------------------

    Thanks in advance for any ideas.

    Cheers,
    Tim


    --
    MLHIM VIP Signup: http://goo.gl/22B0U
    ============================================
    Timothy Cook, MSc +55 21 94711995
    MLHIM http://www.mlhim.org
    Like Us on FB: https://www.facebook.com/mlhim2
    Circle us on G+: http://goo.gl/44EV5
    Google Scholar: http://goo.gl/MMZ1o
    LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook
    --
    You received this message because you are subscribed to the Google Groups
    "Django users" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to django-users+unsubscribe@googlegroups.com.
    To post to this group, send email to django-users@googlegroups.com.
    Visit this group at http://groups.google.com/group/django-users.
    To view this discussion on the web visit
    https://groups.google.com/d/msgid/django-users/CA%2B%3DOU3XNi7-FGOCPnKS%2Bb6%3D-ueWbPMOWFXfOce663fn0YpjWwQ%40mail.gmail.com
    .
    For more options, visit https://groups.google.com/groups/opt_out.


    --
    You received this message because you are subscribed to the Google Groups
    "Django users" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to django-users+unsubscribe@googlegroups.com.
    To post to this group, send email to django-users@googlegroups.com.
    Visit this group at http://groups.google.com/group/django-users.
    To view this discussion on the web visit
    https://groups.google.com/d/msgid/django-users/52D8A90F.3040209%40gmail.com
    .
    For more options, visit https://groups.google.com/groups/opt_out.


    --
    MLHIM VIP Signup: http://goo.gl/22B0U
    ============================================
    Timothy Cook, MSc +55 21 94711995
    MLHIM http://www.mlhim.org
    Like Us on FB: https://www.facebook.com/mlhim2
    Circle us on G+: http://goo.gl/44EV5
    Google Scholar: http://goo.gl/MMZ1o
    LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook

    --
    You received this message because you are subscribed to the Google Groups "Django users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
    To post to this group, send email to django-users@googlegroups.com.
    Visit this group at http://groups.google.com/group/django-users.
    To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CA%2B%3DOU3UYB-V37doGX%2B8GSY%3DN_ZOSAkPKbUHhwLvm0kBbxYd4%2Bw%40mail.gmail.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Начаров Михаил at Jan 17, 2014 at 10:14 am
    You're welcome!

    You can also take a look to another python web-server.
    Especially if you want to have for example two sites with different
    version of python on the same server.
    When I wrote my first django-app on py3, I faced the same problem.


    17.01.2014 15:34, Timothy W. Cook пишет:


    On Fri, Jan 17, 2014 at 1:52 AM, Начаров Михаил
    wrote:

    Hi Timothy,

    Note that your mod_wsgi module compiled for using python2.7. So
    what you need now is install(compile&install) mod_wsgi for python3
    instead of the same module compiled for python2.7.
    On Debian you can do it by this command:
    $ sudo apt-get install libapache2-mod-wsgi-py3


    Thanks, After some poking around, I did find that this was the
    problem. Now, recompiling it on CentOS (with Python 3 as an alternate
    install) was quite another trick. :-)

    Thanks.
    --
    You received this message because you are subscribed to the Google Groups "Django users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
    To post to this group, send email to django-users@googlegroups.com.
    Visit this group at http://groups.google.com/group/django-users.
    To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/52D9027B.4060304%40gmail.com.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupdjango-users @
categoriesdjango, python
postedJan 16, '14 at 10:34a
activeJan 17, '14 at 10:14a
posts4
users2
websitedjangoproject.com

People

Translate

site design / logo © 2021 Grokbase