Hello.

I've migrated 3 Web2py apps from Webfaction to Opalstack.
For all these 3 apps I've the same ticket.

When I save a table record with an upload field Web2py tried to save in the 
myappupload folder instead of the myapp/upload folder.

Of course Web2py is unable to find this folder.

Someone knows why?
Could it be because Web2py 2.20.4 is not compatible with Python 2.7.5, so I 
must update Python to 2.7.16 or the last one 2.7.18?
Or perhaps it's a PIL problem?
from PIL import Image

userweb2py™     Version 2.20.4-stable+timestamp.2020.05.03.05.18.50
Python     Python 2.7.5: /home/user/apps/web2py_folder/env/bin/uwsgi 
(prefix: /home/user/apps/web2py_folder/env)
Traceback

Traceback (most recent call last):
  File "/home/user/apps/web2py_folder/web2py/gluon/restricted.py", line 
219, in restricted
    exec(ccode, environment)
  File 
"/home/user/apps/web2py_folder/web2py/applications/my_app/controllers/appadmin.py",
 
line 635, in <module>
  File "/home/user/apps/web2py_folder/web2py/gluon/globals.py", line 430, 
in <lambda>
    self._caller = lambda f: f()
  File 
"/home/user/apps/web2py_folder/web2py/applications/my_app/controllers/appadmin.py",
 
line 325, in update
    if form.accepts(request.vars, session):
  File "/home/user/apps/web2py_folder/web2py/gluon/sqlhtml.py", line 1992, 
in accepts
    self.id_field_name]).update(**fields)
  File 
"/home/user/apps/web2py_folder/web2py/gluon/packages/dal/pydal/objects.py", 
line 2681, in update
    row = table._fields_and_values_for_update(update_fields)
  File 
"/home/user/apps/web2py_folder/web2py/gluon/packages/dal/pydal/objects.py", 
line 878, in _fields_and_values_for_update
    return self._compute_fields_for_operation(new_fields, to_compute)
  File 
"/home/user/apps/web2py_folder/web2py/gluon/packages/dal/pydal/objects.py", 
line 849, in _compute_fields_for_operation
    row.set_value(name, field.compute(row), field)
  File 
"/home/user/apps/web2py_folder/web2py/applications/my_app/models/db.py", 
line 497, in <lambda>
    db.news.image_file_oleodinamica_thumb.compute = lambda row: 
SMARTHUMB(row.image_file_oleodinamica, box)
  File 
"/home/user/apps/web2py_folder/web2py/applications/my_app/models/db.py", 
line 140, in SMARTHUMB
    img = Image.open(request.folder + 'uploads/' + image)
  File 
"/home/user/apps/web2py_folder/env/lib/python2.7/site-packages/PIL/Image.py", 
line 2766, in open
    fp = builtins.open(filename, "rb")
IOError: [Errno 2] No such file or directory: 
'/home/gael/apps/web2py_folder/web2py/applications/my_appuploads/news.image_file_oleodinamica.844c80079e794fbd.62726f777361626c655f636174616c6f6775652e6a7067.jpg'

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/44c4dbe1-09fb-4634-bdfe-7c8254d82193n%40googlegroups.com.

Reply via email to