2

I am a newbie to python . I am not bad with python programming , but never started using it with web. So I figured it out that python same as php can work on localhost via xampp .But as said It is displaying the python script contents. How can I exactly interpret code in apache(using xampp) an show it in browser. If there isn't any way please give me an alternative to use python on localhost.

Please do correct me if I am wrong anywhere because as I said I am new to python programming and cs world.

5
  • 1
    Unfortunately, python does not work the same way php does. So, simply putting it on a server will not work. You need to create the server server (using wsgi), and if you want o host it on an apache server then you need to configure mod_wsgi. It isn't as simple as putting a file into the root directory or your server. Commented Jul 30, 2015 at 17:58
  • Does modifying mod_wsgi resolve my issue?? Commented Jul 30, 2015 at 18:05
  • Where are you placing the python scripts? Should be in the cgi directory. Commented Jul 30, 2015 at 18:05
  • Yeah...But a server error came up Commented Jul 30, 2015 at 18:06
  • @GamesBrainiac Can you explain in detail about modifying mod_wsgi file. Commented Jul 31, 2015 at 2:47

1 Answer 1

3

The simpliest way for a noobie to run a webserver is probably to use flask: http://flask.pocoo.org/

Just try to get the example on the homepage running first. It has a built in webserver. Then when you're more familiar and you want to deploy it behind apache, you can follow this: http://flask.pocoo.org/docs/0.10/deploying/mod_wsgi/

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you...I really need it urgent so I thought it would be easy if it worked with xampp..

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.