{"id":22916822,"url":"https://github.com/chanmo/django-settings","last_synced_at":"2025-04-01T12:44:40.288Z","repository":{"id":78745269,"uuid":"496845044","full_name":"ChanMo/django-settings","owner":"ChanMo","description":"用户可编辑的站点配置","archived":false,"fork":false,"pushed_at":"2022-09-14T09:38:10.000Z","size":6,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-05T17:49:12.130Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/ChanMo.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-05-27T03:09:22.000Z","updated_at":"2023-03-03T06:27:53.000Z","dependencies_parsed_at":"2023-07-16T22:02:03.518Z","dependency_job_id":null,"html_url":"https://github.com/ChanMo/django-settings","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChanMo%2Fdjango-settings","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChanMo%2Fdjango-settings/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChanMo%2Fdjango-settings/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChanMo%2Fdjango-settings/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ChanMo","download_url":"https://codeload.github.com/ChanMo/django-settings/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246642190,"owners_count":20810559,"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":[],"created_at":"2024-12-14T06:14:45.936Z","updated_at":"2025-04-01T12:44:40.283Z","avatar_url":"https://github.com/ChanMo.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 站点设置\n\n为django提供后台可编辑的配置方案, 同时也方便request调用\n\n## Quick Start\n\n修改`settings.py`\n\n```\nINSTALLED_APPS = [\n    ...\n    'django.contrib.sites',    \n    'settings',\n    ...\n]\n\nSITE_ID = 1\n```\n\n更新数据库\n\n```\n$ ./manage.py makemigrations\n$ ./manage.py migrate\n```\n\n在views中使用\n\n```\ndef index(request):\n    settings = request.site.setting\n```\n\n在templates中使用\n\n```\n\u003cimg src=\"{{request.site.setting.logo.url}}\" alt=\"logo\" /\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchanmo%2Fdjango-settings","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchanmo%2Fdjango-settings","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchanmo%2Fdjango-settings/lists"}