Simple django rest application for demostration and learning purposes built with django rest framework
virtualenv
pip
django
This project use internal SQLite database, so there is no need for database setup. If you want to change database you can do it in settings.py file.
git clone https://github.com/matoxxx/djangoREST.git
Navigate to:
cd djangoREST
virtualenv env
on Windows:
cd env/Scripts
activate
on Unix:
source env/bin/activate
pip install -r requirements.txt
python manage.py migrate
python manage.py createsuperuser
python manage.py runsever <ip:port> # example: python manage.py runserver 127.0.0.1:8000
Django REST framework offers their own REST api via browser: http://127.0.0.1:8000/snippets/
http http://127.0.0.1:8000/snippets/
http http://127.0.0.1:8000/users/ Accept:text/html
http http://127.0.0.1:8000/users/ Accept:application/xml
http http://127.0.0.1:8000/snippets.json
http http://127.0.0.1:8000/users.api
http <GET | POST | PUT | DELETE | OPTIONS | HEAD> http://127.0.0.1:8000/snippets/
http --form POST http://127.0.0.1:8000/snippets/ code="print 123"
http --json POST http://127.0.0.1:8000/snippets/ code="print 456"
http -a matej:password POST http://127.0.0.1:8000/snippets/ code="print 789"
Matej Hocevar @matoxxx