Today we’re going to share with you how to create a separated Django application with the following requirements:
- must be a separated Django application for easier packaging and distribution.
- must be tested like it was tested within a Django project for the same development experience whether the application is within a Django application or a separated one.
- must have test coverage report to check the quality of project.
- must have coding convention checking for consistent style and best practices.
- must be built by travis-ci (or other ci system).
And we managed to meets these requirements with [django-html5-boilerplate][] project.
Well, [django-html5-boilerplate][] is just a simple Django application wrapper for
HTML5 Boilerplate
1 so that you could extend and reuse it on your Django project with much ease,
fun and:
- yes, it’s a separated Django application, could be easily installed with
pip
2 orsetuptools
3. - yes, it was setup to be tested with the help from
django-discover-runner
4. - yes, it was setup to have test coverage report with the help from
coverage
5. - yes, it was setup to have coding convention checking (
PEP 8
6 and more) with the help fromflake8
7. - yes, it was setup to be automatically built with the help from
travis-ci
8. The build page is here at: https://travis-ci.org/teracy-official/django-html5-boilerplate
One feature that we really love from the ci system is that whenever a pull request is made, we
could see the build status immediately within that pull request thanks to the integration of
travis-ci
and github
. You could see a failed pull request here as an example:
https://github.com/teracy-official/django-html5-boilerplate/pull/3
At Teracy, we’re going to promote best development practices that we use every day, one of these is
Test Driven Development
9 practice: “Test first, implement later, then refactor”. The pull
request just contain tests without any implementation, that’s why its build status was failed:
https://github.com/teracy-official/django-html5-boilerplate/pull/3
All the setup work was done on the project repository, please take a look and we believe that you
could setup yourself a similar Django
application easily from this sample project.
If there is anything missing that you could not setup yourself a project like this or you have a better approach, please let us know by commenting or forking the project, creating issues, making pull requests.
Have a nice day and happy hacking!
-
http://html5boilerplate.com/↩
-
https://pypi.python.org/pypi/pip↩
-
https://pypi.python.org/pypi/setuptools↩
-
https://github.com/jezdez/django-discover-runner↩
-
https://pypi.python.org/pypi/coverage↩
-
http://www.python.org/dev/peps/pep-0008/↩
-
https://pypi.python.org/pypi/flake8↩
-
https://travis-ci.org/↩
-
http://www.agiledata.org/essays/tdd.html↩