Middlewares
- Under
crm.middlewares - More info about Middlewares
Custom Command lines
- Under
crm.cli - More info about Commands
Custom Events
- Under
crm.events - More info about DB Events
Admin application
- Under
flask.apps.admin - More info about Admin app
Flask sub application
- Any package under
crm.apps - Main modules for any sub app (except the Admin app) are:
models.pyfor models definitions. Please follow These conventions when defining your own modelsviews.pyfor HTTP end points definitions. . Please follow These conventions when defining your own models- To add an HTTP end point, you put your code in a function inside
views.pyfile in some app decorated by@app.route@app.route('/api', methods=["POST"]) def api(): pass
- To add an HTTP end point, you put your code in a function inside
graphqlpackage for graphql To exposegraphqlmutations & queries for this sub app. Please follow These conventions- Put types in module
types.py - Put arguments in module
arguments.py - Put queries in module
queries.py - Put mutations in module
mutations.py
- Put types in module
Main app
- Flask Main entry point is
app.pyin the root directory - It imports actual Flask app ::
crm.appcrm.appis defined incrm/__init__.pyand it's the actual Flask appcrm/__init__.pycontains code to initialize the app and registering all http endpoints for sub applications incrm.appsby importig theirviews.pymodule if found
- It registers all custom commands by doing
from crm.cli import * - It registers all middlewares by doing
from crm.middlewares import * - It registers all db events by doing
from crm.events import *