[web2py] How to use Let's Encrypt with Web2Py on Apache

2016-01-23 Thread Jean-François Milants
Hi, I would like to get certificates from Let's Encrypt (https://letsencrypt.org/) for my Web2Py applications, but I don't know how to make it work with Let's Encrypt. I already manage to get a certificate for a PHP application, using the --webroot method. This method creates a temporary file

[web2py] Re: How to use Let's Encrypt with Web2Py on Apache

2016-01-23 Thread Anthony
You could configure Apache itself to respond, or you can use web2py's routes.py to route the incoming request to a controller that then returns the requested file. Anthony On Saturday, January 23, 2016 at 10:30:52 AM UTC-5, Jean-François Milants wrote: > > Hi, > > I would like to get certifica

Re: [web2py] Re: Mysterious key error

2016-01-23 Thread Anthony
On Saturday, January 23, 2016 at 1:22:52 AM UTC-5, Seraaj Muneer wrote: > > It appears that placing the 'common_filter' in the table definition > together with the speical field 'request_tenant' is problematic. However, > doing > > > db.bank.common_filter = lambda query: db.bank.company_id == >

[web2py] Print all items from inner join while grouping them

2016-01-23 Thread Hermann Tchehoun
Hello Everyone ! Following this code example in the manual , I can only print the first thing owned by alex when I do "print row.thing.name" What to do to have all the thing owned by someone displayed whi

[web2py] Re: How to use Let's Encrypt with Web2Py on Apache

2016-01-23 Thread Jean-François Milants
If Apache could serve the file by itself, without my Web2Py application knowing it, it would be perfect! But I don't know how to configure Apache so that it does not transmit the request to wsgihandler.py. Here is my virtual host file: ServerName adomain.com ServerAlias www.adomai

[web2py] Re: How to use Let's Encrypt with Web2Py on Apache

