GithubHelp home page GithubHelp logo

api-menu-section's Introduction

api-menu-section

This Menu Section REST API was built using the Django Framework due to its simplicity and rapid development capabilities.

Requirements:
This is a Django app built on Django 2.2 with Python 3.6.2.

Installation Instructions:
Run the following commands to get started running this app locally:

$ git clone https://github.com/feliciatrinh/api-menu-section.git  
$ cd api-menu-section  
$ python -m venv venv # use python3 if you have multiple versions of python
$ source venv/bin/activate  
$ pip install -r requirements.txt  
$ cd menuapi
$ python manage.py migrate  
$ python manage.py runserver

Testing the REST Menu API:
Use any browser or curl to test the API using the URL http://127.0.0.1:8000/api/menu/.

Operations GET, POST, PUT, DELETE are supported as follows:
GET:

curl http://127.0.0.1:8000/api/menu/
{"sections":[{"id":1,"name":"Specials of the Day"},{"id":2,"name":"Lunch Specials"},{"id":3,"name":"Dinner Specials"},{"id":4,"name":"Desserts"}]}   
curl http://127.0.0.1:8000/api/menu/3   
{"section":{"id":3,"name":"Dinner Specials"}}  

POST:

curl -X POST -H "Content-Type: application/json" -d '{"section":{"id":5,"name":"Easter Day Specials"}}' http://localhost:8000/api/menu/
{"success":"Menu section 'Easter Day Specials' created successfully."}

To access admin:
Visit http://127.0.0.1:8000/admin/ and enter the following:
Username: admin
Password: Intern!1

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.