随笔分类 -  django

django默认后台使用
摘要:1.初始化数据python manage.py migrate 2.创建超级用户python manage.py createsuperuser 然后按照提示输入就可以了 3.admin管理页面找不到base.css,dashboard.css文件 在settings文件中设置STATIC_ROOT 阅读全文

posted @ 2018-09-12 10:16 kingofyz 阅读(268) 评论(0) 推荐(0)

django csrf使用教程,解决Forbidden (403)CSRF verification failed. Request aborted.
摘要:Django版本号:1.11.15 django中post请求报错:Forbidden (403)CSRF verification failed. Request aborted. HelpReason given for failure: CSRF cookie not set. 方法1:不使用 阅读全文

posted @ 2018-09-05 15:38 kingofyz 阅读(5514) 评论(0) 推荐(3)

django ajax报错解决:You called this URL via POST, but the URL doesn't end in a slash and you have APPEND_SLASH set.
摘要:Django版本号:1.11.15 django中ajax请求报错:You called this URL via POST, but the URL doesn't end in a slash and you have APPEND_SLASH set. Django can't redirec 阅读全文

posted @ 2018-09-05 15:34 kingofyz 阅读(1828) 评论(0) 推荐(0)

django使用session报错:no such table: django_session
摘要:Django版本:1.11.15 使用session的代码:request.session['key'] = value 运行后报错:no such table: django_session 解决办法: 执行如下命令,初始化数据库python manage.py migrate再次运行,可以了 初 阅读全文

posted @ 2018-09-05 11:59 kingofyz 阅读(477) 评论(0) 推荐(0)

django报错解决:view must be a callable or a list/tuple in the case of include().
摘要:django版本:1.11.15 django应用,修改urls.py后,访问报错:TypeError at /view must be a callable or a list/tuple in the case of include(). 修改后的urls.py文件:from django.co 阅读全文

posted @ 2018-09-03 17:32 kingofyz 阅读(1974) 评论(0) 推荐(0)

django报错解决:Invalid HTTP_HOST header: 'xxx.com'. You may need to add u'xxx.com' to ALLOWED_HOSTS.
摘要:django版本:1.11.15 使用uwsgi+nginx运行django程序,出现报错,报错为:Invalid HTTP_HOST header: 'xxx.com:82'. You may need to add u'xxx.com' to ALLOWED_HOSTS.xxx.com为绑定的测 阅读全文

posted @ 2018-09-03 17:18 kingofyz 阅读(4201) 评论(0) 推荐(0)

导航