Skip to content

Hellrungj/python_heroku_api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

python_heroku_api

Python 3.8 Docker Django

A quickstart api using docker and django that can be deploy easily to Heroku

Authors

Deployment

To deploy this project see Deploying with Docker on Heroku documentation.

Environment Variables

Docker Env

  • HOST: '0.0.0.0'
  • PORT: '8000'
  • DEBUG: 0

Run Django Server Development Locally

Clone the project

  git clone https://github.com/Hellrungj/python_heroku_api.git

Install Python 3

  apt install python3

Install pipenv

  pip install pipenv

Install dependencies

  pipenv install

Activate python virtual environment

  pipenv shell

Go to the project directory

  cd api/

Install dependencies Start the server

  python manage.py runserver

Run Docker Container Locally

Clone the project

  git clone https://github.com/Hellrungj/python_heroku_api.git

Install Docker

  Install the app from https://docs.docker.com/get-docker/

Build Image

docker build -t  django-heroku-app

Run the Container:

docker run -it -e "HOST:0.0.0.0" -e "PORT=8000" -e "DEBUG=0" -p 8000:8000 django-heroku-app