[web2py] Displaying images

2017-04-05 Thread Dave S
I have a bunch of pix that I want to display, which are not in the uploads 
directory of the application.  My options appear to be:

- copy them to the static folder (or a subfolder) and have URL() work for 
them
- set up streamio on each so I can read them from an arbitrary filesystem 
location
- store them as a blob in the database

Is there another option?

If there was just a handful, relatively stable over time, the static option 
would seem a good idea (because it would be simple to do).  But I took more 
than 20 shots yesterday (starting with spring hillsides, and then trying to 
capture birds in flight), and that was just one outing (limited by the 
memory card). Taking down those pictures before putting up the next set 
also seems "un-static".

The blob option might be good, but not until I set up a real DB engine (I'm 
not a DB admin) or use mlabs.  Meanwhile, I'm still on sqlite.

Also, I might want to look into how to cache the images (not because there 
will be heavy use, but because this might be a good application to use for 
the learning experience).

Suggestions?

/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] NGINX 1.6 ERROR 502 BAD GATEWAY

2017-04-05 Thread LC LC
Hi,

I have followed the 
tuto http://web2py.com/books/default/chapter/29/13/deployment-recipes#Nginx 
and i have the error :
2017/04/05 11:50:39 [crit] 15056#0: *1 connect() to 
unix:///tmp/web2py.socket failed (2: No such file or directory) while 
connecting to upstream,

i tried a touch /tmp/web2py.socket && chmod 777 /tmp/web2py.socket   but 
error, WHY
In the forum there are a lot of answers but none of the work


# /etc/init.d/nginx restart
[ ok ] Restarting nginx (via systemctl): nginx.service.
# /etc/init.d/uwsgi-emperor restart
[ ok ] Restarting uwsgi-emperor (via systemctl): uwsgi-emperor.service.



www-data 14972  0.0  0.0  48320  3492 ?S11:40   0:00 
/usr/bin/uwsgi --ini /etc/uwsgi-emperor/emperor.ini --pidfile 
/run/uwsgi-emperor.pid --daemonize /var/log/uwsgi/emperor.log
www-data 14973  0.0  0.0  48084   656 ?S11:40   0:00  \_ 
/usr/bin/uwsgi --ini /etc/uwsgi-emperor/emperor.ini --pidfile 
/run/uwsgi-emperor.pid --daemonize /var/log/uwsgi/emperor.log
root 15007  0.0  0.0 101568  3164 ?Ss   11:40   0:00 nginx: 
master process /usr/sbin/nginx -g daemon on; master_process on;
www-data 15008  0.0  0.0 101928  3784 ?S11:40   0:00  \_ nginx: 
worker process   
www-data 15009  0.0  0.0 101928  3784 ?S11:40   0:00  \_ nginx: 
worker process   
www-data 15010  0.0  0.0 101928  3784 ?S11:40   0:00  \_ nginx: 
worker process   
www-data 15011  0.0  0.0 101928  3784 ?S11:40   0:00  \_ nginx: 
worker process 

File :
/etc/init/uwsgi-emperor.conf
# Emperor uWSGI script
description "uWSGI Emperor"
start on runlevel [2345]
stop on runlevel [06]
respawn
exec uwsgi --master --die-on-term --emperor /etc/uwsgi --logto 
/var/log/uwsgi/uwsgi.log



File : /etc/uwsgi/web2py.xml


/tmp/web2py.socket
/var/www/web2py/
/=wsgihandler:application

4
60
8
1
/tmp/stats.socket
2000
512
256
192
www-data
www-data



Nginx 1.6

# file /etc/nginx/sites-available/web2py
server {
listen  9090;
server_name $hostname;
#to enable correct use of response.static_version
#location ~* /(\w+)/static(?:/_[\d]+.[\d]+.[\d]+)?/(.*)$ {
#alias /home/www-data/web2py/applications/$1/static/$2;
#expires max;
#}
location ~* /(\w+)/static/ {
root /var/www/web2py/applications/;
#remove next comment on production
#expires max;
}
location / {
#uwsgi_pass  127.0.0.1:9001;
uwsgi_pass  unix:///tmp/web2py.socket;
include uwsgi_params;
uwsgi_param UWSGI_SCHEME $scheme;
uwsgi_param SERVER_SOFTWAREnginx/$nginx_version;
}
}
server {
listen 443 default_server ssl;
server_name $hostname;
ssl_certificate /etc/nginx/ssl/server.crt;
ssl_certificate_key /etc/nginx/ssl/server.key;
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
ssl_ciphers 
ECDHE-RSA-AES256-SHA:DHE-RSA-AES256-SHA:DHE-DSS-AES256-SHA:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA;
ssl_protocols SSLv3 TLSv1;
keepalive_timeout70;
location / {
#uwsgi_pass  127.0.0.1:9001;
uwsgi_pass  unix:///tmp/web2py.socket;
include uwsgi_params;
uwsgi_param UWSGI_SCHEME $scheme;
uwsgi_param SERVER_SOFTWAREnginx/$nginx_version;
}

The keys
 ls -l /etc/nginx/ssl/
total 16
-rw-r--r-- 1 root root 757 avril  5 10:38 server.crt
-rw-r--r-- 1 root root 603 avril  5 10:37 server.csr
-rw-r--r-- 1 root root 891 avril  5 10:38 server.key
-rw-r--r-- 1 root root 963 avril  5 10:38 server.key.org




-- 
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: NGINX 1.6 ERROR 502 BAD GATEWAY

2017-04-05 Thread 黄祥
might we know what kind of os did you use? 
what step did you take to reproduce the problem?
i face the same problem before, i suggest you to take a look of the scripts 
that ship with web2py app

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] Re: Why the response.flash can't be dismissed here?

