A Django-powered API

Demo

https://django-api.shemarlindie.com/

User -- demo : Gir@ff3s

See screenshots here.

Overview

Project Structure

  • django_api/api - API apps
  • django_api/modules - Regular apps
  • django_api/utils - Utils app

Requirements

Setup

  1. Install dependencies
pipenv install
  1. Open Pipenv shell
pipenv shell
  1. Make DB migrations
python manage.py makemigrations
python manage.py makemigrations polls issue
  1. Run migrations
python manage.py migrate
  1. Create superuser
python manage.py createsuperuser

Follow the prompts to create an admin user.

  1. Load fixture data (optional)
python manage.py loaddata issue/all

This will load dummy data for the issue module. It includes:

  • Users
  • Issue metadata records (tags, types, statuses, etc)
  • Projects
  • Issues

Run

python manage.py runserver

Try:

API Authentication

{
    "expiry": "2021-09-07T20:51:49.354313-04:00",
    "token": "<auth token>",
    "user": {
        "id": 1,
        "username": "user",
        "email": "[email protected]",
        "first_name": "Example",
        "last_name": "User",
        "last_login": "2021-09-06T20:51:49.356207-04:00",
        "is_active": true,
        "date_joined": "2021-09-06T18:07:32-04:00",
        "is_staff": true,
        "is_superuser": true
    }
}

Use <auth token> with the Authorization header on subsequent request like this:

Authorization: Token <auth token>

Frontend

See Issue Tracker implementation for a frontend to the issue API.

GitHub - shemarlindie/django-api: A Django-powered API with various utility apps / endpoints.
A Django-powered API with various utility apps / endpoints. - GitHub - shemarlindie/django-api: A Django-powered API with various utility apps / endpoints.