Attempt to write a Read only database

Hi Guys hope you are doing well,

Here I am Using Ubuntu to run my Django project (Mayan EDMS Open source project ) after running success fully and tried to login into the application and I am not get into home page because of DB is in the read only Mode, can any one help in this will be appreciated.

Thanks in advance

Are you using default django sqlite3? if yes, then
You have to add writing rights to the directory in which your sqlite database is stored. So running chmod -R u+w /path/ should help.

After running “chmod -R u+w mayan/media/db.sqlite3” still getting same error
Any ways to get out of thiss?

can you share your folder structure tree

db.sqlite3 is in media folder have you specified this path, as it is not in root folder

1 Like

You should be running the chmod command on the path mayan/media and not the file.

(Note: If you’re looking to deploy this to a production-style environment, you probably don’t want your database in that directory. The last thing you want to have happen is to have someone be able to craft a url that accesses your media directory and allows them to download that file.)

1 Like

I run those commands without file, still getting same
any ways to get out of this?


Can you plz check out and which permission should i change?

What are the permissions on the media directory itself? (The directory, not the contents of the directory that you’re showing here.)

Also, how are you running your Django project?

I just made a “media” group and added to in that group except db.sqlite3 by it self

Unfortunately, that doesn’t answer my questions.

  1. What are the permissions on the media directory itself? (What do you get if you do an ls -l if mayan is your current directory?)

  2. How are you running your Django project? What commands or system configuration are you using for this? Is this intended to be a production deployment or is this your development environment?

image
Please check Above media file has permission
To run my django project “make runserver” and for development environment i am trying to run

As a development environment, then I’d say both the media directory and all its contents should have the same ownership as the rest of the files (sayed:sayed). There’s no need to start altering ownership and permissions until deployment.

1 Like

Resolved Man Thank a lot Man :slight_smile: