[web2py] Registration key

2019-11-22 Thread Val K
Because null (none) has special meaning in sql and can't be compared, so you 
should use explicit comparison with null (none)

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/7d710b9d-42d7-4c41-8e54-fd48003cf170%40googlegroups.com.


[web2py] Registration key

2019-11-22 Thread Paco Bernal
Hi all

Today my mind is a little heavy but can't wait till tomorrow

Why 

db((db.auth_user.registration_key=='')|(db.auth_user.registration_key==None)).count()
>

gives me 2 and 

db(db.auth_user.registration_key!='blocked').count()
>

gives me 1 when I use only 'blocked' to block users?

Thanks for the support


-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/e622dfe5-c639-4dfc-b218-70dc537ea291%40googlegroups.com.


[web2py] Re: how to specify python3 for wsgihandler

2019-11-22 Thread David Zejda
Hi again.

Well, I found out that one Apache instance can't handle applications with 
different python interpreters via mod_wsgi. 

So, I decided to set up a virtual environment for a web2py instance running 
python3 applications with its own Apache and mod_wsgi. 

Since it is virtual environment, I decided if favour of pip instead of the 
operating system-specific packaging system.

Apache+mod_wsgi and the script mod_wsgi-express (refer to 
http://blog.dscpl.com.au/2015/04/introducing-modwsgi-express.html) makes 
the process easier:

Provided that the web2py for python3 apps is in /opt/web2py3, my steps were 
roughly:

sudo apt-get install python3-pip virtualenvwrapper
pip3 install --user --upgrade virtualenvwrapper
cd ~/.local/bin
mkvirtualenv -p /usr/bin/python3 /opt/python3env/web2py
cd /opt/python3env/web2py/bin
./pip3 install mod_wsgi-httpd
./pip3 install mod_wsgi 
cd /opt/web2py3
/opt/python3env/web2py/bin/mod_wsgi-express \
  --user www-data \
  --group www-data \
  --port 8830 \
  --working-directory /opt/web2py3
  --server-root /opt/python3env/web2py/etc
  --log-directory /opt/python3env/web2py/log
  --access-log 
  --startup-log
  --rotate-logs
  start-server wsgihandler.py

I will probably use one public IP address for web2py with python2-based 
apps served by the legacy Apache and a different IP address for 
python3-based apps served by the Apache from the virtual environment 
(configured as a bridge on the same network interface), so I can stick to 
default ports for HTTP and HTTPS, which seems a better solution than 
proxying from one Apache instance to the other.

David

On Monday, 11 November 2019 23:42:56 UTC+1, David Zejda wrote:
>
> Hello to all.
>
> I have a web2py with several apps on a production server behind Apache 
> accessed via wsgihandler. So far, all the apps have been developed for 
> python2.
>
> To support python3 apps (preferred for new projects), I set-up a separate 
> web2py directory and adjusted the Apache configs respectively.
>
> The question is - how to set this new web2py instance to run on python3?
>
> For compatibility reasons, /usr/bin/env python still translates to python 
> 2 interpreter. 
>
> Do I have to change all the #!/usr/bin/env python lines in web2py sources 
> to point to python3 instead? 
> Or where else can I specify the python version? 
>
> Thank you very much for an answer in advance!
>
> David
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/a4aff89d-0f78-45f2-a81a-1c3f58179a44%40googlegroups.com.


[web2py] Re: Web2py with python 3.8.0

2019-11-22 Thread Woody
I updated to Python 3.8 on Arch Linux today and I had the same problem with 
'escape'. I patched the languages.py file and got web2py to start, but then 
hit another error:

Traceback (most recent call last):
  File "/home/www/web2py/gluon/restricted.py", line 219, in restricted
exec(ccode, environment)
  File "/home/www/web2py/applications/x10_security/models/db.py" 
, line 
55, in 
auth.define_tables(username=False, signature=False)
  File "/home/www/web2py/gluon/tools.py", line 2092, in define_tables
super(Auth, self).define_tables(username, signature, migrate, 
fake_migrate)._table_signature_list
  File "/home/www/web2py/gluon/authapi.py", line 322, in define_tables
db.define_table(
  File "/home/www/web2py/gluon/packages/dal/pydal/base.py", line 592, in 
define_table
table = self.lazy_define_table(tablename, *fields, **kwargs)
  File "/home/www/web2py/gluon/packages/dal/pydal/base.py", line 623, in 
lazy_define_table
self._adapter.create_table(
  File "/home/www/web2py/gluon/packages/dal/pydal/adapters/base.py", line 798, 
in create_table
return self.migrator.create_table(*args, **kwargs)
  File "/home/www/web2py/gluon/packages/dal/pydal/migrator.py", line 299, in 
create_table
sql_fields_old = pickle.load(tfile)
TypeError: file must have 'read', 'readinto' and 'readline' attributes


I looked for a discussion or patch for this, but I didn't find one. Can 
anybody tell me how to fix this?

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/facebca6--4cd4-a643-a84d2a33e613%40googlegroups.com.


[web2py] New Telegrm Group - Russian - and others

2019-11-22 Thread Ari Lion BR Sp
Hi, 

A new Russian group has been opened at Telegram. Please join.

https://t.me/web2py_rus


Please see also the existent:

https://t.me/web2py_world  => General / English

https://t.me/web2pybrasil => Portuguese


Cheers


-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/525547b4-8501-47a0-9993-a0c32684e661%40googlegroups.com.