3

I am new to Django framework and Python. I installed Python Wamp server and downloaded mod_wsgi. I follow these steps.
I am in confused whether I configured it correctly since when I stop the wamp server then also the http://127.0.0.1:8000/ works correctly.

TheHippo
  • 54,987
  • 13
  • 72
  • 98
Jisson
  • 2,915
  • 7
  • 34
  • 67

2 Answers2

2

Have you considering reading any of the official mod_wsgi documentation at:

http://www.modwsgi.org

including its quick configuration guide.

http://code.google.com/p/modwsgi/wiki/QuickConfigurationGuide

We would then need to now what configuration you set in Apache for mapping your application and a better explaination of the problem you are seeing including any error messages in browser or Apache error logs.

Graham Dumpleton
  • 54,716
  • 6
  • 106
  • 126
  • I follow the steps but it not configured correclty. – Jisson Aug 26 '11 at 09:45
  • 1
    It is impossible to help you as you aren't explaining what the problem is. Does Apache not start? Or are you getting an error in the browser? Or are there errors in the Apache error log? Have you even looked in the Apache error log? – Graham Dumpleton Aug 26 '11 at 10:50
  • when I try using http://localhost:80 I go the result as 'Unable to connect' in browser( my wamp server is active).My development server runing at http:127.0.0.1:8000 it woks fine – Jisson Aug 26 '11 at 11:31
  • Have you found the Apache error log as yet and seen if there are any messages in there about Apache failing to startup? Does it also fail with 127.0.0.1:80? Sometimes localhost can give issues on Windows if IPV6 isn't quite set up right. – Graham Dumpleton Aug 26 '11 at 22:00
  • Finally I retify the problem-My system is 64 bit and am using python2.7,mod_wsgi for 64 bit windows not available,Thank you for u r response – Jisson Aug 27 '11 at 07:33
  • I figured that that was one of the possibilities, but your description wasn't clear enough and the lack of error messages from the Apache error log meant it would have been a guess to suggest it was caused by mixing of 32 and 64 bit binaries. The other common cause of Apache not starting up with mod_wsgi is not having installed Python for all users. – Graham Dumpleton Aug 27 '11 at 08:08
  • Thanks @Graham Dumpleton, I think its better to use linux server for django project,isn't it – Jisson Aug 27 '11 at 10:21
  • Yes, Linux would be a better choice. – Graham Dumpleton Aug 27 '11 at 11:14
  • @GrahamDumpleton I am facing problem in enabling wamp in wsgi mode.http://stackoverflow.com/questions/37971529/not-able-to-load-module-mod-wsgin-in-wamp – niran Jun 22 '16 at 15:49
0

http://www.lfd.uci.edu/~gohlke/pythonlibs/#mod_wsgi is the answer it has a windows vc10 binary.

If you can be bothered getting the latest wampserver (or at lest one compiled with vc10):

Add you your env ;C:\Python27;C:\Python27\Scripts

wget http://peak.telecommunity.com/dist/ez_setup.py (or just down loaded it to you user folder)

python ez_setup.py

easy_install pip

pip install django

http://www.lfd.uci.edu/~gohlke/pythonlibs/#mod_wsgi (put the appropriate with your apache moduales (currently has Apache 22 and 24)

In your http.config:

LoadModule wsgi_module modules/mod_wsgi.so

To test start a project:

django-admin.py startproject mysite
python manage.py runserver 83  # (or some other test port that's not 80)

All that I did I got from this youtube

Edit: So when you want to stop testing on port 83 and use Apache on port 80 you need to set WSGIPythonPath as mentioned here (I didn't bother with that page to much) and WSGIScriptAlias. The main guide to do that is here although @Jisson's wamp guide has that too and shows windows paths etc which I at first found useful too :)

sabgenton
  • 1,563
  • 9
  • 19
  • `python runserver project.py` to restart your django server when you make changes. – sabgenton Jun 02 '13 at 12:41
  • If the pip install bit doesn't work look here for newer ways: http://stackoverflow.com/questions/4750806/how-to-install-pip-on-windows – sabgenton Aug 11 '14 at 02:02