2017-04-05 Thread Marlysson Silva
Do you altered something ?

Em quarta-feira, 5 de abril de 2017 03:14:33 UTC-3, Mike Stephenson 
escreveu:
>
> I am using this layout from web2py's official 
> site: web2py.plugin.layout_Chasmogamous
>
> However I see that the response.flash can't be dismissed.
> I guess there is a problem with this snippet in its layout.html:
> {{=response.flash or ''}}
>
> How do I make it work like it does in default layout?
> This snippet no longer works:
>  {{=response.flash or 
> ''}}
>

-- 
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] Sites Powered by web2py

2017-04-05 Thread Alex
Thanks Fabiano.

Each subdomain refers to an own application, each with it's own database 
since the breeds are not related to each other.

Alex

On Wednesday, April 5, 2017 at 2:52:00 AM UTC+2, Fabiano Almeida wrote:
>
> Hi Alex!
> Great design ! Congratulations!
>
> I see use of subdomain to breeds, how do you do it?
>
> thx,
>
> Fabiano.
>
> 2017-04-02 17:58 GMT-03:00 Alex >:
>
>> The section for "Sites Powered by web2py" does not look very promising 
>> and also seems outdated. Most pages don't have a screenshot and some of 
>> them are not even working anymore. When I try to visit the first site I get 
>> a link to an internal error ticket.
>>
>> Submitting a new page does not work. We tried to add our website but it 
>> does not show up. Maybe you want to add it: https://breedarchive.com
>>
>> Further I'd encourage you to completely restructure the powered by 
>> section because the current page probably has the opposite desired effect 
>> and scares off new visitors. Hundreds of applications, many of them with 
>> questionable content, is not really helpful. It would be much better to 
>> only show a very small selection (~5) of high quality web2py sites. Each 
>> one with a screenshot and a short description.
>>
>> regards,
>> Alex
>>
>> -- 
>> 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.


Re: [web2py] Sites Powered by web2py

2017-04-05 Thread Fabiano Almeida
Thanks Alex!

2017-04-05 11:43 GMT-03:00 Alex :

> Thanks Fabiano.
>
> Each subdomain refers to an own application, each with it's own database
> since the breeds are not related to each other.
>
> Alex
>
> On Wednesday, April 5, 2017 at 2:52:00 AM UTC+2, Fabiano Almeida wrote:
>>
>> Hi Alex!
>> Great design ! Congratulations!
>>
>> I see use of subdomain to breeds, how do you do it?
>>
>> thx,
>>
>> Fabiano.
>>
>> 2017-04-02 17:58 GMT-03:00 Alex :
>>
>>> The section for "Sites Powered by web2py" does not look very promising
>>> and also seems outdated. Most pages don't have a screenshot and some of
>>> them are not even working anymore. When I try to visit the first site I get
>>> a link to an internal error ticket.
>>>
>>> Submitting a new page does not work. We tried to add our website but it
>>> does not show up. Maybe you want to add it: https://breedarchive.com
>>>
>>> Further I'd encourage you to completely restructure the powered by
>>> section because the current page probably has the opposite desired effect
>>> and scares off new visitors. Hundreds of applications, many of them with
>>> questionable content, is not really helpful. It would be much better to
>>> only show a very small selection (~5) of high quality web2py sites. Each
>>> one with a screenshot and a short description.
>>>
>>> regards,
>>> Alex
>>>
>>> --
>>> 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.
>

-- 
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: Questions about production environment / large applications

2017-04-05 Thread Áureo Dias Neto
2017-04-04 16:38 GMT-03:00 Alex Glaros :

> if migrate = True, slows web2py down, forces web2py to check all tables to 
> make sure they are created. Only use when defining new tables or modifying 
> a table
>
> if tables already defined, then set migrate = False
>
>
> https://groups.google.com/forum/#!searchin/web2py/migrate$20$3D$20false$20slow%7Csort:relevance/web2py/2w29c7Revgo/0JvafzGYFAAJ
>
>
> On Tue, Apr 4, 2017 at 11:20 AM, Áureo Dias Neto 
>  wrote:
>
>> Hi, i dont make this, whats you effect on the app?
>>
>> 2017-04-04 13:42 GMT-03:00 Alex Glaros :
>>
>>> Hi Áureo,
>>>
>>> did you set migration = False in the config file?
>>>
>>> just checking...
>>>
>>> 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] OT: Print view fail

2017-04-05 Thread Dave S
There's a site I consider useful for news on SSL/TLS issues.
https://www.feistyduck.com/>
I originally went there because of 
https://www.feistyduck.com/books/openssl-cookbook/>

But they have a newsletter with the issue reports:
https://www.feistyduck.com/bulletproof-tls-newsletter/issue_26_google_plans_to_distrust_all_current_symantec_certificates.html>
(also available as email via free subscription).

Now, I don't think they are using web2py, so I'm not sure there's an 
immediate lesson for us in this story, but ...  I was looking at newsletter 
#26 at that site, and decided to print it out.  10 minutes later, the 
"preparing" box was still spinning, and didn't respond to cancels.  I did 
something else, and even went away for a while ... like a long lunch.  When 
I came back, the webpage had printed.  Or at least the first 118 pages out 
of 25441.  The first page had the top headline, pages 4-5 had the content, 
and the rest had the "flash" message in the corner, and lots of space for 
doodling.

A quick look via inspect element suggests the page is laid out using tables 
to position divs, instead of having blocks.  I don't know if that is what 
blew up, but clearly something in the page layout didn't do what was 
expected when not being put on a screen.

This story would have been better if it had occurred last Saturday, but at 
least it happened in April.

/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: Why the response.flash can't be dismissed here?

2017-04-05 Thread Anthony
On Wednesday, April 5, 2017 at 2:14:33 AM UTC-4, Mike Stephenson wrote:
>
> I am using this layout from web2py's official 
> site: web2py.plugin.layout_Chasmogamous
>
> However I see that the response.flash can't be dismissed.
> I guess there is a problem with this snippet in its layout.html:
> {{=response.flash or ''}}
>

web2py.js was changed so it looks for class="w2p_flash" instead of "flash". 
So, change the class of the div to "w2p_flash", and there is also a 
div.flash CSS rule at the top of the layout.html file that should be 
changed to div.w2p_flash.
 

> How do I make it work like it does in default layout?
> This snippet no longer works:
>  {{=response.flash or 
> ''}}
>

"alert-dismissable" is specific to Bootstrap.

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: smartgrid with linked_tables and constraints broke the links

2017-04-05 Thread Anthony

>
> Pardon me for asking stupid question, what does SQLFORM.smartgrid(., 
> args=request.args[:1], ...) really do? you mentioned in earlier post that 
> args must be a list, and it preserves the 1st argument of URL for 
> application specific use. Does it tell web2py whatever url it creates, it 
> should always preserve the same URL up to the 1st argument (for this case) 
> eg. http://localhost/tests/default/view_invoices/2?
>

The grid builds its own internal URLs by taking the base URL of the action 
that serves the grid and adding URL args. If you specify the "args" 
parameter, it will first add any args from that to the URL before adding 
any of its own args, thus preserving any args you are using for non-grid 
purposes.
 

> I looked up the documentation, there is little info about args in grid / 
> smartgrid signature. If above assumption is correct, if my applications 
> uses first 2 args for specific application purpose, i should modify the 
> code to SQLFORM.smartgrid(., args=request.args[:2], ...)?
>

Correct.
 

> Another stupid question - what's difference between request.args[:1] and 
> request.args(0)?
>

The former produces a list (even if it contains zero items or one item), 
whereas the latter returns an individual value.

def view_invoices():
> customer_id = request.args(0)
> if customer_id:
>

This is not a helpful conditional because once you click on any link 
produced by the grid, there will always be some value for request.args(0) 
(because the grid will have added some URL args to the URLs it generates). 
One option is something like:

customer_id = request.args(0, cast=int, otherwise=lambda: None)
if customer_id is not None:

The above will attempt to cast the first URL arg to an int and return None 
otherwise. The grid doesn't use ints as the first URL arg, so if the above 
returns None, that means there is no URL arg or it is not an int, which 
implies that no customer_id has been specified.

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: Cassandra and web2py

2017-04-05 Thread Massimo Di Pierro
I do not know cassandra well enough. You can use 

connection = cache.ram('cassandra', lambda: establish_connection(), None)

so the connection is cached in ram. The DAL has pooling and works better 
but nobody wrote a cassandra adapter. Perhaps you could try that.

On Wednesday, 29 March 2017 23:33:01 UTC-5, Nicolas Petitclerc wrote:
>
> Hi,
> I'm using external Python driver (e.g., 
> https://github.com/datastax/python-driver) to use Cassandra in web2py, 
> but the issue I have is that I need to get a new Cassandra connection on 
> every query (and this is quite slow, 2-3 sec).
>
> *So I wonder if there is a way to preserve a connection?* 
>
> I though of saving it into the session, but the object can't be pickled, 
> so I can't do that. If I create it in models/db.py it still gets created on 
> every page load...
>
> Thanks.
>
> On Monday, January 27, 2014 at 4:40:16 PM UTC+1, Alan Etkin wrote:
>>
>>
>>
>> The DAL does not have a Cassandra adapter, so you'll have to use an 
>>> external Python driver (e.g., https://github.com/datastax/python-driver
>>> ).
>>>
>>
>> Or code your own adapter (and perhaps share it)
>>
>>
>> http://www.web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Note-on-new-DAL-and-adapters
>>
>

-- 
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: Create Register on Restapi

2017-04-05 Thread Massimo Di Pierro
there is a pending PR that will expose an API. One approach is to do it 
manually as follows:

1) App POSTs username/password which uses web2py auth.login_bare()
2) store the user id (and only the user id) in a session
3) configure web2py to store the session in an encrypted cookie so no 
server disk IO
4) retrieve and user id from session and retrieve the full user from DB 
only when needed.

web3py will have built-in client and server code to handle login from apps 
and perhaps we can backport to web2py.

Massimo


On Saturday, 1 April 2017 00:35:25 UTC-5, PK wrote:
>
> how can i register from mobile app rest client to 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] Re: web2py and python3

2017-04-05 Thread JorgeH
If what prevents the release of web2py python 3 ready are small details , 
why not release 2 versions, one for python 3, and the other one for python 
3.

Eventually, all the libraries will be ported to Py 3, or will be ways to 
sort that out.

just saying

On Monday, April 3, 2017 at 3:59:52 PM UTC-5, Richard wrote:
>
> Good suggestion Paolo,
>
> I will try master asap, hope ealier than later as I am in the middle of a 
> big refactoring...
>
> I was just stand up for the other that may ask them self what's going on.
>
> :)
>
> Richard
>
> On Mon, Apr 3, 2017 at 3:01 PM, Paolo Valleri  > wrote:
>
>> The best is to test your apps with python3 and report any issues. 
>> After a test period, I agree regarding pushing a new release
>>
>>  Paolo
>>
>> 2017-04-03 16:46 GMT+02:00 Richard Vézina > >:
>>
>>> Glad to hear that Leonel...
>>>
>>> But could we have "official" wrapup of the progress so far and where we 
>>> heading to. Are we waiting m2crypto to become py3 compatible to release a 
>>> new web2py version?
>>>
>>> I am sure we could benefit from a new web2py version if the master is 
>>> not broken because of that (py3 compatibility) as we can still benefit from 
>>> the improvement and bugs fixes that occur while keep using web2py with 
>>> python 2.7
>>>
>>> I am not saying that we should rush out a new release though as after 
>>> had waiting that long we surely can wait another 1-2 months and get py3 
>>> compliant version and 2.14.6 is reliable version.
>>>
>>> But, having a new version would help strengthen the code base, so there 
>>> will be less problem to figure out when py3 release will be ready, don't 
>>> you think? We will focus on py3 issue more easily then...
>>>
>>> Also, new version would help keep confidence that web2py is hear to 
>>> stay...
>>>
>>> Thanks
>>>
>>> Richard
>>>
>>>
>>>
>>> On Mon, Apr 3, 2017 at 7:53 AM, Leonel Câmara >> > wrote:
>>>
 Alex pretty much the only thing missing for py3 support is for m2crypto 
 which web2py depends on for X509 stuff to support python 3, according to 
 their repository 
 they're really 
 close to finishing py3 support. So I would say we're almost there.

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


Re: [web2py] Re: Questions about production environment / large applications

2017-04-05 Thread Carlos Zenteno
@Jim

Do you do this more for private control of your app(s) and data or for 
efficiency?
What were your considerations to go this route instead of cloud 
infrastructure like AWS/Pytnonanywhere/Heroku/etc ?

