mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-22 05:04:48 +03:00
Rename 'master' branch to 'main' (#9761)
This commit is contained in:
parent
513ddb4ffb
commit
0d0be8467d
2
.github/workflows/main.yml
vendored
2
.github/workflows/main.yml
vendored
|
@ -3,7 +3,7 @@ name: CI
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- main
|
||||||
pull_request:
|
pull_request:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
2
.github/workflows/mkdocs-deploy.yml
vendored
2
.github/workflows/mkdocs-deploy.yml
vendored
|
@ -3,7 +3,7 @@ name: mkdocs
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- main
|
||||||
paths:
|
paths:
|
||||||
- docs/**
|
- docs/**
|
||||||
- docs_theme/**
|
- docs_theme/**
|
||||||
|
|
2
.github/workflows/pre-commit.yml
vendored
2
.github/workflows/pre-commit.yml
vendored
|
@ -3,7 +3,7 @@ name: pre-commit
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- main
|
||||||
pull_request:
|
pull_request:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
24
README.md
24
README.md
|
@ -179,8 +179,8 @@ Please see the [security policy][security-policy].
|
||||||
|
|
||||||
[build-status-image]: https://github.com/encode/django-rest-framework/actions/workflows/main.yml/badge.svg
|
[build-status-image]: https://github.com/encode/django-rest-framework/actions/workflows/main.yml/badge.svg
|
||||||
[build-status]: https://github.com/encode/django-rest-framework/actions/workflows/main.yml
|
[build-status]: https://github.com/encode/django-rest-framework/actions/workflows/main.yml
|
||||||
[coverage-status-image]: https://img.shields.io/codecov/c/github/encode/django-rest-framework/master.svg
|
[coverage-status-image]: https://img.shields.io/codecov/c/github/encode/django-rest-framework/main.svg
|
||||||
[codecov]: https://codecov.io/github/encode/django-rest-framework?branch=master
|
[codecov]: https://codecov.io/github/encode/django-rest-framework?branch=main
|
||||||
[pypi-version]: https://img.shields.io/pypi/v/djangorestframework.svg
|
[pypi-version]: https://img.shields.io/pypi/v/djangorestframework.svg
|
||||||
[pypi]: https://pypi.org/project/djangorestframework/
|
[pypi]: https://pypi.org/project/djangorestframework/
|
||||||
[group]: https://groups.google.com/forum/?fromgroups#!forum/django-rest-framework
|
[group]: https://groups.google.com/forum/?fromgroups#!forum/django-rest-framework
|
||||||
|
@ -188,16 +188,16 @@ Please see the [security policy][security-policy].
|
||||||
[funding]: https://fund.django-rest-framework.org/topics/funding/
|
[funding]: https://fund.django-rest-framework.org/topics/funding/
|
||||||
[sponsors]: https://fund.django-rest-framework.org/topics/funding/#our-sponsors
|
[sponsors]: https://fund.django-rest-framework.org/topics/funding/#our-sponsors
|
||||||
|
|
||||||
[sentry-img]: https://raw.githubusercontent.com/encode/django-rest-framework/master/docs/img/premium/sentry-readme.png
|
[sentry-img]: https://raw.githubusercontent.com/encode/django-rest-framework/main/docs/img/premium/sentry-readme.png
|
||||||
[stream-img]: https://raw.githubusercontent.com/encode/django-rest-framework/master/docs/img/premium/stream-readme.png
|
[stream-img]: https://raw.githubusercontent.com/encode/django-rest-framework/main/docs/img/premium/stream-readme.png
|
||||||
[spacinov-img]: https://raw.githubusercontent.com/encode/django-rest-framework/master/docs/img/premium/spacinov-readme.png
|
[spacinov-img]: https://raw.githubusercontent.com/encode/django-rest-framework/main/docs/img/premium/spacinov-readme.png
|
||||||
[retool-img]: https://raw.githubusercontent.com/encode/django-rest-framework/master/docs/img/premium/retool-readme.png
|
[retool-img]: https://raw.githubusercontent.com/encode/django-rest-framework/main/docs/img/premium/retool-readme.png
|
||||||
[bitio-img]: https://raw.githubusercontent.com/encode/django-rest-framework/master/docs/img/premium/bitio-readme.png
|
[bitio-img]: https://raw.githubusercontent.com/encode/django-rest-framework/main/docs/img/premium/bitio-readme.png
|
||||||
[posthog-img]: https://raw.githubusercontent.com/encode/django-rest-framework/master/docs/img/premium/posthog-readme.png
|
[posthog-img]: https://raw.githubusercontent.com/encode/django-rest-framework/main/docs/img/premium/posthog-readme.png
|
||||||
[cryptapi-img]: https://raw.githubusercontent.com/encode/django-rest-framework/master/docs/img/premium/cryptapi-readme.png
|
[cryptapi-img]: https://raw.githubusercontent.com/encode/django-rest-framework/main/docs/img/premium/cryptapi-readme.png
|
||||||
[fezto-img]: https://raw.githubusercontent.com/encode/django-rest-framework/master/docs/img/premium/fezto-readme.png
|
[fezto-img]: https://raw.githubusercontent.com/encode/django-rest-framework/main/docs/img/premium/fezto-readme.png
|
||||||
[svix-img]: https://raw.githubusercontent.com/encode/django-rest-framework/master/docs/img/premium/svix-premium.png
|
[svix-img]: https://raw.githubusercontent.com/encode/django-rest-framework/main/docs/img/premium/svix-premium.png
|
||||||
[zuplo-img]: https://raw.githubusercontent.com/encode/django-rest-framework/master/docs/img/premium/zuplo-readme.png
|
[zuplo-img]: https://raw.githubusercontent.com/encode/django-rest-framework/main/docs/img/premium/zuplo-readme.png
|
||||||
|
|
||||||
[sentry-url]: https://getsentry.com/welcome/
|
[sentry-url]: https://getsentry.com/welcome/
|
||||||
[stream-url]: https://getstream.io/?utm_source=DjangoRESTFramework&utm_medium=Webpage_Logo_Ad&utm_content=Developer&utm_campaign=DjangoRESTFramework_Jan2022_HomePage
|
[stream-url]: https://getstream.io/?utm_source=DjangoRESTFramework&utm_medium=Webpage_Logo_Ad&utm_content=Developer&utm_campaign=DjangoRESTFramework_Jan2022_HomePage
|
||||||
|
|
|
@ -453,12 +453,12 @@ create a base `AutoSchema` subclass for your project that takes additional
|
||||||
|
|
||||||
[cite]: https://www.heroku.com/blog/json_schema_for_heroku_platform_api/
|
[cite]: https://www.heroku.com/blog/json_schema_for_heroku_platform_api/
|
||||||
[openapi]: https://github.com/OAI/OpenAPI-Specification
|
[openapi]: https://github.com/OAI/OpenAPI-Specification
|
||||||
[openapi-specification-extensions]: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#specification-extensions
|
[openapi-specification-extensions]: https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#specification-extensions
|
||||||
[openapi-operation]: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#operationObject
|
[openapi-operation]: https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#operationObject
|
||||||
[openapi-tags]: https://swagger.io/specification/#tagObject
|
[openapi-tags]: https://swagger.io/specification/#tagObject
|
||||||
[openapi-operationid]: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#fixed-fields-17
|
[openapi-operationid]: https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#fixed-fields-17
|
||||||
[openapi-components]: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#componentsObject
|
[openapi-components]: https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#componentsObject
|
||||||
[openapi-reference]: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#referenceObject
|
[openapi-reference]: https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#referenceObject
|
||||||
[openapi-generator]: https://github.com/OpenAPITools/openapi-generator
|
[openapi-generator]: https://github.com/OpenAPITools/openapi-generator
|
||||||
[swagger-codegen]: https://github.com/swagger-api/swagger-codegen
|
[swagger-codegen]: https://github.com/swagger-api/swagger-codegen
|
||||||
[info-object]: https://swagger.io/specification/#infoObject
|
[info-object]: https://swagger.io/specification/#infoObject
|
||||||
|
|
|
@ -417,5 +417,5 @@ For example, to add support for using `format='html'` in test requests, you migh
|
||||||
[requestfactory]: https://docs.djangoproject.com/en/stable/topics/testing/advanced/#django.test.client.RequestFactory
|
[requestfactory]: https://docs.djangoproject.com/en/stable/topics/testing/advanced/#django.test.client.RequestFactory
|
||||||
[configuration]: #configuration
|
[configuration]: #configuration
|
||||||
[refresh_from_db_docs]: https://docs.djangoproject.com/en/stable/ref/models/instances/#django.db.models.Model.refresh_from_db
|
[refresh_from_db_docs]: https://docs.djangoproject.com/en/stable/ref/models/instances/#django.db.models.Model.refresh_from_db
|
||||||
[session_objects]: https://requests.readthedocs.io/en/master/user/advanced/#session-objects
|
[session_objects]: https://requests.readthedocs.io/en/latest/user/advanced/#session-objects
|
||||||
[provided_test_case_classes]: https://docs.djangoproject.com/en/stable/topics/testing/tools/#provided-test-case-classes
|
[provided_test_case_classes]: https://docs.djangoproject.com/en/stable/topics/testing/tools/#provided-test-case-classes
|
||||||
|
|
|
@ -961,5 +961,5 @@ You can follow development on the GitHub site, where we use [milestones to indic
|
||||||
|
|
||||||
[kickstarter]: https://www.kickstarter.com/projects/tomchristie/django-rest-framework-3
|
[kickstarter]: https://www.kickstarter.com/projects/tomchristie/django-rest-framework-3
|
||||||
[sponsors]: https://www.django-rest-framework.org/community/kickstarter-announcement/#sponsors
|
[sponsors]: https://www.django-rest-framework.org/community/kickstarter-announcement/#sponsors
|
||||||
[mixins.py]: https://github.com/encode/django-rest-framework/blob/master/rest_framework/mixins.py
|
[mixins.py]: https://github.com/encode/django-rest-framework/blob/main/rest_framework/mixins.py
|
||||||
[django-localization]: https://docs.djangoproject.com/en/stable/topics/i18n/translation/#localization-how-to-create-language-files
|
[django-localization]: https://docs.djangoproject.com/en/stable/topics/i18n/translation/#localization-how-to-create-language-files
|
||||||
|
|
|
@ -209,7 +209,7 @@ If you want to draw attention to a note or warning, use a pair of enclosing line
|
||||||
[pull-requests]: https://help.github.com/articles/using-pull-requests
|
[pull-requests]: https://help.github.com/articles/using-pull-requests
|
||||||
[tox]: https://tox.readthedocs.io/en/latest/
|
[tox]: https://tox.readthedocs.io/en/latest/
|
||||||
[markdown]: https://daringfireball.net/projects/markdown/basics
|
[markdown]: https://daringfireball.net/projects/markdown/basics
|
||||||
[docs]: https://github.com/encode/django-rest-framework/tree/master/docs
|
[docs]: https://github.com/encode/django-rest-framework/tree/main/docs
|
||||||
[mou]: http://mouapp.com/
|
[mou]: http://mouapp.com/
|
||||||
[repo]: https://github.com/encode/django-rest-framework
|
[repo]: https://github.com/encode/django-rest-framework
|
||||||
[how-to-fork]: https://help.github.com/articles/fork-a-repo/
|
[how-to-fork]: https://help.github.com/articles/fork-a-repo/
|
||||||
|
|
|
@ -31,7 +31,7 @@ Team members have the following responsibilities.
|
||||||
|
|
||||||
Further notes for maintainers:
|
Further notes for maintainers:
|
||||||
|
|
||||||
* Code changes should come in the form of a pull request - do not push directly to master.
|
* Code changes should come in the form of a pull request - do not push directly to main.
|
||||||
* Maintainers should typically not merge their own pull requests.
|
* Maintainers should typically not merge their own pull requests.
|
||||||
* Each issue/pull request should have exactly one label once triaged.
|
* Each issue/pull request should have exactly one label once triaged.
|
||||||
* Search for un-triaged issues with [is:open no:label][un-triaged].
|
* Search for un-triaged issues with [is:open no:label][un-triaged].
|
||||||
|
@ -58,14 +58,14 @@ The following template should be used for the description of the issue, and serv
|
||||||
|
|
||||||
Checklist:
|
Checklist:
|
||||||
|
|
||||||
- [ ] Create pull request for [release notes](https://github.com/encode/django-rest-framework/blob/master/docs/topics/release-notes.md) based on the [*.*.* milestone](https://github.com/encode/django-rest-framework/milestones/***).
|
- [ ] Create pull request for [release notes](https://github.com/encode/django-rest-framework/blob/mains/docs/topics/release-notes.md) based on the [*.*.* milestone](https://github.com/encode/django-rest-framework/milestones/***).
|
||||||
- [ ] Update supported versions:
|
- [ ] Update supported versions:
|
||||||
- [ ] `setup.py` `python_requires` list
|
- [ ] `setup.py` `python_requires` list
|
||||||
- [ ] `setup.py` Python & Django version trove classifiers
|
- [ ] `setup.py` Python & Django version trove classifiers
|
||||||
- [ ] `README` Python & Django versions
|
- [ ] `README` Python & Django versions
|
||||||
- [ ] `docs` Python & Django versions
|
- [ ] `docs` Python & Django versions
|
||||||
- [ ] Update the translations from [transifex](https://www.django-rest-framework.org/topics/project-management/#translations).
|
- [ ] Update the translations from [transifex](https://www.django-rest-framework.org/topics/project-management/#translations).
|
||||||
- [ ] Ensure the pull request increments the version to `*.*.*` in [`restframework/__init__.py`](https://github.com/encode/django-rest-framework/blob/master/rest_framework/__init__.py).
|
- [ ] Ensure the pull request increments the version to `*.*.*` in [`restframework/__init__.py`](https://github.com/encode/django-rest-framework/blob/main/rest_framework/__init__.py).
|
||||||
- [ ] Ensure documentation validates
|
- [ ] Ensure documentation validates
|
||||||
- Build and serve docs `mkdocs serve`
|
- Build and serve docs `mkdocs serve`
|
||||||
- Validate links `pylinkvalidate.py -P http://127.0.0.1:8000`
|
- Validate links `pylinkvalidate.py -P http://127.0.0.1:8000`
|
||||||
|
|
|
@ -173,7 +173,7 @@ To submit new content, [create a pull request][drf-create-pr].
|
||||||
[pypi-register]: https://pypi.org/account/register/
|
[pypi-register]: https://pypi.org/account/register/
|
||||||
[semver]: https://semver.org/
|
[semver]: https://semver.org/
|
||||||
[tox-docs]: https://tox.readthedocs.io/en/latest/
|
[tox-docs]: https://tox.readthedocs.io/en/latest/
|
||||||
[drf-compat]: https://github.com/encode/django-rest-framework/blob/master/rest_framework/compat.py
|
[drf-compat]: https://github.com/encode/django-rest-framework/blob/main/rest_framework/compat.py
|
||||||
[rest-framework-grid]: https://www.djangopackages.com/grids/g/django-rest-framework/
|
[rest-framework-grid]: https://www.djangopackages.com/grids/g/django-rest-framework/
|
||||||
[drf-create-pr]: https://github.com/encode/django-rest-framework/compare
|
[drf-create-pr]: https://github.com/encode/django-rest-framework/compare
|
||||||
[authentication]: ../api-guide/authentication.md
|
[authentication]: ../api-guide/authentication.md
|
||||||
|
|
|
@ -106,7 +106,7 @@ For API clients the most appropriate of these will typically be to use the `Acce
|
||||||
[django-translation]: https://docs.djangoproject.com/en/stable/topics/i18n/translation
|
[django-translation]: https://docs.djangoproject.com/en/stable/topics/i18n/translation
|
||||||
[custom-exception-handler]: ../api-guide/exceptions.md#custom-exception-handling
|
[custom-exception-handler]: ../api-guide/exceptions.md#custom-exception-handling
|
||||||
[transifex-project]: https://explore.transifex.com/django-rest-framework-1/django-rest-framework/
|
[transifex-project]: https://explore.transifex.com/django-rest-framework-1/django-rest-framework/
|
||||||
[django-po-source]: https://raw.githubusercontent.com/encode/django-rest-framework/master/rest_framework/locale/en_US/LC_MESSAGES/django.po
|
[django-po-source]: https://raw.githubusercontent.com/encode/django-rest-framework/main/rest_framework/locale/en_US/LC_MESSAGES/django.po
|
||||||
[django-language-preference]: https://docs.djangoproject.com/en/stable/topics/i18n/translation/#how-django-discovers-language-preference
|
[django-language-preference]: https://docs.djangoproject.com/en/stable/topics/i18n/translation/#how-django-discovers-language-preference
|
||||||
[django-locale-paths]: https://docs.djangoproject.com/en/stable/ref/settings/#std:setting-LOCALE_PATHS
|
[django-locale-paths]: https://docs.djangoproject.com/en/stable/ref/settings/#std:setting-LOCALE_PATHS
|
||||||
[django-locale-name]: https://docs.djangoproject.com/en/stable/topics/i18n/#term-locale-name
|
[django-locale-name]: https://docs.djangoproject.com/en/stable/topics/i18n/#term-locale-name
|
||||||
|
|
|
@ -110,7 +110,7 @@
|
||||||
{% block content %}
|
{% block content %}
|
||||||
{% if page.meta.source %}
|
{% if page.meta.source %}
|
||||||
{% for filename in page.meta.source %}
|
{% for filename in page.meta.source %}
|
||||||
<a class="github" href="https://github.com/encode/django-rest-framework/tree/master/rest_framework/{{ filename }}">
|
<a class="github" href="https://github.com/encode/django-rest-framework/tree/main/rest_framework/{{ filename }}">
|
||||||
<span class="label label-info">{{ filename }}</span>
|
<span class="label label-info">{{ filename }}</span>
|
||||||
</a>
|
</a>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<div class="navbar navbar-inverse navbar-fixed-top">
|
<div class="navbar navbar-inverse navbar-fixed-top">
|
||||||
<div class="navbar-inner">
|
<div class="navbar-inner">
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<a class="repo-link btn btn-primary btn-small" href="https://github.com/encode/django-rest-framework/tree/master">GitHub</a>
|
<a class="repo-link btn btn-primary btn-small" href="https://github.com/encode/django-rest-framework">GitHub</a>
|
||||||
<a class="repo-link btn btn-inverse btn-small {% if not page.next_page %}disabled{% endif %}" rel="next" {% if page.next_page %}href="{{ page.next_page.url|url }}"{% endif %}>
|
<a class="repo-link btn btn-inverse btn-small {% if not page.next_page %}disabled{% endif %}" rel="next" {% if page.next_page %}href="{{ page.next_page.url|url }}"{% endif %}>
|
||||||
Next <i class="icon-arrow-right icon-white"></i>
|
Next <i class="icon-arrow-right icon-white"></i>
|
||||||
</a>
|
</a>
|
||||||
|
|
|
@ -428,7 +428,7 @@ class AutoSchema(ViewInspector):
|
||||||
}
|
}
|
||||||
|
|
||||||
# "Formats such as "email", "uuid", and so on, MAY be used even though undefined by this specification."
|
# "Formats such as "email", "uuid", and so on, MAY be used even though undefined by this specification."
|
||||||
# see: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#data-types
|
# see: https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#data-types
|
||||||
# see also: https://swagger.io/docs/specification/data-models/data-types/#string
|
# see also: https://swagger.io/docs/specification/data-models/data-types/#string
|
||||||
if isinstance(field, serializers.EmailField):
|
if isinstance(field, serializers.EmailField):
|
||||||
return {
|
return {
|
||||||
|
@ -555,7 +555,7 @@ class AutoSchema(ViewInspector):
|
||||||
"""
|
"""
|
||||||
for v in field.validators:
|
for v in field.validators:
|
||||||
# "Formats such as "email", "uuid", and so on, MAY be used even though undefined by this specification."
|
# "Formats such as "email", "uuid", and so on, MAY be used even though undefined by this specification."
|
||||||
# https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#data-types
|
# https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#data-types
|
||||||
if isinstance(v, EmailValidator):
|
if isinstance(v, EmailValidator):
|
||||||
schema['format'] = 'email'
|
schema['format'] = 'email'
|
||||||
if isinstance(v, URLValidator):
|
if isinstance(v, URLValidator):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user