[英]I am not able to access my admin in Django
I have Ubuntu VM with Apache Server on which i am running my application.我有 Ubuntu VM 和 Apache 服务器,我在其上运行我的应用程序。 I have inserted some login and registration file using Filezilla.
我使用 Filezilla 插入了一些登录和注册文件。
But my registration, Login and admin page is not working.但是我的注册、登录和管理页面不起作用。 It is giving me
它给了我
Exception Type: OperationalError
Exception Value: attempt to write a readonly database
I tried the following after doing some Stackoveflow.在做了一些 Stackoveflow 之后,我尝试了以下操作。
chown root db.sqlite3
. chown root db.sqlite3
。 Unfortunately, I still get the same error when trying to access above page.不幸的是,我在尝试访问上面的页面时仍然遇到同样的错误。 Any help would be greatly appreciated.
任何帮助将不胜感激。 Probably something to do with changing user permission which i have no idea where to start in diagnosing what permission issue is going on.
可能与更改用户权限有关,我不知道从哪里开始诊断正在发生的权限问题。
Edit:编辑:
After giving the ownership to Apache User I am able to fix this issue.将所有权授予 Apache 用户后,我能够解决此问题。
sudo chown -R www-data:www-data /var/www
Looks like your database
is set to read-only permission.看起来您的
database
设置为只读权限。 You have to give write permission to your sqlite3 db
.你必须给你的
sqlite3 db
写权限。 you can use the chmod
command for changing the file permission您可以使用
chmod
命令更改文件权限
sudo chmod 666 db.sqlite3
( For read and write permission to every user). sudo chmod 666 db.sqlite3
(对于每个用户的读写权限)。
6 indicates read and write permission(4+2) 6表示读写权限(4+2)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.