Skip to content

Releases: vishalanandl177/DRF-API-Logger

API with or without Host

12 Nov 17:16
Compare
Choose a tag to compare

You can specify the endpoint of API should have an absolute URI or not by setting this variable in DRF settings.py file.

Set DRF_API_LOGGER_PATH_TYPE = 'ABSOLUTE' in settings.py
Possible values are ABSOLUTE, FULL_PATH, or RAW_URI.

Considering we are accessing the following URL: http://127.0.0.1:8000/api/v1/?page=123
DRF_API_LOGGER_PATH_TYPE possible values are:

  1. ABSOLUTE (Default) :
    Function used request.build_absolute_uri()
    Output: http://127.0.0.1:8000/api/v1/?page=123

  2. FULL_PATH
    Function used request.get_full_path()
    Output: /api/v1/?page=123

  3. RAW_URI
    Function used request.get_raw_uri()
    Output: http://127.0.0.1:8000/api/v1/?page=123

Note: Similar to ABSOLUTE but skip allowed hosts protection, so may return insecure URI.

Stable Version - 0.0.6

19 Oct 09:45
Compare
Choose a tag to compare
TextField db_index removed, bleach version fixed