Skip to content

Book swap project backend, uses Django rest api framework with Swagger API, created endpoints that allow users to create, read, update, delete wishlist, inventory, trade books

Notifications You must be signed in to change notification settings

scotth527/bookswap_backend

Repository files navigation

Django/Python Rest API for Book Swap

A swagger documented back end with custom endpoints that allow users to create, read, update, delete entries for their library/wishlist,trades etc.

Image

Built from the 4GeeksAcademy Django Python starter template here: https://github.com/4GeeksAcademy/django-rest-hello

API Starter Template (Python & Django REST)

A django-rest boilerplate for 4Geeks Academy students. It features ready-for-deployment on heroku instructions.

Features

  • It uses the latest python version (as of Oct 2018).
  • Ready to deploy to heroku in just 1 minute (for free).
  • 100% compatible with c9.io .

How to install this project ❓

Follow these steps:

  1. Make sure you have python 3.6 installed, if you are using Cloud9 you can install it by typing:
$ pyenv install 3.6.6   (this step takes a while)

$ pyenv global 3.6.6
  1. Install Django and pipenv
$ sudo pip install django pipenv
⚠️ Only run these steps 3 & 4 if you are starting the project from scratch
  1. Make sure your current folder is empty.
$ ls

It should show no files or folders.

  1. Create a new project using the 4Geeks Academy django-rest-hello template:
$ django-admin startproject <project_name> . --template=https://github.com/4GeeksAcademy/django-rest-hello/archive/master.zip --name=Procfile

Note: You can replace <project_name> with your desired project name.

⚠️ All team members need to run these 5,6,7 steps.
  1. Install any default packages (similar to npm install when using javascript) and get inside your recently created python envirnoment
$ pipenv install

$ pipenv shell
  1. Run migrations
$ python manage.py migrate
  1. Start the python server
$ python manage.py runserver $IP:$PORT

What next?

Your python API should be running smoothly.

Deploy your project to Heroku

If you don't have your code connected to a github repository, please do it:

$ git init
$ git add -A
$ git commit -m "Initial commit"

Then, run these 3 steps to deploy to heroku:

$ heroku create
$ git push heroku master

$ heroku run python manage.py migrate

Aditional Tutorials

Packages Being Used (Documentation)

About

Book swap project backend, uses Django rest api framework with Swagger API, created endpoints that allow users to create, read, update, delete wishlist, inventory, trade books

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages