2

I have a python program that I would like to present as a simple web application. The program currently uses sqlite for storage. I also need to distribute the whole thing to colleagues so having something standalone and easy to start would be ideal ( no install if possible). This web app is meant to be used locally , not by multiple users over a network.

Is there a suitable python framework that might fit my needs? I looked at Django so far but it seems a bit heavy handed for what I need.

desertnaut
60.8k32 gold badges155 silver badges183 bronze badges
asked Jul 29, 2011 at 18:16

6 Answers 6

3

I have never tried it myself, but you could try Bottle:

Bottle is a fast, simple and lightweight WSGI micro web-framework for Python. It is distributed as a single file module and has no dependencies other than the Python Standard Library.

answered Jul 29, 2011 at 18:26
Sign up to request clarification or add additional context in comments.

3 Comments

This looks awesome. Shame it doesn't work natively with python 3 but I can work around that
@D.C. Obviously things have changed in the five years since you posted the comment, but for anyone else reading this the latest stable (v0.12) and dev (v0.13) versions of Bottle support Python 3.
Nice. I've waited 5 years to deploy this app, now it's finally time!
2
answered Jul 29, 2011 at 18:19

1 Comment

This would just serve up static HTML resources no? I need cgi like support where form input or Ajax could query the server for something dynamic / useful
1

As web frameworks are not part of the standard lib, you will have to install something in every case. I would propse to look at http://flask.pocoo.org/. It has a build in WSGI server.

answered Jul 29, 2011 at 18:20

2 Comments

I am hoping that instead of installing something I can just include the framework source files with the app
That's a completely different question. Packaging will be a bit boring and tedious, but you should be able to manage it. There are documentations about how to package Flask apps for Google App Engine. There you cannot install anything too, so it's a similar problem. Just ask Google for "Flask and App Engine".
1

Lots of choices for Python web frameworks! Another is web2py which is designed to work out of the box and allows, but doesn't require, through-the-web development. It is mature and has a strong community and is well-documented.

answered Jul 29, 2011 at 18:34

1 Comment

This is the only answer so far that addresses the "standalone" part of the question.
0

Tornado as a framework may be a lot more than what you're looking for. However it will meet the requirement of being a completely python based web server. http://tornadoweb.org

I generally just download the source, drop it in /tornado/ of my project and do includes there from the app.

answered Jul 29, 2011 at 18:22

Comments

0

I don't think that any web framework is specifically oriented for the use case you're talking about; They all assume they are running on a server and there's a browser on a remote machine that is accessing them.

A better approach is to think about the HTTP server you'll be using. It's probably preferable to use a server that's as easy to pack and ship as the rest of the python code you'll be using. Now most frameworks provide a 'development' server that's easy to invoke from the command line, but most of them are intended to be "easy for the developer" which often means they are restricted to a single thread. This is bad for deployment because single threaded servers will always feel a bit sluggish.

CherryPy stands out in contrast, by providing a full featured, embedded server that's easy to configure for many use cases, and is available by default with the rest of the framework. There are probably others, but I haven't used 'em.

answered Jul 29, 2011 at 18:23

1 Comment

Cool, I've heard of cherrypy before. I'll take a closer look

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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.