A simple playground for messing around with REST APIs and for testing drf-api-tracking
-
create venv:
python3 -m venv ~/venv/drf_sample
-
enable venv:
source ~/venv/drf_sample/bin/activate
-
install pip/pipenv:
python3 -m pip install --upgrade pip pipenv
-
pipenv install
-
create db:
python manage.py migrate
-
create admin account
python manage.py createsuperuser
-
drf_yasg / swagger ui has been included as part of this sample, so you can execute REST api calls via:
python manage.py runserver localhost:8000/swagger
-
check in admin view that the log has been added after call to your REST api:
http://localhost:8000/admin/rest_framework_tracking/
To install drf_api_tracking for development use:
pipenv install -e ../../drf-api-tracking
Note this is already configured in the Pipfile
If you then make changes to the models in the drf-api-tracking library, then make sure you run:
python manage.py makemigrations
and ensure that the migrations file(s) are checked into git and PR made.