How to configure Python on a web server?

Not really about programming, but I need help with this.

I am starting development using WampServer. I want to install Python (because I prefer using Python over PHP), but there seems to be no obvious choice. I read about mod_python and WSGI and how the latter is better.

However, from what I compiled (maybe I'm wrong), you should do lower-level things with WSGI than with PHP. So I explored Django, but it seems too complicated for what I want.

So, what recommendations would you give to a newbie in this area?

Again, I'm sorry if this is not about programming, but how it is connected, and it seems like a nice place to ask.

+4
source share
5 answers

Werkzeug is a great tool for python (werkzeug) that works with mod_wsgi to create simple applications that don't need databases with CMS, like calculators. They even have a great screencast where they create a simple wiki in 30 minutes.

You can always add something like SQLAlchemy / FormAlchemy later if you want to have ORM and CMS in the end.

Avoid mod_python tho, it got a pretty large amount of memory, and in my opinion, in fact it is harder to install and configure than mod_wsgi.

+2
source

Django is not a web server, but a web application environment.

If you want a blue-bonded Python web server with some dynamic and some static content, take a look at CherryPy .

+5
source

Use mod_wsgi to implement Python in Apache. It works very, very well.

"However, from what I put together (maybe I'm wrong), you should do lower-level things with WSGI than with PHP. So I explored Django, but it seems too complicated for what I want."

  • If you try to write the entire application as a WSGI-compatible application directly accessible through mod_wsgi, you will invent the wheel.

  • If you try to write your application in Django, you will have time to work and work for several hours. Django is not "too complicated" - it is complete. You do not have to use all of this, but for any realistic application you will need most. In particular, the built-in administrator will save you mountains of programming.

+3
source

To use python with your Apache server, you need to install mod_python, the following links should help you a bit.

0
source

If this is really a development server that you are setting up, and not a machine that will move towards production at some point, Django has a development server in the web server that does not require Apache configuration.

Your observation of low-level performance reflects some of the differences between PHP and Python. PHP is a language developed from the very beginning for the main purpose of creating web pages. Python is a language. Mod_Python and Mod_WSGI provide I / O in this language of a way to live in a web request / response environment. Django adds usability to the web interface.

You mentioned that python seems too complicated for what you want, which rather asks the question: what do you need ?:-)

0
source

All Articles