Two years ago I had an idea for a site, and I embarked myself in what turned out to be a task of behemothic size. Twelve months later, I released to the public the initial incarnation of AstroBin, a website dedicated to the hosting of astrophotographs.
Alas, it was my first complex and feature rich website, and I learned several frameworks and libraries on the go, such as Django and jQuery. Here are some pieces of advice for somebody starting out on a similar path.
1. Do split your project into multiple apps
Django projects can be split in multiple apps, to reduce complexity and allow
the application of the One Responsibility principle. Neglect to do that and you
will end up with a 6,000 line long
views.py, and a shaggy mess of spaghetti code.
2. Do make your project easy to setup and deploy
A project that can be deployed quickly will make your life easier if you have to migrate to a new server, if you have to quickly create a sandboxed server for testing purposes, if you want to get people to collaborate with you.
To do that, try to stay away from things that live outside Django’s sphere of influence, like bash scripts, cron jobs, or other third party code that has nothing to do with your Django app.
I recommend that you start your app on Heroku, because if you get it working there, it’ll work everywhere.
3. Do write a comprehensive set of unit tests
4. Never, ever assume that your users will use your website the way you
They will break it, they will abuse it, they will find holes, they will do everything that can be done to fill your database with inconsistent data. Spend a considerable effort to keep things as tight as possible, so that no unexpected input can reach your code.
5. Do keep your third party dependencies at a minimum
Dependencies must be tracked and upgraded, and often things will break in the most mysterious of ways (see point #3 if you want to prevent that.) It’s really imperative that you keep your ecosystem as small as possible.