【问题标题】:Error Deploying DjangoCMS project to Apache - no such table: django_site将 DjangoCMS 项目部署到 Apache 时出错 - 没有这样的表:django_site
【发布时间】:2017-11-22 03:22:30
【问题描述】:

我正在尝试将 DjangoCMS 项目部署到使用 mod_wsgi 运行 Apache/2.4.18 (Ubuntu) 的 Ubuntu 16.04 服务器上。运行开发服务器工作正常。当我尝试使用 Apache 时,出现以下错误。

OperationalError at /
no such table: django_site
Request Method: GET
Request URL:    http://192.168.1.9/
Django Version: 1.9.13
Exception Type: OperationalError
Exception Value:    
no such table: django_site
Exception Location: /home/jpb/.virtualenvs/gunjive/lib/python3.5/site-      packages/django/db/backends/sqlite3/base.py in execute, line 323
Python Executable:  /home/jpb/.virtualenvs/gunjive/bin/python
Python Version: 3.5.2
Python Path:    
['/var/www/django/gunjive',
 '/home/jpb/.virtualenvs/gunjive/lib/python35.zip',
 '/home/jpb/.virtualenvs/gunjive/lib/python3.5',
 '/home/jpb/.virtualenvs/gunjive/lib/python3.5/plat-x86_64-linux-gnu',
 '/home/jpb/.virtualenvs/gunjive/lib/python3.5/lib-dynload',
 '/usr/lib/python3.5',
 '/usr/lib/python3.5/plat-x86_64-linux-gnu',
 '/home/jpb/.virtualenvs/gunjive/lib/python3.5/site-packages']
Server time:    Tue, 21 Nov 2017 18:55:28 -0800

我尝试删除数据库并运行 makemigrations 并再次迁移以重新创建数据库,但得到相同的错误。

任何帮助将不胜感激。

谢谢

【问题讨论】:

    标签: apache mod-wsgi django-cms


    【解决方案1】:

    通常是由于 Apache 用户没有对 SQLite 数据库文件及其所在目录的写入权限。

    【讨论】:

    • 感谢 Graham - 我确实将自己添加到 www-data 组,并且 SQLite 数据库和目录具有 RW 访问权限:-rw-rw-r-- 1 www-data www-data 237568 Nov 21 18:38 项目.db
    猜你喜欢
    • 2015-09-01
    • 1970-01-01
    • 1970-01-01
    • 2014-02-11
    • 1970-01-01
    • 2021-12-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多