Why am I getting validation error in RESIZE here? I have installed PIL and uploaded images.py module

27 views
Skip to first unread message

RAGHIB R

unread,
Dec 26, 2015, 10:19:37 AM12/26/15
to web2py-users
db1.py reads as:

from images import RESIZE
db.define_table('info',
                Field('info_id',default=auth.user_id,writable=False,readable=False),
                Field('first_name'),
                Field('last_name'),
                Field('dp','upload'),
                Field('back','upload',requires=RESIZE(100,100)),
                Field('hometown'),
                Field('country'),
                Field('dob','datetime',default=request.now,requires=IS_DATE(format=('%d-%m-%Y'))),
                Field('about','text'),
                )


eroor ticket says:

Error ticket for "Site"

Ticket ID

127.0.0.1.2015-12-26.20-29-44.a454583a-f445-435a-a8da-788f2d417165

<type 'exceptions.Exception'> Validation error, field:back <applications.Site.modules.images.RESIZE object at 0x08417310>

Version

web2py™Version 2.12.3-stable+timestamp.2015.08.19.00.18.03
PythonPython 2.7.9: D:\web2py\web2py.exe (prefix: )






and
images.py is same as D:\web2py\gluon\contrib\imageutils.py

RAGHIB R

unread,
Dec 26, 2015, 10:21:37 AM12/26/15
to web2py-users
1.PNG
2.PNG

Massimo Di Pierro

unread,
Dec 26, 2015, 10:44:38 AM12/26/15
to web2py-users
RESIZE requires PIL installed. The windows binary version of web2py does not come with PIL. You have to install python 2.7. Then install PIL. Then run web2py from source.

Massimo

RAGHIB R

unread,
Dec 26, 2015, 10:46:22 AM12/26/15
to web...@googlegroups.com
I did it. Please check the screenshots and then tell me the error I might be facing. I have installed python and updated the registry too with the PIL.

--
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 a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/vRxQH1wH8mY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Massimo Di Pierro

unread,
Dec 26, 2015, 11:40:06 AM12/26/15
to web2py-users
Your second screenshot clearly shows you are running web2py.exe (the windows binary) and not the web2py.py (the source version). As I said, you have to run web2py from source. The windows binary comes with its own version of Python and it does not include PIL.
To unsubscribe from this group and all its topics, send an email to web2py+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages