Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

进rest_framework后台 #19

Open
sfPPP opened this issue May 5, 2018 · 0 comments
Open

进rest_framework后台 #19

sfPPP opened this issue May 5, 2018 · 0 comments

Comments

@sfPPP
Copy link
Owner

sfPPP commented May 5, 2018

image
这里面只能看 api的,看不到views的
url.py里面加一条
url(r'^api-auth/', include('rest_framework.urls')),
然后在rest_framework配置的地方settings.py里面
DEFAULT_RENDERER_CLASSES,如果该字段值为rest_framework.renderers.JSONRenderer
则注释掉

REST_FRAMEWORK = {
    'DEFAULT_AUTHENTICATION_CLASSES': (
        'rest_framework.authentication.SessionAuthentication',
    ),

    'DEFAULT_PERMISSION_CLASSES': [
        'rest_framework.permissions.IsAuthenticated',
    ],

    # 'DEFAULT_RENDERER_CLASSES': (
    #     'rest_framework.renderers.JSONRenderer',
    # ),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant