{"id":22779441,"url":"https://github.com/alexolivas/djangorest-template","last_synced_at":"2025-03-30T14:14:30.989Z","repository":{"id":130263751,"uuid":"326475740","full_name":"alexolivas/djangorest-template","owner":"alexolivas","description":"A production ready django-rest template with docker integration and postgres database.","archived":false,"fork":false,"pushed_at":"2021-01-07T18:16:04.000Z","size":45,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-05T15:52:05.684Z","etag":null,"topics":["api-rest","django-project","django-rest-framework","python","python3","rest-api"],"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/alexolivas.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":"2021-01-03T18:36:54.000Z","updated_at":"2021-01-07T18:16:06.000Z","dependencies_parsed_at":"2023-03-24T07:47:25.750Z","dependency_job_id":null,"html_url":"https://github.com/alexolivas/djangorest-template","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexolivas%2Fdjangorest-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexolivas%2Fdjangorest-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexolivas%2Fdjangorest-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexolivas%2Fdjangorest-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexolivas","download_url":"https://codeload.github.com/alexolivas/djangorest-template/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246326789,"owners_count":20759439,"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":["api-rest","django-project","django-rest-framework","python","python3","rest-api"],"created_at":"2024-12-11T20:08:50.091Z","updated_at":"2025-03-30T14:14:30.981Z","avatar_url":"https://github.com/alexolivas.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Django REST Starter Template\n\nA project starter template for Django 3.1.4 and django-rest 3.12.2.\n\n## Features\n\n- Configured for production environments running gunicorn\n- Production ready docker setup for easy deployment\n- Serve django's static files with Whitenoise\n- Built-in support for CORS management\n- Dependency management with `Pipenv`\n- Python formatting with black\n- Python 3.8 environment\n- Customizable via environment variables defined in `.env` file\n- Comes installed with `pre-commit`\n\n## Creating Your Project\n\nUse this template to create a new Django REST project:\n\n```bash\ndjango-admin.py startproject --template=https://github.com/alexolivas/djangorest-template/archive/master.zip --name=Procfile \u003cyour-project-name\u003e\n```\n\n## Configuration\n\nCreate an environment variables file `vim .env` with the following values\n\n```bash\nPOSTGRES_USER=\u003cusername\u003e\nPOSTGRES_PASSWORD=\u003cpassword\u003e\nPOSTGRES_DB=\u003cdb-name\u003e\nPOSTGRES_PORT=5432\nPOSTGRES_HOST=postgres\nSECRET_KEY=\u003cgenerate-secret-key\u003e\nDEBUG=\u003cTrue|False\u003e\n# Examples\nALLOWED_HOSTS=localhost:3000, 0.0.0.0\nCORS_ORIGIN_WHITELIST='http://localhost:3000', 'http://127.0.0.1:3000'\n```\n\n## Docker And Docker Compose\n\nThis project uses docker which means you can use the standard docker and docker-compose commands to manage your project\n\n```bash\ndocker-compose up --build\n```\n\nTo start a container\n\n```bash\ndocker-compose up\n```\n\n## Dependency Management With Pipenv\n\nThis project uses `Pipenv` to manage it's dependencies. There's no need to do anything to setup the project, but if you want add or delete packages you'll have to install them via Pipenv within your project's docker container. This project doesn't rely on setting up a virtualenv for development since the docker container's volume is mounted to your local computer.\n\n## Code Formatting And Pre-Commit\n\nThis project uses `black` code formatter to keep your python code styling consistent. You also have the option of taking advantage of `pre-commit` so all of your staged files are automatically formatted for a consistent code base. `pre-commit` is configured via the [.pre-commit-config.yaml](.pre-commit-config.yaml) file. See [installation instructions](https://pre-commit.com/#install) to set this up in your local environment.\n\nTo run black on its own, within the docker container, run:\n\n```bash\nblack .\n```\n\n## License: MIT\n\n## Further Reading\n\n- [Django REST](https://www.django-rest-framework.org/)\n- [Gunicorn](https://warehouse.python.org/project/gunicorn/)\n- [WhiteNoise](https://warehouse.python.org/project/whitenoise/)\n- [Pipenv](https://pypi.org/project/pipenv/)\n- [black](https://black.readthedocs.io/en/stable/)\n- [pre-commit](https://pre-commit.com/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexolivas%2Fdjangorest-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexolivas%2Fdjangorest-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexolivas%2Fdjangorest-template/lists"}