Obviously, as idan mentioned already, there is no single "best" framework, so it really depends on the type of application you want to build whether you should choose something like bottle/flask, django/mezzanine/pinax or brubeck/tornado, or even twisted.
Ask HN: Best Python web framework
21–30 of 110 posts
Re: Ask HN: Best Python web framework
#22(Full disclosure: I'm a member of Django's core team) There's no single "best" for every application. One-size-fits-none. One of Django's strengths is in the fact that parts of the framework come off easily when they no longer serve your needs. If the ORM is no longer working for you, you can use SQLAlchemy or write raw SQL. Authentication no longer working for you? Write your own or use a 3rd party one. Et cetera. T…
Yes and no (disclaimer: I mostly use Django for my development), while parts come off easily the tools provided by the framework are "standard" and taking them off usually means not being able to take advantages of many Django features, e.g. if you replace django's ORM with SQLAlchemy, you'll have to say goodbye to the admin or to ModelForms, if you don't use Django's auth then extensions to it (django-registration &al) will have to be torn-out and/or reimplemented, ...
So while theoretically you can remove things, it's not a straightforward process and it'll likely be a lonesome road.
Re: Ask HN: Best Python web framework
#23(Full disclosure: I'm a member of Django's core team) There's no single "best" for every application. One-size-fits-none. One of Django's strengths is in the fact that parts of the framework come off easily when they no longer serve your needs. If the ORM is no longer working for you, you can use SQLAlchemy or write raw SQL. Authentication no longer working for you? Write your own or use a 3rd party one. Et cetera. T…
can you explain what i've been doing wrong, please?
Re: Ask HN: Best Python web framework
#24I really like bottle.py [1]. I've used it for a couple of different projects; although not fundamentally different from web.py or flask, it seems to just "make sense". [1] http://bottlepy.org/docs/stable/ An example from their website: from bottle import get, post, request @get('/login') # or @route('/login') def login_form(): return ''' ''' @post('/login') # or @route('/login', method='POST') def login_submit(): nam…
Re: Ask HN: Best Python web framework
#25Pylons is now called pyramid. I don't know how much it changed? I prefer pylons above Django. Simply because it feels less like a framework.
All of the controllers stuff was replaced with the code formerly known as repoze.bfg
Re: Ask HN: Best Python web framework
#26Tornado. Built-in async operations. Not standing in your way. Rapid developments. Huge community. Simply works. Simple, yet rich.
That said, you can't go too far wrong picking Python web frameworks. They each have their strengths and weaknesses, but on the whole they're all fairly competitive offerings with helpful communities. If you don't find something you like then it's pretty trivial to roll-your-own from existing components like Werkzeug, WTForms, SQLAlchemy, Jinja, beaker, Mako, etc.
Re: Ask HN: Best Python web framework
#27I really like bottle.py [1]. I've used it for a couple of different projects; although not fundamentally different from web.py or flask, it seems to just "make sense". [1] http://bottlepy.org/docs/stable/ An example from their website: from bottle import get, post, request @get('/login') # or @route('/login') def login_form(): return ''' ''' @post('/login') # or @route('/login', method='POST') def login_submit(): nam…
PHP guy here, don't know much about other languages, but seeing HTML mixed in with code is usually a bad code smell. Is this type of thing common in Python?
Re: Ask HN: Best Python web framework
#28(Full disclosure: I'm a member of Django's core team) There's no single "best" for every application. One-size-fits-none. One of Django's strengths is in the fact that parts of the framework come off easily when they no longer serve your needs. If the ORM is no longer working for you, you can use SQLAlchemy or write raw SQL. Authentication no longer working for you? Write your own or use a 3rd party one. Et cetera. T…
Are you building an API? If yes, use Flask.
Are you building a website? If yes, use Django.
Are you building an API and a website? If yes, use Flask for the API and consume it from a Django site.
I wouldn't advocate using Django but ditching the ORM for SQLAlchemy, nor replacing the Auth, as noted (above or below my comment) it gets messy and becomes a lonely road fast.
I would advocate moving a lot (all?) of the model into a REST API, implemented in Flask, using SQLAlchemy. But perhaps my experience isn't as wide or deep as others.
Re: Ask HN: Best Python web framework
#29Re: Ask HN: Best Python web framework
#30(Full disclosure: I'm a member of Django's core team) There's no single "best" for every application. One-size-fits-none. One of Django's strengths is in the fact that parts of the framework come off easily when they no longer serve your needs. If the ORM is no longer working for you, you can use SQLAlchemy or write raw SQL. Authentication no longer working for you? Write your own or use a 3rd party one. Et cetera. T…
I would simplify further: Are you building an API? If yes, use Flask. Are you building a website? If yes, use Django. Are you building an API and a website? If yes, use Flask for the API and consume it from a Django site. I wouldn't advocate using Django but ditching the ORM for SQLAlchemy, nor replacing the Auth, as noted (above or below my comment) it gets messy and becomes a lonely road fast. I would advocate movi…