随笔分类 - Django相关知识
摘要:解决方法如下 from django.urls import reverse 最近从django1.9迁移到django2.0中出现一个意外的报错: No module named 'django.core.urlresolvers' 原因:django2.0 把原来的 django.core.ur
阅读全文
摘要:原代码: # 使用模板文件 # 1.加载模板文件,获取一个模板文件 temp = loader.get_template('booktest/index.html') # 2.定义模板上下文:给模板文件传递数据 context = RequestContext(request, {}) # 3.模板
阅读全文
摘要:django默认使用的sqlite3,更改为SQL时需要按照如下操作进行 1、在settings.py中的78行进行更改 DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': 'bj18', #使用数据库的名
阅读全文
摘要:在配置MySQL和PyCharm时,经常出现这样的错误提示: Connection to base@localhost failed. [08001] Could not create connection to database server. Attempted reconnect 3 time
阅读全文

浙公网安备 33010602011771号