- A basic library website & API built with Django 5.1.x & Django REST Framework (DRF) 3.13.x
- Application
- Browseable Web API
- SwaggerUI & ReDoc API documentation
- User registration with email verification & social(GitHub) login using django-allauth
- Bootstrap4 & crispy-forms decorations
- Customizable user profile pages with bio, profile pic, & country flags
- For additional links to package resources used in this repository, see the Package Index
- Dev/testing
- Basic module testing templates
- Coverage reports on web
- Debug-toolbar available. See notes in
config/settings.py
for enabling. - Examples of using Factories & pytest fixtures in account app testing
- shell_plus with IPython via django-extensions package
- Nox testing sessions for latest Python 3.10, 3.11, 3.12, 3.13
- coverage (
nox -s coverage
) - Sphinx documentaion generation (
nox -s lint
) - linting (
nox -s lint
) - safety(python package vulnerability testing) (
nox -s safety
) - pytest sessions with
pytest-cov &
pytest-django (
coverage run -m pytest
)
- coverage (
git clone https://github.com/kevinbowen777/django-api-library.git
cd django-api-library
- Local installation
poetry install
python manage.py migrate
python manage.py createsuperuser
python manage.py runserver
- Docker installation
docker compose up --build
docker compose exec web python manage.py migrate
docker compose exec web python manage.py createsuperuser
Additional commands:docker compose exec web python manage.py shell_plus
(loads Django shell autoloading project models & classes)docker run -it django-start-web bash
(CLI access to container)
- Browse to http://127.0.0.1:8000 or http://127.0.0.1:8000/resources/
- Pre-commit:
- To add the hook, run the following command in the poetry shell:
pre-commit install
- To add the hook, run the following command in the poetry shell:
docker compose exec web python manage.py test
coverage run -m pytest
- Nox (includes sessions for coverage, lint, typing, safety, tests)
- testing supported for Python 3.10, 3.11, 3.12, 3.13
- e.g.
nox
,nox -rs lint-3.13
,nox -s tests
nox
nox -s coverage-3.12
nox -s docs-3.13
nox -rs lint-3.10
(Use the 'r' flag to reuse existing session)nox -s pyright-3.11
nox -s safety
(will run tests against all Python versions)nox -s tests
- Log In endpoint: http://127.0.0.1:8000/api/v1/dj-rest-auth/login/
- Log Out endpoint: http://127.0.0.1:8000/api/v1/dj-rest-auth/logout/
- Password reset: http://127.0.0.1:8000/api/v1/dj-rest-auth/password/reset
- Password reset confirmation: http://127.0.0.1:8000/api/v1/dj-rest-auth/password/reset/confirm
- User registration endpoint: http://127.0.0.1:8000/api/v1/dj-rest-auth/registration/
- User list: http://127.0.0.1:8000/api/v1/users/
- User detail: http://127.0.0.1:8000/api/v1/users/1/
- API schema download: http://127.0.0.1:8000/api/schema/
- Redoc API browser: http://127.0.0.1:8000/api/schema/redoc/
- Swagger-UI: http://127.0.0.1:8000/api/schema/swagger-ui/
A live application demonstration:
TBD
Visit the Issues page to view currently open bug reports or open a new issue.