Re: [web2py] Re: PKI Authentication? How to grab users certificates httpd wsgi
not everyone needs client certificates, so of course the default config needs tuning. AFAIK (@michele can chime in any time, he's the original author) what is needed are a few environmental variables passed along, such as SSL_CLIENT_CERT SSL_CLIENT_RAW_CERT SSL_CLIENT_VERIFY SSL_CLIENT_SERIAL etc etc etc Apache docs mention that those should be enabled setting the directive SSLOptions +stdEnvVars On Tuesday, March 10, 2015 at 9:57:01 PM UTC+1, LoveWeb2py wrote: The main problem is that when I set auth.settings.login_form = X509Auth() as specified in the book I get the error: Login not allowed. No valid x509 credentials. My httpd.conf is exactly out of the book as specified for mod_wsgi http://web2py.com/books/default/chapter/29/13/deployment-recipes#mod_wsgi I want to pass the certificate credentials to the x509_auth class that web2py has, but its raising an exception because its not finding any certificate present. My browser has certificates in them as I checked them on other sites and they work fine. So its something between the browser, mod_wsgi, wsgi_handler.py or my httpd.conf On Tuesday, March 10, 2015 at 3:57:12 PM UTC-4, LoveWeb2py wrote: *httpd* - Apache Hypertext Transfer Protocol Server my httpd.conf has the certificates and is serving https out properly, I just can't seem to read the user certificates when they visit the site. On Tuesday, March 10, 2015 at 3:36:53 PM UTC-4, Richard wrote: This works out of the box with Rocket (the web2py built-in web server) but you may need some extra configuration work on the web server side if you are using a different web server. In particular you need to tell your web server where the certificates are located on local host and that it needs to verify certificates coming from the clients. How to do it is web server dependent and therefore omitted here. Which server do you use? Richard On Tue, Mar 10, 2015 at 3:35 PM, Richard Vézina ml.richa...@gmail.com wrote: Is M2Crypto there?? Basic, but you know... On Tue, Mar 10, 2015 at 3:18 PM, LoveWeb2py atayl...@gmail.com wrote: Just the basic stuff like first name and last name. But when I try to login using the x509 tutorial in the book I am getting Login not allowed. No valid x509 credentials. This tells me that my certificate isn't being read properly by web2py or I'm not passing the variables through uwsgi properly? Do I need to put something in the wsgi-handler, change my httpd.conf, or something else? On Tuesday, March 10, 2015 at 2:53:58 PM UTC-4, LoveWeb2py wrote: Hello, I'm wondering how to get the users details when they visit my site over SSL. I'm guessing I'll have to parse out the information through the WSGI handler? If anyone has insight or could provide direction I'd really appreciate 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+un...@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] Re: how to insert dynamic record id into field in form
I don't know enough to be able to reply. Here is code that works. Please let me know if there's better way. messageID captures the record ID so it can populate children further down the process db.InternalMessage.created_by.default = auth.user_id db.InternalMessage.subjectLine.label='' db.InternalMessage.messageBody.label='' ##db.InternalMessage.messageThreadID.default = db.InternalMessage.id # didn't work form=SQLFORM.factory(db.InternalMessage, labels=None) if form.process().accepted: recipientCount = db(db.TempInternalMessageRecipient.thisSessionID == response.session_id).count() if recipientCount == 0: session.flash='You did not select message recipients' redirect(URL('forgot_to_add_message_recipient')) messageID = db.InternalMessage.insert(**db.InternalMessage._filter_fields(form.vars)) form.vars.messageID=messageID selectedIndividuals = db((db.TempInternalMessageRecipient.thisSessionID == response.session_id) (db.auth_user.id == db.TempInternalMessageRecipient.recipientOfMessage)).select() for row in selectedIndividuals: db.InternalMessageRecipient.insert(recipientOfMessage=row.auth_user.id, messageID=messageID) session.flash='Your message has been sent.' db(db.InternalMessage.id == messageID.id).update(messageThreadID = messageID.id) db(db.TempInternalMessageRecipient.thisSessionID == response.session_id).delete() redirect(URL('information_center')) return locals() -- 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: Compute insert-only
My url builder requires the « id » field so _before_insert wouldn’t work. That’s a good suggestion though! Thanks Anthony :) Le 10 mars 2015 à 18:00, Anthony abasta...@gmail.com a écrit : Might be easier with a _before_insert callback, so you can add the new value along with the initial insert instead of after: db.mytable._before_insert.append(lambda fields: fields.update(url=make_url(fields))) Anthony On Tuesday, March 10, 2015 at 12:10:12 PM UTC-4, Niphlod wrote: code an _after_insert callback. On Tuesday, March 10, 2015 at 4:21:26 PM UTC+1, Louis Amon wrote: I'm trying to hard-code URLs for SEO purposes so I have a function (make_url(row)) that builds the paths based on other fields. I was thinking of using compute=make_url, but it seems that update operations also call the compute. Is there a way to use compute only on INSERT operations, and not on UPDATE ? -- Resources: - http://web2py.com http://web2py.com/ - http://web2py.com/book http://web2py.com/book (Documentation) - http://github.com/web2py/web2py http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list 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/I1acweQhAEY/unsubscribe https://groups.google.com/d/topic/web2py/I1acweQhAEY/unsubscribe. To unsubscribe from this group and all its topics, send an email to web2py+unsubscr...@googlegroups.com mailto:web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout 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] PKI Authentication? How to grab users certificates httpd wsgi
Which users details? On Tue, Mar 10, 2015 at 2:53 PM, LoveWeb2py atayloru...@gmail.com wrote: Hello, I'm wondering how to get the users details when they visit my site over SSL. I'm guessing I'll have to parse out the information through the WSGI handler? If anyone has insight or could provide direction I'd really appreciate 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. -- 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: how do I add form attributes to SQLFORM.factory?
If the attributes are supposed to apply to the HTML form element, then your approach is correct. But if the attributes belong to individual input and textarea elements, then you must use the widget argument of the Field() constructor or update the widget after creation. For example: Field('score', 'integer', widget=lambda f, v: SQLFORM.widgets.integer.widget(f, v, _autofocus= True)) or after defining the form: form.custom.widget.score['_autofocus'] = True Anthony On Monday, March 9, 2015 at 5:53:24 PM UTC-4, Oliver Holloway wrote: How do I get the form to autofocus the cursor into the text box? Here's one of the approaches I've tried. attributes = {'_autofocus':'autofocus', '_type':'tel', '_autocomplete':'off', '_style':'height:80px; width:80px'} score_box = SQLFORM.factory(Field('score', 'integer'), **attributes) Interestingly, the autocomplete attribute is definitely getting through, I've tested that repeatedly. None of the other ones are. I did see the post about doing this with a form.custom.widget https://groups.google.com/forum/#!searchin/web2py/autofocus/web2py/PC2nDnltGic/OiYEpQEORnkJ setting, but couldn't figure out how to make that work in my case. I've also experimented with using keepvalues=True, from looking through the book. Any help is much appreciated. This is the last thing on my list to have this demo ready. -- 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: DAL: INSERT-query's devilry
IMHO inserting to a view shouldn't be supported at all. On Thursday, March 12, 2015 at 12:18:10 AM UTC+1, Val K wrote: OK guys! My concrete suggestion: - Add attrubute _insert_with_returning to Table class - Fix adapter Postgres.py : def _insert(self, table, fields): table_rname = table.sqlsafe if fields: keys = ','.join(f.sqlsafe_name for f, v in fields) values = ','.join(self.expand(v, f.type) for f, v in fields) if table._id *and table._insert_with_returning*: self._last_insert = (table._id, 1) return 'INSERT INTO %s(%s) VALUES (%s) RETURNING %s;' % ( table_rname, keys, values, table._id.name) else: self._last_insert = None return 'INSERT INTO %s(%s) VALUES (%s);' % (table_rname, keys, values) else: self._last_insert return self._insert_empty(table) That's All Folks -- 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] Executesql SQLFORM.grid
Il 11/03/15 22:15, LaDarrius Stewart ha scritto: Is there anyway to move rows generated from executesql into a grid. With the use of executesql in web2py for complex queries I was surprised not to see this question asked anywhere else that I could find. please give a simplified example of your complicated query so we can try to help you... :) M. -- 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] integrating materialize.css
Someone recommended materialize.css http://materializecss.com/ as a great css resource. Does anyone have suggestions with how to integrate this with a web2py app? In general, a tutorial for using 3rd-party css packages would be great... at the very least, maybe some guidelines on how to create a layout plugin like those on web2py.com/layouts from a css package? -- 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: IMPORTANT - DROPPING SUPPORT FOR PYTHON 2.5?
On Wednesday, March 11, 2015 at 11:07:04 AM UTC-7, Gary Cowell wrote: On Saturday, 7 March 2015 19:18:17 UTC, Massimo Di Pierro wrote: Who is opposed? Why? It would mean support going for Red Hat 5 I think Red Hat 6 is on 2.6, Red Hat 7 is 2.7. Everything I have is at least Red Hat 6. But that would be the reason, most probably FWIW, my CentOS 6.6 is at 2.6.6, which should be equivalent to RHEL 6. My creaky old Fedora 16 has updated to 2.7.3, but Fedora doesn't have the lock-down presumptions of RHEL. /dps -- 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: Running multiple lines of SQL in executesql
Thank you, I tried this: db.executesql(set @num := 0, @type := ''; select type, variety, price from ( select type, variety, price, @num := if(@type = type, @num + 1, 1) as row_number, @type := type as dummy from fruits order by type, price ) as x where x.row_number = 2;)But it returns a null. From: Brian M Sent: Tuesday, March 10, 2015 9:42 PM To: web2py@googlegroups.com Subject: [web2py] Re: Running multiple lines of SQL in executesql Actually just surround your big long multi line SQL statement with triple quotes and it will work fine. I do that all the time. No need for the \ at each line break then either. You can declare and set your @variables all within one executesql query too. On Tuesday, March 10, 2015 at 2:36:28 PM UTC-5, naveed wrote: I need to execute multiple lines of SQL in web2py, something like this: db.executesql(set @num := 0, @type := '';)\ rows = db.executesql(select type, variety, price\ from (\ select type, variety, price,\ @num := if(@type = type, @num + 1, 1) as row_number,\ @type := type as dummy\ from fruits\ order by type, price\ ) as x where x.row_number = 2;)But, when I run it I don't get expected results in web2py (the variables don't get initialized), even though it works from the mysql console. What am I doing wrong? They don't work, even if I put the variable initialization in the same call. This piece of SQL is from here: http://www.xaprb.com/blog/2006/12/07/how-to-select-the-firstleastmax-row-per-group-in-sql/ -- 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/SQEWZzMQ4Gw/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] Please help us testing....
Google app engine support is broken since 2.9.12. Apparently nobody reported this. Doh! It is now fixed in trunk. Please help us test it. Also trunk includes a welcome3 with bootstrap3. Please check it. Let us know if you think this is good enough. I remind you you have to do git clone --recursive Massimo -- 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] Why does this not work: {{=LOAD(c='default', f='user', args='login', ajax=True)}}?
I'd like to be able to login a user using ajax if possible. I thought using LOAD for the built-in user forms would work, but when I add this to my index.html {{=LOAD(c='default', f='user', args='login', ajax=True)}} It only shows Loading Is this possible or do I have to use auth.login_bare? -- 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: type 'exceptions.NameError'(name 'auth' is not defined)
I don't think it has any effect. Although you really shouldn't do it. Particularly this: g_im_handle = '/home/mmb21167/web2py/ba_1_1/applications/welcome/static/%s' Makes the application not portable. Why would you even need to do this if you can do a os.path.join(request.folder, 'static') -- 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] Project: Heroku Buildpack for Web2py
I'm trying to create a Buildpack designed specifically for deploying Web2py-based applications on Heroku. Buildpacks are shell programs that are used to build deploy slugs on Heroku. The buildpack runs *before* the web2py application is launched. It is basically a kind of deploy hook. The features I'd like to include in the web2py buildpack are : - Byte-compilation of the web2py application - Migration and/or re-creation of the .table files - Installation of pip dependencies This would allow automatic optimization of the run speed and tackle the very tricky ephemeral filesystem of Heroku. I could really use some insights about how I should go about building this. Specifically, I need to know how to know how to byte-compile directly from the shell or from a python script and what strategy I should use to handle migrations at deploy-time ? This is the official buildpack for Python, which I intend to build mine upon : https://github.com/heroku/heroku-buildpack-python This is the documentation for the Buildpack API provided by Heroku : https://devcenter.heroku.com/articles/buildpack-api -- 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: two (or more) applications using the same database
Are you trying to have a table in one database (DAL instance) reference a table in a separate database? I don't think the DAL supports that. Anthony On Thursday, March 12, 2015 at 10:10:58 AM UTC-4, lucas wrote: alright, so i have successfully created my new database of states, counties, and zip codes. i wanted to recreate it based on a better database structure so i did it under a new DAL called db_region. however, when i have a regular db field like in the old, it would have looked like: Field('county', db.counties, requires=IS_IN_DB(db, db.counties.id, '%(county)s')), but now when i change it to reflect the new db_region DAL, shouldn't it look like: Field('county', db_region.county, requires=IS_IN_DB(db_region, db_region.county.id, '%(county)s)), ???, cuz i get the error: Traceback (most recent call last): File /opt/web-apps/web2py/gluon/restricted.py, line 224, in restricted exec ccode in environment File /opt/web-apps/web2py_2.9.11/applications/afs9/models/db.py https://accuratefamilysupport.com/admin/default/edit/afs9/models/db.py, line 357, in module format = '%(petitioner_last_name)s VS. %(respondent_last_name)s: %(case_number)s') File /opt/web-apps/web2py/gluon/dal.py, line 8414, in define_table table = self.lazy_define_table(tablename, *fields, **args) File /opt/web-apps/web2py/gluon/dal.py, line 8450, in lazy_define_table polymodel=polymodel) File /opt/web-apps/web2py/gluon/dal.py, line 929, in create_table raise KeyError('Cannot resolve reference %s in %s definition' % (referenced, table._tablename)) KeyError: 'Cannot resolve reference county in cases definition' when i try to recompile the code. so what am i doing wrong in this field definition. thanx in advance, lucas -- 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] SQLFORM refresh
If I use SQLFORM to update an existing record and some of the fields may be altered (eg, uppercased, or stripped of whitespace), I would like the form to show the resulting field values, not the ones that the user originally entered. I can see no way to do this. -- 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] bokeh python interactive data visualization
good to use with web2py ? http://bokeh.pydata.org/en/latest/docs/quickstart.html#quickstart Regards António -- 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: two (or more) applications using the same database
yes, wouldn't DAL need to if it allows for connection(s) to multiple databases in the first place? lucas On Thursday, March 12, 2015 at 10:22:32 AM UTC-4, Anthony wrote: Are you trying to have a table in one database (DAL instance) reference a table in a separate database? I don't think the DAL supports that. 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: PKI Authentication? How to grab users certificates httpd wsgi
@dps - I agree comments should be added. I'll put together a detailed description of the configuration changes I had to make and the modification needed in x509 auth to get it to work. -Austin On Wednesday, March 11, 2015 at 1:56:58 PM UTC-4, Dave S wrote: On Wednesday, March 11, 2015 at 6:50:28 AM UTC-7, mcm wrote: If you do not have the email you can use the registration_id and username fields. Most details are on the book: http://web2py.com/books/default/chapter/29/09/access-control Would it be appropriate to add some of the comments above into the deployment recipe chapter (#13 , URL: http://www.web2py.com/books/default/chapter/29/13/deployment-recipes#Apache-setup since the X509 section in your link ends with In particular you need to tell your web server where the certificates are located on local host and that it needs to verify certificates coming from the clients. How to do it is web server dependent and therefore omitted here. /dps 2015-03-11 14:08 GMT+01:00 Michele Comitini michele@gmail.com: You can read any of the fields a certificate contains eventually. see here for some ideas: https://code.google.com/p/simpatica/ It's a working PKI that allows to generate csr and sign them with a valid signin certificate 2015-03-11 13:48 GMT+01:00 LoveWeb2py atayl...@gmail.com: Once authentication happens how can I make them members of groups. I notice now they don't have an entry in Auth user. Should I have them register first and once they're reigstered they can use PKI authentication? This is uncharted waters for me so I'm trying to figure out the best approach for it. On Wednesday, March 11, 2015 at 8:05:48 AM UTC-4, mcm wrote: I am glad someone is using x509 Auth, it is a very simple way to handle user security, One important piece of the puzzle (with apache) is: SSLVerifyClient optional The optional allows one to accept any user on the website, while having some web2py actions require a valid user certificate just by adding the standard @auth.requires_login() ## Client Authentication (Type): # Client certificate verification type and depth. Types are none, optional, # require and optional_no_ca. Depth is a number which specifies how deeply # to verify the certificate issuer chain before deciding the certificate is # not valid. #SSLVerifyClient require #SSLVerifyDepth 10 2015-03-11 12:27 GMT+01:00 LoveWeb2py atayl...@gmail.com: Those are exactly the two I don't have so far from the list I saw in another post I have: SSL_CIPHER, SSL_CLIENT_I_DN, SSL_CLIENT_CERT, SSL_CLIENT_VERIFY The following are not being passed (probably a problem with my ssl.conf: SSL_CLIENT_RAW_CERT, SSL_SESSION_ID, SSL_CLIENT_SERIAL Almost there! :) I'll post the fix when I find it On Tuesday, March 10, 2015 at 7:56:45 PM UTC-4, Niphlod wrote: debug it, debug it, debug it. AFAICS, x509_auth.py requires: ssl_client_raw_cert optional ssl_client_serial On Wednesday, March 11, 2015 at 12:04:51 AM UTC+1, LoveWeb2py wrote: so I did {{=request.env}} and I can see the SSL DATA certificate in another app, but for some reason the app that requires the data isn't being passed. Going to keep troubleshooting that app because I really want to use the x509 authentication with web2py!! for some reason the x509 auth isn't working still. Going to keep pressing and will post a fix when I find it. Thank you so much for your help Niphlod. I hope this helps others in the future! On Tuesday, March 10, 2015 at 6:40:29 PM UTC-4, Niphlod wrote: what if you return somewhere this dict (takes the SSL* env variables and prints it) def yourcode(): . debug_values = {} for k, v in request.env.iteritems(): if k.lower().startswith('ssl'): debug_values[k] = v . return dict(., debug_values=debug_values) just to see if those gets indeed passed along. -- 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+un...@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+un...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. --
Re: [web2py] Re: two (or more) applications using the same database
alright, so i have successfully created my new database of states, counties, and zip codes. i wanted to recreate it based on a better database structure so i did it under a new DAL called db_region. however, when i have a regular db field like in the old, it would have looked like: Field('county', db.counties, requires=IS_IN_DB(db, db.counties.id, '%(county)s')), but now when i change it to reflect the new db_region DAL, shouldn't it look like: Field('county', db_region.county, requires=IS_IN_DB(db_region, db_region.county.id, '%(county)s)), ???, cuz i get the error: Traceback (most recent call last): File /opt/web-apps/web2py/gluon/restricted.py, line 224, in restricted exec ccode in environment File /opt/web-apps/web2py_2.9.11/applications/afs9/models/db.py https://accuratefamilysupport.com/admin/default/edit/afs9/models/db.py, line 357, in module format = '%(petitioner_last_name)s VS. %(respondent_last_name)s: %(case_number)s') File /opt/web-apps/web2py/gluon/dal.py, line 8414, in define_table table = self.lazy_define_table(tablename, *fields, **args) File /opt/web-apps/web2py/gluon/dal.py, line 8450, in lazy_define_table polymodel=polymodel) File /opt/web-apps/web2py/gluon/dal.py, line 929, in create_table raise KeyError('Cannot resolve reference %s in %s definition' % (referenced, table._tablename)) KeyError: 'Cannot resolve reference county in cases definition' when i try to recompile the code. so what am i doing wrong in this field definition. thanx in advance, lucas -- 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: two (or more) applications using the same database
you can use IS_IN_DB() but that would be an application constraint, not a db one (which 'reference othertable' creates instead). On Thursday, March 12, 2015 at 3:46:05 PM UTC+1, lucas wrote: yes, wouldn't DAL need to if it allows for connection(s) to multiple databases in the first place? lucas On Thursday, March 12, 2015 at 10:22:32 AM UTC-4, Anthony wrote: Are you trying to have a table in one database (DAL instance) reference a table in a separate database? I don't think the DAL supports that. 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: Can we disable moderation in the group?
On Thursday, March 12, 2015 at 5:51:00 PM UTC-4, Jack Kuan wrote: I too have a feeling that all my posts have been moderated because whenever I make a new post, I have to wait for hours or a day for it to show up in the group. Your posts are not moderated, but it looks like many existing members are still moderated. Perhaps we could try turning off moderation, and instead of group owners spending time approving new users or individual messages, we could instead delete spam and block their senders. The latter task may end up being just as easy and would remove a barrier for new users. 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: two (or more) applications using the same database
On Thursday, March 12, 2015 at 5:43:30 PM UTC-4, Niphlod wrote: Within the context of a web2py request, wouldn't there be two transactions open (one for each database)? In that case, at least if the request results in an error, both transactions would be rolled back. Anthony well, pydal isn't used only in web2py's context The context here is within web2py applications. but even if it was, you'd be forced to call a commit() on the callback (or just before that) to ensure referential integrity when dealing with such scenario. Why would you need a commit()? If everything is happening within a web2py request, any open transactions will be rolled back should either database throw an error, or if the app code itself results in an exception. So, if a record in one database is deleted, but then an exception occurs before the linked record in the other database is deleted, the initial delete gets rolled back. 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: two (or more) applications using the same database
i thought that could be a connection or association that web2py can make internally but above the database limitations. that should be doable no? On Thursday, March 12, 2015 at 11:03:07 AM UTC-4, Anthony wrote: On Thursday, March 12, 2015 at 10:46:05 AM UTC-4, lucas wrote: yes, wouldn't DAL need to if it allows for connection(s) to multiple databases in the first place? Separate DAL instances can have separate connections to different databases, but it is an entirely different matter setting up cross-database foreign keys (which are not supported by all databases, and certainly not between two different RDBMSs). 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: two (or more) applications using the same database
On Thursday, March 12, 2015 at 10:46:05 AM UTC-4, lucas wrote: yes, wouldn't DAL need to if it allows for connection(s) to multiple databases in the first place? Separate DAL instances can have separate connections to different databases, but it is an entirely different matter setting up cross-database foreign keys (which are not supported by all databases, and certainly not between two different RDBMSs). 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: PKI Authentication? How to grab users certificates httpd wsgi
Any thoughts on how I could check to see if the user is a new user and if they are to mark their account as pending (as if I was using the old form of auth). However, pending doesn't seem to work when using x509 auth. I wanted to use the book class: auth.settings.registration_requires_verification = True However, if I use PKI authentication it automatically registers the user and grants them access. Any thoughts on how I could set their account to pending when they visit the page for the first time? I was thinking of selecting db(db.auth_user.username==auth.user).select().first() if that equals none then enter their data with the account pending, else just pass, but pending doesn't work either. On Thursday, March 12, 2015 at 10:10:33 AM UTC-4, LoveWeb2py wrote: @dps - I agree comments should be added. I'll put together a detailed description of the configuration changes I had to make and the modification needed in x509 auth to get it to work. -Austin On Wednesday, March 11, 2015 at 1:56:58 PM UTC-4, Dave S wrote: On Wednesday, March 11, 2015 at 6:50:28 AM UTC-7, mcm wrote: If you do not have the email you can use the registration_id and username fields. Most details are on the book: http://web2py.com/books/default/chapter/29/09/access-control Would it be appropriate to add some of the comments above into the deployment recipe chapter (#13 , URL: http://www.web2py.com/books/default/chapter/29/13/deployment-recipes#Apache-setup since the X509 section in your link ends with In particular you need to tell your web server where the certificates are located on local host and that it needs to verify certificates coming from the clients. How to do it is web server dependent and therefore omitted here. /dps 2015-03-11 14:08 GMT+01:00 Michele Comitini michele@gmail.com: You can read any of the fields a certificate contains eventually. see here for some ideas: https://code.google.com/p/simpatica/ It's a working PKI that allows to generate csr and sign them with a valid signin certificate 2015-03-11 13:48 GMT+01:00 LoveWeb2py atayl...@gmail.com: Once authentication happens how can I make them members of groups. I notice now they don't have an entry in Auth user. Should I have them register first and once they're reigstered they can use PKI authentication? This is uncharted waters for me so I'm trying to figure out the best approach for it. On Wednesday, March 11, 2015 at 8:05:48 AM UTC-4, mcm wrote: I am glad someone is using x509 Auth, it is a very simple way to handle user security, One important piece of the puzzle (with apache) is: SSLVerifyClient optional The optional allows one to accept any user on the website, while having some web2py actions require a valid user certificate just by adding the standard @auth.requires_login() ## Client Authentication (Type): # Client certificate verification type and depth. Types are none, optional, # require and optional_no_ca. Depth is a number which specifies how deeply # to verify the certificate issuer chain before deciding the certificate is # not valid. #SSLVerifyClient require #SSLVerifyDepth 10 2015-03-11 12:27 GMT+01:00 LoveWeb2py atayl...@gmail.com: Those are exactly the two I don't have so far from the list I saw in another post I have: SSL_CIPHER, SSL_CLIENT_I_DN, SSL_CLIENT_CERT, SSL_CLIENT_VERIFY The following are not being passed (probably a problem with my ssl.conf: SSL_CLIENT_RAW_CERT, SSL_SESSION_ID, SSL_CLIENT_SERIAL Almost there! :) I'll post the fix when I find it On Tuesday, March 10, 2015 at 7:56:45 PM UTC-4, Niphlod wrote: debug it, debug it, debug it. AFAICS, x509_auth.py requires: ssl_client_raw_cert optional ssl_client_serial On Wednesday, March 11, 2015 at 12:04:51 AM UTC+1, LoveWeb2py wrote: so I did {{=request.env}} and I can see the SSL DATA certificate in another app, but for some reason the app that requires the data isn't being passed. Going to keep troubleshooting that app because I really want to use the x509 authentication with web2py!! for some reason the x509 auth isn't working still. Going to keep pressing and will post a fix when I find it. Thank you so much for your help Niphlod. I hope this helps others in the future! On Tuesday, March 10, 2015 at 6:40:29 PM UTC-4, Niphlod wrote: what if you return somewhere this dict (takes the SSL* env variables and prints it) def yourcode(): . debug_values = {} for k, v in request.env.iteritems(): if k.lower().startswith('ssl'): debug_values[k] = v . return dict(., debug_values=debug_values) just to see if those gets indeed passed along. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -
Re: [web2py] Re: two (or more) applications using the same database
On Thursday, March 12, 2015 at 11:20:15 AM UTC-4, lucas wrote: i thought that could be a connection or association that web2py can make internally but above the database limitations. that should be doable no? Well, as Niphlod pointed out, you can still use the IS_IN_DB validator to maintain the referential constraint from the app side. You won't get automatic cascading, but I suppose you could handle that with an _after_delete callback. Perhaps some of this could be automated by the DAL. 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: PKI Authentication? How to grab users certificates httpd wsgi
You can do another check and raise HTTP(404, 'Pending registration') if the user is pending just after that code you already put in place 2015-03-12 16:53 GMT+01:00 LoveWeb2py atayloru...@gmail.com: Any thoughts on how I could check to see if the user is a new user and if they are to mark their account as pending (as if I was using the old form of auth). However, pending doesn't seem to work when using x509 auth. I wanted to use the book class: auth.settings.registration_requires_verification = True However, if I use PKI authentication it automatically registers the user and grants them access. Any thoughts on how I could set their account to pending when they visit the page for the first time? I was thinking of selecting db(db.auth_user.username==auth.user).select().first() if that equals none then enter their data with the account pending, else just pass, but pending doesn't work either. On Thursday, March 12, 2015 at 10:10:33 AM UTC-4, LoveWeb2py wrote: @dps - I agree comments should be added. I'll put together a detailed description of the configuration changes I had to make and the modification needed in x509 auth to get it to work. -Austin On Wednesday, March 11, 2015 at 1:56:58 PM UTC-4, Dave S wrote: On Wednesday, March 11, 2015 at 6:50:28 AM UTC-7, mcm wrote: If you do not have the email you can use the registration_id and username fields. Most details are on the book: http://web2py.com/books/ default/chapter/29/09/access-control Would it be appropriate to add some of the comments above into the deployment recipe chapter (#13 , URL:http://www.web2py.com/books/default/chapter/29/13/ deployment-recipes#Apache-setup since the X509 section in your link ends with In particular you need to tell your web server where the certificates are located on local host and that it needs to verify certificates coming from the clients. How to do it is web server dependent and therefore omitted here. /dps 2015-03-11 14:08 GMT+01:00 Michele Comitini michele@gmail.com: You can read any of the fields a certificate contains eventually. see here for some ideas: https://code.google.com/p/simpatica/ It's a working PKI that allows to generate csr and sign them with a valid signin certificate 2015-03-11 13:48 GMT+01:00 LoveWeb2py atayl...@gmail.com: Once authentication happens how can I make them members of groups. I notice now they don't have an entry in Auth user. Should I have them register first and once they're reigstered they can use PKI authentication? This is uncharted waters for me so I'm trying to figure out the best approach for it. On Wednesday, March 11, 2015 at 8:05:48 AM UTC-4, mcm wrote: I am glad someone is using x509 Auth, it is a very simple way to handle user security, One important piece of the puzzle (with apache) is: SSLVerifyClient optional The optional allows one to accept any user on the website, while having some web2py actions require a valid user certificate just by adding the standard @auth.requires_login() ## Client Authentication (Type): # Client certificate verification type and depth. Types are none, optional, # require and optional_no_ca. Depth is a number which specifies how deeply # to verify the certificate issuer chain before deciding the certificate is # not valid. #SSLVerifyClient require #SSLVerifyDepth 10 2015-03-11 12:27 GMT+01:00 LoveWeb2py atayl...@gmail.com: Those are exactly the two I don't have so far from the list I saw in another post I have: SSL_CIPHER, SSL_CLIENT_I_DN, SSL_CLIENT_CERT, SSL_CLIENT_VERIFY The following are not being passed (probably a problem with my ssl.conf: SSL_CLIENT_RAW_CERT, SSL_SESSION_ID, SSL_CLIENT_SERIAL Almost there! :) I'll post the fix when I find it On Tuesday, March 10, 2015 at 7:56:45 PM UTC-4, Niphlod wrote: debug it, debug it, debug it. AFAICS, x509_auth.py requires: ssl_client_raw_cert optional ssl_client_serial On Wednesday, March 11, 2015 at 12:04:51 AM UTC+1, LoveWeb2py wrote: so I did {{=request.env}} and I can see the SSL DATA certificate in another app, but for some reason the app that requires the data isn't being passed. Going to keep troubleshooting that app because I really want to use the x509 authentication with web2py!! for some reason the x509 auth isn't working still. Going to keep pressing and will post a fix when I find it. Thank you so much for your help Niphlod. I hope this helps others in the future! On Tuesday, March 10, 2015 at 6:40:29 PM UTC-4, Niphlod wrote: what if you return somewhere this dict (takes the SSL* env variables and prints it) def yourcode(): . debug_values = {} for k, v in request.env.iteritems(): if k.lower().startswith('ssl'): debug_values[k] = v . return dict(., debug_values=debug_values) just to see if those gets indeed passed
[web2py] Re: SQLFORM refresh
Is the alteration done automatically? Or is it something that's applied later? Due to user input? If this alteration is automatic, you can use the represent keyword to Field(). On Thursday, March 12, 2015 at 10:35:57 AM UTC-4, horridohobbyist wrote: If I use SQLFORM to update an existing record and some of the fields may be altered (eg, uppercased, or stripped of whitespace), I would like the form to show the resulting field values, not the ones that the user originally entered. I can see no way to do this. -- 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 we disable moderation in the group?
I've been moderated for more than the first post... On Tuesday, March 10, 2015 at 10:39:46 AM UTC-4, Massimo Di Pierro wrote: We only moderate the first post. We get lots of spam. On Friday, 6 March 2015 20:12:30 UTC-6, Jack Kuan wrote: I don't see the need and think it can be off putting for new comers. -- 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: Integrating with Google App Engine
if you plan to deploy on GAE, develop on GAE. On Thursday, March 12, 2015 at 7:46:16 PM UTC+1, Omar Sanseviero wrote: I have a question about web2py. Should I be implementing all the database in web2py or in GAE? -- 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: Integrating with Google App Engine
On Thursday, March 12, 2015 at 2:15:54 PM UTC-7, Niphlod wrote: if you plan to deploy on GAE, develop on GAE. On Thursday, March 12, 2015 at 7:46:16 PM UTC+1, Omar Sanseviero wrote: I have a question about web2py. Should I be implementing all the database in web2py or in GAE? If the database needs to be persistent long-term (almost always the case, if you need a database in the first place), isn't it the case that GAE has to be setup to handle that? /dps -- 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: Unclear how to create a unique multiple fields on web2py
I tis also possible to use _before_insert before form process : http://stackoverflow.com/questions/8054665/multi-column-unique-constraint-with-web2py/23738715#23738715 On Sunday, 29 June 2014 02:16:14 UTC+1, Daniel Lafrance wrote: Thanks M. Di Pierro I was not expecting an answer so fast. I will give that a try but I can not remove the unique clause from the DBMS because other apps (PHP and PERL) also have access to it. Regard's D. Lafrance Le vendredi 27 juin 2014 02:20:26 UTC-4, Massimo Di Pierro a écrit : I would not do it that way. There are two places to enforce uniqueness: at the database level and at the form level. To enforce is at the database level you can manually do create table sometable ( a_field varchar(10), b_field timestamp default date(now()), unique(a_field, b_field) ); and in web2py: db.define_table('sometable', Field('a_field', 'string', length=10), Field('b_field','datetime', default=request.now), migrate=False ) so web2py will take the table as in database. This still will not enforce uniqueness in forms. To enforce uniqueness in forms, the problem is, you need to specify how is the error to be reported. Let's say you want the b field to report the error. You can do this in the action, before SQLFORM... def index(): if request.post_vars.b_field: db.sometable.b_field.requires = IS_NOT_IN_DB(db(db.sometable.a_field== request.post_vars.a_field),'b_field') form = SQLFORM(db.sometable).process() On Thursday, 26 June 2014 12:32:17 UTC-5, Daniel Lafrance wrote: Hi gang I am quite new to web2py and i am confronted to the following lack of my own knowledge. In other DB engine one can write : create table sometable ( a_field varchar(10), b_field timestamp default date(now()), unique(a_field, b_field) ); wich I have reproduce in web2py using the following syntax: # coding: utf8 db.define_table('sometable', Field('a_field', 'string', length=10), Field('b_field','datetime', default=request.now), Field('unique_fields','text',compute=lambda s: str(s.a_field) + str(s.b_field), unique=True) ) db.sometable.requires = IS_NOT_IN_DB(db, 'sometable.unique_fields') Written as is it works and I get a ticket when I try to create duplicate. My question is : In some posts it is being said not to put the unique=True for the unique field. I have tried it, (after deleting all databases files created by web2py) and the IS_NOT_IN_DB clause does not seem to work. Any idea of what I am doing wrong ? Regard's Daniel L -- 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: two (or more) applications using the same database
On Thursday, March 12, 2015 at 4:53:18 PM UTC+1, Anthony wrote: On Thursday, March 12, 2015 at 11:20:15 AM UTC-4, lucas wrote: i thought that could be a connection or association that web2py can make internally but above the database limitations. that should be doable no? Well, as Niphlod pointed out, you can still use the IS_IN_DB validator to maintain the referential constraint from the app side. You won't get automatic cascading, but I suppose you could handle that with an _after_delete callback. Perhaps some of this could be automated by the DAL. I don't think it'll be safe, because there's no way to support a callback in the same transaction on different dbs, hence there's no way to preserve integrity. -- 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: two (or more) applications using the same database
On Thursday, March 12, 2015 at 4:53:18 PM UTC+1, Anthony wrote: On Thursday, March 12, 2015 at 11:20:15 AM UTC-4, lucas wrote: i thought that could be a connection or association that web2py can make internally but above the database limitations. that should be doable no? Well, as Niphlod pointed out, you can still use the IS_IN_DB validator to maintain the referential constraint from the app side. You won't get automatic cascading, but I suppose you could handle that with an _after_delete callback. Perhaps some of this could be automated by the DAL. I don't think it'll be safe, because there's no way to support a callback in the same transaction on different dbs, hence there's no way to preserve integrity. Within the context of a web2py request, wouldn't there be two transactions open (one for each database)? In that case, at least if the request results in an error, both transactions would be rolled back. 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: accessing current.variable from a module
are you staying in the same thread while calling BOTH initialize and parse_command() ? On Thursday, March 12, 2015 at 7:46:16 PM UTC+1, Gray Kanarek wrote: I'm defining a variable in one of my modules: from gluon import * def initialize(): current.output_buffer = deque(maxlen=100) The problem is, when I try to access the same variable in a different routine in the same module, I get: def parse_command(command): pre_buffer = current.output_buffer -- AttributeError: 'thread._local' object has no attribute 'output_buffer' I thought that as long as I dealt with current.stored_variable in local scope, I was fine... is this not the case? Is there a better way to store a session-specific global variable than this? (I'm pretty new when it comes to web dev, so it's likely there's something I'm missing.) -- 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] Integrating with Google App Engine
I have a question about web2py. Should I be implementing all the database in web2py or in GAE? -- 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] accessing current.variable from a module
I'm defining a variable in one of my modules: from gluon import * def initialize(): current.output_buffer = deque(maxlen=100) The problem is, when I try to access the same variable in a different routine in the same module, I get: def parse_command(command): pre_buffer = current.output_buffer -- AttributeError: 'thread._local' object has no attribute 'output_buffer' I thought that as long as I dealt with current.stored_variable in local scope, I was fine... is this not the case? Is there a better way to store a session-specific global variable than this? (I'm pretty new when it comes to web dev, so it's likely there's something I'm missing.) -- 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: IMPORTANT - DROPPING SUPPORT FOR PYTHON 2.5?
OSX earlier than 10.7 isn't supported by Apple anymore (and so is a pain to use), and even 10.6.8 shipped with 2.6. On Wednesday, March 11, 2015 at 7:41:33 PM UTC-4, LightDot wrote: RHEL 5 (and naturally CentOS 5 etc.) ship with python 2.4.3, that's already water under the bridge as far ar web2py goes. Keeping python 2.6 compatibility for a good while longer would be greatly appreciated - we have quite a few production apps on RHEL 6 / Scientific Linux 6, but python 2.5 is of no interest to us. Looking at the greater picture, I see nobody speaking in favor of python 2.5 compatibility so far. Hm? No Mac OS X users that still need it..? Regards On Wednesday, March 11, 2015 at 7:07:04 PM UTC+1, Gary Cowell wrote: On Saturday, 7 March 2015 19:18:17 UTC, Massimo Di Pierro wrote: Who is opposed? Why? It would mean support going for Red Hat 5 I think Red Hat 6 is on 2.6, Red Hat 7 is 2.7. Everything I have is at least Red Hat 6. But that would be the reason, most probably -- 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: PKI Authentication? How to grab users certificates httpd wsgi
@Austin, did you try to set CGI/WSGI variables by using SetEnv and PassEnv directives inside your apache configuration? IMHO that would make things cleaner than modifying the x509 module. mic 2015-03-12 15:10 GMT+01:00 LoveWeb2py atayloru...@gmail.com: @dps - I agree comments should be added. I'll put together a detailed description of the configuration changes I had to make and the modification needed in x509 auth to get it to work. -Austin On Wednesday, March 11, 2015 at 1:56:58 PM UTC-4, Dave S wrote: On Wednesday, March 11, 2015 at 6:50:28 AM UTC-7, mcm wrote: If you do not have the email you can use the registration_id and username fields. Most details are on the book: http://web2py.com/books/ default/chapter/29/09/access-control Would it be appropriate to add some of the comments above into the deployment recipe chapter (#13 , URL:http://www.web2py.com/books/default/chapter/29/13/ deployment-recipes#Apache-setup since the X509 section in your link ends with In particular you need to tell your web server where the certificates are located on local host and that it needs to verify certificates coming from the clients. How to do it is web server dependent and therefore omitted here. /dps 2015-03-11 14:08 GMT+01:00 Michele Comitini michele@gmail.com: You can read any of the fields a certificate contains eventually. see here for some ideas: https://code.google.com/p/simpatica/ It's a working PKI that allows to generate csr and sign them with a valid signin certificate 2015-03-11 13:48 GMT+01:00 LoveWeb2py atayl...@gmail.com: Once authentication happens how can I make them members of groups. I notice now they don't have an entry in Auth user. Should I have them register first and once they're reigstered they can use PKI authentication? This is uncharted waters for me so I'm trying to figure out the best approach for it. On Wednesday, March 11, 2015 at 8:05:48 AM UTC-4, mcm wrote: I am glad someone is using x509 Auth, it is a very simple way to handle user security, One important piece of the puzzle (with apache) is: SSLVerifyClient optional The optional allows one to accept any user on the website, while having some web2py actions require a valid user certificate just by adding the standard @auth.requires_login() ## Client Authentication (Type): # Client certificate verification type and depth. Types are none, optional, # require and optional_no_ca. Depth is a number which specifies how deeply # to verify the certificate issuer chain before deciding the certificate is # not valid. #SSLVerifyClient require #SSLVerifyDepth 10 2015-03-11 12:27 GMT+01:00 LoveWeb2py atayl...@gmail.com: Those are exactly the two I don't have so far from the list I saw in another post I have: SSL_CIPHER, SSL_CLIENT_I_DN, SSL_CLIENT_CERT, SSL_CLIENT_VERIFY The following are not being passed (probably a problem with my ssl.conf: SSL_CLIENT_RAW_CERT, SSL_SESSION_ID, SSL_CLIENT_SERIAL Almost there! :) I'll post the fix when I find it On Tuesday, March 10, 2015 at 7:56:45 PM UTC-4, Niphlod wrote: debug it, debug it, debug it. AFAICS, x509_auth.py requires: ssl_client_raw_cert optional ssl_client_serial On Wednesday, March 11, 2015 at 12:04:51 AM UTC+1, LoveWeb2py wrote: so I did {{=request.env}} and I can see the SSL DATA certificate in another app, but for some reason the app that requires the data isn't being passed. Going to keep troubleshooting that app because I really want to use the x509 authentication with web2py!! for some reason the x509 auth isn't working still. Going to keep pressing and will post a fix when I find it. Thank you so much for your help Niphlod. I hope this helps others in the future! On Tuesday, March 10, 2015 at 6:40:29 PM UTC-4, Niphlod wrote: what if you return somewhere this dict (takes the SSL* env variables and prints it) def yourcode(): . debug_values = {} for k, v in request.env.iteritems(): if k.lower().startswith('ssl'): debug_values[k] = v . return dict(., debug_values=debug_values) just to see if those gets indeed passed along. -- 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+un...@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
[web2py] Re: Project: Heroku Buildpack for Web2py
1. You do not need to byte compile form shell. The code is byte compiled when requested 2. bug can of worms. Problem in a multi-server environment is that only one of the server can do migrations at once but all need the correct .table files. I do not have a simple answer. Make sure you look into gluon/contrib/heroku.py On Thursday, 12 March 2015 09:02:54 UTC-5, Louis Amon wrote: I'm trying to create a Buildpack designed specifically for deploying Web2py-based applications on Heroku. Buildpacks are shell programs that are used to build deploy slugs on Heroku. The buildpack runs *before* the web2py application is launched. It is basically a kind of deploy hook. The features I'd like to include in the web2py buildpack are : - Byte-compilation of the web2py application - Migration and/or re-creation of the .table files - Installation of pip dependencies This would allow automatic optimization of the run speed and tackle the very tricky ephemeral filesystem of Heroku. I could really use some insights about how I should go about building this. Specifically, I need to know: 1. how to to byte-compile directly from the shell or from a python script 2. what strategy I should use to handle migrations at deploy-time This is the official buildpack for Python, which I intend to build mine upon : https://github.com/heroku/heroku-buildpack-python This is the documentation for the Buildpack API provided by Heroku : https://devcenter.heroku.com/articles/buildpack-api -- 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: bokeh python interactive data visualization
why not? On Thursday, 12 March 2015 09:46:21 UTC-5, Ramos wrote: good to use with web2py ? http://bokeh.pydata.org/en/latest/docs/quickstart.html#quickstart Regards António -- 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 we disable moderation in the group?
I too have a feeling that all my posts have been moderated because whenever I make a new post, I have to wait for hours or a day for it to show up in the group. -- 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: two (or more) applications using the same database
Within the context of a web2py request, wouldn't there be two transactions open (one for each database)? In that case, at least if the request results in an error, both transactions would be rolled back. Anthony well, pydal isn't used only in web2py's context but even if it was, you'd be forced to call a commit() on the callback (or just before that) to ensure referential integrity when dealing with such scenario. This theoretically would enable handling the logic required to perform such a task feasible, but only in the case if it's the only operation in the whole function. A user can still put a commit() here and there in web2py, breaking the aforementioned safety... moreover, I don't certainly want a something commit()ting on my behalf under the hood, breaking my own app's integrity. -- 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: Why does this not work: {{=LOAD(c='default', f='user', args='login', ajax=True)}}?
It is possible but it will not automatically refresh the outer page. Not sure why it is stuck on loading without looking at the rest of the code. On Tuesday, 10 March 2015 19:29:42 UTC-5, naveed wrote: I'd like to be able to login a user using ajax if possible. I thought using LOAD for the built-in user forms would work, but when I add this to my index.html {{=LOAD(c='default', f='user', args='login', ajax=True)}} It only shows Loading Is this possible or do I have to use auth.login_bare? -- 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: import_from_csv_file and id_map={}
I agree. The problem is lack of manpower. If you send me a paragraph I will include it in the docs. On Wednesday, 11 March 2015 13:07:04 UTC-5, Tom Clerckx wrote: I recently learned (by searching through the google-group) the usefulness of the id_map={} parameter in the db.import_from_csv_file function. I was wondering why this is not included in the documentation of web2py? Is this on the 'todo' list or is there another reason why it is not included? Best regards, Tom. -- 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: Wildcard in domain mapping route?
I don't think so, but would love to have something like this in Parameter Based System domains = {*.myserver.com: myapp/controller/function/*} On Wednesday, 30 May 2012 22:23:50 UTC+1, pbreit wrote: Is it possible to wildcard the sub-domain of a domain mapping route? Ex: domains = {*.myserver.com: myapp} -- 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: Compute insert-only
code an _after_insert callback. On Tuesday, March 10, 2015 at 4:21:26 PM UTC+1, Louis Amon wrote: I'm trying to hard-code URLs for SEO purposes so I have a function (make_url(row)) that builds the paths based on other fields. I was thinking of using compute=make_url, but it seems that update operations also call the compute. Is there a way to use compute only on INSERT operations, and not on UPDATE ? -- 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] Compute insert-only
That’d do the trick nicely. Thanks Niphlod! Le 10 mars 2015 à 17:10, Niphlod niph...@gmail.com a écrit : code an _after_insert callback. On Tuesday, March 10, 2015 at 4:21:26 PM UTC+1, Louis Amon wrote: I'm trying to hard-code URLs for SEO purposes so I have a function (make_url(row)) that builds the paths based on other fields. I was thinking of using compute=make_url, but it seems that update operations also call the compute. Is there a way to use compute only on INSERT operations, and not on UPDATE ? -- Resources: - http://web2py.com http://web2py.com/ - http://web2py.com/book http://web2py.com/book (Documentation) - http://github.com/web2py/web2py http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list 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/I1acweQhAEY/unsubscribe https://groups.google.com/d/topic/web2py/I1acweQhAEY/unsubscribe. To unsubscribe from this group and all its topics, send an email to web2py+unsubscr...@googlegroups.com mailto:web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout 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.