Simple boilerplate for Django 2.1 & Django rest framework
Simple boilerplate for django & django rest framework.
Method | Endpoint | Functionanlity |
---|---|---|
POST | /api-token-auth |
Request jwt token |
Method | Endpoint | Functionality |
---|---|---|
GET | /api/user |
List users |
POST | /api/user/create |
Creates a user |
GET | /api/user/profile/{pk} |
Retrieve a user |
PUT | /api/user/update/{pk} |
Edit a user |
DELETE | /api/user/destroy/{pk} |
Delete a user |
If you wish to run your own build, you two options
User Docker compose.
$ git clone https://github.com/p8ul/django-rest-framework-boilerplate
$ cd django-rest-framework-boilerplate
$ docker-compose up
Without docker
First ensure you have python globally installed in your computer. If not, you can get python here.
After doing this, confirm that you have installed virtualenv globally as well. If not, run this:
$ pip install virtualenv
Then, Git clone this repo to your PC
$ git clone https://github.com/p8ul/django-rest-framework-boilerplate
$ cd django-rest-framework-boilerplate
Create a virtual environment
$ virtualenv .venv && source .venv/bin/activate
Install dependancies
$ pip install -r requirements.txt
Make migrations & migrate
$ python manage.py makemigrations && python manage.py migrate
Create Super user
$ python manage.py createsuperuser
$ python manage.py runserver
$ python manage.py test