本文介绍了错误:没有名为“ django.core.urlresolvers”的模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Django REST Framework创建Web服务。在运行服务器时,当我尝试访问管理页面时,出现以下错误:

I am trying to create web services using the Django REST Framework. While running the server, when I try to access the admin page, I get the following error:

Invalid template library specified.
ImportError raised when trying to load
'rest_framework.templatetags.rest_framework': No module named 'django.core.urlresolvers'

注意:我已经在设置中添加了 rest_framework

Note: I have added the rest_framework in the settings.

推荐答案

使用此功能。

from django.urls import reverse

Django 1.10已弃用模块 django.core.urlresolvers 。请使用上述导入功能来解决您的问题。

Django 1.10 the module django.core.urlresolvers deprecated. Please use above import which solve your issue.

这篇关于错误:没有名为“ django.core.urlresolvers”的模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-18 17:59