Skip to content

3. Django Web App Architecture

christine edited this page Sep 19, 2017 · 1 revision

The fec.gov website mainly uses code from the fec-cms repo, except for regulations, which uses the fec-eregs app.

  • fec-cms - Django project that contains apps for managing the home page and CMS (managed by Wagtail), Data (http://www.fec.gov/data/), and Legal pages.
  • fec-eregs - The eRegulations viewer, on /regulations.

High Level Diagram

< Currently being updated >

FEC Django Architecture

  • FEC app (main project folder) fec-cms/fec/fec/*
    • settings/ - base.py holds the environment variables and project specific settings.
    • templates/ - base level templates for home page and Wagtail CMS pages. partials/ holds shared navigation, header, footer, site orientation, etc templates that are shared across all apps.
    • static/ - where all the front-end assets reside.
  • Wagtail CMS app (includes home page) fec-cms/fec/home/*
    • migrations/ - this is where all the database migrations for Wagtail are.
    • templates/ - where all the templates for CMS pages (including the home page) are.
    • templatetags/ - custom template filters and partial view blocks.
    • models.py - database models for Wagtail
    • views.py - views for Wagtail pages
  • Data app (http://www.fec.gov/data) fec-cms/fec/data/*
    • templates/ - Jinja templates for all data pages.
    • templatetags/ - custom filters for Jinja templates (django_jinja specific)
    • api_caller.py - functions for calling and returning data from the API to be passed and manipulated by views.py
    • constants.py - several OrderedDicts of common variable constants
    • urls.py - main routing for data pages
    • utils.py - utility functions for api_caller.py and views.py
    • views.py - views for data pages
    • views_datatables.py - view for datatable pages
  • Legal app fec-cms/fec/legal/*
    • templates/ - Jinja templates for legal pages
    • urls.py - main routing for legal pages
    • views.py - views for legal pages