Jump to content

How To Write File On Tommy With Python Script.


Recommended Posts

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?
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...