{"id":46654805,"url":"https://github.com/diploi/component-django","last_synced_at":"2026-03-08T07:31:44.746Z","repository":{"id":286092588,"uuid":"952425264","full_name":"diploi/component-django","owner":"diploi","description":"Official Diploi component for Django","archived":false,"fork":false,"pushed_at":"2025-12-18T08:39:56.000Z","size":92,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2026-01-30T02:17:00.550Z","etag":null,"topics":["backend","component","deployable","diploi","django","docker","framework","fullstack","orm","python","starter-kit"],"latest_commit_sha":null,"homepage":"https://diploi.com/component/django","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/diploi.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-03-21T09:02:46.000Z","updated_at":"2025-12-18T08:39:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"10ba5c58-677c-4596-b46e-9f36666ee976","html_url":"https://github.com/diploi/component-django","commit_stats":null,"previous_names":["diploi/component-django"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/diploi/component-django","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diploi%2Fcomponent-django","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diploi%2Fcomponent-django/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diploi%2Fcomponent-django/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diploi%2Fcomponent-django/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/diploi","download_url":"https://codeload.github.com/diploi/component-django/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diploi%2Fcomponent-django/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30248865,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-08T05:41:50.788Z","status":"ssl_error","status_checked_at":"2026-03-08T05:41:39.075Z","response_time":56,"last_error":"SSL_read: 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":["backend","component","deployable","diploi","django","docker","framework","fullstack","orm","python","starter-kit"],"created_at":"2026-03-08T07:31:44.304Z","updated_at":"2026-03-08T07:31:44.741Z","avatar_url":"https://github.com/diploi.png","language":"Python","readme":"\u003cimg alt=\"icon\" src=\".diploi/icon.svg\" width=\"32\"\u003e\n\n# Django Component for Diploi\n\n[![launch with diploi badge](https://diploi.com/launch.svg)](https://diploi.com/component/django)\n[![component on diploi badge](https://diploi.com/component.svg)](https://diploi.com/component/django)\n[![latest tag badge](https://badgen.net/github/tag/diploi/component-django)](https://diploi.com/component/django)\n\nStart a demo, no card required\nhttps://diploi.com/component/django\n\nGetting started guide\nhttps://diploi.com/blog/hosting_django_apps\n\nA generic Django component ready to build your Django app.\n\nThis component was kickstarted running\n`django-admin startproject djangoapp`\nand it has `DEBUG=true` inside **settings.py** by default\n\n**To secure your Django app,** you must **update your SECRET_KEY in settings.py**\n\nBy default all Django apps use SQlite, which you must update to use your database of choice inside **settings.py**\n\nUses the official [astral-sh/uv:3.13-alpine](https://github.com/astral-sh/uv/pkgs/container/uv) Docker image and Django\n\n#### IMPORTANT\n- You must generate a new SECRET_KEY for your own application\n- Remember to update the database settings inside **settings.py** to match your own database config\n- In production you must remember to update your **settings.py**, by changing `DEBUG=false` and if you want to use external CDNs for your static files, you will need to update the `STATIC_ROOT`\n- For production and development, you are free to change the app server runner, so for example, if you prefer `uwsgi` you can change it directly on the Dockerfile for production and development\n- To install new packages, this component uses `uv`, so you can add new packages using `uv add \u003cname-of-package\u003e`\n\n## Operation\n\n### Getting started\n\n1. In the Dashboard, click **Create Project +**\n2. Under **Pick Components**, choose **Django**\n3. In **Pick Add-ons**, you can add one or multiple databases to your app\n4. Choose **Create Repository**, which will generate a new GitHub repo\n5. Now click **Launch Stack**\n\n### Development\n\nWill run\n`uv sync`\nwhen component is first initialized, and `uv run --isolated python3 manage.py runserver 0.0.0.0:8000` when deployment is started.\n\n### Production\n\nWill build a production ready image. The first step runs the command:\n`uv sync --locked --no-dev --group deploy`\nWhich installs **gunicorn**, as part of `--group=deploy` in `pyproject.toml`, to install all necessary dependencies for production.\n\nTo get all static files, the image runs the command:\n`uv run --locked --no-dev python manage.py collectstatic --noinput` to get all static files.\n\nLastly, the image will start the production server with the command:\n`uv run gunicorn djangoapp.wsgi:application --bind 0.0.0.0:8000 --workers 3 --log-level info`\n\n### Common tasks (using uv)\n\n- Create a superuser  \n  `uv run python manage.py createsuperuser`\n\n- Run migrations  \n  `uv run python manage.py migrate`\n\n- Switch the database to Postgres instead of SQLite  \n  1. Install the Postgres driver (already present in `pyproject.toml`, but if missing run `uv add \"psycopg2-binary\"`).  \n  2. In `djangoapp/settings.py`, set `DATABASES[\"default\"]` to read from `DATABASE_URL` (e.g. using `env.dj_db_url` if `environs[django]` is installed). A typical value:  \n     `postgres://postgres:postgres@postgres.postgres:5432/app`  \n  3. Export `DATABASE_URL` in your environment (or add to `.env`), then run `uv run python manage.py migrate`.\n\n- Adjust CSRF trusted origins  \n  In `djangoapp/settings.py`, the list comes from `CSRF_TRUSTED_ORIGINS` env var. Add hosts as a comma-separated list, e.g.:  \n  `export CSRF_TRUSTED_ORIGINS=\"https://example.com,https://admin.example.com\"`  \n  After updating, restart the app so Django picks up the new origins.\n\n## Links\n\n- [Adding Django to a project](https://docs.diploi.com/building/components/django)\n- [Django for production](https://docs.djangoproject.com/en/5.2/howto/deployment/checklist/)\n- [Django static files](https://docs.djangoproject.com/en/5.2/howto/static-files/)\n- [SECRET_KEY in Django](https://docs.djangoproject.com/en/5.2/ref/settings/#std-setting-SECRET_KEY)\n- [Databases in Django](https://docs.djangoproject.com/en/5.2/ref/databases/)\n- [Working with multiple databases in Django](https://docs.djangoproject.com/en/5.2/topics/db/multi-db/)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiploi%2Fcomponent-django","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdiploi%2Fcomponent-django","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiploi%2Fcomponent-django/lists"}