Laws.Africa Developer Guide
  • Laws.Africa Developer Guide
  • Get Started
    • Introduction
    • Quick start
    • Works and expressions
    • Webhooks
    • Changelog
  • Tutorial
    • About the tutorial
    • Module 1: Build a legislation reader
      • Introductory concepts
      • Create a basic Django app
      • Create database models
      • Fetching the data
      • Work listing page
      • Expression detail page
      • Styling with Law Widgets
      • Adding interactivity
      • Staying up to date
    • Module 2: Enrichments and interactivity
      • Basic enrichments
      • Advanced enrichments
      • Advanced interactivity
    • Module 3: Text extraction for search and analysis
      • Why extracting text is important
      • Basics of text extraction
      • Advanced text extraction
      • Extracting text for analysis and machine learning
  • Content API Reference
    • About the Content API
    • Authentication
    • Pagination
    • Places
    • All work expressions
    • Single work expression
      • Commencements
      • Embedded images
      • Publication document
      • Table of Contents
      • Timeline
    • Taxonomy topics
    • Enrichment datasets
  • AI API Reference
    • About the AI API
    • Authentication
    • Knowledge Bases
  • How-to Guides
    • How to use the Table of Contents API
    • How to download images
Powered by GitBook
On this page
  1. Tutorial

Module 1: Build a legislation reader

Building a basic Django app to display legislation fetched from the Laws.Africa Content API.

PreviousAbout the tutorialNextIntroductory concepts

Last updated 1 year ago

In this module we'll cover the following:

  • Setting up the basic Django app

  • Database models

  • Working with the Laws.Africa Content API

  • Listing works

  • Displaying the content of a document

  • Basic interactivity

We'll be following the for setting up an app, but we'll build a legislation reader.

At the end of the module, you should have a working legislation reader app with a legislation listing page and detail pages for each piece of legislation.

We will use:

  • Django – for storing and displaying the data

  • Python – for extracting data from the API

  • Law widgets – a library for styling and working with interactive elements on the page

The complete working code is available in GitHub at .

Django tutorial
https://github.com/laws-africa/legislation-reader