Skip to content

pabrrs/django-boilerplate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

3 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Django Boilerplate

Django RestAPI backend boilerplate ๐Ÿ

How to Run

make up

After that, access the API at http://localhost:8888.

NOTE: In the local configuration, SQLite is used as the database. See the configuration file at django_app/settings/dev.py.

How to Use the API

The djnago-app project can be used through a graphical interface (represented in HTML) and in JSON format, both generated by the Django Rest Framework.

To use it locally through the link http://localhost:8888/api. The default user used in development is the email django@admin.com with password admin@1234.

Graphical Interface

By accessing http://localhost:8888/api, you will be taken to a UI where you can query the project's entities and perform CRUD operations on the database without the need to interact directly with the API.

JSON

To access the JSON format of the API, just add the parameter ?format=json to the application URL. Example: http://localhost:8888/api?format=json.

Scripts

Build the API

pipenv run build

Start the Server

pipenv run server

Run All Checks

pipenv run check

Run Health Check

pipenv run health

Run Tests

pipenv run test

Run Specific Tests

pipenv run test django_app.apps.<app_name>.tests.<test_file>

Run Linter

pipenv run lint

Run Formatter

pipenv run format

To run only the format check:

pipenv run format-check

Create Migrations with Model Changes

pipenv run makem

How to Configure Pre-commit Hook

The project uses the pre-commit tool to run routine code checks every time a git commit is executed, thus avoiding common problems like formatting errors, style issues, and tests from being committed and pushed to the branch, which could then fail in the CI pipeline.

Install Pre-commit

To configure pre-commit in your local repository, run:

pre-commit install

Uninstall Pre-commit

pre-commit uninstall

About

Django RestAPI backend boilerplate ๐Ÿ

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published