Jump to content

Recommended Posts

Posted

One of my web app requires that the file is created for example on:

 

'/home/patents/public_html/mysite/log.txt'

 

but I got

 

PermissionError at /

[Errno 13] Permission denied: '/home/patents/public_html/mysite/log.txt'

It is understood that it is not enabled for web server. Is there any way I can modify files using python3.6 script?
Posted

I tested python3.6 django writing to a file on Tommy and it works for me. You have to create the log file manually and give it 666 permissions. 666 means owner, group, and other can read/write from it. You have to remember that django runs as the user nobody not your hosting account user so if you use the default 644 permissions nobody won't have access to write to it.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...