Re: [web2py] Re: Problems with the server stalling out. Setting up debuging.
Yeah, something with apache. But ngix is much better for us anyway. I don't think I will go back to apache any time soon. As for the time to process the files, about 1 second max at the absolute most. Honestly I don't know how to test or check this kind of stuff. But what we do know is that it's handle requests right now just fine. BR, Jason Brower On Sun, 2014-02-02 at 12:09 -0800, Niphlod wrote: seems related to apache and timeouts... https://groups.google.com/forum/#!topic/modwsgi/UqmMeV0lhC8 BTW: odd errors and unforgiving syntax complexity is what moved me (among many others) to nginx+uwsgi. Things there are far more understandable, debuggable and reproduceable. BTW2: how many processes and threads are running for web2py ? How much time a request takes to be processed ? On Sunday, February 2, 2014 8:52:21 PM UTC+1, Encompass solutions wrote: To give more information I looked in the error logs and found the following: I am not sure if it is related, but it seems to happen around the same time as the error. Ideas? - [Sun Feb 02 17:38:52 2014] [error] [client 83.145.241.129] File /home/www-data/web2py/gluon/globals.py, line 252, in body [Sun Feb 02 17:38:52 2014] [error] [client 83.145.241.129] raise HTTP(400, Bad Request - HTTP body is incomplete) [Sun Feb 02 17:38:52 2014] [error] [client 83.145.241.129] HTTP: 400 BAD REQUEST [Sun Feb 02 17:38:58 2014] [error] [client 83.145.241.129] Script timed out before returning headers: wsgihandler.py [Sun Feb 02 17:40:29 2014] [error] [client 83.145.241.129] Script timed out before returning headers: wsgihandler.py [Sun Feb 02 17:40:29 2014] [error] [client 83.145.241.129] Script timed out before returning headers: wsgihandler.py [Sun Feb 02 17:40:35 2014] [error] [client 83.145.241.129] Script timed out before returning headers: wsgihandler.py [Sun Feb 02 17:40:42 2014] [error] [client 83.145.241.129] (70007)The timeout specified has expired: mod_wsgi (pid=10727): Unable to get bucket brigade for request. [Sun Feb 02 17:40:44 2014] [error] [client 83.145.241.129] mod_wsgi (pid=10725): Exception occurred processing WSGI script '/home/www-data/web2py/wsgihandler.py'. [Sun Feb 02 17:40:44 2014] [error] [client 83.145.241.129] Traceback (most recent call last): [Sun Feb 02 17:40:44 2014] [error] [client 83.145.241.129] File /home/www-data/web2py/gluon/main.py, line 532, in wsgibase [Sun Feb 02 17:40:44 2014] [error] [client 83.145.241.129] if request.body: [Sun Feb 02 17:40:44 2014] [error] [client 83.145.241.129] File /home/www-data/web2py/gluon/globals.py, line 252, in body [Sun Feb 02 17:40:44 2014] [error] [client 83.145.241.129] raise HTTP(400, Bad Request - HTTP body is incomplete) [Sun Feb 02 17:40:44 2014] [error] [client 83.145.241.129] HTTP: 400 BAD REQUEST [Sun Feb 02 17:40:44 2014] [error] [client 83.145.241.129] mod_wsgi (pid=10725): Exception occurred processing WSGI script '/home/www-data/web2py/wsgihandler.py'. [Sun Feb 02 17:40:44 2014] [error] [client 83.145.241.129] Traceback (most recent call last): [Sun Feb 02 17:40:44 2014] [error] [client 83.145.241.129] File /home/www-data/web2py/gluon/main.py, line 532, in wsgibase [Sun Feb 02 17:40:44 2014] [error] [client 83.145.241.129] if request.body: [Sun Feb 02 17:40:44 2014] [error] [client 83.145.241.129] File /home/www-data/web2py/gluon/globals.py, line 252, in body [Sun Feb 02 17:40:44 2014] [error] [client 83.145.241.129] raise HTTP(400, Bad Request - HTTP body is incomplete) [Sun Feb 02 17:40:44 2014] [error] [client 83.145.241.129] HTTP: 400 BAD REQUEST [Sun Feb 02 17:40:44 2014] [error] [client 83.145.241.129] mod_wsgi (pid=10725): Exception occurred processing WSGI script '/home/www-data/web2py/wsgihandler.py'. [Sun Feb 02 17:40:44 2014] [error] [client 83.145.241.129] Traceback (most recent call last): [Sun Feb 02 17:40:44 2014] [error] [client 83.145.241.129] File /home/www-data/web2py/gluon/main.py, line 532, in wsgibase [Sun Feb 02 17:40:44 2014] [error] [client 83.145.241.129] if request.body: [Sun Feb 02 17:40:44 2014] [error] [client 83.145.241.129] File /home/www-data/web2py/gluon/globals.py, line 252, in body [Sun Feb 02 17:40:44 2014] [error] [client 83.145.241.129] raise HTTP(400, Bad Request - HTTP body is incomplete) [Sun Feb 02 17:40:44 2014] [error]
[web2py] Random ticket issued with apace wsgi
I have a web application with wsgi (apache + mysql debian wheezy). Web2py is 2.5.1, and sometimes I have this error: Error ticket for gesiesweb Ticket ID 172.17.156.31.2014-03-10.09-44-48.045b2f54-9181-46f8-8604-24745a8a Versión web2py™ Version 2.5.1-stable+timestamp.2013.06.06.10.35.58 Python Python 2.7.3: /usr/bin/python (prefix: /usr) Traceback 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. Traceback (most recent call last): File /var/www/web2py/gluon/main.py, line 606, in wsgibase session._try_store_in_cookie_or_file(request, response) File /var/www/web2py/gluon/globals.py, line 757, in _try_store_in_cookie_or_file self._try_store_in_file(request, response) File /var/www/web2py/gluon/globals.py, line 763, in _try_store_in_file if not response.session_id or self._forget or self._unchanged(): File /var/www/web2py/gluon/globals.py, line 719, in _unchanged session_pickled = cPickle.dumps(dict(self)) File /usr/lib/python2.7/copy_reg.py, line 84, in _reduce_ex dict = getstate() TypeError: 'NoneType' object is not callable Error snapshot [image: help] https://auxiliar/admin/default/ticket/gesiesweb/172.17.156.31.2014-03-10.09-44-48.045b2f54-9181-46f8-8604-24745a8a# type 'exceptions.TypeError'('NoneType' object is not callable) When I restart apache service with /etc/init.d/apache2 restart, the error disappears until reappears... I thank any suggestion. Thanks. -- 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. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Ckeditor plugin - Update ckeditor
With a new version of ckeditor, it miss this js file plugin, that have to be in the ckeditor root: ckeip.js I've take it from the Bruno Rocha Github. Anyway adding plugin still a problem. What I want to have for example is adding this plugin: http://ckeditor.com/addon/oembed It have these dependencies: http://ckeditor.com/addon/widget http://ckeditor.com/addon/dialog (already installed, have dialogui dependecy) I've upload all files, and add missing plugins in the ckeditor config.js . CKEDITOR.editorConfig = function( config ) { config.extraPlugins = 'widget,dialogui,oembed'; }; The oembed is not displayed. I've tried also to add this really simple plugin, Save: http://ckeditor.com/addon/save No way. It's not displayed. I've try also only with the save plugin: CKEDITOR.editorConfig = function( config ) { config.extraPlugins = 'save'; }; It don't works. Do you know how I can go ahead ? Thanks. Il giorno lunedì 24 marzo 2014 08:54:58 UTC+1, Gael Princivalle ha scritto: Image upload with IE works great. Replacing the complete plugin_ckeditor folder by the downloaded ckeditor folder works, but some ckeditor plugins are not availables. I've try to put the full ckeditor version with all plugins, and a lot are missing. Here is the full version demo: http://ckeditor.com/demo#full For example I don't have the text color button. Is it a problem due to ckeditor or to the ckeditor plugin for web2py ? In attach file the full ckeditor plugin. Regards. Il giorno lunedì 24 marzo 2014 01:13:17 UTC+1, Tim Richardson ha scritto: Oh, would be great if you can test the image upload functionality (ie when using ckeditor to place an image, you should be able to upload images). On Monday, 24 March 2014 07:04:36 UTC+11, Gael Princivalle wrote: Thank you Tim. This new version works well What I don't understand is how can I update the CKeditor version. In the release notes I've saw that To upgrade to a newer version of ckeditor, replace the directory static/plugin_ckeditor with the directory downloaded from the ckeditor site. But when I do it quite all buttons disappear and some functions are missing. Here is in attach file the custom version that I've download from the CKeditor website. Can you make a test ? Regards. Il giorno mercoledì 5 marzo 2014 05:14:34 UTC+1, Tim Richardson ha scritto: Have a look here:( The plugin can be found on releases; download it and then upload it via the admin app. I'll move it to web2py slices once I get some feedback and do some more testing myself) https://github.com/timrichardson/web2py_ckeditor4/releases Let me know if it works ok. It's the current ckeditor, standard edition. The release notes have instructions on how to update it. Unless the API to the custom browsers and uploaders changes, putting a new release in is very easy. That API didn't change between v3 and v4 which is good news. On Wednesday, 5 March 2014 07:41:58 UTC+11, Gael Princivalle wrote: That's a really good news. Can you give also a little documentation for updating/changing the ckeditor version ? Thank's a lot Tim. Il giorno martedì 4 marzo 2014 20:19:50 UTC+1, Tim Richardson ha scritto: I've cloned the ckeditor plugin and updated it to the latest version of ckeditor and fixed a couple of other problems. It's working for me in an app. I'll finish the plugin in a few days, I need to merge my changes back and add some testing code. I've removed the inline edit capability since it depends on JavaScript which appears to be unmaintained. -- 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. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Ckeditor plugin - Update ckeditor
Hi again. I've saw that you've comment this config.js definition in plugin_ckeditor.py: function ckeditor_config() { return { contentsCss: %(contents_css)s, filebrowserUploadUrl: '%(upload_url)s', filebrowserBrowseUrl: '%(browse_url)s', toolbar: [ {name: 'clipboard', items: ['Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo']}, {name: 'editing', items: ['Find', 'Replace', '-' , 'SelectAll', '-', 'SpellChecker', 'Scayt']}, {name: 'links', items: ['Link', 'Unlink', 'Anchor']}, {name: 'insert', items: ['Image', 'Flash', 'Table', 'SpecialChar']}, {name: 'tools', items: ['Maximize', 'ShowBlocks' , '-', 'Source']}, '/', {name: 'styles', items: ['Format', 'Font', 'FontSize']}, {name: 'basicstyles', items: ['Bold', 'Italic', 'Underline', 'Strike', '-', 'RemoveFormat']}, {name: 'paragraph', items: ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock']}, ], scayt_autoStartup: %(scayt)s, } } %(immediate)s Perhaps we've to add here something... Il giorno lunedì 24 marzo 2014 10:58:12 UTC+1, Gael Princivalle ha scritto: With a new version of ckeditor, it miss this js file plugin, that have to be in the ckeditor root: ckeip.js I've take it from the Bruno Rocha Github. Anyway adding plugin still a problem. What I want to have for example is adding this plugin: http://ckeditor.com/addon/oembed It have these dependencies: http://ckeditor.com/addon/widget http://ckeditor.com/addon/dialog (already installed, have dialogui dependecy) I've upload all files, and add missing plugins in the ckeditor config.js . CKEDITOR.editorConfig = function( config ) { config.extraPlugins = 'widget,dialogui,oembed'; }; The oembed is not displayed. I've tried also to add this really simple plugin, Save: http://ckeditor.com/addon/save No way. It's not displayed. I've try also only with the save plugin: CKEDITOR.editorConfig = function( config ) { config.extraPlugins = 'save'; }; It don't works. Do you know how I can go ahead ? Thanks. Il giorno lunedì 24 marzo 2014 08:54:58 UTC+1, Gael Princivalle ha scritto: Image upload with IE works great. Replacing the complete plugin_ckeditor folder by the downloaded ckeditor folder works, but some ckeditor plugins are not availables. I've try to put the full ckeditor version with all plugins, and a lot are missing. Here is the full version demo: http://ckeditor.com/demo#full For example I don't have the text color button. Is it a problem due to ckeditor or to the ckeditor plugin for web2py ? In attach file the full ckeditor plugin. Regards. Il giorno lunedì 24 marzo 2014 01:13:17 UTC+1, Tim Richardson ha scritto: Oh, would be great if you can test the image upload functionality (ie when using ckeditor to place an image, you should be able to upload images). On Monday, 24 March 2014 07:04:36 UTC+11, Gael Princivalle wrote: Thank you Tim. This new version works well What I don't understand is how can I update the CKeditor version. In the release notes I've saw that To upgrade to a newer version of ckeditor, replace the directory static/plugin_ckeditor with the directory downloaded from the ckeditor site. But when I do it quite all buttons disappear and some functions are missing. Here is in attach file the custom version that I've download from the CKeditor website. Can you make a test ? Regards. Il giorno mercoledì 5 marzo 2014 05:14:34 UTC+1, Tim Richardson ha scritto: Have a look here:( The plugin can be found on releases; download it and then upload it via the admin app. I'll move it to web2py slices once I get some feedback and do some more testing myself) https://github.com/timrichardson/web2py_ckeditor4/releases Let me know if it works ok. It's the current ckeditor, standard edition. The release notes have instructions on how to update it. Unless the API to the custom browsers and uploaders changes, putting a new release in is very easy. That API didn't change between v3 and v4 which is good news. On Wednesday, 5 March 2014 07:41:58 UTC+11, Gael Princivalle wrote: That's a really good news. Can you give also a little documentation for updating/changing the ckeditor version ? Thank's a lot Tim. Il giorno martedì 4 marzo 2014 20:19:50 UTC+1, Tim Richardson ha scritto: I've cloned the ckeditor plugin and updated it to the latest version of ckeditor and fixed a couple of other problems.
[web2py] Searching an undisplayed column
I have a field called 'description'. In SQLFORM.grid, I do NOT want to display the 'description' field, but I do want to be able to search the 'description' field from the grid's search function. Is there a way to do this? Thanks. -- 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. For more options, visit https://groups.google.com/d/optout.
[web2py] manage extra custom field with ldap_auth
Hi all, i try to manage extra custom field from ldap via ldap_auth user attribute: but I can't figure out how to manage it... any idea? code snippet: auth.settings.extra_fields['auth_user']= [ Field('employeeid' , type='string')] ... ... auth.settings.login_methods = [ldap_auth(mode = 'ad', server = 'DCserver', base_dn = 'DC=domain,DC=it', db = db, manage_user = True, user_firstname_attrib = 'givenName', user_lastname_attrib = 'sn', user_mail_attrib = 'mail' user_employeeid_attrib = 'employeeID' )] thanks in advance maurizio -- 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. For more options, visit https://groups.google.com/d/optout.
[web2py] Searching an undisplayed column
What does your code look like? I think all readable fields are searchable, so maybe you could make the field readable and hide it by using the fields argument to list the fields to be displayed. Anthony -- 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. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Searching an undisplayed column
I tried that, but it doesn't work. I solved it by letting the field be readable and hiding it with description.label=' ' and represent=lambda v,r: ''. Not particularly elegant, but it gets the job done. Of course, the search dropdown includes the ' ' label, but it's not a big deal. On Monday, 24 March 2014 07:48:37 UTC-4, Anthony wrote: What does your code look like? I think all readable fields are searchable, so maybe you could make the field readable and hide it by using the fields argument to list the fields to be displayed. Anthony -- 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. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] Re: .json in url does not like contruções
This is my problem import json var=FOPIC - Construção e Investimentos, Lda. if i do json.dumps({'name': var, 'value': 1}) '{name: FOPIC - Constru\\u00e7\\u00e3o e Investimentos, Lda., value: 1}' its ok, but i need to truncate the string to the first 18 letters so i do json.dumps({'name': var[:18], 'value': 1}) Traceback (most recent call last): File interactive input, line 1, in module File C:\Python27\lib\json\__init__.py, line 231, in dumps return _default_encoder.encode(obj) File C:\Python27\lib\json\encoder.py, line 201, in encode chunks = self.iterencode(o, _one_shot=True) File C:\Python27\lib\json\encoder.py, line 264, in iterencode return _iterencode(o, 0) UnicodeDecodeError: 'utf8' codec can't decode byte 0xc3 in position 17: unexpected end of data I need help ,as usual :P Thank you 2014-03-18 20:33 GMT+00:00 Michele Comitini michele.comit...@gmail.com: @Antonio, please create a simple example action that causes the error in your setup and post it here. something like # -*- coding: utf-8 -*- def myfunc(): return dict(mykey='contruções') 2014-03-18 15:57 GMT+01:00 António Ramos ramstei...@gmail.com: yes i have it in my controller.py file # -*- coding: utf-8 -*- 2014-03-18 14:48 GMT+00:00 Leonel Câmara leonelcam...@gmail.com: Olá António, Is your controller .py file saved in utf-8 (make sure the text editor is doing it, use the save with encoding option if you have it) and has this as the first line? # -*- coding: utf-8 -*- -- 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. For more options, visit https://groups.google.com/d/optout. -- 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. For more options, visit https://groups.google.com/d/optout. -- 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. For more options, visit https://groups.google.com/d/optout. -- 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. For more options, visit https://groups.google.com/d/optout.
[web2py] Admin diabled due to too many password attempts?
Okay, I have managed to change the password, but the admin interface remains disabled - not allowing me to even try the new password. The app is being hosted on pythonanywhere.com - how can I fix this problem? -- 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. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Admin diabled due to too many password attempts?
You can wait an hour, log in from a different IP address, or delete the /admin/private/hosts.deny file. Anthony On Monday, March 24, 2014 10:56:28 AM UTC-4, Bklynate wrote: Okay, I have managed to change the password, but the admin interface remains disabled - not allowing me to even try the new password. The app is being hosted on pythonanywhere.com - how can I fix this problem? -- 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. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Admin diabled due to too many password attempts?
Thx for that dude, ill just wait the hr - heck I am at work anyway lol. I use pythonanywhere to dabble with programming in-between my clerical work. On Monday, March 24, 2014 11:03:55 AM UTC-4, Anthony wrote: You can wait an hour, log in from a different IP address, or delete the /admin/private/hosts.deny file. Anthony On Monday, March 24, 2014 10:56:28 AM UTC-4, Bklynate wrote: Okay, I have managed to change the password, but the admin interface remains disabled - not allowing me to even try the new password. The app is being hosted on pythonanywhere.com - how can I fix this problem? -- 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. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: form.custom.begin doesn't add the form _class and other attributes
Anyway, feel free to submit a pull request if this functionality is important to you. Put my time where my mouth is? Eheheh, I should have expected this. I guess I'll try to find time to make it soon, as this issue annoys me, not sure if it's important, but I don't want to have to remember that form.custom.begin loses form attributes each time I use it. -- 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. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] New python.org layout
On Sunday, March 23, 2014, Michele Comitini michele.comit...@gmail.com wrote: ;-) ;-) From that page you sent I understand that Ansible is starting to get more traction than chef. Ansible is in python or what? yes and imho way cool. you didn't need agents On clients neither a weird infrastructure with daemons to manage your infrastructure. C'mon, we are talking about the *python* software foundation, they must favour a python based product, unless there is no other way. Deploying a django based application is such a pain that one starts looking for anything that can help automate the task. Paradoxically they had used RoR they wouldn't need chef. ;-) ;-) 2014-03-23 22:04 GMT+01:00 Niphlod niph...@gmail.com javascript:;: offtopic you don't have to move to RoR. chef is just an emerging standard in deployment recipes (you may also intend it as buzzword-project gone right). See it as fabric snippets on steroids. Puppet, ansible, salt, etc, are also on the same family. http://redmonk.com/sogrady/2013/12/06/configuration-management-2013/ Instead of doing 'bash setup-*.sh' you do 'chef therecipe.rb' The fact that it needs ruby (not RoR) it's just due to the fact that creating DSL is much easier in ruby than python. /offtopic On Sunday, March 23, 2014 6:38:55 PM UTC+1, Michele Comitini wrote: 2014-03-23 18:31 GMT+01:00 Niphlod nip...@gmail.com javascript:;: having a chef opcode does not count as ruby is needed. Given chef's spread, it's exactly as if we shipped all scripts/setup* scripts in ruby. I hope not! I started using web2py to avoid moving to ruby RoR! ;-) -- 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 javascript:;. For more options, visit https://groups.google.com/d/optout. -- 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 javascript:;. For more options, visit https://groups.google.com/d/optout. -- 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. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] Re: .json in url does not like contruções
My guess is that the function is probably receiving this string: FOPIC - Constru\\u When it tries to convert the unicode character it returns the end of data error because the full unicode value is not present (00e7 for ç). So the problem is that you are truncating the string with the escaped unicode values (\\u00e7 instead of ç), which is causing the escaped character to be cut in the half. You should convert the string before truncate. Em 24-03-2014 11:36, António Ramos escreveu: This is my problem import json var=FOPIC - Construção e Investimentos, Lda. if i do json.dumps({'name': var, 'value': 1}) '{name: FOPIC - Constru\\u00e7\\u00e3o e Investimentos, Lda., value: 1}' its ok, but i need to truncate the string to the first 18 letters so i do json.dumps({'name': var[:18], 'value': 1}) Traceback (most recent call last): File interactive input, line 1, in module File C:\Python27\lib\json\__init__.py, line 231, in dumps return _default_encoder.encode(obj) File C:\Python27\lib\json\encoder.py, line 201, in encode chunks = self.iterencode(o, _one_shot=True) File C:\Python27\lib\json\encoder.py, line 264, in iterencode return _iterencode(o, 0) UnicodeDecodeError: 'utf8' codec can't decode byte 0xc3 in position 17: unexpected end of data I need help ,as usual :P Thank you 2014-03-18 20:33 GMT+00:00 Michele Comitini michele.comit...@gmail.com mailto:michele.comit...@gmail.com: @Antonio, please create a simple example action that causes the error in your setup and post it here. something like # -*- coding: utf-8 -*- def myfunc(): return dict(mykey='contruções') 2014-03-18 15:57 GMT+01:00 António Ramos ramstei...@gmail.com mailto:ramstei...@gmail.com: yes i have it in my controller.py file # -*- coding: utf-8 -*- 2014-03-18 14:48 GMT+00:00 Leonel Câmara leonelcam...@gmail.com mailto:leonelcam...@gmail.com: Olá António, Is your controller .py file saved in utf-8 (make sure the text editor is doing it, use the save with encoding option if you have it) and has this as the first line? # -*- coding: utf-8 -*- -- 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 mailto:web2py%2bunsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- 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 mailto:web2py%2bunsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- 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 mailto:web2py%2bunsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- 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 mailto:web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- 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. For more options, visit https://groups.google.com/d/optout.
[web2py] response.toolbar() does not show statistics for some tables
Hello I try to use response.toolbar() to measure database queries. I've added it to the site, now it shows statistics only for tables created by web2py auth and tables connected to them, for example: SET standard_conforming_strings=on; 0.14ms SELECT company.id, company.number, company.name FROM company; 0.43ms SELECT count(*) FROM auth_group WHERE (auth_group.role = 'root'); 0.72ms SELECT count(*) FROM auth_group WHERE (auth_group.role = 'service'); 0.11ms SELECT count(*) FROM auth_group WHERE (auth_group.role = 'producer'); 0.10ms SELECT count(*) FROM auth_user WHERE (auth_user.email = 't...@test.com'); 0.20ms SELECT auth_group.id, auth_group.role, auth_group.description FROM auth_group WHERE (auth_group.role = 'service'); 0.20ms SELECT auth_membership.id, auth_membership.user_id, auth_membership.group_id FROM auth_membership WHERE ((auth_membership.user_id = 1) AND (auth_membership.group_id = 2)); 0.31ms I have another tables like: db.define_table('controller', Field('uid', 'string', length=64, unique=True), Field('descr', 'string', length=256, notnull=True), Field('address_id', db.address, ondelete='SET NULL'), Field('service_access', 'boolean', notnull=True)) There is db.executesql query for that table and statistics are not shown. Do you known what is the reason for that? Maciej S -- 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. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] Re: uploading a csv file and read it with python module pandas
Thanks Anthony once more. I should really read the tutorial before going further. On Sat, Mar 22, 2014 at 4:06 AM, Anthony abasta...@gmail.com wrote: That wasn't complete code. You'll have to define id somewhere, and it should be the record ID of a record in the db.mytable table. Anthony On Friday, March 21, 2014 3:52:18 AM UTC-4, Gaston wrote: Thanks Anthony. Then, in db.py db.define_table('mytable',Field('myfile','upload')) and in default.py def stat(): record=db.mytable(id) data = pd.read_csv(db.mytable.myfile.retrieve(record.myfile)[1] But I got the following error message type 'exceptions.AttributeError'('NoneType' object has no attribute 'myfile') Sorry for my poor understanding of how the database works. Could you direct me to a manual or tutorial for beginners so I can learn these issues. Thanks On Thursday, March 20, 2014 2:35:50 PM UTC+1, Anthony wrote: Something like: record = db.mytable(id) data = pd.read_csv(db.mytable.myfile.retrieve(record.myfile)[1]) Anthony On Wednesday, March 19, 2014 9:50:15 AM UTC-4, Gaston wrote: I am statistician and new in web2py. I tried to build an application that allows users to: - upload a csv file in the database (my file) - and click a link where some automated analyses have been attached using the python module pandas with (import pandas as pd) In the db.py, I have db.define_table('mytable',Field('myfile','upload')) In the default.py I have the below lines def stat(): data=pd.read.csv('myfile') I received the following error: type 'exceptions.AttributeError'('module' object has no attribute 'read') Great if someone could help. Thanks. Gaston -- 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/L1_e_rNzD84/unsubscribe. To unsubscribe from this group and all its topics, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- 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. For more options, visit https://groups.google.com/d/optout.
[web2py] Crash in gluon/html.py
html.py does not seem to be unicode-safe. It contains (line 1914 or thereabouts): components.append(OPTION(c, _value=str(c))) In my case c contains Max-Guénaël (i.e., uMax-Gu\xe9na\xebl). The str(c) dies nastily. Is this a bug or am I asking too much of web2py? -- 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. For more options, visit https://groups.google.com/d/optout.
[web2py] default values in a form
In my app I have this: cf = db.contacts.fields form = FORM(Field:,SELECT(cf, _name=field, requires = IS_IN_SET( cf ), _value=last_name), (Exact match?), INPUT( _type=checkbox, _name = 'exact', _value = True), Search for (required):, INPUT( _type=text, _name= 'search', requires = IS_NOT_EMPTY() ), INPUT( _type=submit, _value=SEARCH)) which is intended to generate a generic search form. And, in fact, it does. I have two problems with giving the for, default values though. I want the field field to have last_name selected by default. It does, but only after the first submission of the form - when the page is first loaded, the first field (id) is selected. And I can't seem to set a default value for the checkboc - I want it selected by default - despite trying several possibilities, like _default and so on. Can't seem to find this in the documentation. How is it properly done? thanks Daniel -- 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. For more options, visit https://groups.google.com/d/optout.
[web2py] Stripe example from book out of date
Just to inform that the example here does not work with Stripe V3 (current) The script reports that the payments are accepted (provided you supply valid currency and date arguments) however they are not received at the stripe end. (they do not show in the stripe console log file.) Was hoping to use a version of this and will have a look at the Library and measure it against the current python bindings on Github but for the moment it should probably be removed from the book. -- 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. For more options, visit https://groups.google.com/d/optout.
[web2py] Crash in gluon/html.py caused by unicode characters
I tried to post this problem earlier, but it doesn't seem to have appeared. If it has now appeared twice, then I apologise and suggest you read the two stereoscopically. /gluon/html.py in _fixup at line 1914 has the line components.append(OPTION(c, _value=str(c))) This call to str() coughs and explodes when presented with the string uMax-Gu\xe9na\xebl as it was in my application yesterday as part of a SELECT(). Should this be unicode-safe or am I expecting too much of web2py? -- 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. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Stripe example from book out of date
Look into web2py/gluon/contrib/stripe.py there is example of usage. The new code is compliant with V3. The book needs to be updated. On Monday, 24 March 2014 06:21:54 UTC-5, Greg Vaughan wrote: Just to inform that the example here does not work with Stripe V3 (current) The script reports that the payments are accepted (provided you supply valid currency and date arguments) however they are not received at the stripe end. (they do not show in the stripe console log file.) Was hoping to use a version of this and will have a look at the Library and measure it against the current python bindings on Github but for the moment it should probably be removed from the book. -- 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. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Crash in gluon/html.py
The convention in web2py is NO UNICODE. all text handled by web2py must be UTF8 encoded strings. On Monday, 24 March 2014 08:04:35 UTC-5, Chris Hobbs wrote: html.py does not seem to be unicode-safe. It contains (line 1914 or thereabouts): components.append(OPTION(c, _value=str(c))) In my case c contains Max-Guénaël (i.e., uMax-Gu\xe9na\xebl). The str(c) dies nastily. Is this a bug or am I asking too much of web2py? -- 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. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: response.toolbar() does not show statistics for some tables
Please submit a bug report. It is possible executesql does not log it. On Monday, 24 March 2014 08:11:56 UTC-5, Maciej S wrote: Hello I try to use response.toolbar() to measure database queries. I've added it to the site, now it shows statistics only for tables created by web2py auth and tables connected to them, for example: SET standard_conforming_strings=on; 0.14ms SELECT company.id, company.number, company.name FROM company; 0.43ms SELECT count(*) FROM auth_group WHERE (auth_group.role = 'root'); 0.72ms SELECT count(*) FROM auth_group WHERE (auth_group.role = 'service'); 0.11ms SELECT count(*) FROM auth_group WHERE (auth_group.role = 'producer'); 0.10ms SELECT count(*) FROM auth_user WHERE (auth_user.email = 'te...@test.com javascript:'); 0.20ms SELECT auth_group.id, auth_group.role, auth_group.description FROM auth_group WHERE (auth_group.role = 'service'); 0.20ms SELECT auth_membership.id, auth_membership.user_id, auth_membership.group_id FROM auth_membership WHERE ((auth_membership.user_id = 1) AND (auth_membership.group_id = 2)); 0.31ms I have another tables like: db.define_table('controller', Field('uid', 'string', length=64, unique=True), Field('descr', 'string', length=256, notnull=True), Field('address_id', db.address, ondelete='SET NULL'), Field('service_access', 'boolean', notnull=True)) There is db.executesql query for that table and statistics are not shown. Do you known what is the reason for that? Maciej S -- 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. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] Re: Crash in gluon/html.py
On 24 Mar 2014, at 10:45 AM, Massimo Di Pierro massimo.dipie...@gmail.com wrote: The convention in web2py is NO UNICODE. all text handled by web2py must be UTF8 encoded strings. Though there are quite a few instances of html.py taking explicit notice of unicode (search for 'unicode'...). On Monday, 24 March 2014 08:04:35 UTC-5, Chris Hobbs wrote: html.py does not seem to be unicode-safe. It contains (line 1914 or thereabouts): components.append(OPTION(c, _value=str(c))) In my case c contains Max-Guénaël (i.e., uMax-Gu\xe9na\xebl). The str(c) dies nastily. Is this a bug or am I asking too much of web2py? -- 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. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] Crash in gluon/html.py
On 24 Mar 2014, at 6:04 AM, Chris Hobbs cwlho...@gmail.com wrote: html.py does not seem to be unicode-safe. It contains (line 1914 or thereabouts): components.append(OPTION(c, _value=str(c))) In my case c contains Max-Guénaël (i.e., uMax-Gu\xe9na\xebl). The str(c) dies nastily. Is this a bug or am I asking too much of web2py? Is it practical for you to encode it yourself to utf8? Possible a better solution, long-term: define a function, call it ustr, either in html.py or in some utility file that does: def ustr(s): if isinstance(s, str): return s if isinstance(s, unicode): return s.encode('utf8') return str(s) I think it'd be a reasonable replacement for most (not all) of html.py's str() invocations. -- 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. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] New python.org layout
indeed. It seems very well thought and documented. On Monday, 24 March 2014 05:03:07 UTC-5, ureal frank wrote: On Sunday, March 23, 2014, Michele Comitini michele@gmail.comjavascript: wrote: ;-) ;-) From that page you sent I understand that Ansible is starting to get more traction than chef. Ansible is in python or what? yes and imho way cool. you didn't need agents On clients neither a weird infrastructure with daemons to manage your infrastructure. C'mon, we are talking about the *python* software foundation, they must favour a python based product, unless there is no other way. Deploying a django based application is such a pain that one starts looking for anything that can help automate the task. Paradoxically they had used RoR they wouldn't need chef. ;-) ;-) 2014-03-23 22:04 GMT+01:00 Niphlod niph...@gmail.com: offtopic you don't have to move to RoR. chef is just an emerging standard in deployment recipes (you may also intend it as buzzword-project gone right). See it as fabric snippets on steroids. Puppet, ansible, salt, etc, are also on the same family. http://redmonk.com/sogrady/2013/12/06/configuration-management-2013/ Instead of doing 'bash setup-*.sh' you do 'chef therecipe.rb' The fact that it needs ruby (not RoR) it's just due to the fact that creating DSL is much easier in ruby than python. /offtopic On Sunday, March 23, 2014 6:38:55 PM UTC+1, Michele Comitini wrote: 2014-03-23 18:31 GMT+01:00 Niphlod nip...@gmail.com: having a chef opcode does not count as ruby is needed. Given chef's spread, it's exactly as if we shipped all scripts/setup* scripts in ruby. I hope not! I started using web2py to avoid moving to ruby RoR! ;-) -- 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. For more options, visit https://groups.google.com/d/optout. -- 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. For more options, visit https://groups.google.com/d/optout. -- 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. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] New python.org layout
I wasn't sponsoring anything. Just as Django, it is *a* standard. -- 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. For more options, visit https://groups.google.com/d/optout.
[web2py] Can't send request password reset email
I'm working with a couple of applications where the password reset email isn't sending. I'm getting this error: Traceback (most recent call last): File /home/www-data/web2py/gluon/restricted.py, line 217, in restricted exec ccode in environment File /home/www-data/web2py/applications/ibc2/controllers/default.py https://ibc-internalsite.industrialbuyers.com/admin/edit/ibc2/controllers/default.py, line 92, in module File /home/www-data/web2py/gluon/globals.py, line 372, in lambda self._caller = lambda f: f() File /home/www-data/web2py/applications/ibc2/controllers/default.py https://ibc-internalsite.industrialbuyers.com/admin/edit/ibc2/controllers/default.py, line 54, in user return dict(form=auth()) File /home/www-data/web2py/gluon/tools.py, line 1303, in __call__ return getattr(self, args[0])() File /home/www-data/web2py/gluon/tools.py, line 2927, in request_reset_password if self.email_reset_password(user): File /home/www-data/web2py/gluon/tools.py, line 2951, in email_reset_password message=self.messages.reset_password % d): File /home/www-data/web2py/gluon/tools.py, line 371, in send raise Exception('Server address not specified') Exception: Server address not specified However, the server name is most definitely set in db.py. # configure email mail = Mail() mail.settings.server = 'localhost' mail.settings.sender = 'em...@companyname.com' mail.settings.login = None mail.settings.tls = False I seem to be missing something here, but can't figure out what it might be. Any pointers from anyone? -Jim -- 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. For more options, visit https://groups.google.com/d/optout.
[web2py] Problem with
I'm trying to auto-populate a field when a table entry is created. Of course, web2py has a feature, the compute= clause, just for this purpose! But... in my case at least, the feature is not working. OK -- full disclosure of the only weird thing going on in my design... I have pushed all table definitions into module files instead of loading them from the model directory. It saves a lot of time as I have large tables, and a bunch of them. So here is my table: @classmethod def createTable(cls,db): import datetime as dt db.define_table(meet, Field(id_club, reference club, label=Host club), Field(id_venue, reference venue, label=Venue, ondelete=SET NULL), Field(id_lsc, reference lsc, label=Swimming association, ondelete=SET NULL), Field(title, string, label=Additional Name,comment=ex: Spooktacular Halloween meet), Field(name, string,comment=ex: WA Zone 3 C/B/BB+), Field(sanction, string, label=Sanction Number), Field(info, text,label=Information,comment=To be shown on meet homepage), Field(start_date, date, label=Starting date,comment=First day of meet), ... blah, blah, blah... lots of fields here... Field(season, compute=lambda r: ((r['start_date'] or dt.datetime.now())+dt.timedelta(122)).date), current.auth.signature, format=%(name)s, migrate=current.settings.migrate) The table works perfectly except the compute field of season is never populated. I know for a fact the lambda is run, because when I had datetime imported into the wrong scope I got a walkback when this line was executed. But for some reason, the result of this calculation is never entered into the database when the row is created. Any ideas?? -- Joe B. -- 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. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Problem with
Huh. Nice descriptive title, huh? Did you know you can't edit the title after the post is created? Even if your mouse slipped up and clicked the submit button too soon? Ah well, live and learn. On Monday, March 24, 2014 1:20:59 PM UTC-7, Joe Barnhart wrote: I'm trying to auto-populate a field when a table entry is created. Of course, web2py has a feature, the compute= clause, just for this purpose! But... in my case at least, the feature is not working. OK -- full disclosure of the only weird thing going on in my design... I have pushed all table definitions into module files instead of loading them from the model directory. It saves a lot of time as I have large tables, and a bunch of them. So here is my table: @classmethod def createTable(cls,db): import datetime as dt db.define_table(meet, Field(id_club, reference club, label=Host club), Field(id_venue, reference venue, label=Venue, ondelete=SET NULL), Field(id_lsc, reference lsc, label=Swimming association, ondelete=SET NULL), Field(title, string, label=Additional Name,comment=ex: Spooktacular Halloween meet), Field(name, string,comment=ex: WA Zone 3 C/B/BB+), Field(sanction, string, label=Sanction Number), Field(info, text,label=Information,comment=To be shown on meet homepage), Field(start_date, date, label=Starting date,comment=First day of meet), ... blah, blah, blah... lots of fields here... Field(season, compute=lambda r: ((r['start_date'] or dt.datetime.now())+dt.timedelta(122)).date), current.auth.signature, format=%(name)s, migrate=current.settings.migrate) The table works perfectly except the compute field of season is never populated. I know for a fact the lambda is run, because when I had datetime imported into the wrong scope I got a walkback when this line was executed. But for some reason, the result of this calculation is never entered into the database when the row is created. Any ideas?? -- Joe B. -- 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. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Problem with
When you go into edit mode, there should be an Edit subject link (or maybe only moderators can see that). On Monday, March 24, 2014 4:22:35 PM UTC-4, Joe Barnhart wrote: Huh. Nice descriptive title, huh? Did you know you can't edit the title after the post is created? Even if your mouse slipped up and clicked the submit button too soon? Ah well, live and learn. On Monday, March 24, 2014 1:20:59 PM UTC-7, Joe Barnhart wrote: I'm trying to auto-populate a field when a table entry is created. Of course, web2py has a feature, the compute= clause, just for this purpose! But... in my case at least, the feature is not working. OK -- full disclosure of the only weird thing going on in my design... I have pushed all table definitions into module files instead of loading them from the model directory. It saves a lot of time as I have large tables, and a bunch of them. So here is my table: @classmethod def createTable(cls,db): import datetime as dt db.define_table(meet, Field(id_club, reference club, label=Host club), Field(id_venue, reference venue, label=Venue, ondelete=SET NULL), Field(id_lsc, reference lsc, label=Swimming association, ondelete=SET NULL), Field(title, string, label=Additional Name,comment=ex: Spooktacular Halloween meet), Field(name, string,comment=ex: WA Zone 3 C/B/BB+), Field(sanction, string, label=Sanction Number), Field(info, text,label=Information,comment=To be shown on meet homepage), Field(start_date, date, label=Starting date,comment=First day of meet), ... blah, blah, blah... lots of fields here... Field(season, compute=lambda r: ((r['start_date'] or dt.datetime.now())+dt.timedelta(122)).date), current.auth.signature, format=%(name)s, migrate=current.settings.migrate) The table works perfectly except the compute field of season is never populated. I know for a fact the lambda is run, because when I had datetime imported into the wrong scope I got a walkback when this line was executed. But for some reason, the result of this calculation is never entered into the database when the row is created. Any ideas?? -- Joe B. -- 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. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Can't send request password reset email
did you try with mail = auth.settings.mailer mail.settings.server . ? On Monday, March 24, 2014 9:02:09 PM UTC+1, Jim S wrote: I'm working with a couple of applications where the password reset email isn't sending. I'm getting this error: Traceback (most recent call last): File /home/www-data/web2py/gluon/restricted.py, line 217, in restricted exec ccode in environment File /home/www-data/web2py/applications/ibc2/controllers/default.py https://ibc-internalsite.industrialbuyers.com/admin/edit/ibc2/controllers/default.py, line 92, in module File /home/www-data/web2py/gluon/globals.py, line 372, in lambda self._caller = lambda f: f() File /home/www-data/web2py/applications/ibc2/controllers/default.py https://ibc-internalsite.industrialbuyers.com/admin/edit/ibc2/controllers/default.py, line 54, in user return dict(form=auth()) File /home/www-data/web2py/gluon/tools.py, line 1303, in __call__ return getattr(self, args[0])() File /home/www-data/web2py/gluon/tools.py, line 2927, in request_reset_password if self.email_reset_password(user): File /home/www-data/web2py/gluon/tools.py, line 2951, in email_reset_password message=self.messages.reset_password % d): File /home/www-data/web2py/gluon/tools.py, line 371, in send raise Exception('Server address not specified') Exception: Server address not specified However, the server name is most definitely set in db.py. # configure email mail = Mail() mail.settings.server = 'localhost' mail.settings.sender = 'em...@companyname.com javascript:' mail.settings.login = None mail.settings.tls = False I seem to be missing something here, but can't figure out what it might be. Any pointers from anyone? -Jim -- 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. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] Re: Can't send request password reset email
No, I hadn't tried that. I just did and it fixed it. Is that the recommended way to setup your mail server now? I must have done it wrong a long time ago and just kept replicating it. It works on some of my deployed apps, but not all of them. -Jim On Mon, Mar 24, 2014 at 4:49 PM, Niphlod niph...@gmail.com wrote: did you try with mail = auth.settings.mailer mail.settings.server . ? On Monday, March 24, 2014 9:02:09 PM UTC+1, Jim S wrote: I'm working with a couple of applications where the password reset email isn't sending. I'm getting this error: Traceback (most recent call last): File /home/www-data/web2py/gluon/restricted.py, line 217, in restricted exec ccode in environment File /home/www-data/web2py/applications/ibc2/controllers/default.py https://ibc-internalsite.industrialbuyers.com/admin/edit/ibc2/controllers/default.py, line 92, in module File /home/www-data/web2py/gluon/globals.py, line 372, in lambda self._caller = lambda f: f() File /home/www-data/web2py/applications/ibc2/controllers/default.py https://ibc-internalsite.industrialbuyers.com/admin/edit/ibc2/controllers/default.py, line 54, in user return dict(form=auth()) File /home/www-data/web2py/gluon/tools.py, line 1303, in __call__ return getattr(self, args[0])() File /home/www-data/web2py/gluon/tools.py, line 2927, in request_reset_password if self.email_reset_password(user): File /home/www-data/web2py/gluon/tools.py, line 2951, in email_reset_password message=self.messages.reset_password % d): File /home/www-data/web2py/gluon/tools.py, line 371, in send raise Exception('Server address not specified') Exception: Server address not specified However, the server name is most definitely set in db.py. # configure email mail = Mail() mail.settings.server = 'localhost' mail.settings.sender = 'em...@companyname.com' mail.settings.login = None mail.settings.tls = False I seem to be missing something here, but can't figure out what it might be. Any pointers from anyone? -Jim -- 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/mdz4qHx_nPI/unsubscribe. To unsubscribe from this group and all its topics, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- 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. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] Re: before_update callback and sheduler
Working fine here: steps to reproduce: - install whoosh - create a fresh app - overwrite fresh app with contents from your archive - go to /appname/default/form/1---argh!!! requesting me to follow the rabbit to see that if an arg isn't there the whole form crashes!!! - post a pdf - get /appname/default/form/1 with base_document.doc_text empty - run web2py.py -K appname - wait for the task to be executed steps to verify its working as expected: - get /appname/default/form/1 with base_document.doc_text full - confirm that private/index/ is created BTW: if you're expecting your print statements to appear somewhere you must turn on the debugging in the scheduler. Or, if you still want to debug by print (a perfectly fine method for simple things like this) just put a return 1 at the end of your task_get_pdf_text() function. In that way, a scheduler_run record will be created for each task execution and you'll be glad to see that your print statements are right there in the run_output column ! ^__^ -- 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. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] Re: Can't send request password reset email
I just saw how the welcome app is. The fact is (at least I think, there are a bit of turnarounds in the core code)... mail = Mail() is good if you later do mail.send() but Auth **needs** a mailer to send messages. Auth(db) in reality stands for Auth( db=None, mailer=True, hmac_key=.. ) the mailer parameter is treated as follows mailer=(mailer == True) and Mail() or mailer Soby default if you don't pass a mailer to Auth(), the default value (True) creates a Mail() object for you. Current welcome is smart in exploiting such shortcuts auth = Auth(db) . mail = auth.settings.mailer mail.settings.server = 'logging' or 'smtp.gmail.com:587' mail.settings.sender = 'y...@gmail.com' mail.settings.login = 'username:password' This assigns to the mail variable the Mail() created by Auth (so that Auth can use it), and configures it accordingly The other method would be to mail=Mail() mail.settings.server='smtp.gmail.com:587' mail.settings.sender='y...@somewhere.com' mail.settings.login='username:password' auth=Auth(db) auth.settings.mailer=mail # auth.settings=... auth.define_tables() In this way, Mail() created by Auth() is overwritten by your Mail() with the settings. Same thing goes with mail=Mail() mail.settings.server='smtp.gmail.com:587' mail.settings.sender='y...@somewhere.com' mail.settings.login='username:password' auth=Auth(db, mailer=mail) but in this case, Auth doesn't create it, so it's just an assignment and not an override ^__^ On Monday, March 24, 2014 10:54:43 PM UTC+1, Jim S wrote: No, I hadn't tried that. I just did and it fixed it. Is that the recommended way to setup your mail server now? I must have done it wrong a long time ago and just kept replicating it. It works on some of my deployed apps, but not all of them. -Jim -- 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. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Install in hostgator
When I used your commands, I got python2.6 in my virtualenv. To specify python2.7, rather than python2.6, in the virtualenv see below. In my example '/home/USER/python' == 'path to your new virtualenv' 1) virtualenv -p /usr/local/bin/python2.7 path to your new virtualenv 2) source path to your new virtualenv/bin/activate 3) pip install flup 4) deactivate This is the command to leave your virtualenv. To re-enter, use the command in #2. My project does not load (Error 500). From reading this forum, I think these are the required steps. Is this correct? 1. create a virtualenv and install flup 2. create a file '.htaccess' in the 'public_html' directory 2.1 edit content in /home4/USER/public_html/.htaccess 3. create a file 'index.fcgi' in the public_html' directory 3.1 edit content in /home4/USER/public_html/index.fcgi 4. make the index.fcgi file executable (I used cpanel 'File Manager' to set the permissions on this file to 755) 5. Download the source code for web2py from the web2py website. http://www.web2py.com/examples/static/web2py_src.zip 5.1 FTP or SCP the zip file to your /home4/USER directory 5.2 Use the unzip command to put web2py at /home4/USER/web2py 6. Copy the 'routespatterns.example.py' file from /home4/USER/web2py/examples to /home4/USER/web2py 6.1 rename the file 'routes.patterns.example.py' to 'routes.py' 6.2 edit content in /home4/USER/web2py/routes.py I sent a ticket to their support team about utilizing mod_wsgi or fcgi, knowing that web2py would not be supported. Will this even work with the 'Hatchling' package? Perhaps I am wasting my time and need to change hosting providers. From my support ticket: Currently, our Reseller and Shared plans (Hatchling, Baby, and Business) are set up with suPHP, and would require an upgrade if you needed to use a different handler. We have Apache 2.2 and 2.4 available for our VPS and Dedicated servers, and Apache 2.2 for our shared environment. In order to use fcgi or mod_wsgi, it is required that you upgrade to either a VPS or a Dedicated server solution. Both of these packages allow for custom configuration of nearly any aspect of your server, and give you full control over your software. Any pointers would be appreciated. Thanks! On Friday, January 31, 2014 9:36:47 AM UTC-8, desta wrote: I am writing to update this method. We have followed the instructions included above but we kept getting an internal server error 500. The problem was that we had no experience how virtualenv works! So first you need to create one with the following command: virtualenv /home/USER/python The problem was here, that this virtualenv missing the flup module. So to install you first need to run source /home/USER/python/bin/activate and then run pip install flup After that, it should work. Make sure you run the instructions from the previous posts. I hope this helps someone. On Wednesday, April 17, 2013 8:28:07 PM UTC+3, Diogo Munaro wrote: Thx man! You help me a lot!! Em sábado, 14 de maio de 2011 01h21min13s UTC-3, José Eloy escreveu: Hello! Recently a customer bought a hosting plan (business) with hostgator. I'm developing for him a web2py application, I have doubts of how to deploy it. Somebody can help me? The application runs well in localhost (ubuntu). Thanks in advance -- 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. For more options, visit https://groups.google.com/d/optout.
[web2py] default value in Options Widget
Hi, I am new to web2py and would like to know how to set the value of options widget. I am creating a form using SQLFORM.factory and have a select field with requires=IS_IN_SET(opt1,opt2,opt3) For fields of type input I am setting the value using form.element(input['name=name'])[_value] = myvalue The same doesn't work for options widget form.element(select['name=name'])[_value] = myvalue Appreciate any help you could provide. -- 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. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: default value in Options Widget
had you already tried : requires = IS_IN_SET(['opt1', 'opt2', 'opt3'], zero = 'opt1') ref : http://web2py.com/books/default/chapter/29/07/forms-and-validators#Range--set-and-equality-validators best regards, stifan -- 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. For more options, visit https://groups.google.com/d/optout.
[web2py] jQuery load no longer working
I have a strange issue. I had code that includes an external HTML file. It used to work. Lately, it suddenly no longer works. I've isolated the code and put it into my Welcome program. I am unable to figure out what's wrong. script $(function(){ $(#includedContent).load(/welcome/static/desc.html); }; /script div id='includedContent'Put included content here./div Since the Welcome application includes jQuery, this ought to work, right? And it did work in my development project. So what's wrong? Thanks. -- 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. For more options, visit https://groups.google.com/d/optout.