Configuration is stored in elk/.env
, for examples see elk/.env.circle
, used during CI.
This project requires python3 (i don't test it on python2). For frontend building you need to install Node.JS. I run tests on OS X and Linux (Circle CI), so the project should work on both systems.
pip install -r requirements.txt
npm install -g gulp bower
npm install
bower install
./build/download_geoip_db.sh
cp elk/.env.circle elk/.env
./manage.py loaddata crm lessons products teachers
For always-actual bootstrap process please consider CI configuration.
Running a development host:
gulp&
./manage.py runserver
Production version is built via CircleCI — .
All frontend programming should be done in CoffeeScript. You can learn it in 3 hours, and it will save you nearly 30% of code by removing JS boilerplate. The price is a slightly bigger cognitive load, but the absence of the boilerplate worth it.
All CSS is written in Stylus. You event don't need to learn it — just omit everything boilerplate-like: {
, }
and ;
CoffeeScript has a built-in protector from polluting global namespace — it wraps every file like this:
(function(){
# your code here
})()
So you can't pollute global namespace even if you want it.
When you really need to publish something globally, you can use the Project
object. It's ok to store Models, Controllers and Helpers there, like this:
# model.coffee
class Model extends MicroEvent
constructor (@a, @b, @c) ->
# your wonerful code here
Project.Models.YourModel = Model
# later, in controller.coffee
class Controller
constructor (@a, @b, @c ) ->
@model = new Project.Models.YourModel @a, @b, @c
If you need a specific to an element peace of code, you should write a simple jquery plugin.
By default all vendor assets, located it build/js-vendor-filters.json
and build/css-vendor-files.json
are cross-site. If you need a heavy library, you can include it with templatetags css
and js
, like this:
{% block css %}
<link rel="stylesheet" href="{% static 'vendor/fullcalendar/dist/fullcalendar.min.css' %}">
{% endblock %}
{% block js %}
<script type="text/javascript" src="{% static 'vendor/fullcalendar/dist/fullcalendar.min.js' %}"></script>
{% endblock %}
Please use flake8 for checking your python code. Imports should be sorted by isort. For Stylus and CoffeeScript use stylint and coffeelint respectively (pre-configured in Gulp).
Configure your IDE with respect to .editorconfig
.
All comments and commit messages should be written in English.
Every model and model method should have a docstring.
All your code should be covered by tests.