piraidev / django-on-demand

Django generic marketplace API

Home Page:https://django-on-demand.readthedocs.io/en/latest/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DJANGO ON-DEMAND

pypi-version build-status-image

Manage suppliers and consumers in an on-demand marketplace. Think of it like an API to build services like Airbnb, Upwork, or any marketplace where you have suppliers offering a service or product, and consumers searching for specific characteristics of the product or service.

More info about on-demand: https://www.pubnub.com/blog/what-is-the-on-demand-economy/

This app provides models and API endpoints to facilitate the implementation of the marketplace.

Yes, fork it.

Please, contribute. Thanks!

Full documentation on https://django-on-demand.readthedocs.io/en/latest/

Endpoints

  • /search-suppliers
  • /users/<id>/supplier-profile (create, update, retrieve)
  • /users/<id>/consumer-profile (create, update, retrieve)
  • /newest-suppliers
  • /connection (create a connection between supplier and consumer, update, terminate)

Install app

This app is still work in progress. To install the work in progress version pip3 install django-on-demand

INSTALLED_APPS requirement

This app is using django-rest-framework to provide API endpoints, which means this app will need to be added to the list of installed apps. The app will automatically install django-rest-framework if it's not installed. on_demand also needs to be added to the list of installed apps.

 INSTALLED_APPS = [
        ...
        'on_demand',
        'rest_framework'
    ]

Given that the app has models, a db client should be installed. For example pip install mysqlclient

Run python3 manage.py migrate to get the models from the app.

Include the Django On Demand Rest API URLconf in your project urls.py like this: path('ondemand/', include('on_demand.urls'))

Tests

This project includes (and encourages writing) tests, with coverage, using an in memory db 'SQLite'.

Running tests:

python runtests.py 

Test + coverage

coverage run --source='./on_demand' runtests.py

Then to get the report on the CLI run

coverage report -m

Or to get a fancy HTML report just run:

coverage html
open htmlcov/index.html

and navigate the file to inspect statements covered.

About

Django generic marketplace API

https://django-on-demand.readthedocs.io/en/latest/

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:Python 99.1%Language:Shell 0.9%