Live data from Hacker News

Ask HN: What Python web programming frameworks and tools are you using?

news.ycombinator.com

41–46 of 46 posts

Re: Ask HN: What Python web programming frameworks and tools are you using?

#43
framework: NONE, NONE, NONE web server: CherryPy database: SQLite for dev/test, PostgreSQL for prod, investigating NoSQL data access: SQLAlchemy database schema: SQLAlchemy-migrate OS: Ubuntu, but perhaps eventually NixOS DVCS: Mercurial via BitBucket dependency mgmt: APT, setuptools, perhaps Nix JavaScript: MooTools

I am a web application security engineer (among other things), so I screened and was forced to reject all frameworks because they don't adequately address security (not even webpy), and because they are too heavy.

Instead, I am building a very lightweight, simple, but integrated web content generation layer directly in Python using built-in string formatting. I construct a page using a trivial DOM-like object model that renders to a string web response (HTML, CSS, JS). I push Model data into the DOM-like View under the direction of a page Controller (MVC pattern). However, my View contains the logic to properly encode output contextually to avoid common security vulnerabilities in the web response. Likewise, I have exhaustive input validation to deal with the data in the web request.

Re: Ask HN: What Python web programming frameworks and tools are you using?

#44
post #25
post #23

Earlier quoted context omitted.

You can compose queries like this: query = myModel.all().filter("property_1 =", value) query = query.filter("property_2 =", value) Here's a gotcha... be sure to have a space between "property_1" and "=", "property_1=" won't work (but it won't raise an error either). Be aware that the Datastore has very limited support for querying in general, and you will certainly not have anywhere near the kind of power you are use…

Thanks for the advice. My program wont be doing any heavy lifting, it's just a simple tool to guide the SQL-writing process and save the user typing everything out down to the last semi-colon; a visual aid really. All I need is a tiny bit of graphical whizzbang, so it's not a totally static form - the labels/menus change somewhat, more fields/labels are added, according to the user input.

try to stop thinking in terms of SQL, if you can - although they call it GQL it's only superficially similar. One particularly big gotcha is that you can only return keys or whole objects in your queries, and if you return an object it has to deserialize all the data associated with that object, so think twice before storing binary data against a frequently queried object - look to the BlobStore (this is NOT the same as a BlobProperty) or a separate object to hold larger chunks of data.

This is something to consider at the get go, you'd be surprised how quickly performance degrades (ie a hundred or more items, not thousands)

Re: Ask HN: What Python web programming frameworks and tools are you using?

#46
post #32

framework: Flask database: Postgresql server: UWSGI + Cherokee Flask is a very nice framework, and the documentation is awesome. I've tried a lot of Python frameworks out before deciding on Flask. It's a paralyzing decision - there is just so much out there. The process of choosing a web framework is filled with information overload - from reading about the framework, dabbling with the code, and finally learning the…

I like the idea of microframeworks. My first framework was rails; I struggled with it after being used to framework-less PHP. I was much happier when I found out about Sinatra! I'll have to check out Flask, though really Django doesn't get in your way too much for most tasks.
Post reply on HN