This tutorial will go throw some steps of how to create a simple Rest API using Django. You can follow the slides here.
-
Clone this repository
$ git clone https://github.com/rencesar/supermarket-djangoapi-tutorial.git
-
Generate your Django Secret Key
- Access this link and generate your secret key
-
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
-
-
Change file permissions
$ chmod +x entrypoint.sh
-
Install Docker and Docker-compose
- Follow this tutorial
-
Running applications
$ docker-compose up --build