{"id":17247582,"url":"https://github.com/jcarbaugh/django-wellknown","last_synced_at":"2025-04-14T04:42:52.330Z","repository":{"id":66452046,"uuid":"370708","full_name":"jcarbaugh/django-wellknown","owner":"jcarbaugh","description":"Easy administration of /.well-known/ resources, robots.txt, and crossdomain.xml","archived":false,"fork":false,"pushed_at":"2012-11-02T17:04:00.000Z","size":123,"stargazers_count":12,"open_issues_count":3,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-27T18:50:15.276Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jcarbaugh.png","metadata":{"files":{"readme":"README.rst","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}},"created_at":"2009-11-12T20:34:57.000Z","updated_at":"2022-04-18T16:28:58.000Z","dependencies_parsed_at":"2023-02-20T04:45:38.625Z","dependency_job_id":null,"html_url":"https://github.com/jcarbaugh/django-wellknown","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcarbaugh%2Fdjango-wellknown","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcarbaugh%2Fdjango-wellknown/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcarbaugh%2Fdjango-wellknown/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcarbaugh%2Fdjango-wellknown/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jcarbaugh","download_url":"https://codeload.github.com/jcarbaugh/django-wellknown/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248824662,"owners_count":21167343,"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-10-15T06:38:22.773Z","updated_at":"2025-04-14T04:42:52.312Z","avatar_url":"https://github.com/jcarbaugh.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"================\ndjango-wellknown\n================\n\nDjango application to provide easy administration of site-meta URIs. Includes robots.txt and crossdomain.xml.\n\nhttp://tools.ietf.org/html/draft-nottingham-site-meta-03\nhttp://tools.ietf.org/html/draft-hammer-hostmeta-04\n\nRequirements\n============\n\npython \u003e= 2.5\n\ndjango \u003e= 1.0\n\ndjango-robots (optional)\n\npython-xrd\n\niso8601\n\nInstallation\n============\n\nBe sure to add ``wellknown`` to ``INSTALLED_APPS`` in settings.py. Additionally, add the following entry to urls.py::\n\n\turls(r'^', include('wellknown.urls')),\n\nRun ``./manage.py syncdb``\n\nUsage\n=====\n\nRegister resources\n------------------\n\n::\n\n\timport wellknown\n\twellknown.register('host-meta', ...)\n\nThe first argument is the path that will be exposed for the resource. A path of ``host-meta`` will map to::\n\n\thttp://example.com/.well-known/host-meta\n\nAt least one of the following arguments is required:\n\n* ``content``: a string or unicode representation of the resource, cached on startup\n* ``template``: the path to a template that will be rendered for the resource, rendered and cached on startup\n* ``handler``: a handler method that will be used to render the resource, invoked on each request\n\nHandler methods must have the following signature and return a string or unicode object::\n\n\tdef handler(request, *args, **kwargs):\n\t\tpass\n\nThe register method takes one optional parameter, ``content_type``. This is the content type that will be used to return the rendered resource. The following rules are used to determine the content_type to use:\n\n#. if a content_type parameter was passed to register, use it\n#. attempt to infer content_type from the path using the mimetypes package\n#. use ``text/plain`` if no content_type can be guessed\n\nModel resources\n---------------\n\nResources may be stored in the database to make it easy for non-technical users to edit. The following fields are available on a Resource:\n\n* ``path``: the path that maps to the resource\n* ``content``: the content that will be served when the resource is requested\n* ``content_type``: the content_type with which the content will be returned, defaults to ``text/plain``\n\nWhen a resource is saved, it is updated in the cache.\n\nhost-meta\n---------\n\nA default ``host-meta`` file is automatically handled by wellknown. To register an entry in ``host-meta``::\n\n\twellknown.hostmeta.links.append(Link(rel=..., ...))\n\nRefer to the python-xrd documentation for instructions on creating XRD Link elements.\n\nThe ``Host`` element of ``host-meta`` is inferred from the domain of the current Django Site object. To override the hosts, edit settings.py::\n\n\tWELLKNOWN_HOSTMETA_SITES = ('example.com', 'www.example.com')\n\ndjango-robots\n-------------\n\nwellknown will defer to `django-robots \u003chttp://bitbucket.org/jezdez/django-robots/\u003e`_ if it is installed. To use django-robots to render robots.txt, add ``robots`` to ``INSTALLED_APPS`` in settings.py and wellknown will take care of the rest.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjcarbaugh%2Fdjango-wellknown","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjcarbaugh%2Fdjango-wellknown","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjcarbaugh%2Fdjango-wellknown/lists"}