All Projects → gurupratap-matharu → Django Rest Booking Api

gurupratap-matharu / Django Rest Booking Api

Licence: mit
A Restful api which allows you to book sports events or update existing odds.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Django Rest Booking Api

Modern Django
Modern Django: A Guide on How to Deploy Django-based Web Applications in 2017
Stars: ✭ 662 (+2658.33%)
Mutual labels:  rest-api, django, pip
Project Dashboard With Django
Agile Project Management dashboard with Django REST and Vue.js
Stars: ✭ 25 (+4.17%)
Mutual labels:  rest-api, postgresql, django
Django Postgres Extra
Bringing all of PostgreSQL's awesomeness to Django.
Stars: ✭ 365 (+1420.83%)
Mutual labels:  postgresql, django
Django React Boilerplate
DIY Django + React Boilerplate for starting your SaaS
Stars: ✭ 385 (+1504.17%)
Mutual labels:  postgresql, django
Dj Rest Auth
Authentication for Django Rest Framework
Stars: ✭ 491 (+1945.83%)
Mutual labels:  rest-api, django
Mediacms
MediaCMS is a modern, fully featured open source video and media CMS, written in Python/Django and React, featuring a REST API.
Stars: ✭ 313 (+1204.17%)
Mutual labels:  rest-api, django
Dsmr Reader
DSMR-protocol reader, telegram data storage and energy consumption visualizer. Can be used for reading the smart meter DSMR (Dutch Smart Meter Requirements) P1 port yourself at your home. You will need a cable and hardware that can run Linux software. Free for non-commercial use. A Docker implementation can be found here: https://github.com/xirixiz/dsmr-reader-docker
Stars: ✭ 327 (+1262.5%)
Mutual labels:  postgresql, django
Django Dbbackup
Management commands to help backup and restore your project database and media files
Stars: ✭ 471 (+1862.5%)
Mutual labels:  postgresql, django
Xtuple
This repository contains the source code for the database schema for the PostBooks edition of xTuple ERP and xTuple's REST API server. The REST API server is written in JavaScript running on Node.js. The database schema for PostBooks runs on a PostgreSQL database server.
Stars: ✭ 247 (+929.17%)
Mutual labels:  rest-api, postgresql
Filterlists
🛡 The independent, comprehensive directory of filter and host lists for advertisements, trackers, malware, and annoyances.
Stars: ✭ 653 (+2620.83%)
Mutual labels:  rest-api, postgresql
Docker Tutorial
Docker 基本教學 - 從無到有 Docker-Beginners-Guide 教你用 Docker 建立 Django + PostgreSQL 📝
Stars: ✭ 906 (+3675%)
Mutual labels:  postgresql, django
Gitlit
Platform to connect contributors and projects based on skill level and shared interests.
Stars: ✭ 265 (+1004.17%)
Mutual labels:  rest-api, django
Php Crud Api
Single file PHP script that adds a REST API to a SQL database
Stars: ✭ 2,904 (+12000%)
Mutual labels:  rest-api, postgresql
Docker Django Nginx Uwsgi Postgres Tutorial
Docker + Django + Nginx + uWSGI + Postgres 基本教學 - 從無到有 ( Docker + Django + Nginx + uWSGI + Postgres Tutorial )
Stars: ✭ 334 (+1291.67%)
Mutual labels:  postgresql, django
Tweetme 2
Build a twitter-like app in Django, Bootstrap, Javascript, & React.js. Step-by-Step.
Stars: ✭ 247 (+929.17%)
Mutual labels:  rest-api, django
Drf Spectacular
Sane and flexible OpenAPI 3 schema generation for Django REST framework.
Stars: ✭ 414 (+1625%)
Mutual labels:  rest-api, django
Django Ninja
💨 Fast, Async-ready, Openapi, type hints based framework for building APIs
Stars: ✭ 875 (+3545.83%)
Mutual labels:  rest-api, django
Prest
PostgreSQL ➕ REST, low-code, simplify and accelerate development, ⚡ instant, realtime, high-performance on any Postgres application, existing or new
Stars: ✭ 3,023 (+12495.83%)
Mutual labels:  rest-api, postgresql
Django Rest Registration
User-related REST API based on the awesome Django REST Framework
Stars: ✭ 240 (+900%)
Mutual labels:  rest-api, django
Feedhq
FeedHQ is a web-based feed reader
Stars: ✭ 525 (+2087.5%)
Mutual labels:  postgresql, django

