Skip to content
relekang edited this page Sep 24, 2014 · 7 revisions

Folder structure

lego/
  lego/
    app/
      events/
        api.py
        models.py
        test_api.py
        test_models.py
        urls.py
      ...
    users/
    utils/
    settings/
    templates/
    urls.py
    wsgi.py
  requirements/
    base.txt
    prod.txt
    ...
  .frigg.yml
  Makefile
  tox.ini

Imports

Divide imports into three sections: System libraries, third-party packages and stuff from lego:

Example

import os
import json

from django.conf import settings

from lego.utils import ice_cream

Use local imports within apps

# lego/events/views.py
from .models import Event

Do NOT use from models import Event.

Models

All models should inherit BasisModel

Clone this wiki locally