Skip to content
This repository has been archived by the owner on Jul 22, 2020. It is now read-only.

die-trying/django-celery

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ELK Dashboard

CircleCI codecov

Configuration

Configuration is stored in elk/.env, for examples see elk/.env.circle, used during CI.

Installing on a local machine

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 — CircleCI.

Frontend

CoffeeScript

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.

Stylus

All CSS is written in Stylus. You event don't need to learn it — just omit everything boilerplate-like: {, } and ;

Global namespace

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.

Local assets

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 %}

Coding style

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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published