Skip to content

p-rdx/users_teams_api_example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

users_teams_api_example

Local Deployment

  • Clone or download repository
  • Create a virtual environment and activate it -- You can use various virtual environments, like virtualenvwrapper, anaconda etc.
  • Install requirements
> pip install -r requirements.txt
  • run migrations
> python manage.py migrate
  • create superuser
> python manage.py createsuperuser
  • run
> python manage.py runserver

Deployment

  • add 'auth_api' to INSTALLED_APPS in settings.py
  • add AUTH_USER_MODEL = 'auth_api.CustomUser' to settings.py
  • add url(r'^api/$', include(auth_api.urls)) to urlpatterns in urls.py
  • add EMAIL_BACKEND and EMAIL_FROM to settings.py

API endpoints

/api/login/ (POST)

requires: email, password returns: Authorisation Token

/api/logout/ (POST)

deletes Authorisation token, returns: success message

api/userdetails/ (GET)

requires: (Auth) returns: user details

api/userdetails/ (PUT)

requires: (Auth); email or first_name or last_name returns: user details

api/reset/ (POST)

requires: email creates password reset token sends e-mail to user returns: success/error

api/password/ (POST)

requires: (Auth); new password OR requires: email, password reset code, new password Sets new password, removes code returns: success/error

api/invite/ (POST)

requires: (Auth); team name, recipient email Creates or retrieves an invitation link from user to team Sends an email with code returns: invitationLink parameters

api/register/ (POST)

requires: email, password (first name, last name, invitation code) Creates a new user with provided information returns: created user details

api/create_team/ (POST)

requires: (Auth); team name Creates a new team using provided name, adds team to user teams returns: success/error

api/verify_email/ (POST)

requires: verification code Verifies user email, deletes verification token record returns: success/error

api/retrieve_code/ (POST)

requires: (Auth) returns: email verification code, password reset code

Example application:

https://users-teams-example-app.herokuapp.com email: [email protected] password: QWer!@34

ToDo:

  • Tests
  • Remove invitation link from user, team when user leaves team

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages