Live data from Hacker News

Python and Django on Heroku

blog.heroku.com

11–20 of 75 posts

Re: Python and Django on Heroku

#12
post #7
post #4

Great news! But why is the example for Flask?

Maybe because it takes less code to write a "hello world" with Flask than with Django.

Definitely this. A database is a requirement for a Django app, but not for Flask. I always seem to go back and forth about whether to start a micro-framework like Flask and use plugins and Python libs to assembly a framework that has only what I need, or use Django and (possible) include a lot of code that will never get run.

Re: Python and Django on Heroku

#13

Django has been able to run on Heroku for a while now. This topic keeps coming up over and over again and it is very old news. There are a lot of major flaws in running Django on Heroku right now too simply because of how their system works.

Could you elaborate on why?

Re: Python and Django on Heroku

#14

Django has been able to run on Heroku for a while now. This topic keeps coming up over and over again and it is very old news. There are a lot of major flaws in running Django on Heroku right now too simply because of how their system works.

Hi, care to list some of the flaws?

Re: Python and Django on Heroku

#15
post #7

Earlier quoted context omitted.

Maybe because it takes less code to write a "hello world" with Flask than with Django.

Definitely this. A database is a requirement for a Django app, but not for Flask. I always seem to go back and forth about whether to start a micro-framework like Flask and use plugins and Python libs to assembly a framework that has only what I need, or use Django and (possible) include a lot of code that will never get run.

It really depends on your vision for the app. If this is a single weekend project or a toy web site that you'll likely never touch again, or if you do will only be for minor updates, then I say go for Flask. It'll get in your way less and let you just launch it sooner.

For anything larger than that though, Flask has always turned into a giant headache for me. As soon as I ever start to try and organize the project better because it's become too large for a single file, all shit hits the fan. Supposedly this has gotten slightly better with 0.7's Blueprints, but I've yet to see it. Circular imports and Flask's global variables bite me in the ass on a regular basis. I also have come to really miss tons of features that Django offered, like URLconfs. The decorator technique works great when you can count the number of URLs that your app has on two hands. Beyond that, ack/grepping my project to find where anything lives isn't my idea of maintainable. With Django I can very cleanly trace through the whole request/response cycle in my head and by looking at the code paths.

Re: Python and Django on Heroku

#16
This is pretty much what I've been waiting for to finally migrate my project to Heroku. I know you've been able to unofficially run Python/Django on the stack for a while now, but a lack official support (even in beta form) was all that had been keeping me from taking the leap.

Re: Python and Django on Heroku

#18
post #5

Interesting... I wonder if this makes Google App Engine more appropriate for internal apps for Google Apps customers? For quick/easy personal hacking/development having a Python stack on Heroku seems pretty attractive now.

Personally I don't like Google App Engine, but I can understand its value -- it has reasonable free quotas (even now, after the pricing scheme changed), and your app ends up running on Google's infrastructure which is rock solid.

However, I never understood why people like Heroku ... it's like renting instances on EC2, only 10 times more expensive.

Of course, people then start enumerating a whole bunch of stuff that they don't have to worry about when using Heroku. However, when starting out, configuring a server is just like configuring your localhost development environment. You just have to start with something that works, then gradually keep learning.

Heroku doesn't provide anything to me other than an unreasonable free quota that's basically useless for serving anything other than static content (poorly) ... even GitHub does a better job with their static pages option, since GitHub's servers don't go sleeping when unused.

Re: Python and Django on Heroku

#19
This is great! Looking at the Django tutorial in the docs [1], I think it's too bad, though, that they don't provide a build-in, well tuned WSGI Server. This way, you have to choose your own WSGI server, configure and update it yourself.

[1] http://devcenter.heroku.com/articles/django#using_a_differen...

Re: Python and Django on Heroku

#20
I loved Heroku, many moons ago when I was working in Rails. As I've emigrated away from Rails to Django, I've found dotcloud to be the premiere platform -- I want to qualify this, it is the premiere polyglot platform, but for each individual environment I've deployed on dotcloud, their experience has been the best.

I haven't used dotcloud's Ruby/Rails stack, so I can't compare that, but Heroku is definitely fighting a hard battle if they're going to swing me from dotcloud, but it's always good to have competition, and if anybody is going to bring their A-game, it will be Heroku, who were sort of pioneers in the space.

The Heroku Python Free platform might be better in some instances than dotcloud's, and I'll definitely investigate that, but for anything I can think of using, dotcloud has been amazing for me.

Post reply on HN