

Ask HN: What's your preferred web application structure? - squigs25

I&#x27;ve created a lot of small web apps using python with flask without ever really thinking about it. I&#x27;m about to embark on a bigger project, and I&#x27;m getting a little overwhelmed with all the options, and the lack of guides.<p>Should I use Python or PHP? (I&#x27;m leaning towards Python)<p>Should I use Django, Pyramid, Flask, or something else as the framework? (I&#x27;m leaning towards Django)<p>Should I buy hosting, use Google App engine, or get a dedicated server?<p>How will I store data, how will users login (Open ID, or should I create a login service).<p>How will things scale if the app performs well?<p>Can anyone recommend a good book or resource on navigating all the options available for creating and launching a python web app?
======
workhere-io
_Should I use Python or PHP? (I 'm leaning towards Python)_

Use what you know best.

 _Should I use Django, Pyramid, Flask, or something else as the framework? (I
'm leaning towards Django)_

Use what you know best. I personally prefer Flask.

 _Should I buy hosting, use Google App engine, or get a dedicated server?_

Google App Engine is rather pricey and has a lot of lock-in. Have you
considered something like DigitalOcean or WebFaction?

 _How will I store data, how will users login (Open ID, or should I create a
login service)._

OpenID is pretty much dead if you ask me. Use Persona instead. Sample Persona
log-in code for Flask and PHP: [https://github.com/workhere-
io/personaexamples](https://github.com/workhere-io/personaexamples)

 _How will things scale if the app performs well?_

Upgrade your VPS. Flask + PostgreSQL can take quite a couple of hits.

~~~
chishaku
+1 Flask, especially if you already have experience with it.

Check out this Flask boilerplate:
[https://github.com/imwilsonxu/fbone](https://github.com/imwilsonxu/fbone)

It has Flask-login, sqlalchemy, wtforms, and other key extensions all
configured out of the box.

I don't have the most extensive experience but from what I understand, this
template app incorporates a lot of the best practices for large scale
applications.

------
jnazario
largely concur with workhere-io.

unless you have a sollid match for Django's use case (or something explicitly
supported with a plugin) i would warn you that hammering in "oddness" into
Django can be painful. for the features you are paying a price of some
restrictions.

also, study caching mechanisms.

as for logins, i would suggest marrying up with an existing authentication
infrastructure that looks similar to your userbases' typical login stack -
facebook, google, twitter, etc - and avoid doing it yourself.