On Tuesday, April 4, 2017 at 8:38:31 AM UTC-5, Jim S wrote:
>
> The advantages would be more processing power and separation of duties. 
>  In our environment, we have:
>
> * database server (MySQL)
> * Load balancer (haproxy)
> * Multiple webservers running nginx/uwsgi/web2py
> * Redis server for caching
>
> By separating the database server from the webserver we can then scale up 
> for more web traffic by adding more webservers.  The load balancer server 
> just handles routing traffic to the least used webserver.  All servers run 
> on Ubuntu on different VMs under VMWare ESXi.
>
> This is a mildly complicated environment and definitely not necessary for 
> all installations.  If you're newer to deploying web applications then 
> keeping everything on one piece of hardware may make more sense.
>
> When you say you have a large multiuser application, how many users do you 
> typically have?  Any idea how many transactions per second?
>
> -Jim
>
>
>
> On Tuesday, April 4, 2017 at 8:30:09 AM UTC-5, Áureo Dias Neto wrote:
>>
>> Are the advantages of using mysql on another server?
>> Or does this solution vary from my hardware?
>>
>> 2017-04-04 10:22 GMT-03:00 Jim S :
>>
>>> Take a look here 
>>> http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Connection-strings--the-uri-parameter-
>>>
>>> Then, for MySQL, change the localhost in the connectstring to the name 
>>> of your database server.  You also have to make sure that MySQL is set to 
>>> allow remote connections from the user you are connecting with.  Check out 
>>> this link on how to do that:  
>>>
>>>
>>> http://stackoverflow.com/questions/23733734/how-to-enable-remote-access-of-mysql-in-centos
>>>
>>> -Jim
>>>
>>>
>>> On Tuesday, April 4, 2017 at 8:07:55 AM UTC-5, Áureo Dias Neto wrote:

 How to migrate data from sqlite to mysql or postgre?
 I tried to migrate the data to mysql using the workbench, but it did 
 not work ..

 And, how would this question the database on another server? How does 
 the connection work?

>>> -- 
>>> 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.


Re: [web2py] Sites Powered by web2py

2017-04-05 Thread Dave S


On Wednesday, April 5, 2017 at 7:43:57 AM UTC-7, Alex wrote:
>
> Thanks Fabiano.
>
> Each subdomain refers to an own application, each with it's own database 
> since the breeds are not related to each other.
>
> Alex
>

Are you using the same schema for each database?  I only sampled a couple 
of breeds (Italian Greyhound, frex), so I didn't think to look to see if 
there was consistency .

(I'd have looked at Norfolks and MinPins, but evidently none of those 
breeders have signed on yet)


/dps


> On Wednesday, April 5, 2017 at 2:52:00 AM UTC+2, Fabiano Almeida wrote:
>>
>> Hi Alex!
>> Great design ! Congratulations!
>>
>> I see use of subdomain to breeds, how do you do it?
>>
>> thx,
>>
>> Fabiano.
>>
>> 2017-04-02 17:58 GMT-03:00 Alex :
>>
>>> The section for "Sites Powered by web2py" does not look very promising 
>>> and also seems outdated. Most pages don't have a screenshot and some of 
>>> them are not even working anymore. When I try to visit the first site I get 
>>> a link to an internal error ticket.
>>>
>>> Submitting a new page does not work. We tried to add our website but it 
>>> does not show up. Maybe you want to add it: https://breedarchive.com
>>>
>>> Further I'd encourage you to completely restructure the powered by 
>>> section because the current page probably has the opposite desired effect 
>>> and scares off new visitors. Hundreds of applications, many of them with 
>>> questionable content, is not really helpful. It would be much better to 
>>> only show a very small selection (~5) of high quality web2py sites. Each 
>>> one with a screenshot and a short description.
>>>
>>> regards,
>>> Alex
>>>
>>> -- 
>>> 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.


Re: [web2py] Sites Powered by web2py

2017-04-05 Thread Dave S


On Wednesday, April 5, 2017 at 2:18:38 PM UTC-7, Dave S wrote:
>
>
>
> On Wednesday, April 5, 2017 at 7:43:57 AM UTC-7, Alex wrote:
>>
>> Thanks Fabiano.
>>
>> Each subdomain refers to an own application, each with it's own database 
>> since the breeds are not related to each other.
>>
>
Seems like a good idea to ask how you are using the routes.py modules.  One 
top-level one, at each app-level, or none?
 

>  
>
Are you using the same schema for each database?  I only sampled a couple 
> of breeds (Italian Greyhound, frex), so I didn't think to look to see if 
> there was consistency .
>
> (I'd have looked at Norfolks and MinPins, but evidently none of those 
> breeders have signed on yet)
>
>
Also, I missed the shortcut/link back up to the top level site.

