Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
revised language and approach to import the system check
Adds a rest framework app config.
  • Loading branch information
matteius committed Sep 25, 2017
commit 7a0a5c38b31901ef58c4790e59e3190b1d70c730
3 changes: 2 additions & 1 deletion rest_framework/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
| |\ \| |___/\__/ / | | | | | | | (_| | | | | | | __/\ V V / (_) | | | <
\_| \_\____/\____/ \_/ |_| |_| \__,_|_| |_| |_|\___| \_/\_/ \___/|_| |_|\_|
"""
from .checks import * # NOQA

__title__ = 'Django REST framework'
__version__ = '3.6.3'
Expand All @@ -22,3 +21,5 @@

# Default datetime input and output formats
ISO_8601 = 'iso-8601'

default_app_config = 'rest_framework.apps.RestFrameworkConfig'
10 changes: 10 additions & 0 deletions rest_framework/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from django.apps import AppConfig


class RestFrameworkConfig(AppConfig):
name = 'rest_framework'
verbose_name = "Django REST framework"

def ready(self):
# Add System checks
from .checks import pagination_system_check # NOQA
10 changes: 4 additions & 6 deletions rest_framework/checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@ def pagination_system_check(app_configs, **kwargs):
if api_settings.PAGE_SIZE and not api_settings.DEFAULT_PAGINATION_CLASS:
errors.append(
Warning(
"You have specified a default `PAGE_SIZE` pagination rest_framework setting,"
"without specifying also a `DEFAULT_PAGINATION_CLASS`.",
hint="The prior version of rest_framework defaulted this setting to "
"`PageNumberPagination` however pagination defaults to disabled now. "
"Consider specifying `DEFAULT_PAGINATION_CLASS` explicitly for your project, "
"unless you specify individual pagination_class values on specific view classes.",
"You have specified a default PAGE_SIZE pagination rest_framework setting,"
"without specifying also a DEFAULT_PAGINATION_CLASS.",
hint="The default for DEFAULT_PAGINATION_CLASS is None. "
"In previous versions this was PageNumberPagination",
)
)
return errors