Django版本:1.11.15

使用session的代码:
request.session['key'] = value

运行后报错:
no such table: django_session

解决办法:

执行如下命令,初始化数据库
python manage.py migrate
再次运行,可以了

初始化一下数据库就解决了。
据说1.9之前的版本初始化数据库命令:
python manage.py syscdb

done!

django使用session报错:no such table: django_session的更多相关文章

  1. 报错: no such table:django_session解决方式

    如果出现这个错误 “no such table:django_session” 这个错误跟Session的机制有关, 既然要从Web服务器端来记录用户信息, 那么一定要有存放用户session id对 ...

  2. Django迁移数据库报错

    Django迁移数据库报错 table "xxx" already exists错误 django在migrate时报错django migrate error: table 'x ...

  3. CodeIgniter 3.0+ 部署linux环境 session报错

    codeigniter Message: mkdir(): Invalid path Filename: drivers/Session_files_driver.php 看起来像权限问题,在默认情况 ...

  4. django startproject xxx:报错UnicodeDecodeError: 'ascii' codec can't decode byte 0xe6 in position 13: ordinal not in range(128)

    django startproject xxx:报错UnicodeDecodeError: 'ascii' codec can't decode byte 0xe6 in position 13: o ...

  5. django正常运行确报错的解决方法

    django正常运行却报错的处理方法 出处 : https://www.infvie.com/ops-notes/django-normal-operation-error 报错一:self._soc ...

  6. ASP.NET Global Application_Error事件中访问Session报错 解决

    报错信息:会话状态在此上下文中不可用 protected void Application_Error(object sender, EventArgs e) { //以此判断是否可用Session ...

  7. Django:django-cors-headers 报错no module named "corsheaders"

    django跨域使用 pip install django-cors-headers 然后在settings文件中加上参数设置 # app配置 INSTALLED_APPS = [ 'django.c ...

  8. .NET CORE 使用Session报错:Session has not been configured for this application or request

    报错信息:Session has not been configured for this application or request 解决方案:在Startup.cs文件中的Configure方法 ...

  9. django调用py报错 django.core.exceptions.ImproperlyConfigured: Requested setting DEFAULT_INDEX_TABLESPACE, but settings are not configured.

    完整报错信息如下 django.core.exceptions.ImproperlyConfigured: Requested setting DEFAULT_INDEX_TABLESPACE, bu ...

随机推荐

  1. Python 基础day4

    整体大纲关于占位符 tpl = "i am %s" % "alex"   tpl = "i am %s age %d" % ("a ...

  2. python 26个技巧

    26个你不知道的Python技巧   Python是目前世界上最流行的编程语言之一.因为: 1.它容易学习 2.它用途超广 3.它有非常多的开源支持(大量的模块和库) 不好意思,优达菌又啰嗦了. 本文 ...

  3. Tomcat jdk 项目搭建问题

    Tomcat 出现log4j未找到  是因为缺少servlet包 出现版本1.5及更高错误 是Java Compiler的版本错误 需重新导包Installed JRES.

  4. python day05 作业答案

    1. b.不可以 c.tu=("alex",[11,22,{"k1":"v1","k2":["age" ...

  5. Linux文件和目录常用操作命令(40个)

    1.ls(list) [命令作用] 列出文件和目录 [命令语法] ls [选项] [参数] [常用选项] -l 以长格式显示(文件或目录的类型.权限.软硬链接的次数.属主.属组.大小.时间.文件名) ...

  6. [转] 理解 LSTM 网络

    [译] 理解 LSTM 网络 http://www.jianshu.com/p/9dc9f41f0b29 Recurrent Neural Networks 人类并不是每时每刻都从一片空白的大脑开始他 ...

  7. 【tomcat】启动报错:Failed to initialize end point associated with ProtocolHandler ["http-apr-8080"] java.lang.Exception: Socket bind failed 和java.net.BindException: Address already in use: JVM_Bind错误解决

    背景:[新手] 将开发机子上的Tomcat连同其中的项目,一起拷贝到服务器上,启动tomcat的start.bat,然后报错如下: 问题1: Failed to initialize end poin ...

  8. [LeetCode&Python] Problem 107. Binary Tree Level Order Traversal II

    Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left ...

  9. camp待补

    待修莫对 序列自动机 几何积分 沈阳 M 待删除背包  : 分组背包 K-LIS, K次二分(插到最后stop) 问题转化为LIS bzoj2131 hdu4055 最小线段覆盖环 实时路况 分治+f ...

  10. select的width和input的width

    select的width包括了border,而input不包括