Coder Social home page Coder Social logo

drf-for-test's Introduction

DRF-For-Test

a very simple API for Insert, Delete and Select in SQLs dataBases

Using The project with virtual environment:

first active your virtual environment,

then run:

  source start.sh

Using The project with Docker:

it is obvious that you'll need Docker on your system.

execute this command:

  docker-compose up

Attention:

by default, swagger uses staticfiles for directions of static.Go to site packages and replaces {%staticfiles%} by {%static%} in the templates directory;index.html.


API Usage:

/schema

returns api documentation by swagger interface.

api/status

returns api availability under get and post requests

/api/hero/<primary_key>

returns a hero by its pk

/api/hero/?name=''

returns a hero by its name or alias

/api/hero/all

returns all heroes

/api/hero/search/?q=''

returns a lis of heroes by your q value

/api/hero/submit

submit a new hero By 3 parameters:(name,alias,world_id) - world_id is the pk of the world

/api/hero/delete

delete an existing hero by pass 2 parameters:(name,flag) - flag = 1 is delete confirmation

/api/world//?world_name=''

returns a world by its name or content

/api/world/all

returns all worlds

/api/auth/login

returns sign in authentication

/api/auth/logout

returns log out function

/api/product/

returns product details by its ID


Making Query

get products that are in one sub_category

>>> cotumeproducts = Product.objects.filter(sub_category__name="suit's")
>>> cotumeproducts
<QuerySet [<Product: batman's gloves - 4456987>, <Product: Spiderman's mask - 3365479>]>
>>> for name in cotumeproducts:
...     print(name.name)
...
batman's gloves
Spiderman's mask

TODO:

  • : Dispaly category and sub-category 's name instead of id's

  • : Think more about category and sub-category 's Logic

  • : Auto generate barcode

drf-for-test's People

Contributors

mrshahsafi avatar

Stargazers

 avatar Amir Mohamad Eftekhari avatar

Watchers

 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.