{"id":13936858,"url":"https://github.com/SykoTheKiD/DockerDjangoRest","last_synced_at":"2025-07-19T22:32:51.207Z","repository":{"id":201747983,"uuid":"59228300","full_name":"SykoTheKiD/DockerDjangoRest","owner":"SykoTheKiD","description":"A Docker setup for a Django REST API with Travis CI support","archived":false,"fork":false,"pushed_at":"2016-06-02T17:58:37.000Z","size":5,"stargazers_count":45,"open_issues_count":0,"forks_count":6,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-08-08T23:24:41.733Z","etag":null,"topics":["django","docker","travis-ci"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SykoTheKiD.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2016-05-19T17:36:15.000Z","updated_at":"2022-04-20T17:14:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"1947b32a-5bf4-4e96-9a02-60d4858a6ea7","html_url":"https://github.com/SykoTheKiD/DockerDjangoRest","commit_stats":null,"previous_names":["sykothekid/dockerdjangorest"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SykoTheKiD%2FDockerDjangoRest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SykoTheKiD%2FDockerDjangoRest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SykoTheKiD%2FDockerDjangoRest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SykoTheKiD%2FDockerDjangoRest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SykoTheKiD","download_url":"https://codeload.github.com/SykoTheKiD/DockerDjangoRest/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226693903,"owners_count":17667757,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["django","docker","travis-ci"],"created_at":"2024-08-07T23:03:03.729Z","updated_at":"2024-11-27T05:30:37.946Z","avatar_url":"https://github.com/SykoTheKiD.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"## Django REST Application in Docker with Continuous Integration\n### Includes\n* Python 2.X and Python 3.X\n* PostgreSQL\n* Unicorn\n* Nginx\n* Travis CI Integration\n\n### Setup\n1. In the `docker-compose.yml` file in the **app** section under **command** enter your Django project name\n2. In the `.env` file enter your Django project's secret key under **secret key**\n3. Place the entire contents of your Django project inside the `app/` folder\n4. 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\n5. If you have a `requirements.txt` file append the contents of the `requirements.txt` in this project to yours.\n6. In your `settings.py` file replace your \n    * **SECRET KEY** with `os.environ['SECRET_KEY']`\n    * **DEBUG** with `True if os.getenv('DEBUG') == 'true' else False`\n\n\n7. In the **DATABASES** section of `settings.py` replace your\n    * **NAME** with `os.environ['DB_NAME']`\n    * **USER** with `os.environ['DB_USER']`\n    * **PASSWORD** with `os.environ['DB_PASS']`\n    * **HOST** with `os.environ['DB_HOST']`\n    * **PORT** with `os.environ['DB_PORT']`\n\nYou 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.\n\n8. 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)\n\n### Travis CI Setup\n1. Insert your Django project **SECRET_KEY** between the quotes under the **env** section\n2. Enter a name for your database under **DB_NAME** and the same name inside the `psql` command under **before_script** \n\n### Docker Deployment\n1. Run `docker-compose build`\n2. After building run `docker-compose up`\n3. In your browser go to your docker machine's IP address and you should see your app\n4. If the CSS isn't loading run `docker-compose run app /usr/local/bin/python manage.py collectstatic` and then reload\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSykoTheKiD%2FDockerDjangoRest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSykoTheKiD%2FDockerDjangoRest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSykoTheKiD%2FDockerDjangoRest/lists"}