Awesome API is an example REST API using Django REST framework. Try our live interactive docs or
It is tested with the following versions. Add the missing packages to the requirements.txt of your Django project
- Python
- pip
- Django ver. 1.9.7
- django-filter ver. 0.13.0
- djangorestframework ver. 3.4.6
- Markdown ver. 2.6.6
- gunicorn ver. 19.6.0
- whitenoise ver. 3.2.1
- drfdocs ver. 0.0.11
- Clone this repo
git clone https://github.com/aliminaei/awesome-api.git
pip install -r requirements.txt
python manage.py collectstatic --noinput
python manage.py test
python manage.py runserver 0.0.0.0:8080
- Go to api docs
-
Parameters
- username: (required, unique, string, min length=3, max length=254) - The username of the API user in form of a string.
- email: (required, string, max length=254) - The email address of the API user in form of a string.
- password (required, string, min length=3, max length=254) - The password of the API user in form of a string.
- first_name (optional, string, max length=254) - The first name of the API user in form of a string.
- last_name (optional, string, max length=254) - The last name of the API user in form of a string.
-
Request (application/json)
- Body
{ "username": "username", "password": "password", "email": "[email protected]" "first_name": "fname", "last_name": "lname", }
-
Response 201
- Body
{ "username": "username", "email": "[email protected]" "first_name": "fname", "last_name": "lname", }
-
Response 200
- Body
[ { "username": "username", "email": "[email protected]" "first_name": "fname", "last_name": "lname", }, { "username": "username2", "email": "[email protected]" "first_name": "fname2", "last_name": "lname2", }, { "username": "username3", "email": "[email protected]" "first_name": "fname3", "last_name": "lname3", } ]
-
Path Parameters
- username: (required, unique, string, min length=3, max length=254) - The username of the API user in form of a string.
-
Response 200
- Body
{ "username": "username", "email": "[email protected]" "first_name": "fname", "last_name": "lname", }
-
Path Parameters
- username: (required, unique, string, min length=3, max length=254) - The username of the API user in form of a string.
-
Header Parameters
- api-secret: (required, unique, string, max length=254) - Your api secret.
-
Request
- Example
curl -X DELETE 'http://127.0.0.1:8000/api/users/{username}/' -H "HTTP_API_SECRET: {api-secret}"
-
Response 204