willkara
willkara

Reputation: 177

How to develop a simple web application with server-side Python

I am wondering how to go about implementing a web application with Python.

For example, the html pages would link to python code that would give it increased functionality and allow it to write to a database.

Kind of like how Reddit does it.

Upvotes: 0

Views: 7734

Answers (5)

Daniel Tan
Daniel Tan

Reputation: 29

If you're looking for server side programming with databases and html templates etc, I think Django is great, along with Pyramid. However, I use Flask ( http://flask.pocoo.org/ ) for this since it is easy to use, learn and deploy even though it may not have as much support as the before mentioned 2 framework since it's just a microframework, using the Jinja2 templating engine, including a development test server with it's own debugger.

On the other hand, if you're going for client-side programming (i.e. in browser implementation ) You can look up .NET Ironpython or even Brython which uses python like javascript.

Upvotes: 1

octopusgrabbus
octopusgrabbus

Reputation: 10685

We have never used Python for a web site without a framework. In our case that is Django. In other words, we do not use Python for our web sites the way Perl can be used, just having Apache run a Perl script.

The recommendations you have received about Django are sound. If you go the Django route, Graham Dumpleton and the modwsgi Google group were very helpful to me. I could not have gotten mod_wsgi deployed on Red Hat Enterprise 5 64-bit without Graham's help.

Whether you choose Django or "straight" Python, you will need to become familiar with mod_wsgi.

Good luck in quantum time, which means by now, I hope this all worked out for you.

Upvotes: 0

xhaw
xhaw

Reputation: 1

Plain CGI is a good starting point to learn about server side scripting, but it is an outdated technology and gets difficult to maintain after certain level of complexity. I would think it is no longer used in industrial-grade web server anymore. Plus you have to setup a web server and then install some module to interpret python script (like Apache with mod_python) just to get started.

I had some experience with Django (https://www.djangoproject.com/) and found it fairly easy to get started with since they come with development test server. All you need to have is a Python interpreter + Django and you can get up-and-running quickly and worry about the deployment setup later. They have pretty good documentation for beginner as well.

Upvotes: 0

user1031446
user1031446

Reputation:

This is a good article from the Python website: http://docs.python.org/howto/webservers.html

Upvotes: 0

chown
chown

Reputation: 52728

You might want to check out mod_wsgi or mod_python.

What Is mod_wsgi?

The aim of mod_wsgi is to implement a simple to use Apache module which can host any Python application which supports the Python WSGI interface. The module would be suitable for use in hosting high performance production web sites, as well as your average self managed personal sites running on web hosting services.

-

Current State of Mod_Python

Currently mod_python is not under active development. This does not mean that it is "dead" as some people have claimed. It smiply means that the code and the project are mature enough when very little is required to maintain it.

Upvotes: 0

Related Questions