Coder Social home page Coder Social logo

pytemp's Introduction

pytemp is python template project

I am writing this project to support backend service projects. It undertakes the following functions.

  • Automatic JWT authentication for API
  • support local caching and singleton to manage memory.
  • Provides HTTP validate solutions for RESTFull.
  • Automatic logging and fault management.
  • Provides OOP solution for the controller.
  • Support multi language with VI and EN

The project will continue to improve after I have learned from new projects, or ideas from the community.

Install

pip instal -r requirement

Run App

py app.py run

Migrate database

py run.py migrate

Teardown and migrate database

py run.py teardown

Run under background process

py run.py

Usage

See how to install the api in the bot.py file

Apis

Method PUT BOT

curl -X PUT \
http://localhost:5000/api/v1.0/bot/bot_single_seller_shop_pizza_express \
-H 'authorization: Basic bliauwbralwiubnawk24114eobn' \
-H 'content-type: application/json' \
-d '{
    "id": 1245,
    "name": "Tuấn Anh",
    "age": 5,
    "gender": 4,
    "message": "Chào"
}'

Method GET BOT

curl -X GET \
http://localhost:5000/api/v1.0/bot/bot_single_seller_shop_pizza_express \
-H 'authorization: Basic bliauwbralwiubnawk24114eobn'

Method SET BOT

curl -X PATCH \
  http://localhost:5000/api/v1.0/bot/bot_single_seller_shop_pizza_express \
  -H 'authorization: Basic cawiuvnleruivkurwi2938r6lawihvw49fj123452' \
  -H 'content-type: application/json' \
  -d '{
    "consumer": {
        "address": "19 Dịch Vọng",
        "id": "shop_pizza_express",
        "name": "cửa hàng Pizza Express",
        "phone": "09888-------30588",
        "email": "pizza.Express@Express",
        "product": "bánh Pizza",
        "unit": "Chiếc"
    },
    "desc": "cửa hàng Pizza Express",
    "id": "bot_single_seller_shop_pizza_express",
    "meta_class": {
        "class_name": "BotSingleSeller",
        "module_name": "controllers.bot_single_seller"
    },
    "name": "Ngọc Trinh",
    "nlp_key": "bot_single_seller",
    "token": "bliauwbralwiubnawk24114eobn"
}'
  • param body of request

request body

  • param Authorization header of request

request header

  • param Json has complex architecture

request dùng cấu trúc json phúc tạp

Versioning

The default API version is 20171210.

pytemp's People

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

nguyenanhduc

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.