All Projects → SykoTheKiD → DockerDjangoRest

SykoTheKiD / DockerDjangoRest

Licence: other
A Docker setup for a Django REST API with Travis CI support

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to DockerDjangoRest

cpp14-project-template
A simple, cross-platform, and continuously integrated C++14 project template
Stars: ✭ 64 (+39.13%)
Mutual labels:  travis-ci
kMD2PDF
Markdown to PDF conversion library written in Kotlin
Stars: ✭ 14 (-69.57%)
Mutual labels:  travis-ci
projection-pursuit
An implementation of multivariate projection pursuit regression and univariate classification
Stars: ✭ 24 (-47.83%)
Mutual labels:  travis-ci
dokusho
Simple Japanese reading stats tracker
Stars: ✭ 12 (-73.91%)
Mutual labels:  travis-ci
firebase-ci
Simplified Firebase interaction for continuous integration
Stars: ✭ 71 (+54.35%)
Mutual labels:  travis-ci
react-multi-context
Manage multiple React 16 contexts with a single component.
Stars: ✭ 19 (-58.7%)
Mutual labels:  travis-ci
alexa-skill-boilerplate
An easy to use Amazon Alexa Skill Boilerplate for fast skill creation
Stars: ✭ 54 (+17.39%)
Mutual labels:  travis-ci
unity-ci-test
Example Unity Project using TravisCI
Stars: ✭ 35 (-23.91%)
Mutual labels:  travis-ci
travistorrent-tools
Tools used to create the data on TravisTorrent (http://travistorrent.testroots.org).
Stars: ✭ 38 (-17.39%)
Mutual labels:  travis-ci
webperf-dashboard
Web Performance Dashboard forked from https://github.com/boyney123/garie
Stars: ✭ 51 (+10.87%)
Mutual labels:  travis-ci
googletest-ci
Continuous integration (CI) + Google Test (gtest) + CMake example boilerplate demo
Stars: ✭ 14 (-69.57%)
Mutual labels:  travis-ci
Clean Marvel Kotlin
This repository contains a detailed sample app that implements Clean architecture and MVP in Kotlin using RxJava2, Retrofit
Stars: ✭ 27 (-41.3%)
Mutual labels:  travis-ci
knapsack pro-ruby
Knapsack Pro gem splits tests across parallel CI nodes and makes sure that tests will run in optimal time on each node.
Stars: ✭ 101 (+119.57%)
Mutual labels:  travis-ci
dump-env
A utility tool to create .env files
Stars: ✭ 81 (+76.09%)
Mutual labels:  travis-ci
xiaomi-r3g-openwrt-builder
OpenWrt builder for any supported routers using Docker. Scheduled to run weekly
Stars: ✭ 25 (-45.65%)
Mutual labels:  travis-ci
docker-coala-base
coala base docker image
Stars: ✭ 20 (-56.52%)
Mutual labels:  travis-ci
loci
Testing remote CI scripts locally
Stars: ✭ 25 (-45.65%)
Mutual labels:  travis-ci
travis-minikube
Run minikube on Travis CI
Stars: ✭ 89 (+93.48%)
Mutual labels:  travis-ci
argocd-operator-helm
[DEPRECATED] Argo CD Operator (Helm) installs Argo CD in OpenShift and Kubernetes.
Stars: ✭ 18 (-60.87%)
Mutual labels:  travis-ci
LocalSupport
A directory of local support services and volunteer opportunities
Stars: ✭ 60 (+30.43%)
Mutual labels:  travis-ci

Django REST Application in Docker with Continuous Integration

Includes

  • Python 2.X and Python 3.X
  • PostgreSQL
  • Unicorn
  • Nginx
  • Travis CI Integration

Setup

  1. In the docker-compose.yml file in the app section under command enter your Django project name

  2. In the .env file enter your Django project's secret key under secret key

  3. Place the entire contents of your Django project inside the app/ folder

  4. In the Dockerfile inside the app/ directory if you are using Python 3 uncomment the FROM python:3-onbuild command and comment out the FROM python:2-onbuild we are using the onbuild version so it will automatically load the requirements.txt file

  5. If you have a requirements.txt file append the contents of the requirements.txt in this project to yours.

  6. In your settings.py file replace your

    • SECRET KEY with os.environ['SECRET_KEY']
    • DEBUG with True if os.getenv('DEBUG') == 'true' else False
  7. In the DATABASES section of settings.py replace your

    • NAME with os.environ['DB_NAME']
    • USER with os.environ['DB_USER']
    • PASSWORD with os.environ['DB_PASS']
    • HOST with os.environ['DB_HOST']
    • PORT with os.environ['DB_PORT']

You have made your Django project get the database and secret key data from the environment variables which are defined in the .env file from earlier.

  1. Add '*'as one of your hosts in ALLOWED_HOSTS (don't know if this is needed, had to do this to get it to work on my machine)

Travis CI Setup

  1. Insert your Django project SECRET_KEY between the quotes under the env section
  2. Enter a name for your database under DB_NAME and the same name inside the psql command under before_script

Docker Deployment

  1. Run docker-compose build
  2. After building run docker-compose up
  3. In your browser go to your docker machine's IP address and you should see your app
  4. If the CSS isn't loading run docker-compose run app /usr/local/bin/python manage.py collectstatic and then reload
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].