Skip to content

Latest commit

 

History

History
58 lines (37 loc) · 1.95 KB

README.md

File metadata and controls

58 lines (37 loc) · 1.95 KB

djangorf-base


Python PRs Welcome GitHub license

Introduction

djangorf-base is a Django project built with the aim of avoiding boilerplate and being used as the base of other projects to build REST APIs using django-rest-framework.

drawing

Diagram drawn using diagrams.

Table of Contents

  1. Introduction
  2. Development
  3. Contributing
  4. License

Development

This projects is built using docker, docker-compose and make within the development environment.

make build && make up will up and run the django rest server.

API Requests

curl -H 'Accept: application/json; indent=4' -u user:passwd http://127.0.0.1:8000/users/

Prometheus

Some available metrics

  • django_http_requests_body_total_bytes_bucket

  • django_http_responses_body_total_bytes_bucket

  • django_http_requests_latency_seconds_by_view_method_bucket

  • django_http_requests_latency_including_middlewares_seconds_bucket

  • prometheus_http_requests_total

  • prometheus_http_request_duration_seconds_bucket

  • prometheus_http_response_size_bytes_bucket

PromQL queries examples

  • sum(rate(django_http_requests_latency_seconds_by_view_method_bucket[30s])) BY (job, method)
  • sum(rate(django_http_responses_body_total_bytes_bucket[30s])) by (job)

Contributing

License

This project is licensed under the Apache license.