详解django中cookiecutter的使用教程
时间:2022-02-24 10:26
相关免费学习推荐:python视频教程 导入: 问题:在导入的过程中可能会报错: pkg_resources.VersionConflict: (importlib-metadata 3.1.0 (/Users/apple/.local/share/virtualenvs/testProject-h0hp04R9/lib/python3.6/site-packages), Requirement.parse('importlib-metadata<2,>=0.12; python_version < "3.8"'))。 原因及解决:这个问题的出现主要是pipenv版本不支持,需要更新pipenv,使用命令:pip3 install -U pipenv,然后重新导入即可。 运行cookiecutter 问题:直接报错 解决办法:使用pipenv --py获取python环境的安装目录,在该目录下运行cookiecutter 运行之后会继续报错:缺少Template 在github中找到pydanny/cookiecutter-django,赋值github地址,把地址写在python运行环境的后边,再次运行 成功进入配置选项,进行具体的配置 项目在进行数据迁移的时候可能会报错: 原因:django-celery-beat setup.py有一个https://github.com/celery/django-celery-beat/blob/master/requirements/default.txt依赖要求,强制django-timezone-field只能使用>=4.0和<5.0版本的,开发者推送了一个4.1.1版本的django-timezone-field,中断了数据迁移过程。 解决办法:pipenv install django-timezone-field==4.0,重新执行数据迁移就可以了 到此这篇关于django中cookiecutter使用教程的文章就介绍到这了。 想了解更多编程学习,敬请关注php培训栏目! 以上就是详解django中cookiecutter的使用教程的详细内容,更多请关注gxlsystem.com其它相关文章!python视频教程栏目介绍cookiecutter的使用方法
一、安装
pipenv install cookiecutter
二、创建项目
zsh: command not found: cookiecutter
Usage: cookiecutter [OPTIONS] TEMPLATE [EXTRA_CONTEXT]...
Try 'cookiecutter -h' for help.
Error: Missing argument 'TEMPLATE'.
/Users/apple/.local/sha~~~~re/virtualenvs/testProject-h0hp04R9/bin/cookiecutter https://github.com/pydanny/cookiecutter-django.git
三、具体配置
四、问题:
File "/Users/apple/.local/share/virtualenvs/django-pro-7n8-wfJY/lib/python3.6/site-packages/django_celery_beat/models.py", line 60, in crontab_schedule_celery_timezone
choice[0].zone for choice in timezone_field.TimeZoneField.CHOICES
AttributeError: type object 'TimeZoneField' has no attribute 'CHOICES'
总结