2016-01-23 Thread Anthony
> > AliasMatch ^/([^/]+)/static/(.*) > /home/www-data/web2py-2.10/applications/$1/static/$2 > > Order Allow,Deny > Allow from all > > The above block configures Apache to serve web2py static files directly (rather than passing

Re: [web2py] Re: Mysterious key error

2016-01-23 Thread Seraaj Muneer
Unfortunately refactoring to db.define_table('company', Field('name', 'string', length=20, represent=lambda name, row: name.upper(), required=True, unique=True, notnull=True, ), Field('is_default'

Re: [web2py] Re: Mysterious key error

2016-01-23 Thread Seraaj Muneer
To be clear, I didn't insert the last line response ._vars=response ._caller(banks) in the controller. Web2py did that. On Saturday, 23 January 2016 18:06:23 UTC, Seraaj Muneer wrote:

Re: [web2py] Re: Mysterious key error

2016-01-23 Thread Seraaj Muneer
If I take out common_filter=lambda query: db.bank.company_id == get_default_company_id() from the table definition, everthing works just fine. On Saturday, 23 January 2016 18:10:54 UTC, Seraaj Muneer wrote: > > To be clear, I didn't insert the last line > > response

[web2py] Re: Print all items from inner join while grouping them

2016-01-23 Thread 'DenesL' via web2py-users
Use orderby: for row in db(db.person.id==db.thing.owner_id).select( db.person.name,db.thing.name, orderby=db.person.name): print row.person.name, row.thing.name Denes On Saturday, January 23, 2016 at 11:59:59 AM UTC-5, Hermann Tchehoun wrote: > > Hello Everyone ! > > Following

[web2py] Retrieve value of dictionary in field with requires=IS_IN_SET(dictcionary)

2016-01-23 Thread Fabio Ceccarani
Hi all, I create a field with requires=IS_IN_SET where list of values is a dictionary: db.define_table('courses', ... Field('category',requires=IS_IN_SET({1:'Arte',2:'Artigianato',3:'Cucina',4 :'sport',5:'informatica'},zero='Scegli la categoria')) ...) In default.py *result* function ret

[web2py] download csv and excel file in zip

2016-01-23 Thread Yebach
Hello I have the following problem I need to download a csv and an excel file together in a zip file I would like to skip the part to create file(s) on server and then serve it and remove it. I am getting an error while using import csv, cStringIO import zipfile exported_chun

Re: [web2py] web2py on AWS

2016-01-23 Thread Michele Comitini
did you run with the -p option? else you should connect to port 8000, i.e: http://your.aws.ip:8000/welcome check the output of: netstart -tanp | grep 80 mic 2016-01-23 8:46 GMT+01:00 Dave S : > I'm trying to set up a demo on an AWS free-tier linux system. I'm running > web2py in shake-the-box

[web2py] Re: Retrieve value of dictionary in field with requires=IS_IN_SET(dictcionary)

2016-01-23 Thread 'DenesL' via web2py-users
web2py will only store the key part (1,2,.. or 5) in the category field. You have to provide the value part for the key:value pairs. courses = {1:'Arte',2:'Artigianato',3:'Cucina',4:'sport',5:'informatica'} db.courses.category.requires = IS_IN_SET(courses, zero='Scegli la categoria' ) # it can be

[web2py] Re: download csv and excel file in zip

2016-01-23 Thread Niphlod
something is wrong with the code zipf.writestr('ExportAllWorkers.csv', rows) you can't pipe in to writestr "rows", which in your case is the uber-rich Rows object spitted by DAL, as writestr expects a file-like object or a string. Maybe what you're trying to do is to pipe in the default r

Re: [web2py] Re: download csv and excel file in zip

2016-01-23 Thread Vid Ogris
and how do i add excel file to zip? On Jan 23, 2016 8:09 PM, "Niphlod" wrote: > something is wrong with the code > > zipf.writestr('ExportAllWorkers.csv', rows) > > you can't pipe in to writestr "rows", which in your case is the uber-rich > Rows object spitted by DAL, as writestr expects a fi

[web2py] Re: Print all items from inner join while grouping them

2016-01-23 Thread Hermann Tchehoun
Hi Denes, Thanks for your answer. But in your answer, you've removed the "groupby" and the count. What I need is to print the - the Owner - the quantity of thing owned -and the list of these things what you suggest don't give me the number of things. Is there a way to have all the 3 (owner, num

Re: [web2py] Re: download csv and excel file in zip

2016-01-23 Thread Niphlod
where is your excel file created ? On Saturday, January 23, 2016 at 8:10:18 PM UTC+1, Yebach wrote: > > and how do i add excel file to zip? > On Jan 23, 2016 8:09 PM, "Niphlod" > wrote: > >> something is wrong with the code >> >> zipf.writestr('ExportAllWorkers.csv', rows) >> >> you can't pip

[web2py] Re: web2py resources

2016-01-23 Thread Alfonso Serra
web2py video bookmarks Massimo's 4 web2py videos are 11 hours long so its hard to find specifics subjects. With this tool you can create VLC Player bookmarks which helps to quickly find any subject. demo video vlclist.zip

[web2py] Re: web2py on AWS

2016-01-23 Thread Mark Graves
Hey Dave, Any reason why you are choosing to use the rocket server and manual install? I usually use the scripts from github as follows: (configurable, but ubuntu is easiest) 1. Create new ubuntu micro box. 2. ssh into box 3. wget https://raw.githubusercontent.com/web2py/web2py/master/scripts/

[web2py] Re: web2py on AWS

2016-01-23 Thread Mark Graves
Re reading your answer, check the access logs. See if rocket is getting overwhelmed by robots or other spam traffic. consider installing ip tables if thats the case or use nginx. -Mark On Saturday, January 23, 2016 at 1:46:56 AM UTC-6, Dave S wrote: > > I'm trying to set up a demo on an AWS fr

[web2py] improving DAL for normalized DB

2016-01-23 Thread Val K
Hi guys! I have an idea to improve DAL in scope of work with normalized DB. As known It's a common practice to avoid NULL value by creating separate (option) table(s) to store non required fields. So, it would be great to have a field type like "storedin table_name.field_name" For example: db

[web2py] Re: compute and after_insert callback on table

2016-01-23 Thread 黄祥
still face the same error : e.g. db.define_table('default_size', Field('name'), Field('length_in_cm', 'double'), Field('width_in_cm', 'double'), Field('total_square_meter', 'double'), Field('acquisition_price', 'integer') ) db.default_size.total_square_meter.compute = lambda r: (float(r['length_