Tutorial Django API

This tutorial will go throw some steps of how to create a simple Rest API using Django. You can follow the slides here.

Setup

  1. Clone this repository

    $ git clone https://github.com/rencesar/supermarket-djangoapi-tutorial.git
    
  2. Generate your Django Secret Key

    • Access this link and generate your secret key
  3. Add environment variables

    • You can add them permanently

      $ echo 'export DJANGO_SECRET_KEY=[PUT YOUR SECRET KEY HERE WITHOUT THE SQUARED BRACKETS]' >> ~/.bashrc
      
    • or temporarily

      $ export DJANGO_SECRET_KEY=[PUT YOUR SECRET KEY HERE WITHOUT THE SQUARED BRACKETS
      
  4. Change file permissions

    $ chmod +x entrypoint.sh
    
  5. Install Docker and Docker-compose

  6. Running applications

    $ docker-compose up --build