Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

thanks to the community here I have managed to deploy and run my flask app in production. Currently the only issue I am facing is when I upload form to store in my static folder I keep getting error file config not found. Ran the test on localhost Ubuntu and it worked fine. Do I need to do additional settings to enable file upload in production mode? below is a snippet of the code for your reference. Again thanks a lot for your help.

root@gamy-beginner:/# app.config['FILE_UPLOADS1'] = '/var/www/html/test/static/s torage/local'

[Wed Jan 13 10:49:47.064757 2021] [wsgi:error] [pid 25985:tid 139888930240256] [client 175.144.166.163:51433] return self.view_functions[rule.endpoint](**req.view_args), referer: http://onlinebiztrust.com/CIDB_renewal_form3

[Wed Jan 13 10:49:47.064762 2021] [wsgi:error] [pid 25985:tid 139888930240256] [client 175.144.166.163:51433] File "var/www/html/test/init.py", line 267, in CIDB_renewal_form3, referer: http://onlinebiztrust.com/CIDB_renewal_form3

[Wed Jan 13 10:49:47.064766 2021] [wsgi:error] [pid 25985:tid 139888930240256] [client 175.144.166.163:51433] files.save(os.path.join(app.config['FILE_UPLOADS'], filename)), referer: http://onlinebiztrust.com/CIDB_renewal_form3

[Wed Jan 13 10:49:47.064770 2021] [wsgi:error] [pid 25985:tid 139888930240256] [client 175.144.166.163:51433] File "/usr/local/lib/python3.6/dist-packages/werkzeug/datastructures.py", line 3066, in save, referer: http://onlinebiztrust.com/CIDB_renewal_form3

[Wed Jan 13 10:49:47.064782 2021] [wsgi:error] [pid 25985:tid 139888930240256] [client 175.144.166.163:51433] dst = open(dst, "wb"), referer: http://onlinebiztrust.com/CIDB_renewal_form3

[Wed Jan 13 10:49:47.064788 2021] [wsgi:error] [pid 25985:tid 139888930240256] [client 175.144.166.163:51433] PermissionError: [Errno 13] Permission denied: '/var/www/html/test/static/storage/foreign/PCB_LED_strip_MCPCB_v5_2021-01-11_17-18-46.pdf', referer: http://onlinebiztrust.com/CIDB_renewal_form3

[Wed Jan 13 10:49:47.064811 2021] [wsgi:error] [pid 25985:tid 139888930240256] [client 175.144.166.163:51433] , referer: http://onlinebiztrust.com/CIDB_renewal_form3

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
3.5k views
Welcome To Ask or Share your Answers For Others

1 Answer

等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...