All Projects → guidocecilio → django-restframework-userprofile

guidocecilio / django-restframework-userprofile

Licence: other
Public Profile is a Django REST Framework based API that demos how to extends a default Django Auth User model with a Profile. In addition, the code also includes a demo client that show how to consume the API from a Client Web Application.

Programming Languages

python
139335 projects - #7 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to django-restframework-userprofile

drf tweaks
Extensions for Django Rest Framework
Stars: ✭ 77 (+220.83%)
Mutual labels:  django-rest-framework
oms cms
A Django content management system focused on flexibility and user experience
Stars: ✭ 18 (-25%)
Mutual labels:  django-rest-framework
django-ninja-extra
Django Ninja Extra - Class-Based Utility and more for Django Ninja(Fast Django REST framework)
Stars: ✭ 53 (+120.83%)
Mutual labels:  django-rest-framework
drf-turbo
An alternative serializer implementation for REST framework written in cython built for speed.
Stars: ✭ 73 (+204.17%)
Mutual labels:  django-rest-framework
rest-framework-latex
A LaTeX renderer for Django REST Framework
Stars: ✭ 30 (+25%)
Mutual labels:  django-rest-framework
agent
Job tracker & performance platform
Stars: ✭ 26 (+8.33%)
Mutual labels:  django-rest-framework
django-rest-framework-example
REST framework example for Django < 1.9 // New version ->
Stars: ✭ 29 (+20.83%)
Mutual labels:  django-rest-framework
django-rest-live
Subscribe to updates from Django REST Framework over Websockets.
Stars: ✭ 48 (+100%)
Mutual labels:  django-rest-framework
django-parler-rest
Translatable model support for django-rest-framework
Stars: ✭ 48 (+100%)
Mutual labels:  django-rest-framework
mobileAudit
Django application that performs SAST and Malware Analysis for Android APKs
Stars: ✭ 140 (+483.33%)
Mutual labels:  django-rest-framework
open
The most boring open source you've ever seen ....
Stars: ✭ 109 (+354.17%)
Mutual labels:  django-rest-framework
django-final
source code for django-final course
Stars: ✭ 28 (+16.67%)
Mutual labels:  django-rest-framework
django-logic
Django Logic - easy way to implement state-based business logic with pure functions
Stars: ✭ 44 (+83.33%)
Mutual labels:  django-rest-framework
dr scaffold
scaffold django rest apis like a champion 🚀
Stars: ✭ 116 (+383.33%)
Mutual labels:  django-rest-framework
PyQuotes
PyQuotes is a Django-based web application and REST API. That will allow you to launch an online quotes service.
Stars: ✭ 23 (-4.17%)
Mutual labels:  django-rest-framework
repanier
Django extension : web tool for short circuit food supply
Stars: ✭ 18 (-25%)
Mutual labels:  django-rest-framework
tscharts
Django REST framework-based Digital Patient Registration and EMR backend
Stars: ✭ 14 (-41.67%)
Mutual labels:  django-rest-framework
Face-Recognition-System
Intelligent Facial Recognition with Django Restful IoT on Raspberry Pi
Stars: ✭ 46 (+91.67%)
Mutual labels:  django-rest-framework
drf-SimpleJWT-React
Template Django + DRF + SimpleJWT + React project
Stars: ✭ 80 (+233.33%)
Mutual labels:  django-rest-framework
Shappar
気軽に投票を【取れる】【見れる】【できる】アプリです。
Stars: ✭ 22 (-8.33%)
Mutual labels:  django-rest-framework

Public Profile

Public Profile is a Django REST Framework based API that demos how to extends a default Django Auth User model with a Profile. In addition, the code also includes a demo client that show how to consume the API from a Client Web Application.

Makefile

This project uses a Makefile for various tasks. Some of the available tasks are listed below.

  • make setup - Setup the application (Creates venv, db, and loads fixtures)
  • make run - Run the server
  • make test - Run Unit Tests (using nose)
  • make lint - Get a pep8 compliance report about your code

Backends

Fixtures

The API comes with some data dumped by default that might be useful for testing purpose.

Install fixtures by runnign the command:

$ python src/manage.py loaddata topics users

To backup your test fixtures use the following command:

$ python src/manage.py dumpdata auth.User --indent 4 > src/api/fixtures/users.json
$ python src/manage.py dumpdata api.topic --indent 4 > src/api/fixtures/topics.json
$ python src/manage.py dumpdata api.profile --indent 4 > src/api/fixtures/profiles.json

Then the API is exposed in your localhost through the port 8000

Authentication

The API provides three default authentication. However, any Django REST Framework supportes authentication can be added to the list of authentication classes.

The top authentication class used by the API is the JWT

Security

Unlike some more typical uses of JWTs, this module only generates authentication tokens that will verify the user who is requesting one of your DRF protected API resources. The actual request parameters themselves are not included in the JWT claims which means they are not signed and may be tampered with. You should only expose your API endpoints over SSL/TLS to protect against content tampering and certain kinds of replay attacks.

Using the API

You can easily test if the endpoint is working by doing the following in your terminal, if you had a user created with the username admin and password password123.

$ curl -X POST -d "username=admin&password=password123" http://localhost:8000/api-token-auth/

Alternatively, you can use all the content types supported by the Django REST framework to obtain the auth token. For example:

$ curl -X POST -H "Content-Type: application/json" -d '{"username":"admin","password":"password123"}' http://localhost:8000/api-token-auth/

Now in order to access protected api urls you must include the Authorization: JWT <your_token> header.

$ curl -H "Authorization: JWT <your_token>" http://localhost:8000/protected-url/

Visit REST framework JWT Auth for a detailed explanation about Django REST Framework and JWT.

Debug

Debugging unit test

To debug the unit test code, it is recommended to use the virtual environment and the following command to append the conole output and allow the developer to print data to the console output. e.g:

(.env) $ python src/manage.py test -s

Clients

Client side applications are located within the clients folder in the root of project. At the moment of this writing the available client application is the `` but there will be even mobiles app for consumption of REST API.

Development

As all clients application are managed independently there should be a README.md file with instruction about how to use or extend the client application.

React Web Application

For more details about how to deploy or extend the web app please refer to the README.md file within client repository code.

React User Profile

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].