/dps

 

>
>
> On Wednesday, April 5, 2017 at 2:52:00 AM UTC+2, Fabiano Almeida wrote:
>>
>> Hi Alex!
>> Great design ! Congratulations!
>>
>> I see use of subdomain to breeds, how do you do it?
>>
>> thx,
>>
>> Fabiano.
>>
>> 2017-04-02 17:58 GMT-03:00 Alex :
>>
>>> The section for "Sites Powered by web2py" does not look very promising 
>>> and also seems outdated. Most pages don't have a screenshot and some of 
>>> them are not even working anymore. When I try to visit the first site I get 
>>> a link to an internal error ticket.
>>>
>>> Submitting a new page does not work. We tried to add our website but it 
>>> does not show up. Maybe you want to add it: https://breedarchive.com
>>>
>>> Further I'd encourage you to completely restructure the powered by 
>>> section because the current page probably has the opposite desired effect 
>>> and scares off new visitors. Hundreds of applications, many of them with 
>>> questionable content, is not really helpful. It would be much better to 
>>> only show a very small selection (~5) of high quality web2py sites. Each 
>>> one with a screenshot and a short description.
>>>
>>> regards,
>>> Alex
>>>
>>> -- 
>>> 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.


Re: [web2py] Re: Questions about production environment / large applications

2017-04-05 Thread Jim S
Here is a quick list of reasons why we host

1. Data sync - we sync data to/from a number other platforms that we host 
here as well, HR/Payroll (MS SQL), Accounting/Inventory (AS/400), Product 
Development (Pervasive).  Would be slower if we were syncing to the cloud 
and we get killed on bandwidth charges.
2. Availability - we are in a relatively (not terribly) remote area.  We 
have fiber to our building but we did lose it for about 1/2 a day twice in 
the past year.  Our local users take priority over remote so we are willing 
to live with this.  
3. Private Control - as you mentioned, we do like to retain control over 
our data.  We have backups and replicate to a couple of our remote sites.
4. Cost uncertainty - last time I looked at moving to a cloud 
infrastructure it was hard to pin down exact costs.  My concerns were with 
our synchronization programs and what kind of bandwidth we'd be charged 
for.  But, it has been a while since I've researched any of those options 
and of course things could have changed.

So many new container technologies out there that we could benefit from but 
we haven't made the jump yet.  Walking that thin like between sticking with 
a stable environment and newer bleeding edge technologies.

-Jim

 

> @Jim
>
> Do you do this more for private control of your app(s) and data or for 
> efficiency?
> What were your considerations to go this route instead of cloud 
> infrastructure like AWS/Pytnonanywhere/Heroku/etc ?
>
> On Tuesday, April 4, 2017 at 8:38:31 AM UTC-5, Jim S wrote:
>>
>> The advantages would be more processing power and separation of duties. 
>>  In our environment, we have:
>>
>> * database server (MySQL)
>> * Load balancer (haproxy)
>> * Multiple webservers running nginx/uwsgi/web2py
>> * Redis server for caching
>>
>> By separating the database server from the webserver we can then scale up 
>> for more web traffic by adding more webservers.  The load balancer server 
>> just handles routing traffic to the least used webserver.  All servers run 
>> on Ubuntu on different VMs under VMWare ESXi.
>>
>> This is a mildly complicated environment and definitely not necessary for 
>> all installations.  If you're newer to deploying web applications then 
>> keeping everything on one piece of hardware may make more sense.
>>
>> When you say you have a large multiuser application, how many users do 
>> you typically have?  Any idea how many transactions per second?
>>
>> -Jim
>>
>>
>>
>> On Tuesday, April 4, 2017 at 8:30:09 AM UTC-5, Áureo Dias Neto wrote:
>>>
>>> Are the advantages of using mysql on another server?
>>> Or does this solution vary from my hardware?
>>>
>>> 2017-04-04 10:22 GMT-03:00 Jim S :
>>>
 Take a look here 
 http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Connection-strings--the-uri-parameter-

 Then, for MySQL, change the localhost in the connectstring to the name 
 of your database server.  You also have to make sure that MySQL is set to 
 allow remote connections from the user you are connecting with.  Check out 
 this link on how to do that:  


 http://stackoverflow.com/questions/23733734/how-to-enable-remote-access-of-mysql-in-centos

 -Jim


 On Tuesday, April 4, 2017 at 8:07:55 AM UTC-5, Áureo Dias Neto wrote:
