Skip to content

Django REST application with Django REST Framework

Notifications You must be signed in to change notification settings

nathansf/rest_users

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

# Create virtualenv
virtualenv env
source env/bin/activate

# Install reqs
pip install -r requirements.txt

# Sync DB first time
python manage.py syncdb

# Start server
python manage.py runserver

# You'll be asked if you want to set up a superuser, type 'no'

# Create user
curl -X POST http://127.0.0.1:8000/users/ -d '{"username": "tester1", "first_name":"tester", "last_name":"last", "email": "tester1@tester.com"}' -H "Content-Type: application/json"

# Get users
curl -H 'Accept: application/json; indent=4' http://127.0.0.1:8000/users/

# Get specific user
curl -H 'Accept: application/json; indent=4' http://127.0.0.1:8000/users/1/

# Update user
curl -X PUT http://127.0.0.1:8000/users/5/ -d '{"username": "testerupdate", "first_name":"tester", "last_name":"last", "email": "tester1update@tester.com"}' -H "Content-Type: application/json"

# Delete user
curl -X DELETE http://127.0.0.1:8000/users/4/ -H "Content-Type: application/json"

# Add group
curl -X POST http://127.0.0.1:8000/groups/ -d '{"name": "awesome users"}' -H "Content-Type: application/json"
curl -X POST http://127.0.0.1:8000/groups/ -d '{"name": "super users"}' -H "Content-Type: application/json"

# Delete group
curl -X DELETE http://127.0.0.1:8000/groups/2/ -H "Content-Type: application/json"

# Get groups
curl -H 'Accept: application/json; indent=4' http://127.0.0.1:8000/groups/


# View unit tests at /rest_users/restapp/tests.py
# To perform unit tests (make sure virtualenv running)
python manage.py test

About

Django REST application with Django REST Framework

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages