简介:今天,首席CTO Note将与您分享哪个Django对应于Python3.6。如果您可以解决您现在面临的问题,请不要忘记注意此网站。让我们现在开始!
描述错误
python == 3.5
django == 1.7
Django的创建项目是错误的,如下所示:
Trackback(最近的最新电话):
文件“/root/envs/django-test/bin/django-add”,第11行,在模块中
sys.exit(execute_from_command_line()))
文件“/root/envs/django-test/lib/python3.5/site-packages/django/core/core/management/_init__.py”,第385行,在execute_from_line_line中
utility.execute()
文件“/root/envs/django-test/lib/python3.5/site-packages/django/core/core/management/_init__.py”,第354行,在Execute中
django.setup()
文件“/root/envs/django-test/lib/python3.5/site-packages/django/__init_.py”,第18行,在设置中
来自django.utils.log导入configure_logging
文件“/root/envs/django-test/lib/python3.5/site-packages/django/utils/log.py”,第10行,在模块中
来自django.views.debug import exceptionreporter,get_exception_reporter_filter
文件“/root/envs/django-test/lib/python3.5/site-packages/django/views/debug.py”,第10行,在模块中
来自django.http import(httpresponse,httpresponseservererror,
文件“/root/envs/django-test/lib/python3.5/site-packages/django/http/__init__.py”,第4行,在模块中
来自django.http.Response导入(httpresponse,streamhttpresponse,
文件13,第13行
来自django.core.serializers.json导入djangojsonenncoder
文件“/root/envs/django-test/lib/python3.5/site-packages/django/core/core/serializers/__init__.py”,第23行,在模块中
来自django.core.core.serializers.base Import Seriesnotexist
文件6,第6行
来自django.db导入模型
文件“/root/envs/django-test/lib/python3.5/site-packages/django/django/db/models/_init__.py”,第6行,在模块中
来自django.db.models.query导入Q,QuerySet,预取#NOQA
文件13,第13行
来自django.db.models.fields导入自动赛,空
文件“/root/envs/django-test/lib/python3.5/site-packages/django/django/db/models/momodels/__init__.py”,第18行,在模块中
从django导入表格
文件“/root/envs/django-test/lib/python3.5/site-packages/django/forms/forms/__init__.py”,第6行,在模块中
来自django.forms.fields导入 *#noqa
文件“/root/envs/django-test/lib/python3.5/site-packages/django/forms/fields.py”,第18行,在模块中
来自django.forms.utils从_current_timezone导入,to_current_timezone
文件“/root/envs/django-test/lib/python3.5/site-packages/django/forms/utils.py”,第15行,在模块中
来自django.utils.html导入format_html,format_html_join,逃脱
文件“/root/envs/django-test/lib/python3.5/site-packages/django/utils/html.py”
从.html_parser导入htmlparser,htmlparseerror
文件“/root/envs/django-test/lib/python3.5/site-packages/django/utml_parser.py”,第12行,在模块中
htmlparseerror = _html_parser.htmlparseerror
attributerror:模块'html.parser'没有属性'htmlparseerror'
(django-test)root@localhost:?/source/djangotest#django-addmin start superslists superslists
Trackback(最近的最新电话):
文件“/root/envs/django-test/bin/django-add”,第11行,在模块中
sys.exit(execute_from_command_line()))
文件“/root/envs/django-test/lib/python3.5/site-packages/django/core/core/management/_init__.py”,第385行,在execute_from_line_line中
utility.execute()
文件“/root/envs/django-test/lib/python3.5/site-packages/django/core/core/management/_init__.py”,第354行,在Execute中
django.setup()
文件“/root/envs/django-test/lib/python3.5/site-packages/django/__init_.py”,第18行,在设置中
来自django.utils.log导入configure_logging
文件“/root/envs/django-test/lib/python3.5/site-packages/django/utils/log.py”,第10行,在模块中
来自django.views.debug import exceptionreporter,get_exception_reporter_filter
文件“/root/envs/django-test/lib/python3.5/site-packages/django/views/debug.py”,第10行,在模块中
来自django.http import(httpresponse,httpresponseservererror,
文件“/root/envs/django-test/lib/python3.5/site-packages/django/http/__init__.py”,第4行,在模块中
来自django.http.Response导入(httpresponse,streamhttpresponse,
文件13,第13行
来自django.core.serializers.json导入djangojsonenncoder
文件“/root/envs/django-test/lib/python3.5/site-packages/django/core/core/serializers/__init__.py”,第23行,在模块中
来自django.core.core.serializers.base Import Seriesnotexist
文件6,第6行
来自django.db导入模型
文件“/root/envs/django-test/lib/python3.5/site-packages/django/django/db/models/_init__.py”,第6行,在模块中
来自django.db.models.query导入Q,QuerySet,预取#NOQA
文件13,第13行
来自django.db.models.fields导入自动赛,空
文件“/root/envs/django-test/lib/python3.5/site-packages/django/django/db/models/momodels/__init__.py”,第18行,在模块中
从django导入表格
文件“/root/envs/django-test/lib/python3.5/site-packages/django/forms/forms/__init__.py”,第6行,在模块中
来自django.forms.fields导入 *#noqa
文件“/root/envs/django-test/lib/python3.5/site-packages/django/forms/fields.py”,第18行,在模块中
来自django.forms.utils从_current_timezone导入,to_current_timezone
文件“/root/envs/django-test/lib/python3.5/site-packages/django/forms/utils.py”,第15行,在模块中
来自django.utils.html导入format_html,format_html_join,逃脱
文件“/root/envs/django-test/lib/python3.5/site-packages/django/utils/html.py”
从.html_parser导入htmlparser,htmlparseerror
文件“/root/envs/django-test/lib/python3.5/site-packages/django/utml_parser.py”,第12行,在模块中
htmlparseerror = _html_parser.htmlparseerror
原因
pythons3.5中的htmlparseerror消失了
解决方案
将Python版本返回3.3或3.4
升级Django版本
它应该是您的Django版本问题,与Python版本无关。
我不知道您是否已安装Django 2.0版本,可以尝试较低版本,例如1.11.5
Python2.7和Python3都支持Django。鉴于Python2.7限制已经到了,建议使用Python3
不支持该框架,或与框架不兼容
Django是一个具有开源代码的Web应用程序框架,由Python编写。使用MT'V框架模式,即Model M,模板T和View V.IT最初是为了管理Lawrence Publishishing拥有的一些网站而开发的。Group,主要是新闻内容,即CMS(内容管理系统)软件。它于2005年7月在BSD许可下发布。此框架以比利时吉普车的吉他手Django Reinhardt命名。
程序猿程序的工作确实很难。我有一个大头看这些代码,但我不理解代码,否则我可以与您讨论
结论:以上是Django对应于Python3.6的主要CTO注释的所有内容。我希望这对每个人都会有所帮助。如果您想了解有关此信息的更多信息,请记住要收集对该网站的关注。