Skip to content
Public template

About

template for a django-rest framework workflow

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Repository files navigation

Django Initialization

A quick way to up a django rest server. Has an admin ui to manage data from a browser (local) and an API to expose data. Superuser/staff user and seed creation is in scripts/seed_database.

Username: admin
Password: password123

See the admin on heroku here: https://django-rest-template.herokuapp.com/.

Packages:

  1. Singleton models for configuration using django-solo.
  2. Static file uploading with whitenoise.
  3. Performance monitoring with django-silk.
  4. JWT authentication using djangorestframework-simplejwt.
  5. Has pre-commit hooks to lint and fix files using Black and flake8.
  6. Setup for github actions to run tests.
  7. Model graph visualization with pygraphviz.
  8. CORS handling based on environment variables by django-cors-headers.
  9. Abstact user models set up in users/

Requirements:

  1. pre-commit
  2. docker & docker-compose

Installation:

Clone the repository and initialize

$ git clone https://github.com/vanities/django-init
$ cd django-init
$ make init

Running the web API:

The Makefile is a task manager to wrap docker commands, read it to know what the common tasks are.

Quickstart with Docker:

$ make up

Quit the server:

$ make down

Drop and Seed the database:

$ make fresh

Testing:

To run all of the tests once with Docker:

$ make test

To run a single test file:

$ docker-compose run --rm test ./manage.py test user.tests

Creating a new app, typically apps are plural ex: features:

$ docker-compose run --rm python ./manage.py startapp features

See the list of contributors who participated in this project.

Adding Python packages

  1. find the package on pypi
  2. find the version, for the example above, pyyaml is 6.0
  3. pyyaml==6.0 to requirements.txt
  4. run make build

About

template for a django-rest framework workflow

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages