I'm trying to deploy a DjangoCMS project onto an Ubuntu 16.04 Server running Apache/2.4.18 (Ubuntu) with mod_wsgi. Running the development server works fine. When I try using Apache I get the following error.
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
I've tried deleting the DB and running makemigrations and migrate again to recreate the DB, but get the same error.
Any help would be greatly appreciated.
Thanks
Usually caused by the Apache user not having write access to both the SQLite database file and the directory it is in.