django.db.utils.OperationalError: unable to open database file

后端 未结 8 531

When I run

python manage.py runserver

I get this error

File \"/usr/local/lib/python2.7/dist-packages/Django-1.10.1-py2.7.egg/django

8条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-10 16:49

    I had the same problem, just solved it. Make sure www-data (or whatever daemon running your web server) has access to both the db.sqlite3 file, and also the path to it. So:

    sudo chown :www-data /
    sudo chown :www-data /db.sqlite3
    sudo chmod 664 /db.sqlite3
    

提交回复
热议问题