Giter Site home page Giter Site logo

app-generator / sample-django-api-drf Goto Github PK

View Code? Open in Web Editor NEW
4.0 3.0 3.0 35 KB

Django API Server - Open-source Sample | AppSeed

Home Page: https://docs.appseed.us/samples/django/api-server-sample

License: Other

Shell 0.58% Dockerfile 0.83% Python 98.59%
appseed-sample django-sample drf

sample-django-api-drf's Introduction

Simple starter built with Python / Django Rest / SQLite3 and JWT Auth. The authentication flow is based on json web tokens. Forked from Django API Server. For more information please access the project documentation.


Features:

  • Simple, intuitive codebase - built for beginners (can be extended with ease)
  • Django / Django REST / SQLite3 - a simple, easy to use backend
  • Authentication with JWT (JWT login, JWT logout)
  • Testing, Docker
  • Forked and extended from Django API Server with more features
    • api/transactions/create - create transaction
    • api/transactions/edit/id- edit transaction
    • api/transactions/delete/id - delete transaction
    • api/transactions/get/id - get specific transaction
    • api/transactions/get - get all transactions

Can be used with other UI projects for a complete fullstack experience


Support:

  • Github (issues tracker), Email: support @ appseed.us
  • Discord: LIVE Support (registered AppSeed Users)

Django API Server - Open-source Django Starter provided by AppSeed.


Requirements

  • Django==3.2.5
  • djangorestframework==3.12.4
  • PyJWT==2.1.0
  • django-cors-headers==3.7.0

How to use the code

Clone the sources

$ git clone https://github.com/app-generator/api-server-django-sample.git
$ cd api-server-django-sample

Create a virtual environment

$ virtualenv -p python3 venv
$ source venv/bin/activate

Install dependencies using pip

$ pip install -r requirements.txt

Start the API server

$ python manage.py migrate
$ python manage.py runserver

The API server will start using the default port 8000.


Docker execution


Get the code

$ git clone https://github.com/app-generator/api-server-django.git
$ cd api-server-django

Start the app in Docker

$ docker-compose up -d --build

Visit http://localhost:5000 in your browser. The API server will be running.


API

For a fast set up, use this POSTMAN file: api_sample

Register - api/users/signup

POST api/users/signup
Content-Type: application/json

{
    "username":"test",
    "password":"pass", 
    "email":"[email protected]"
}

Login - api/users/login

POST /api/users/login
Content-Type: application/json

{
    "password":"pass", 
    "email":"[email protected]"
}

Logout - api/users/logout

POST api/users/logout
Content-Type: application/json
authorization: JWT_TOKEN (returned by Login request)

{
    "token":"JWT_TOKEN"
}


Django API Server Sample - Provided by AppSeed App Generator

sample-django-api-drf's People

Contributors

app-generator avatar koladev32 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.