社区版pycharm创建django项目的一些问题

1. cannot import view

解决:项目名称——右键——设为Sources root

2. cannot find templates

解决:在setting.py里把空的'DIRS’改成

'DIRS': [os.path.join(BASE_DIR,'templates')],

3. page not found

老师课上url路径设置为path(r'^app01/',include('app01.urls')),当只有一个项目时可以运行,然而多项目时报错,此时需要把^都去掉。

4.社区版在tools里找不到run manage.py task

解决:运行项目,会报错,此处错误原因是Django项目版本与mysql驱动版本不匹配的问题,点链接进去把版本的两行注释掉,然后在settings.py里把项目名称加进去,运行python manage.py makemigrations以及python manage.py migrate

5. 社区版连接mysql出现报错:The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.

解决:

6. 双击表单选择no filter就看到表单内容了。

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。