{"id":19782830,"url":"https://github.com/tyronejosee/template_django","last_synced_at":"2026-04-11T19:06:06.721Z","repository":{"id":252858914,"uuid":"841647364","full_name":"tyronejosee/template_django","owner":"tyronejosee","description":"Django project template with Django REST Framework, Docker, and PostgreSQL. A basic setup to start building backend projects.","archived":false,"fork":false,"pushed_at":"2024-08-24T01:28:17.000Z","size":78,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-28T13:05:31.811Z","etag":null,"topics":["django","django-rest-framework","docker","docker-compose","github-actions","posgresql","precommit-hooks","python","snippets"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tyronejosee.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":"2024-08-12T20:35:28.000Z","updated_at":"2024-12-18T02:19:25.000Z","dependencies_parsed_at":"2025-02-28T06:58:39.703Z","dependency_job_id":"a0268e5b-5701-430a-be07-badcb5f964d8","html_url":"https://github.com/tyronejosee/template_django","commit_stats":null,"previous_names":["tyronejosee/template_django"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tyronejosee/template_django","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tyronejosee%2Ftemplate_django","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tyronejosee%2Ftemplate_django/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tyronejosee%2Ftemplate_django/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tyronejosee%2Ftemplate_django/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tyronejosee","download_url":"https://codeload.github.com/tyronejosee/template_django/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tyronejosee%2Ftemplate_django/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278266895,"owners_count":25958733,"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","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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-rest-framework","docker","docker-compose","github-actions","posgresql","precommit-hooks","python","snippets"],"created_at":"2024-11-12T06:06:15.687Z","updated_at":"2025-10-04T04:56:53.036Z","avatar_url":"https://github.com/tyronejosee.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cd align=\"center\"\u003e\n  \u003ch1\u003e\u003cstrong\u003eDjango Template\u003c/strong\u003e\u003c/h1\u003e\n\u003c/d\u003e\n\n## ⚙️ Installation\n\nClone the repository.\n\n```bash\ngit clone git@github.com:tyronejosee/template_django.git\n```\n\nCreate a virtual environment (Optional, only if you have Python installed).\n\n```bash\npython -m venv env\n```\n\nActivate the virtual environment (Optional, only if you have Python installed).\n\n```bash\nenv\\Scripts\\activate\n```\n\n\u003e Notes: `(env)` will appear in your terminal input.\n\nInstall all dependencies (Optional, only if you have Python installed).\n\n```bash\npip install -r requirements/local.txt\n```\n\nCreate a copy of the `.env.example` file and rename it to `.env`.\n\n```bash\ncp .env.example .env\n```\n\n**Update the values of the environment variables (Important).**\n\n\u003e Note: Make sure to correctly configure your variables before building the container.\n\n## 🐳 Docker\n\nBuild your container; it will take time the first time, as Docker needs to download all dependencies and build the image.\nUse the `-d` (detached mode) flag to start your containers in the background.\nUse the `--build` flag if you have changes and need to rebuild.\n\n```bash\ndocker compose up\ndocker compose up -d\ndocker compose up --build\n```\n\nStop the running containers (does not remove them).\n\n```bash\ndocker compose stop\n```\n\nStart previously created and stopped containers.\n\n```bash\ndocker compose start\n```\n\nShow container logs in real-time.\n\n```bash\ndocker compose logs -f\n```\n\nRestart a service with issues (Replace `\u003cservice_name\u003e`).\n\n```bash\ndocker compose restart \u003cservice_name\u003e\n```\n\nRemove your container.\n\n```bash\ndocker compose down\n```\n\n## 🐍 Django\n\nAccess the `web` service console that runs Django.\n\n```bash\ndocker compose exec web bash\n```\n\nInside the Django console, create the migrations.\n\n```bash\npython manage.py makemigrations\n```\n\nRun the migrations.\n\n```bash\npython manage.py migrate\n```\n\nIf you need to be more specific, use:\n\n```bash\npython manage.py migrate \u003capp_label\u003e \u003cmigration_name\u003e\n```\n\nList all available migrations and their status.\n\n```bash\npython manage.py showmigrations\n```\n\n\u003e Note: Manually create the migration if Django skips an app; this happens because Django did not find the `/migrations` folder.\n\nCreate a superuser to access the entire site without restrictions.\n\n```bash\npython manage.py createsuperuser\n```\n\nLog in to `admin`:\n\n```bash\nhttp://127.0.0.1:8000/admin/\n```\n\nAccess Swagger or Redoc.\n\n```bash\nhttp://127.0.0.1:8000/api/schema/swagger/\nhttp://127.0.0.1:8000/api/schema/redoc/\n```\n\n## 🚨 Important Notes\n\nCheck the creation of migrations before creating them.\n\n```bash\ndocker compose exec web python manage.py makemigrations users\n```\n\n\u003e Note: Checking migrations before their creation is necessary to avoid inconsistencies in user models.\n\n## 🐘 PostgreSQL\n\nAccess the PostgreSQL console.\n\n```bash\ndocker compose exec db psql -U postgres -d example_db\n```\n\nList all the tables in the database.\n\n```bash\n\\dt\n```\n\nShow the detailed structure of a specific table.\n\n```bash\n\\d \u003ctable_name\u003e\n```\n\nCreate a backup of your database (Optional).\n\n```bash\ndocker compose exec web python manage.py dumpdata \u003e backup.json\n```\n\nLoad the created backup if needed (Optional).\n\n```bash\ndocker compose exec web python manage.py loaddata\n```\n\n## ⚖️ License\n\nThis project is under the [Apache-2.0 license](https://github.com/tyronejosee/template_django/blob/main/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftyronejosee%2Ftemplate_django","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftyronejosee%2Ftemplate_django","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftyronejosee%2Ftemplate_django/lists"}