How to fix deferral warning in Django 1.9

I am a new user of the Django Framework. I am currently creating a REST API with django_rest_framework. When I start my server, I get obsolete warnings that I don’t know how to fix.

RemovedInDjango110Warning: 'get_all_related_objects is an unofficial API that is deprecated. You can replace it with "get_fields ()" for the relationship in opts.get_all_related_objects ()

The above is the first of them. Does anyone know how to fix this problem. All I have in my API per minute are standard calls using the built-in ModelViewSet, and I also overwrite the default authentication system and user system myself, so I have no idea why I get these warnings since I used Django 1.9 from the start.

I also got this:

RemovedInDjango110Warning: render () needs to be called using a dict, not a RequestContext

From my initial research, this is related to patterns. I do not use any templates, so I do not know why this is happening.

Can someone help me fix these issues?

+4
2

"" , , . , , . , , . - , , .

, Django 1.10, .

+3

, - , , :

RemovedInDjango110Warning: render() dict, RequestContext

Django:

def render(self, context=None, request=None):
    # A deprecation path is required here to cover the following usage:
    # >>> from django.template import Context
    # >>> from django.template.loader import get_template
    # >>> template = get_template('hello.html')
    # >>> template.render(Context({'name': 'world'}))
    # In Django 1.7 get_template() returned a django.template.Template.
    # In Django 1.8 it returns a django.template.backends.django.Template.
    # In Django 1.10 the isinstance checks should be removed. If passing a
    # Context or a RequestContext works by accident, it won't be an issue
    # per se, but it won't be officially supported either.

, RequestContext Context render() .

v1.9, , . Django, . , 1.9 .

+6

Source: https://habr.com/ru/post/1625902/


All Articles