>
> How to migrate data from sqlite to mysql or postgre?
> I tried to migrate the data to mysql using the workbench, but it did 
> not work ..
>
> And, how would this question the database on another server? How does 
> the connection work?
>
 -- 
 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.


Re: [web2py] Sites Powered by web2py

2017-04-05 Thread Alex


Am Mittwoch, 5. April 2017 23:18:38 UTC+2 schrieb Dave S:
>
>
>
> On Wednesday, April 5, 2017 at 7:43:57 AM UTC-7, Alex wrote:
>>
>> Thanks Fabiano.
>>
>> Each subdomain refers to an own application, each with it's own database 
>> since the breeds are not related to each other.
>>
>> Alex
>>
>
> Are you using the same schema for each database?  I only sampled a couple 
> of breeds (Italian Greyhound, frex), so I didn't think to look to see if 
> there was consistency .
>
> (I'd have looked at Norfolks and MinPins, but evidently none of those 
> breeders have signed on yet)
>

Yes, it's the same schema for each db. So internally it's actually only one 
application (source), but deployed as different applications.

-- 
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] Sites Powered by web2py

2017-04-05 Thread Alex

>
> Seems like a good idea to ask how you are using the routes.py modules.  
> One top-level one, at each app-level, or none?
>

Routing is basically handled at the webserver level. routes.py is only used 
for standard in/out route and error handling.
 

> Also, I missed the shortcut/link back up to the top level site.
>

At the left top there is a link to the main site / portal.
 
Alex

-- 
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] GAE Datastore conceptual question - different fields in different rows of a table

2017-04-05 Thread Karoly Kantor
In GAE Datastore I can put any arbitrary properties into an entity of an 
entity kind (in SQL terms, I can put any field into a table row), without 
having to redefine / migrate the table. This GAE datastore feature is very 
useful for my specific purposes.

Is there a way I can make use of this GAE Datastore possibility thru web2py 
DAL? How? Or, do I have to do directly to GAE, circumventing DAL?

More specifically, if i had GAE datastore entities of an entity kind that 
have different properties, could I still somehow use the following web2py 
features:

- DAL query, insert, update,
- SQLFORM?




-- 
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] Sites Powered by web2py

2017-04-05 Thread Dave S


On Wednesday, April 5, 2017 at 2:50:12 PM UTC-7, Alex wrote:
>
> Seems like a good idea to ask how you are using the routes.py modules.  
>> One top-level one, at each app-level, or none?
>>
>
> Routing is basically handled at the webserver level. routes.py is only 
> used for standard in/out route and error handling.
>

Okay.
 

>  
>
>> Also, I missed the shortcut/link back up to the top level site.
>>
>
> At the left top there is a link to the main site / portal.
>
 
Ah, the "pages" icon/graphic.  I didn't see that, and the navbar's "Home" 
stays within the breed.

/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: web2py and python3

2017-04-05 Thread Dave S


On Wednesday, April 5, 2017 at 1:15:55 PM UTC-7, JorgeH wrote:
>
> If what prevents the release of web2py python 3 ready are small details , 
> why not release 2 versions, one for python 3, and the other one for python 
> 3.
>
> Eventually, all the libraries will be ported to Py 3, or will be ways to 
> sort that out.
>
> just saying
>


I think this is the plan being worked on.

Massimo recently made a remark about having a post-2.14.6 release of 
web2py, and the web3py stuff is accumulating. So far, they seem to have it 
all in sources that can be used in either environment, so those changes 
will be in the stuff you download in the 2.14.6-followon.  More changes as 
the py3 stuff continues to work out.

Because of things like pickling, you won't be able to switch back and forth 
in place, but you shouldn't have to do a lot of changes to run in either 
environment ... except that views/client-side stuff could change a lot to 
be simpler, and perhaps SQLFORM won't be carried over (in favor of js 
wrappers for FORM, AIUI).

/dps


> On Monday, April 3, 2017 at 3:59:52 PM UTC-5, Richard wrote:
>>
>> Good suggestion Paolo,
>>
>> I will try master asap, hope ealier than later as I am in the middle of a 
>> big refactoring...
>>
>> I was just stand up for the other that may ask them self what's going on.
>>
>> :)
>>
>> Richard
>>
>> On Mon, Apr 3, 2017 at 3:01 PM, Paolo Valleri  
>> wrote:
>>
>>> The best is to test your apps with python3 and report any issues. 
>>> After a test period, I agree regarding pushing a new release
>>>
>>>  Paolo
>>>
>>> 2017-04-03 16:46 GMT+02:00 Richard Vézina :
>>>
 Glad to hear that Leonel...

 But could we have "official" wrapup of the progress so far and where we 
 heading to. Are we waiting m2crypto to become py3 compatible to release a 
 new web2py version?

 I am sure we could benefit from a new web2py version if the master is 
 not broken because of that (py3 compatibility) as we can still benefit 
 from 
 the improvement and bugs fixes that occur while keep using web2py with 
 python 2.7

 I am not saying that we should rush out a new release though as after 
 had waiting that long we surely can wait another 1-2 months and get py3 
 compliant version and 2.14.6 is reliable version.

 But, having a new version would help strengthen the code base, so there 
 will be less problem to figure out when py3 release will be ready, don't 
 you think? We will focus on py3 issue more easily then...

 Also, new version would help keep confidence that web2py is hear to 
 stay...

 Thanks

 Richard



 On Mon, Apr 3, 2017 at 7:53 AM, Leonel Câmara  
 wrote:

