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

后端 未结 8 536

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:48

    Basically there are two answers, either user which running server don't have rights to open database file. You can try to fix this by:

    sudo chown $(whoami):$(whoami) /path/to/dir/db/db.sqlite3
    

    Or you don't have this file, you can create it by applying migrate command:

    ./manage.py migrate
    

提交回复
热议问题