Contains the MayanAppConfig subclass as required by Django 1.7 and up. This
is a place to define the app name and translatable verbose name as well as
code to be execute when the modules of the app are ready.

classes.py

Hold python classes to be used internally or externally. Any class defined by
the app that is not a model.

events.py

Define event class instances that are later committed to a log by custom
code.

exceptions.py

Custom exceptions defined by the app.

fields.py

Place any custom form field classed you define here.

forms.py

Standard Django app module that hold custom form classes.

handlers.py

Contains the signal handlers, functions that will process a given signal
emitted from this or other apps. Connect the handler functions to the
corresponding signal in the ready() method of the MayanAppConfig subclass in
apps.py

links.py

Defines the links to be used by the app. Import only from the navigation app
and the local permissions.py file.

literals.py

Stores magic numbers, module choices (if static), settings defaults, and
constants. Should contain all capital case variables. Must not import from
any other module.

managers.py

Standard Django app module that hold custom model managers. These act as
model class method to performs actions in a series of model instances or
utilitarian actions on external models instances.

models.py

Standard Django app module that defines ORM persistent data schema.

permissions.py

Defines the permissions to be used to validate user access by links and views.
Imports only from the permissions app. Link or view conditions such as
testing for is_staff or is_super_user flag are defined in this same module.

runtime.py

Use this module when you need the same instance of a class for the entire app.
This module acts as a shared memory space for the other modules of the app or
other apps.

serializers.py

Hold Django REST Framework serializers used by the api_views.py module.

settings.py

Define the configuration settings instances that the app will use.

signals.py

Any custom defined signal goes here.

statistics.py

Provides functions that will compute any sort of statistical information on
the app’s data.

tasks.py

Code to be execute in the background or as an out-of-process action.

tests/ directory

Hold test modules. There should be one test_*.py module for each aspect being
tested, examples: test_api.py, test_views.py, test_parsers.py, test_permissions.py
Any shared constant data used by the tests should be added to tests/literals.py

utils.py

Holds utilitarian code that doesn’t fit on any other app module or that is
used by several modules in the app. Anything used internally by the app that
is not a class or a literal (should be as little as possible)

widgets.py

HTML widgets go here. This should be the only place with presentation
directives in the app (aside the templates).