Hacker News new | ask | show | jobs
Ask HN: Moving from PHP to Django, setup & host advice?
1 points by thomaaas 4644 days ago
Hello HNers!

For years I've been building my side projects in plain PHP. However, I recently decided to learn Django after reading everywhere that it's better than PHP. It's been only a few days since I've started learning Django, and I'm already convinced that it's awesome: clean syntax, database-abstraction API, auto-generated admin, MVC, etc.

But there are also a few things that I really have trouble with: - Installation/setup/configuration. It took me way too long to install Python/Django, and then to understand how to deal with static files [1] - I can't find a host for my Django projects that is simple to use [2]

I mean, all of this is trivial to do in PHP. Since I'm not really comfortable with these "sysadmin tasks", I'm considering to switch back to PHP.

Any tips on how to make this less painful? Thanks!

[1] Actually, it still doesn't work properly... [2] For example, Heroku, that is supposed to be simple, has a long documentation for Django that is scary to me: https://devcenter.heroku.com/articles/getting-started-with-django

2 comments

Hi Thomaaas. I landed on a job position where I had to stopped using PHP and start to use Django. Not only that, but to use on Google App Engine, for what I had to use Django Non Rel fork.

My best advice is to get an aaccount on Digital Ocean (www.digitalocean.com) and reads the tutorials, they will guide you to install a Django App easily. I was just like you: I didn't like to set up envs and hostings, but it was easy after I did a few times.

+ 1 for Digital Ocean. I was composing my reply while you posted yours :).
1. Static files are a bit confusing because they need to be compiled, but this can be done when you build/deploy OR dynamically. Read the official docs carefully to grok what it all means.

2. Heroku really is pretty easy. Once you structure your code properly, you add a Procfile that looks something like this:

    web: gunicorn YOUR-PROJECT-NAME.wsgi
And it will magically do the rest.

Also, depending on your schedule, learn to do the sysadmin things, and get yourself a VPS with Digital Ocean for $5/month.

There's a walkthrough of some of those sysadmin-y things here:

  http://ponytech.net/blog/2013/09/10/django-deployement-ubuntu-upstart-nginx-gunicorn-and-virtualenvwrapper/