Skip to content

Installing Django+REST to create API using django (Boilerplate + Quick Tutorials)

Notifications You must be signed in to change notification settings

4GeeksAcademy/django-rest-hello

Repository files navigation

API Starter Template (Python & Django REST)

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

Open in Gitpod

Features

  • Ready to deploy to heroku in just 1 minute (for free).
  • 100% compatible with gitpod.

1) Install any default packages (similar to npm install when using javascript) and get inside your recently created python envirnoment

$ pipenv install

2) Run migrations

  1. $ pipenv run migrate Run database migration
  2. $ pipenv run start Run the server

What next?

Your python API should be running smoothly. You should read the docs for tutorials.

You can go ahead and add/update the following files:

  • api/models.py to include more tables/entities into your database.
  • api/urls.py to include more endpoints and match them with views
  • views.py to specify wich methods will apply to each endpoint (GET, POST, PUT, DELETE)

Aditional Tutorials

Packages Being Used (Documentation)

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

Contributors

This template was built as part of the 4Geeks Academy Coding Bootcamp by Alejandro Sanchez and many other contributors. Find out more about our Full Stack Developer Course, and Data Science Bootcamp.