Hacker News new | comments | show | ask | jobs | submit login
Deploying Django on Heroku (blog.abhiomkar.in)
76 points by abhiomkar on Sept 17, 2011 | hide | past | web | favorite | 18 comments

This is running via runserver, right? Don't use this for production.

There are some nice pure-Python web servers though. To someone who knows more about Heroku's stack, if I replace “manage.py runserver” with, say, CherryPy, would there be any Heroku-specific performance issues to consider?

(I would use gunicorn)

Good plan. From the Django documentation:


(https://docs.djangoproject.com/en/1.3/ref/django-admin/#runs... )

We made a nice recipe for production-ready Djanogo setup on Heroku http://www.askthepony.com/blog/2011/07/getting-django-on-her...

gunicorn server will work, this makes it production ready.

Please replace runserver line with the below line in your Procfile

    web: bin/gunicorn_django --workers=4 --bind=$PORT django_project/settings.py

I have done this with Twisted and have yet to see any problems.

In your requirements.txt, add "Twisted". In your procfile, try something like:

    web: bin/python ./twistd -n web --port=$PORT --wsgi fully.qualified.app.name

Just a quick heads up, I made a Flask template with Gevent to get up and running on Heroku: https://github.com/zachwill/flask_heroku

Or you could go for https://gondor.io/, a much more featureful solution by the makers of Pinax.

I've been using this for my staging environment. Works well! Has support for the essential django tools (PIL, South, collectstatic), etc.

That's really cool, thanks for posting. What's it using to serve the pages though, it looks like the django test server? Btw, not a ror dev (at all) but what does that typically use as a web server and how is heroku doing it? (not apache?)

Question: is this a hack to get some Python on Heroku or is it a valuable potential Django server? When I did Rails work, I loved Heroku. Now that I do Django work, I love ... well ... my own server. I'm sure I should check out the various like-Heroku-but-Django services out there, but I'm used to Heroku. Valuable? Or move along nothing to see here?

Note: I see maaku's note about runserver, but I can hope can't I?

Note 2: as this comment lingers, can anyone recommend a living, non-invite-only Django hosting service?

I've used a couple of the django-heroku clones, Djangy, Gondor and Ep.io. Djangy is no more. Gondor is nice but lacking critical features (background jobs, caching... etc.), and generally seems like a sideshow to their consulting business. ep.io is ahead in features and quality so far. I have not tried DjangoZoom, as I was a little bit annoyed that they required me to pay for beeing in their beta test program.

Gondor has caching (has for a while) and background jobs will be available this week. Gondor is not a sideshow to the consulting; if anything, it's the other way around :-)

Nice to hear. I didn't see anything about caching / Redis in the docs. I definitely had a good experience with Gondor.io.

Gondor (https://gondor.io) now has open sign up.

python apps are not officially supported by Heroku, Looks like python app support is added for Facebook Apps to run on Heroku? (http://www.heroku.com/facebook)

However, heroku.com says "Run Anything" :)

It's not a hack. Heroku's Cedar stack supports Python applications, first-class.

Python and/or Django aren't listed anywhere here: http://devcenter.heroku.com/articles/cedar

Suggests that Python/Django aren't so much first-class as incidental...

Applications are open for YC Summer 2018

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact