[web2py] web2py scripts setup apache (httpd) tested on docker

2018-12-07 Thread 黄祥
tested all web2py scripts setup apache (httpd) on docker, result only 
setup-web2py-ubuntu.sh worked

*centos*
docker pull centos
docker run -it centos /bin/bash

yum install -y unzip wget sudo iptables 
mkdir /srv
cd /srv
wget -c http://web2py.com/examples/static/web2py_src.zip
unzip -o web2py_src.zip
chmod +x web2py/scripts/setup-web2py-centos7.sh
web2py/scripts/setup-web2py-centos7.sh

*result*
Failed to get D-Bus connection: Operation not permitted

 - Setup web2py admin password

admin password: passme
error reading information on service iptables: No such file or directory
Note: Forwarding request to 'systemctl enable httpd.service'.
Created symlink /etc/systemd/system/multi-user.target.wants/httpd.service, 
pointing to /usr/lib/systemd/system/httpd.service.
 - Complete!

*result on browser*
502 (Bad Gateway)

*debian*
docker pull debian
docker run -it debian /bin/bash

apt update
apt install -y unzip wget sudo 
mkdir /srv
cd /srv
wget -c http://web2py.com/examples/static/web2py_src.zip
unzip -o web2py_src.zip
chmod +x web2py/scripts/setup-web2py-debian-sid.sh
web2py/scripts/setup-web2py-debian-sid.sh

*result*
[] Restarting Apache httpd web server: apache2AH00558: apache2: Could 
not reliably determine the server's fully qualified domain name, using 
172.17.0.2. Set the 'ServerName' directive globally to suppress this message
. ok
admin password: done!

*result on browser*
*http://localhost*
Apache2 Debian Default Page

*http://localhost/web2py*
Not Found
The requested URL /web2py was not found on this server.

*http://localhost/applications*
Not Found
The requested URL /applications was not found on this server.

*http://localhost/welcome*
Not Found
The requested URL /web2py was not found on this server.

*fedora (setup-web2py-fedora-ami.sh)*
docker pull fedora
docker run -it fedora /bin/bash

yum install -y unzip wget sudo iptables initscripts 
mkdir /srv
cd /srv
wget -c http://web2py.com/examples/static/web2py_src.zip
unzip -o web2py_src.zip
chmod +x web2py/scripts/setup-web2py-fedora-ami.sh
web2py/scripts/setup-web2py-fedora-ami.sh

*result*
Redirecting to /bin/systemctl restart httpd.service
System has not been booted with systemd as init system (PID 1). Can't 
operate.
Failed to connect to bus: Host is down

 - Setup web2py admin password

admin password: error reading information on service iptables: No such file 
or directory
Note: Forwarding request to 'systemctl enable httpd.service'.
Created symlink /etc/systemd/system/multi-user.target.wants/httpd.service → 
/usr/lib/systemd/system/httpd.service.
 - Complete!

*result on browser*
502 (Bad Gateway)

*fedora (setup-web2py-fedora.sh)*
docker pull fedora
docker run -it fedora /bin/bash

yum install -y unzip wget sudo iptables initscripts 
mkdir /srv
cd /srv
wget -c http://web2py.com/examples/static/web2py_src.zip
unzip -o web2py_src.zip
chmod +x web2py/scripts/setup-web2py-fedora.sh
web2py/scripts/setup-web2py-fedora.sh

*result*
Redirecting to /bin/systemctl restart httpd.service
System has not been booted with systemd as init system (PID 1). Can't 
operate.
Failed to connect to bus: Host is down

 - Setup web2py admin password

admin password: passme
error reading information on service iptables: No such file or directory
Note: Forwarding request to 'systemctl enable httpd.service'.
Created symlink /etc/systemd/system/multi-user.target.wants/httpd.service → 
/usr/lib/systemd/system/httpd.service.
 - Complete!

*result on browser*
502 (Bad Gateway)

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: New production install Ubuntu/nginx/uwsgi - connect to redis

2018-12-07 Thread Leonel Câmara
You can make a pull request with your fixes in github if you know how to 
fix it or you can open an issue in github.

https://github.com/web2py/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: Help with deploy with nginx and ubuntu 18.04

2018-12-07 Thread 黄祥
root@cb542ca9612f:/srv# find / -name web2py.socket
find: '/proc/6191/map_files': Permission denied
find: '/proc/6192/map_files': Permission denied
find: '/proc/6193/map_files': Permission denied
find: '/proc/6195/map_files': Permission denied
find: '/proc/6196/map_files': Permission denied
find: '/proc/6197/map_files': Permission denied
find: '/proc/6198/map_files': Permission denied
find: '/proc/6199/map_files': Permission denied

root@cb542ca9612f:/srv# service nginx status
 * nginx is running

root@cb542ca9612f:/srv# systemctl status emperor.uwsgi.service
System has not been booted with systemd as init system (PID 1). Can't 
operate.

if im not wrong systemd package is required to run systemctl
seems like uwsgi service isnt running

everything is tested under ubuntu latest and web2py latest on docker 
environment (start from scratch)

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: multi-level form acceptance

2018-12-07 Thread Dave S


On Thursday, December 6, 2018 at 11:43:37 PM UTC-8, pradeep chauhan wrote:
>
> hi,
> i want to send form which i created to some person, if that person accepts 
> the application it will be sent to 2nd person for approval and so on..how 
> can i do that?
>

The easy way (according to my personal sense of "easy"):  Email Person1 a 
link to a normal web2py FORM page.  When they fill out the form and click 
the 'submit' button, make sure there is a "state" field that gets updated 
to "ACCEPTED", and then queue a scheduler task.  The scheduler task then 
looks for all the rows with 'ACCEPTED', emails links to approval forms to 
Person2, who can click an 'APPROVE' button to change the state to 
'APPROVED'.  The email to Person2 could be to a single page that uses 
SQLTABLE or SQLFORM.grid to show the work items.

You *could* try putting the form in the email, but I don't know how to do 
those input elements, and many people don't do HTML email, so my emails 
just include links.

/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: upload a photo to your site by >

2018-12-07 Thread Dave S


On Friday, December 7, 2018 at 4:35:53 AM UTC-8, Morteza Tabibi wrote:
>
> Hi, my friend, I'm having this problem. I want to, for example, take a 
> picture of a flower on my site and explain about it. What should I do? 
> Thank you for saying, for example.
>
>
Are you wanting to make a page that permanently displays the same image and 
text?  For that, it is probably easiest to use non-web2py tools to upload 
the image to the static directory, which is how the welcome app displays 
its banner.

If you want a dynamic selection of an image and text, then the example in 
the book is a good starting point.
http://web2py.com/books/default/chapter/29/03/overview#An-image-blog>

There are some things that can be done to display a dynamic choice of 
images that aren't in the upload folder (see the example), but those are 
complicated enough you should try the example first.  After doing a lot of 
simple apps first, I've worked out for my personal app that I use to sort 
my photos, and the clues I needed were in the group archives.  But best not 
to start there.

/dps



 

> On Fri, Dec 7, 2018 at 1:29 PM 黄祥 > 
> wrote:
>
>> perhaps you can show the code and the traceback error
>> ref:
>> http://web2py.com/books/default/chapter/29/03/overview#An-image-blog
>>
>> 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+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: PostgreSQL log flooded with "could not receive data from client: Connection reset by peer" messages;

2018-12-07 Thread Tadas U
20 tasks ** ..

On Fri, 7 Dec 2018 at 09:50, Tadas U  wrote:

> Sorry, yes, postgres is 9.3 by the way, forgot to mention
>
>
> On Fri, 7 Dec 2018, 09:46 Massimo Di Pierro  wrote:
>
>> What do you mean by "20 schedulers"? 20 workers? 20 tasks?
>>
>> On Sunday, 18 November 2018 10:46:35 UTC-8, Tadas U wrote:
>>>
>>> Web2py version: Version 2.14.6-stable+timestamp.2016.05.10.00.21.47
>>>
>>> AFAIK, the scheduler is responsible, e.x.:
>>>
>>> SETUP (e.x.):
>>>
>>> scheduler.queue_task(
>>> 'test__task_insert', application_name='app', repeats=0,
>>> period=60, timeout=3600, retry_failed=-1)
>>>
>>> def task_insert():
>>> db.table.insert(title='abc')
>>> db.commit()
>>> # db.close()  -- same problem, doesn't matter
>>>
>>> scheduler = Scheduler(db, {
>>> 'test__task_insert': task_insert
>>> })
>>>
>>>
>>> log output, when taks runs:
>>> 
>>> 2018-11-13 13:14:11 EET LOG:  duration: 0.029 ms  statement: BEGIN
>>> 2018-11-13 13:14:11 EET LOG:  duration: 0.340 ms  statement: SELECT
>>> scheduler_worker.id, scheduler_worker.worker_name,
>>> scheduler_worker.first_heartbeat, scheduler_worker.last_heartbeat,
>>> scheduler_worker.status, scheduler_worker.is_ticker,
>>> scheduler_worker.group_names, scheduler_worker.worker_stats FROM
>>> scheduler_worker WHERE (scheduler_worker.worker_name = 'web2py#8228');
>>> 2018-11-13 13:14:11 EET LOG:  duration: 0.305 ms  statement: UPDATE
>>> scheduler_worker SET status='ACTIVE',last_heartbeat='2018-11-13
>>> 13:14:11',worker_stats='{"status": "RUNNING", "errors": 0, "workers": 1,
>>> "queue": 1, "empty_runs": 0, "sleep": 3, "distribution": {"main":
>>> {"workers": [{"c": 1, "name": "web2py#8228"}]}}, "total": 1}' WHERE
>>> (scheduler_worker.worker_name = 'web2py#8228');
>>> 2018-11-13 13:14:11 EET LOG:  duration: 1.890 ms  statement: COMMIT
>>> 2018-11-13 13:14:11 EET LOG:  duration: 0.067 ms  statement: BEGIN
>>> 2018-11-13 13:14:11 EET LOG:  duration: 0.046 ms  statement: SET
>>> CLIENT_ENCODING TO 'UTF8'
>>> 2018-11-13 13:14:11 EET LOG:  duration: 0.020 ms  statement: SET
>>> standard_conforming_strings=on;
>>> 2018-11-13 13:14:11 EET LOG:  duration: 0.047 ms  statement: COMMIT
>>> 2018-11-13 13:14:12 EET LOG:  duration: 0.029 ms  statement: BEGIN
>>> 2018-11-13 13:14:12 EET LOG:  duration: 2.413 ms  statement: INSERT INTO
>>> table(title) VALUES ('abc');
>>> 2018-11-13 13:14:12 EET LOG:  duration: 2.594 ms  statement: COMMIT
>>> 2018-11-13 13:14:12 EET LOG:  could not receive data from client:
>>> Connection reset by peer
>>> 2018-11-13 13:14:12 EET LOG:  duration: 0.029 ms  statement: BEGIN
>>> 2018-11-13 13:14:12 EET LOG:  duration: 0.285 ms  statement: DELETE FROM
>>> scheduler_run WHERE (scheduler_run.id = 967703);
>>> 2018-11-13 13:14:12 EET LOG:  duration: 0.306 ms  statement: UPDATE
>>> scheduler_task SET status='QUEUED',next_run_time='2018-11-13
>>> 13:15:11',times_run=93796,times_failed=0 WHERE (scheduler_task.id =
>>> 371);
>>> 2018-11-13 13:14:12 EET LOG:  duration: 2.426 ms  statement: COMMIT
>>> 2018-11-13 13:14:12 EET LOG:  duration: 0.024 ms  statement: BEGIN
>>> 
>>>
>>> PROBLEM:  "2018-11-13 13:14:12 EET LOG:  could not receive data from
>>> client: Connection reset by peer"
>>> We have ~20 ish active schedulers, so the log gets flooded a lot,
>>> basically:
>>>
>>> 2018-11-13 09:21:00 EET LOG:  could not receive data from client:
>>> Connection reset by peer
>>> 2018-11-13 09:21:00 EET LOG:  could not receive data from client:
>>> Connection reset by peer
>>> 2018-11-13 09:21:00 EET LOG:  could not receive data from client:
>>> Connection reset by peer
>>> 2018-11-13 09:21:16 EET LOG:  could not receive data from client:
>>> Connection reset by peer
>>> 2018-11-13 09:21:46 EET LOG:  could not receive data from client:
>>> Connection reset by peer
>>> 2018-11-13 09:22:00 EET LOG:  could not receive data from client:
>>> Connection reset by peer
>>> 2018-11-13 09:22:00 EET LOG:  could not receive data from client:
>>> Connection reset by peer
>>> 2018-11-13 09:22:01 EET LOG:  could not receive data from client:
>>> Connection reset by peer
>>>
>>> --
>> 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] Re: 2.17.2 is out

2018-12-07 Thread 黄祥

>
> If you are asking me, I am sorry, i don't know how to make a patch.
>

ref:
http://web2py.com/books/default/chapter/29/15/helping-web2py#Contributing-code-and-documentation-changes

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.


Re: [web2py] Re: New production install Ubuntu/nginx/uwsgi - connect to redis

2018-12-07 Thread Jim Steil
Leonel - what's the process to get this fixed in web2py?  I don't think I
know enough about the redis library to offer a fix.  I also found a couple
bugs in the ubuntu/nginx/uwsgi install script.

Would it make sense to make these install scripts version specific?

-Jim

On Fri, Dec 7, 2018 at 11:15 AM Leonel Câmara 
wrote:

> Whoa nice find:
>
> redis-py 2.X attempted to coerce any type of input into a string. While
> occasionally convenient, this caused all sorts of hidden errors when users
> passed boolean values (which were coerced to ‘True’ or ‘False’), a None
> value (which was coerced to ‘None’) or other values, such as user defined
> types.
>
> --
> 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/PdquGF_9a2E/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] Re: New production install Ubuntu/nginx/uwsgi - connect to redis

2018-12-07 Thread Leonel Câmara
Whoa nice find:

redis-py 2.X attempted to coerce any type of input into a string. While 
occasionally convenient, this caused all sorts of hidden errors when users 
passed boolean values (which were coerced to ‘True’ or ‘False’), a None 
value (which was coerced to ‘None’) or other values, such as user defined 
types.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Problem with wsgihandler.py Apache/Python3

2018-12-07 Thread Carl Petersen
I was able to get web2py up and running by changing the following line 
(131) in http.py  I don't expect that this was the proper way to do it 
(especially considering backward compatibility), but at lease it might 
point out where the issue is:

elif isinstance(body, (str, bytes, bytearray)):
 if isinstance(body, unicodeT):
 body = to_bytes(body)
 return [body]
elif hasattr(body, '__iter__'):
return [x.encode('utf-8') for x in body]  - Changed from  
"return body"
else:
body = str(body)
if isinstance(body, unicodeT):
body = to_bytes(body)
return [body]
 
I didn't know whether I should just apply to_bytes(body) like the other 
returns because the other returns were coded "return [body]" instead of 
"return body".

Thanks

On Friday, December 7, 2018 at 7:50:16 AM UTC-6, Carl Petersen wrote:
>
> Hello,
>
> I'm having a similar issue.  I'm using Python 3.6.6, mod_wsgi 4.6.5, 
> Apache 2.4.6 with web2py 2.17.2.
>
> I can get to the welcome screen, but as soon as I try to access the admin 
> application I get the following on my screen:
>
> Internal Server Error
>
> The server encountered an internal error or misconfiguration and was 
> unable to complete your request.
>
> Please contact the server administrator at root@localhost to inform them 
> of the time this error occurred, and the actions you performed just before 
> this error.
>
> More information about this error may be available in the server error log.
>
>
> And this in my apache error_log:
>
>  [Fri Dec 07 08:32:14.626246 2018] [mpm_prefork:notice] [pid 30005] 
> AH00163: Apache/2.4.6 (Red Hat Enterprise Linux) OpenSSL/1.0.2k-fips 
> mod_wsgi/4.6.5 Python/3.6 configured -- resuming normal operations
>
> [Fri Dec 07 08:32:33.572686 2018] [wsgi:error] [pid 30007] [remote 
> 10.20.100.133:56416] mod_wsgi (pid=30007): Exception occurred processing 
> WSGI script '/opt/web-apps/web2py/wsgihandler.py'.
>
> [Fri Dec 07 08:32:33.572836 2018] [wsgi:error] [pid 30007] [remote 
> 10.20.100.133:56416] TypeError: sequence of byte string values expected, 
> value of type str found
>
> Any assistance would be greatly appreciated.
>
>
>
> On Sunday, September 2, 2018 at 1:03:30 PM UTC-5, motionbutterfly wrote:
>>
>> Hello, I was wondering if anyone here could help me. I've been migrating 
>> a web2py application from Python2.7 to Python3.4, this application was 
>> already being hosted in a webserver with Apache2.4 following the steps in 
>> the Deployment Recipes chapter of the web2py book. I reconfigured apache to 
>> run with python 3, and reinstalled mod_wsgi using pip. My problem is that 
>> as soon as I load my application I get an internal error, and when I click 
>> on the ticket it shows me "500 Internal Server Error", and when I look up 
>> the error log for apache this is what comes up: 
>>
>> [Thu Aug 23 22:42:17.748139 2018] [wsgi:warn] [pid 2268:tid 
>> 139927378876288] mod_wsgi: Compiled for Python/3.4.2rc1+.
>> [Thu Aug 23 22:42:17.748154 2018] [wsgi:warn] [pid 2268:tid 
>> 139927378876288] mod_wsgi: Runtime using Python/3.4.2.
>> [Thu Aug 23 22:42:17.896498 2018] [mpm_event:notice] [pid 2268:tid 
>> 139927378876288] AH00489: Apache/2.4.10 (Debian) OpenSSL/1.0.1t 
>> mod_wsgi/4.3.0 Python/3.4.2 mod_perl/2.0.9dev Perl/v5.20.2 configured -- 
>> resuming normal operations
>> [Thu Aug 23 22:42:17.896584 2018] [core:notice] [pid 2268:tid 
>> 139927378876288] AH00094: Command line: '/usr/sbin/apache2'
>> [Thu Aug 23 22:45:29.528373 2018] [wsgi:error] [pid 2272:tid 
>> 139927187830528] 
>> [Thu Aug 23 22:45:29.528468 2018] [wsgi:error] [pid 2272:tid 
>> 139927187830528] 10
>> [Thu Aug 23 22:45:29.968522 2018] [wsgi:error] [pid 2272:tid 
>> 139927213033216] Loads pas\xc3\xb3
>> [Thu Aug 23 22:45:35.289112 2018] [wsgi:error] [pid 2272:tid 
>> 139927179421440] [remote 186.89.23.145:25178] mod_wsgi (pid=2272): 
>> Exception occurred processing WSGI script 
>> '/home/www-data/web2py/wsgihandler.py'.
>> [Thu Aug 23 22:45:35.289293 2018] [wsgi:error] [pid 2272:tid 
>> 139927179421440] [remote 186.89.23.145:25178] TypeError: sequence of 
>> byte string values expected, value of type str found
>>
>> Which seems to suggest that the problem is inside the wsgihandler.py 
>> script, but doesn't point out where. Has this happened to anyone else 
>> before?
>>
>> Thanks in advance for any help.
>>
>

-- 
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] CAS error

2018-12-07 Thread Carlos Cesar Caballero Díaz

Hi Massimo, I am working on a fix, hopefully I will submit a PR soon.

Greetings.

El 7/12/18 a las 3:03 a.m., Massimo Di Pierro escribió:

can you please open an issue about this?

On Thursday, 29 November 2018 13:51:14 UTC-8, Carlos Cesar Caballero 
wrote:


Hi guys, after some clean tests, the issue is not happening with
Python
2.7, so it seems to be a Python 3 issue.

Greetings.


El 29/11/18 a las 1:34 p.m., Carlos Cesar Caballero Díaz escribió:
> Hi, I am using the web2py version
> 2.17.2-stable+timestamp.2018.10.06.18.54.02 in Ubuntu Linux, and
I am
> not able to use CAS. I have a web2py app as server, an another as
> client, and when client try to log in, the browser starts a
redirect
> loop and returns a ERR_TOO_MANY_REDIRECTS error. There are no error
> tickets in client or server apps, and the behavior is happening
using
> python 2.7 and 3.6.
>
> I have configured the client just using:
>
> auth = Auth(db, cas_provider =
> 'http://127.0.0.1:8000/welcome/default/user/cas
')
>
> I want to authenticate against the welcome app as I have being
doing
> with past web2py versions.
>
> Any idea how to fix this?
>
>
> Greetings.
>

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google 
Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to web2py+unsubscr...@googlegroups.com 
.

For more options, visit https://groups.google.com/d/optout.


--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups "web2py-users" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Help with deploy with nginx and ubuntu 18.04

2018-12-07 Thread Morteza Tabibi
hi friend better see in web
https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-18-04

On Fri, Dec 7, 2018 at 6:33 PM Morteza Tabibi 
wrote:

>
>- sudo apt update
>- sudo apt install nginx
>
>
> On Fri, Dec 7, 2018 at 1:34 PM 黄祥  wrote:
>
>> tried recently ubuntu 18.04 with the web2py latest version the scripts is
>> no longer work, need update
>> perhaps you can share the error log (nginx) ?
>>
>> 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.
>>
>
>
> --
> باتشکر از شما
>


-- 
باتشکر از شما

-- 
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: Help with deploy with nginx and ubuntu 18.04

2018-12-07 Thread Morteza Tabibi
   - sudo apt update
   - sudo apt install nginx


On Fri, Dec 7, 2018 at 1:34 PM 黄祥  wrote:

> tried recently ubuntu 18.04 with the web2py latest version the scripts is
> no longer work, need update
> perhaps you can share the error log (nginx) ?
>
> 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.
>


-- 
باتشکر از شما

-- 
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: New production install Ubuntu/nginx/uwsgi - connect to redis

2018-12-07 Thread Jim Steil
WooHoo! I think I finally figured it out.

Python redis package was at a different level on the other machine.

Python redis 2.10.6 works
Python redis 3.0.1 does not.  Seems to only want strings passed to it.

On my new server I ->   pip install redis==2.10.6and now it works.

By default it is installing 3.0.1.

3.0.1 is breaking backward compatibility ->  https://pypi.org/project/redis/

What is the proper way to handle this differently for different versions of
redis?  Line 1230 of globals.py is where the values are set, but
redis_session.py is where the call is failing.

-Jim

On Fri, Dec 7, 2018 at 7:18 AM Leonel Câmara  wrote:

> That's the same as locked=True as the string 'False' evaluates is a Truthy
> value. What you should try is to use:
>
> RedisSession(redis_conn=rconn, session_expiry=False, *with_lock=True*)
>
>
> Notice the added with_lock=True
>
> --
> 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/PdquGF_9a2E/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] Re: Help with deploy with nginx and ubuntu 18.04

2018-12-07 Thread Jim S
One thing I had to do was change the install of nginx

Line 30:
apt-get -y install nginx-full

Should be
apt -y install nginx

I seem to recall changing something else too, but don't recall right now.  
But, I'm setting up new servers today and hope to put a list of issues 
together.  I have another thread going where I am having issues with 
redis.  The latest version of python redis seems to not play well with 
web2py's redis bridge.

-Jim

On Friday, December 7, 2018 at 4:04:38 AM UTC-6, 黄祥 wrote:
>
> tried recently ubuntu 18.04 with the web2py latest version the scripts is 
> no longer work, need update
> perhaps you can share the error log (nginx) ?
>
> 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.


Re: [web2py] Re: 2.17.2 is out

2018-12-07 Thread Morteza Tabibi
hi, my friend, when you export CSV  see you in error.???
in Linux does not a problem export CSV
I have not to experience in windows
sorry

On Fri, Dec 7, 2018 at 11:28 AM Massimo Di Pierro <
massimo.dipie...@gmail.com> wrote:

> Can I ask for a patch?
>
> On Tuesday, 27 November 2018 09:42:35 UTC-8, Web2_3py wrote:
>>
>> for web2py version 2.17.2
>>
>> On Sunday, November 25, 2018 at 8:17:08 PM UTC+3, Web2_3py wrote:
>>>
>>>
>>> *export_to_csv_file*
>>>
>>>
>>> under python2 , no problem
>>>
>>> under python3 , the following problem
>>>
>>>   File 
>>> "C:\Users\assus\Desktop\Flash\python3\web2py_2_17_2_src\web2py\gluon\packages\dal\pydal\objects.py",
>>>  line 2619, in export_to_csv_file
>>> writer.writerow(unquote_colnames(colnames))
>>> TypeError: a bytes-like object is required, not 'str'
>>>
>>>
>>>
>>>
>>> --
> 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: Problem with wsgihandler.py Apache/Python3

2018-12-07 Thread Carl Petersen
Hello,

I'm having a similar issue.  I'm using Python 3.6.6, mod_wsgi 4.6.5, Apache 
2.4.6 with web2py 2.17.2.

I can get to the welcome screen, but as soon as I try to access the admin 
application I get the following on my screen:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable 
to complete your request.

Please contact the server administrator at root@localhost to inform them of 
the time this error occurred, and the actions you performed just before 
this error.

More information about this error may be available in the server error log.


And this in my apache error_log:

 [Fri Dec 07 08:32:14.626246 2018] [mpm_prefork:notice] [pid 30005] 
AH00163: Apache/2.4.6 (Red Hat Enterprise Linux) OpenSSL/1.0.2k-fips 
mod_wsgi/4.6.5 Python/3.6 configured -- resuming normal operations

[Fri Dec 07 08:32:33.572686 2018] [wsgi:error] [pid 30007] [remote 
10.20.100.133:56416] mod_wsgi (pid=30007): Exception occurred processing 
WSGI script '/opt/web-apps/web2py/wsgihandler.py'.

[Fri Dec 07 08:32:33.572836 2018] [wsgi:error] [pid 30007] [remote 
10.20.100.133:56416] TypeError: sequence of byte string values expected, 
value of type str found

Any assistance would be greatly appreciated.



On Sunday, September 2, 2018 at 1:03:30 PM UTC-5, motionbutterfly wrote:
>
> Hello, I was wondering if anyone here could help me. I've been migrating a 
> web2py application from Python2.7 to Python3.4, this application was 
> already being hosted in a webserver with Apache2.4 following the steps in 
> the Deployment Recipes chapter of the web2py book. I reconfigured apache to 
> run with python 3, and reinstalled mod_wsgi using pip. My problem is that 
> as soon as I load my application I get an internal error, and when I click 
> on the ticket it shows me "500 Internal Server Error", and when I look up 
> the error log for apache this is what comes up: 
>
> [Thu Aug 23 22:42:17.748139 2018] [wsgi:warn] [pid 2268:tid 
> 139927378876288] mod_wsgi: Compiled for Python/3.4.2rc1+.
> [Thu Aug 23 22:42:17.748154 2018] [wsgi:warn] [pid 2268:tid 
> 139927378876288] mod_wsgi: Runtime using Python/3.4.2.
> [Thu Aug 23 22:42:17.896498 2018] [mpm_event:notice] [pid 2268:tid 
> 139927378876288] AH00489: Apache/2.4.10 (Debian) OpenSSL/1.0.1t 
> mod_wsgi/4.3.0 Python/3.4.2 mod_perl/2.0.9dev Perl/v5.20.2 configured -- 
> resuming normal operations
> [Thu Aug 23 22:42:17.896584 2018] [core:notice] [pid 2268:tid 
> 139927378876288] AH00094: Command line: '/usr/sbin/apache2'
> [Thu Aug 23 22:45:29.528373 2018] [wsgi:error] [pid 2272:tid 
> 139927187830528] 
> [Thu Aug 23 22:45:29.528468 2018] [wsgi:error] [pid 2272:tid 
> 139927187830528] 10
> [Thu Aug 23 22:45:29.968522 2018] [wsgi:error] [pid 2272:tid 
> 139927213033216] Loads pas\xc3\xb3
> [Thu Aug 23 22:45:35.289112 2018] [wsgi:error] [pid 2272:tid 
> 139927179421440] [remote 186.89.23.145:25178] mod_wsgi (pid=2272): 
> Exception occurred processing WSGI script 
> '/home/www-data/web2py/wsgihandler.py'.
> [Thu Aug 23 22:45:35.289293 2018] [wsgi:error] [pid 2272:tid 
> 139927179421440] [remote 186.89.23.145:25178] TypeError: sequence of byte 
> string values expected, value of type str found
>
> Which seems to suggest that the problem is inside the wsgihandler.py 
> script, but doesn't point out where. Has this happened to anyone else 
> before?
>
> Thanks in advance for any help.
>

-- 
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: 2.17.2 is out

2018-12-07 Thread Web2_3py


If you are asking me, I am sorry, i don't know how to make a patch.

-- 
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: New production install Ubuntu/nginx/uwsgi - connect to redis

2018-12-07 Thread Leonel Câmara
That's the same as locked=True as the string 'False' evaluates is a Truthy 
value. What you should try is to use:

RedisSession(redis_conn=rconn, session_expiry=False, *with_lock=True*)


Notice the added with_lock=True

-- 
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: upload a photo to your site by >

2018-12-07 Thread Morteza Tabibi
Hi, my friend, I'm having this problem. I want to, for example, take a
picture of a flower on my site and explain about it. What should I do?
Thank you for saying, for example.

On Fri, Dec 7, 2018 at 1:29 PM 黄祥  wrote:

> perhaps you can show the code and the traceback error
> ref:
> http://web2py.com/books/default/chapter/29/03/overview#An-image-blog
>
> 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.
>


-- 
باتشکر از شما

-- 
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: upload a photo to your site by >

2018-12-07 Thread Christian Varas
As Stifan says, please show us the code. If you follow the example in the
book,  image upload works perfect.

About ">" what are you trying to do with this?

Cheers.
Chris.

El vie., 7 dic. 2018 6:59 a. m., 黄祥  escribió:

> perhaps you can show the code and the traceback error
> ref:
> http://web2py.com/books/default/chapter/29/03/overview#An-image-blog
>
> 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.
>

-- 
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: "web2py.app“ wants access to control “System Events.app“

2018-12-07 Thread 黄祥
curl -L -O -C - 
https://mdipierro.pythonanywhere.com/examples/static/web2py_osx.zip
unzip web2py_osx.zip
open web2py/web2py.app

tested it with the step above but not found the error like you posted 
before, for system events.app perhaps you can get explanation here

*ref:*
https://macosx.com/threads/system-events-what-is-it.285312/
https://forums.macrumors.com/threads/snow-leopard-asks-for-system-events-app.774207/

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: "web2py.app“ wants access to control “System Events.app“

2018-12-07 Thread John McMaster
Hello stifen,
I am running for MAC version 2.17.2.
I have downloaded both for MAC and the Source Code. But I have not run from 
source yet.

I would like to know more about the reason behind the message and what it 
is doing with the System Events.app? 

Thank You


-- 
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: Help with deploy with nginx and ubuntu 18.04

2018-12-07 Thread 黄祥
tried recently ubuntu 18.04 with the web2py latest version the scripts is 
no longer work, need update
perhaps you can share the error log (nginx) ?

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: "web2py.app“ wants access to control “System Events.app“

2018-12-07 Thread 黄祥
did you run web2py_osx.zip (For Mac) ?
had you try web2py_src.zip (Source Code) ?

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: upload a photo to your site by >

2018-12-07 Thread 黄祥
perhaps you can show the code and the traceback error
ref:
http://web2py.com/books/default/chapter/29/03/overview#An-image-blog

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: multi-level form acceptance

2018-12-07 Thread 黄祥
perhaps you can use auth_group and auth_membership, assign person in 
auth_user table to auth_membership that belong to auth_gorup
then using conditional if to check the value if person from group_1 is 
'accepted' then it will appears in person fron group_2

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: Problem in Ubuntu 18.04

2018-12-07 Thread 黄祥
2.9 version is old, perhaps you can share the error log (web2py or web 
server log)

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.


Re: [web2py] Conditional Checks on output from DB.Select statements?

2018-12-07 Thread sandeep patel
Yes, Arjun you are right you are comparing row object to a string.so
first you have to extract value from row object.

You can use first or last function to get values.

if measure_1.first()['name']=='DBD':

instead, store a row object in variables you can store values which you
want to compare.

measure_1 = 
db(db.Detailed_Info.MEMBER_NBR==form.vars.name).select(db.Detailed_Info.MEASURE_1).frist()['name']

Hope this helps you!


On Fri, Dec 7, 2018 at 1:13 PM  wrote:

> I am writing a simple web2py application and can't seem to figure out how
> to run comparison checks on variables from db.select statements. Code is
> posted below:
>
>
> form = FORM('Enter Member ID: ', INPUT(_type='text', _name='name'),
>INPUT(_type='submit', _value='submit'))
> if form.accepts(request, session):
> member_id= form.vars.name
> measure_1 = 
> db(db.Detailed_Info.MEMBER_NBR==form.vars.name).select(db.Detailed_Info.MEASURE_1)
> measure_2 = 
> db(db.Detailed_Info.MEMBER_NBR==form.vars.name).select(db.Detailed_Info.MEASURE_2)
> response.flash = 'Form Accepted'
>
> if measure_1=='DBD':
>test = 'IT WORKED'else:
>test = 'IT DIDNT WORK'
> return dict(form=form, test=test)
>
>
>
> My question is, I am able to see that the value from the first select 
> statement (that defines variable measure_1) is in fact 'DBD'. But the if 
> statement conditional at the bottom isn't working. I feel it's because the 
> result of the select statement is a "row" object. Is there a way to extract 
> the actual value?
>
>
> Thank you!
>
> down votefavorI am writing a simple web2py application and can't seem to
> figure out how to run comparison checks on variables from db.select
> statements. Code is posted below:
> 
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Help needed with web2py-book app

2018-12-07 Thread Massimo Di Pierro
Merged. Will deploy tomorrow. Excellent and very much appreciated.

On Tuesday, 4 December 2018 00:51:53 UTC-8, Nico Zanferrari wrote:
>
> Yes, the online version of the book is a web2py application - and I've 
> made it Python 3 compatible with that PR.
>
> But indeed the content of the book itself is still mainly 
> Python2-oriented 
> any help is appreciated ;-)
>
> Nico
>
> Il giorno Lun 3 Dic 2018, 18:17 Marcelo Huerta  
> ha scritto:
>
>> El sábado, 24 de noviembre de 2018, 19:48:32 (UTC-3), Nico Zanferrari 
>> escribió:
>>>
>>> I'm proud to announce that I've finished the work, and now the web2py 
>>> book is python3 compatible, as with PR #395 
>>>  It was a hard work for 
>>> me, but I've learned a lot ;-)
>>>

>
>> Is this the online version at web2py.com/book ?
>>
>> I see there that the explanations about string are Python2-oriented, e.g. 
>> http://web2py.com/books/default/chapter/29/02/the-python-language#str 
>>
>> -- 
>> 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.
>>
>
> Il 03 Dic 2018 18:17, "Marcelo Huerta"  ha 
> scritto:
>
> El sábado, 24 de noviembre de 2018, 19:48:32 (UTC-3), Nico Zanferrari 
> escribió:
>>
>> I'm proud to announce that I've finished the work, and now the web2py 
>> book is python3 compatible, as with PR #395 
>>  It was a hard work for 
>> me, but I've learned a lot ;-)
>>
>>>

> Is this the online version at web2py.com/book ?
>
> I see there that the explanations about string are Python2-oriented, e.g. 
> http://web2py.com/books/default/chapter/29/02/the-python-language#str 
>
> -- 
> 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: MySql encryption using DAL

2018-12-07 Thread Massimo Di Pierro
Very useful. this should go in the book. 

https://github.com/web2py/web2py-book

Would you be able to submit a PR? else I can do it.

On Friday, 30 November 2018 15:26:17 UTC-8, appjar...@gmail.com wrote:
>
> Thanks Massimo.
>
> These are the steps and syntax to connect to Amazon's RDS using SSL.
>
> *Step1:*
> Download Amazons's CA certificate from here:
>  https://s3.amazonaws.com/rds-downloads/rds-combined-ca-bundle.pem
> and save it into 
> web2py/applications/myapp/private/ssl/rds-combined-ca-bundle.pem
>
> *Step2:*
> Modify your model (db.py) as follows, using your own username, password, 
> endpoint, and DB
>
> driver_args = { 'ssl':{ 'ca': 
> 'applications/ads/private/ssl/rds-combined-ca-bundle.pem'} }
> db_auth = 'mysql://
> web2py_db_user:mypassw...@x-cluster-1.cluster-xus-east-1.rds.amazonaws.com:3306/my_db
> '  
> db = DAL( db_auth, 
>   driver_args = driver_args )
>
>
> *Step 3 (optional):*
> To force SSL for this user (web2py_db_user), connect to the RDS server 
> using MySQL Workbench (or any other DB client) and execute the following 
> SQL. 
>
> For MySQL 5.6 GRANT USAGE ON *.* TO 'web2py_db_user'@'%' REQUIRE SSL; 
>
> For MySQL 5.7
> ALTER USER 'web2py_db_user'@'%' REQUIRE SSL; 
>
>
>
>
>
>
> On Sunday, September 2, 2018 at 12:56:06 PM UTC-5, Massimo Di Pierro wrote:
>>
>> For postgresql it has been there for long time:
>>
>> 
>> postgres://{username}:{password}@{domain}:5432/{dbname}?sslmode=require
>>
>> For MySQL it can also be done with current PyDAL. My understanding is 
>> that MySQL requires certificates so you
>>
>> 1) you need to install certificates
>>
>> 2) on server side in my my.ini:
>>
>> require_secure_transport=true
>> tls_version=TLSv1,TLSv1.1,TLSv1.2
>> ssl-ca=*install_path*/ca-cert.pem
>> ssl-cert=*install_path*/cert.pem
>> ssl-key=*install_path*/key.pem
>>
>>
>> 3) on web2py side:
>>
>> ssl = { 'cert': '*install_path/cert.pem*',
>> 'key': '*install_path*/key.pem',
>> 'ca': '*install_path*/ca-cert.pem'} 
>>
>> DAL('mysql://', driver_args = {'ssl': ssl})
>>
>> Mind I did not try this. All I am telling you is how to use driver_args 
>> to pass ssl info to the mysqldb.connect( , ssl = ...) function.
>>
>> On Friday, 31 August 2018 22:07:54 UTC-7, appj...@gmail.com wrote:
>>>
>>> I was curious if the ability to connect securely to a database service 
>>> (without an SSH tunnel) was added to 2.17.1?  Thanks.
>>>
>>>
>>>
>>> On Wednesday, January 31, 2018 at 12:27:01 AM UTC-6, appj...@gmail.com 
>>> wrote:

 Hi, I wanted to check back to see if there was any update on this.  

 With more and more database solutions moving to hosted DB services (so 
 no SSH tunnels), Web2Py apps do not have the ability to connect to these 
 securely.   

 We are stuck hosting a dedicated machine to server our MySQL and run an 
 SSH server.  We'd like to switch to Amazon Aurora for example.


 On Wednesday, October 11, 2017 at 11:52:02 AM UTC-5, Massimo Di Pierro 
 wrote:
>
>
>
> On Saturday, 7 October 2017 01:55:53 UTC-5, appj...@gmail.com wrote:
>>
>> Thank you Massimo!
>>
>> There is a great detailed deployment recipe for SSH tunneling to your 
>> database server from a Heroku app instance (dyno). It works as of this 
>> post.10/8/17
>>
>> https://stackoverflow.com/questions/21575582/ssh-tunneling-from-heroku/46629121#46629121
>>
>> There are 2 issues/questions with this though:
>>
>> 1) So now that I can tunnel in, I have a performance question:  Since 
>> the mysql database server will be making all of its connections to 
>> localhost is that a single connection rather than multiple?  Will I lose 
>> database read concurrency?  If so, will either that or the SSH tunnels 
>> be a 
>> bottleneck and severely degrade my database performance?
>>
>
> web2py has connection pooling. Each of connection from the pool will 
> go through the tunnel, concurrently up to the max number in the pool.
>
>>
>> 2) SSH tends to be flaky and drop connections leaving a broken Web2py 
>> app instance.  Any suggestions on best practices for handling that case?
>>
>
>
> No. Sorry. If others have suggestions I would like to hear them.
>  
>
>>
>> It's too bad DAL doesn't support secure connections.  Encrypted 
>> database connections are pretty standard nowadays and I see there are 
>> python mysql connectors that do. Has anyone successfully swapped out the 
>> one that ships with one of those?
>>
>
> It would be easy to add. we will work in it.
>  
>
>>
>> Cloud deployment is new to me so I really appreciate the help, and I 
>> love using Web2py so thanks for making it and the ongoing support! 
>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py 

Re: [web2py] CAS error

2018-12-07 Thread Massimo Di Pierro
can you please open an issue about this?

On Thursday, 29 November 2018 13:51:14 UTC-8, Carlos Cesar Caballero wrote:
>
> Hi guys, after some clean tests, the issue is not happening with Python 
> 2.7, so it seems to be a Python 3 issue. 
>
> Greetings. 
>
>
> El 29/11/18 a las 1:34 p.m., Carlos Cesar Caballero Díaz escribió: 
> > Hi, I am using the web2py version 
> > 2.17.2-stable+timestamp.2018.10.06.18.54.02 in Ubuntu Linux, and I am 
> > not able to use CAS. I have a web2py app as server, an another as 
> > client, and when client try to log in, the browser starts a redirect 
> > loop and returns a ERR_TOO_MANY_REDIRECTS error. There are no error 
> > tickets in client or server apps, and the behavior is happening using 
> > python 2.7 and 3.6. 
> > 
> > I have configured the client just using: 
> > 
> > auth = Auth(db, cas_provider = 
> > 'http://127.0.0.1:8000/welcome/default/user/cas') 
> > 
> > I want to authenticate against the welcome app as I have being doing 
> > with past web2py versions. 
> > 
> > Any idea how to fix this? 
> > 
> > 
> > Greetings. 
> > 
>
>

-- 
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: AWS Lambda Deployment Recipe

2018-12-07 Thread Massimo Di Pierro
Good job! If you change that to a markdown or html page we can post on the 
web2py web site. I would also be happy to take the code from your example 
and turn it into a script that shops with web2py. Want to propose one?

On Tuesday, 27 November 2018 15:51:54 UTC-8, appjar...@gmail.com wrote:
>
> I've created a first pass at an AWS Lambda deployment recipe which uses an 
> open-source tool called Zappa.
>
> I welcome any comments or suggested improvements.  In particular, step 3 
> requires modifying gluon/main.py which I would like to avoid.
>
> Deployment Recipe:
>
> https://docs.google.com/document/d/1ff_JxiZPKy1Mdck8UQbUybBtP3bRK48U1Uw-iHgr4wc/edit?usp=sharing
>
>
>

-- 
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: Migrations

2018-12-07 Thread Massimo Di Pierro
Welcome to the team!

On Tuesday, 27 November 2018 13:28:51 UTC-8, Ben Duncan wrote:
>
> LOL - Understand, can throw down C with the Best of them, write 
> applications (myriad of programming languages)  and setup Databases and 
> design them in  my sleep,
> but this is my first in a career that spans over 30 years, of having to do 
> some SERIOUS web programming.  
>
> Beginning to feel like a Newbie ..
>
> *Ben Duncan*
> DBA / Chief Software Architect 
> Mississippi State Supreme Court
> Electronic Filing Division
>
>
> On Tue, Nov 27, 2018 at 1:02 PM Dave S  wrote:
>
>>
>>
>> On Monday, November 26, 2018 at 4:42:10 AM UTC-8, Ben Duncan wrote:
>>>
>>> Thanks Dave !!!
>>>
>>> That makes sense.
>>>
>>> I tried a few tables with "fake migration" (for grins and giggles) 
>>> turned on and the code that generates the database/ stuff choked and puked 
>>> all over
>>> the "foreign keys". 
>>>
>>
>> It might be of interest (says the firmware geek with 1 semester DB creds) 
>> to have a minimal example that illustrates the problem, but of course that 
>> would have to fit within the project schedule, as well.
>>  
>>
>>>
>>> I went back and left it as is, with everything expected as a "external" 
>>> table, whcih is just as well, since I will have to dove tail this with
>>> a e-filing systems at some point.
>>>
>>> Thanks again ...
>>>
>>> *Ben Duncan*
>>> DBA / Chief Software Architect 
>>> Mississippi State Supreme Court
>>> Electronic Filing Division
>>>
>>
>> Happy to help ... this group has been good to me, and sometimes I can pay 
>> it forward.
>>
>> /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.
>>
>

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