> Alex pretty much the only thing missing for py3 support is for 
> m2crypto which web2py depends on for X509 stuff to support python 3, 
> according to their repository 
> they're 
> really close to finishing py3 support. So I would say we're almost there.
>
> -- 
> 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 a topic in the 
 Google Groups "web2py-users" group.
 To unsubscribe from this topic, visit 
 https://groups.google.com/d/topic/web2py/UKcWKU66qnA/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to 
 web2py+un...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.

>>>
>>> -- 
>>> 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)
---

[web2py] Re: Create Register on Restapi

2017-04-05 Thread Dave S


On Wednesday, April 5, 2017 at 12:13:46 PM UTC-7, Massimo Di Pierro wrote:
>
> there is a pending PR that will expose an API. One approach is to do it 
> manually as follows:
>
> 1) App POSTs username/password which uses web2py auth.login_bare()
> 2) store the user id (and only the user id) in a session
> 3) configure web2py to store the session in an encrypted cookie so no 
> server disk IO
> 4) retrieve and user id from session and retrieve the full user from DB 
> only when needed.
>
> web3py will have built-in client and server code to handle login from apps 
> and perhaps we can backport to web2py.
>  
>
Massimo
>
>  
Are steps 2-4 significantly different from JWT support?

/dps

 

>
> On Saturday, 1 April 2017 00:35:25 UTC-5, PK wrote:
>>
>> how can i register from mobile app rest client to 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] web2py install on AWS with IIS

2017-04-05 Thread weheh
I am trying to get web2py to run behind IIS on an AWS EC2 instance. Can 
anyone help me get this running? I have followed the deployment 
instructions to the letter but getting nowhere. I have budget to get this 
done.

-- 
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: smartgrid with linked_tables and constraints broke the links

2017-04-05 Thread Rudy
Anthony,

I can't thank you enough for all your advises and help, not only i 
understand more about the grid / smartgrid, but the use of request.args 
now. I appreciate a lot of your time. Rudy

On Thursday, April 6, 2017 at 2:57:00 AM UTC+8, Anthony wrote:
>
> Pardon me for asking stupid question, what does SQLFORM.smartgrid(., 
>> args=request.args[:1], ...) really do? you mentioned in earlier post that 
>> args must be a list, and it preserves the 1st argument of URL for 
>> application specific use. Does it tell web2py whatever url it creates, it 
>> should always preserve the same URL up to the 1st argument (for this case) 
>> eg. http://localhost/tests/default/view_invoices/2?
>>
>
> The grid builds its own internal URLs by taking the base URL of the action 
> that serves the grid and adding URL args. If you specify the "args" 
> parameter, it will first add any args from that to the URL before adding 
> any of its own args, thus preserving any args you are using for non-grid 
> purposes.
>  
>
>> I looked up the documentation, there is little info about args in grid / 
>> smartgrid signature. If above assumption is correct, if my applications 
>> uses first 2 args for specific application purpose, i should modify the 
>> code to SQLFORM.smartgrid(., args=request.args[:2], ...)?
>>
>
> Correct.
>  
>
>> Another stupid question - what's difference between request.args[:1] and 
>> request.args(0)?
>>
>
> The former produces a list (even if it contains zero items or one item), 
> whereas the latter returns an individual value.
>
> def view_invoices():
>> customer_id = request.args(0)
>> if customer_id:
>>
>
> This is not a helpful conditional because once you click on any link 
> produced by the grid, there will always be some value for request.args(0) 
> (because the grid will have added some URL args to the URLs it generates). 
> One option is something like:
>
> customer_id = request.args(0, cast=int, otherwise=lambda: None)
> if customer_id is not None:
>
> The above will attempt to cast the first URL arg to an int and return None 
> otherwise. The grid doesn't use ints as the first URL arg, so if the above 
> returns None, that means there is no URL arg or it is not an int, which 
> implies that no customer_id has been specified.
>
> 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.