Django RestAPI backend boilerplate ๐
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
.
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
.
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.
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.
pipenv run build
pipenv run server
pipenv run check
pipenv run health
pipenv run test
pipenv run test django_app.apps.<app_name>.tests.<test_file>
pipenv run lint
pipenv run format
To run only the format check:
pipenv run format-check
pipenv run makem
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.
To configure pre-commit
in your local repository, run:
pre-commit install
pre-commit uninstall