简体   繁体   English

我无法在 Django 中访问我的管理员

[英]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)

  • Read -------> 4阅读-------> 4
  • Write -------> 2写-------> 2
  • Execute ---> 1执行---> 1

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我无法在 Django 框架中打开管理页面 - I am not able to open admin page in Django Framework 我无法在 Django Admin 中导出 CSV 文件中的图像 - I am not able to export image in CSV file in Django Admin 我无法在虚拟环境中访问 django - I am not able to access django inside virtual environment 我无法在我的 Django 多对多关系中获得字段 - I am not able to get a field in my Django ManyToMany Relation 我如何能够在 Django 中显示我的评论回复 - How am I able to display my comment replies in Django 无法在管理站点中访问和添加产品?-Django - not able to access and add product in admin site?-Django 无法验证超级用户或登录Django的管理站点,我做错了什么? - Not able to authenticate superuser or login into admin site in Django, what am I doing wrong? 我能创建一个无需登录管理面板即可添加新的django.contrib.auth用户的表单吗? - Am I able to create a form that is able to add a new django.contrib.auth User without logging in to the admin panel? 我无法在 django 中链接页面我的代码是正确的。我还需要做什么? - i am not able to link pages in django my code is correct .What else i need to do? Python+Django:我在结账时看不到我呈现的数据,但我可以在其他页面中看到它 - Python+Django : I cannot see my rendered data in checkout but I am able to see it in other pages
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM