Giter Site home page Giter Site logo

django-celery's Introduction

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.

django-celery's People

Contributors

f213 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.