Django RestApi Nested Serializers

drawing

LIVE

https://midware.herokuapp.com/api/v1/

Browsable Request API

drawing

Motivation 🎯

  • App suggestion based on interview assignment
  • Deployment with docker on heroku
  • Working with tools that are free for open source
  • Working with payment methods like stripe and REST apis

Features ✨

  • Manage data about sporting events to allow users to place bets.
  • Provide API to receive data from external providers and update our system with the latest data about events in real time.
  • Provide access to support team to allow the to see the most recent data for each event and to query data.
  • multiple connected models with foreign keys
  • nested serializers which permit showing related model in json
  • Updates only part of data based on request
  • Versioning of api possible see /api/v1/
  • Fast response time
  • Easily customizable with Login | Logout | reset password features and rest-token authentication
  • Make file for faster setup and reusability

Development setup 🛠

Steps to locally setup development after cloning the project.

docker-compose up -d --build or simple make build ;)

Requirements

Python (3.4, 3.5, 3.6, 3.7) Django (2.0, 2.1, 3.1)

Implementation Details

  • Data:

    • Markets are unique per Sport
    • Selections are unique per Market
  • Receiving data:

    • For our purposes we can assume this API will be used by a single provider, so no need to keep track of which provider is sending the message.

API Features

Message Types

  • NewEvent: A complete new sporting event is being created. Once the event is created successfully the only field that will updated is the selection odds.

  • UpdateOdds: There is an update for the odds field (all the other fields remain unchanged)

How to run

If running on local machine do

python manage.py runserver
./manage.py runserver

You can now open the API in your browser at http://127.0.0.1:8000/api/, and view your new 'match' API. For this exercise we are not using authentication. So all users have full CRUD access.

If you don't use the database provided on your local machine you need to do the migrations and create a super user.

python manage.py createsuperuser

Access admin panel at http://127.0.0.1:8000/admin/ From the admin panel you can do more operations like add, create and delete models, users, do grouping, etc.

You can also interact with the API using command line tools such as curl. For example, to list the match endpoint:

Example

Let's take a look at a quick example of using REST framework to build a simple model-backed API.

Startup up a new project like so...

pip install django
pip install djangorestframework
django-admin startproject example .
./manage.py migrate
./manage.py createsuperuser

Now edit the example/urls.py module in your project:

from django.conf.urls import url, include
from django.contrib.auth.models import User
from rest_framework import serializers, viewsets, routers

# Serializers define the API representation.
class MatchListSerializer(serializers.ModelSerializer):
    class Meta:
        model = Match
        fields = ('id', 'url', 'name', 'startTime')
# ViewSets define the view behavior.
class MatchViewSet(viewsets.ModelViewSet):
    queryset = Match.objects.all()
    serializer_class = MatchSerializer
# Routers provide a way of automatically determining the URL conf.
router = routers.DefaultRouter()
router.register(r'match', MatchViewSet)

# Wire up our API using automatic URL routing.
# Additionally, we include login URLs for the browsable API.
urlpatterns = [
    url(r'^', include(router.urls)),
    url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework'))
]

We'd also like to configure a couple of settings for our API.

Add the following to your settings.py module:

INSTALLED_APPS = (
    ...  # Make sure to include the default installed apps here.
    'rest_framework',
)

REST_FRAMEWORK = {
    # Use Django's standard `django.contrib.auth` permissions,
    # or allow read-only access for unauthenticated users.
    'DEFAULT_PERMISSION_CLASSES': [
        'rest_framework.permissions.DjangoModelPermissionsOrAnonReadOnly'
    ]
}

Documentation & Support

Full documentation for the project is available at https://www.django-rest-framework.org/.

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].