{"id":23557729,"url":"https://github.com/dougpenny/djangodockerdevdeploy","last_synced_at":"2026-02-15T21:33:49.045Z","repository":{"id":144666620,"uuid":"463676362","full_name":"dougpenny/DjangoDockerDevDeploy","owner":"dougpenny","description":"Use the same Docker setup for both developing and deploying a Django site","archived":false,"fork":false,"pushed_at":"2022-03-09T17:56:34.000Z","size":20,"stargazers_count":1,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-22T15:42:45.070Z","etag":null,"topics":["django","django-docker","docker","nginx","nginx-docker","postgres-docker","postgresql"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dougpenny.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-02-25T21:09:52.000Z","updated_at":"2022-03-21T18:51:31.000Z","dependencies_parsed_at":null,"dependency_job_id":"a2fd0c19-14bd-444e-aee4-cbf06e703c59","html_url":"https://github.com/dougpenny/DjangoDockerDevDeploy","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dougpenny/DjangoDockerDevDeploy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dougpenny%2FDjangoDockerDevDeploy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dougpenny%2FDjangoDockerDevDeploy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dougpenny%2FDjangoDockerDevDeploy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dougpenny%2FDjangoDockerDevDeploy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dougpenny","download_url":"https://codeload.github.com/dougpenny/DjangoDockerDevDeploy/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dougpenny%2FDjangoDockerDevDeploy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29490346,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-15T19:29:10.908Z","status":"ssl_error","status_checked_at":"2026-02-15T19:29:10.419Z","response_time":118,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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","django-docker","docker","nginx","nginx-docker","postgres-docker","postgresql"],"created_at":"2024-12-26T15:16:37.936Z","updated_at":"2026-02-15T21:33:49.024Z","avatar_url":"https://github.com/dougpenny.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DjangoDockerDevDeploy (4D)\n[![MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)\n\nAre you fed up with managing virtual environments and looking for a way to cleanly package all of the bits and pieces needed for Django development and deployment? While there are many opinons about which tools to use, DjangoDockerDevDeploy includes the basic items needed to have a fully functional development environment, that with a few changes to environment files, can also be used for deployment. The ultimate goal is to simply commit changes to the repo and easily deploy into production; DjangoDockerDevDeploy allows just that.\n\n***\n\n## Table of Contents\n* [Usage](#usage)\n* [Certificates](#certificates)\n* [Contributing](#contributing)\n* [License](#license)\n\n---\n### Directory Layout\n\n```\n.\n├── /certs/                      # Local development security certificates\n├── /django/                     # Top-level Django project\n│   ├── /config/                 # Configuration root directory\n│   │   ├── /settings/           # Django settings files\n│   │   │   ├── base.py          # Shared, base settings\n│   │   │   ├── local.py         # Settings used for local development\n│   │   │   ├── production.py    # Settings used for production\n│   │   ├── asgi.py              # ASGI config file\n│   │   ├── urls.py              # Base URLConf file\n│   │   ├── wsgi.py              # WSGI config file\n│   ├── .env.sample              # Environment variables for the Django project\n│   ├── manage.py                # Django management file\n├── /nginx-dev/                  # Nginx local development configuration\n│   ├── default.conf.template    # Nginx configuration template for local development\n├── /nginx-prod/                 # Nginx production configuration\n│   ├── default.conf.template    # Nginx configuration template for production\n│── .env.sample                  # Environment variables for docker-compose.yml\n│── Dockerfile                   # Instructions for building the Docker images\n│── docker-compose.yml           # Configuration for the various services\n│── nginx.env.sample             # Environment variables for Nginx configuration\n└── requirements.txt             # List of Python modules to install\n```\n\n## Usage\nFork the repository and check it out locally. A basic Django project is included, so you can change into the directory and then build and start the app by running:\n\n```shell\ndocker-compose up --build\n```\n\nNavigate to `http://localhost:8000` in your browser and you will be presented with the “Congratulations!” Django page. You are now ready to start developing your Django app!\n\nIf you do not have Django installed locally, you can run all of the Django management commands in the Django Docker container. For example, to add a new app to your Django project you can run the following command, in a seperate terminal window:\n\n```shell\ndocker-compose exec django python /code/django/manage.py startapp mynewapp\n```\n\nThere are many different opinions about project layout; this project follows the [Two Scoops](https://www.feldroy.com/books/two-scoops-of-django-3-x) recommendation of having a top-level `config` directory that contains the settings, base URLConf (_urls.py_), and gateway interface (_wsgi.py/asgi.py_) files.\n\n### Async or Sync\nBy default, the project is setup to proxy requests from Nginx directly to [Uvicorn](https://www.uvicorn.org). The `docker-compose.yml` file contains commented options for using [Gunicorn](https://gunicorn.org) both directly and as a process manager for Uvicorn. _Please note:_ Gunicorn is not installed by default and will need to be added to the `requirements.txt` file if used.\n\n## Certificates\nIf you would like to use `https` during development, you will need to generate both a certificate and key and place them in the `certs` directory. The easiest way to do this is to use [mkcert](https://github.com/FiloSottile/mkcert) to create locally-trusted development certificates. Full instructions are provided in the [mkcert README](https://github.com/FiloSottile/mkcert/blob/master/README.md). Place the generated cetificate and key in the `certs` directory and update `nginx.env` file with the names of the certificate and key.\n\nIn production, you can use [certbot](https://certbot.eff.org) to generate [Let's Encrypt](https://letsencrypt.org) certificates. Simply update the `LOCAL_CERTS_PATH` in the top-level `.env` file to point to your certificates.\n\n## Contributing\nIf you have a feature or idea you would like to see added to DjangoDockerDevDeploy, please [create an issue](https://github.com/dougonecent/DjangoDockerDevDeploy/issues/new) explaining your idea. Likewise, if you come across a bug, please [create an issue](https://github.com/dougonecent/DjangoDockerDevDeploy/issues/new) explaining the bug with as much detail as possible.\n\nIf you have suggestions to improve the security for deployment, please feel free to open a pull request. I am far from an expert on security issues and would welcome any assistance or suggestions.\n\n## License\nDjangoDockerDevDeploy (4D) is released under an MIT license. See [LICENSE](https://opensource.org/licenses/MIT) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdougpenny%2Fdjangodockerdevdeploy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdougpenny%2Fdjangodockerdevdeploy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdougpenny%2Fdjangodockerdevdeploy/lists"}