Code Monkey home page Code Monkey logo

game-api's Introduction

Game API

Project example from the book Building RESTful Python Web Services by Gastón C. Hillar.

Installation

git clone [email protected]:werberth/scrum-api.git gameapi
cd gameapi
python -m venv .env
source .env/bin/activate
pip install -r requirements.txt
  • Rename the example.env file to .env and set the DEBUB variable to True.

  • If you want to use PostgreSQL, replace the username for the database username, the password for the user's password, and database_name for the database name. Example:

    DATABASE_URL='postgres://username:password@localhost/database_name'

    Taking as an example a database with name "game_database", and a user with username "admin" and password "12345":

    DATABASE_URL='postgres://admin:12345@localhost/game_database

  • Run python manage.py runserver

Using the API

URLs

  • Game Categories Routes
    • game-categories/$ [name='gamecategory-list']
    • game-categories/(?P<pk>[0-9]+)/$ [name='gamecategory-detail']
  • Games Routes
    • games/$ [name='game-list']
    • games/(?P<pk>[0-9]+)/$ [name='game-detail']
  • Players Routes
    • players/$ [name='player-list']
    • players/(?P<pk>[0-9]+)/$ [name='player-detail']
  • Players Score Routes
    • player-scores/$ [name='playerscore-list']
    • player-scores/(?P<pk>[0-9]+)/$ [name='playerscore-detail']
  • Users Routes
    • users/$ [name='user-list']
    • users/(?P<pk>[0-9]+)/$ [name='user-detail']

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.