Re: [web2py] Re: PostgreSQL 10.2

2018-03-01 Thread Anthony
On Thursday, March 1, 2018 at 6:36:40 PM UTC-5, Rob Paire wrote:
>
> I am running the windows binary that is why PostgreSQL was working out of 
> the box.
>
> The Windows binary distribution works out of the box with SQLite, MSSQL, 
> Postgresql and MySQL. 
>

Now I see the Windows binary does include psycogp2. Assumed you had 
switched to running from source after this suggestion 
.

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: Where is Auth table on Database Administration?

2018-03-01 Thread Anthony
Don't think so.

On Thursday, March 1, 2018 at 6:20:07 PM UTC-5, greenpoise wrote:
>
> Did anything changed that now the AUth table is not displayed on the 
> Database Administration tool??
>
>
> 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.


Re: [web2py] Re: PostgreSQL 10.2

2018-03-01 Thread Anthony
Have you restarted the web2py server since updating psycopg2? Do you only 
have one Python installation on the system?

On Thursday, March 1, 2018 at 5:35:59 PM UTC-5, Rob Paire wrote:
>
> Anthony, 
> This is surprising information, the server is brand new and all software 
> is freshly installed. I will research further. Thank you for your help.
>
> -Rob
>
>
> On Thursday, March 1, 2018 at 4:40:19 PM UTC-5, Anthony wrote:
>>
>> On Thursday, March 1, 2018 at 3:58:52 PM UTC-5, Rob Paire wrote:
>>>
>>> Hi Anthony, 
>>> Yes web2py PG driver works fine, except it is too old, doesn't support 
>>> Postgres v10.2
>>>
>>
>> web2py does not ship with the psycopg2 driver, so if your driver is out 
>> of date, it is up to you to update your system. If your system does not 
>> have psycopg2 installed, the DAL will default to the pure Python pg8000 
>> driver that ships with the DAL, but according to your traceback, your app 
>> is using psycopg2, which must be coming from your system.
>>
>> Anthony
>>
>

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


Re: [web2py] Re: PostgreSQL 10.2

2018-03-01 Thread Rob Paire
I am running the windows binary that is why PostgreSQL was working out of 
the box.

The Windows binary distribution works out of the box with SQLite, MSSQL, 
Postgresql and MySQL. The Mac binary distribution works out of the box with 
SQLite. To use any other database back-end, run from the source 
distribution and install the appropriate driver for the required back end.

Looks like the path forward is to run from source and upgrade the drivers. 
You guys were great - Thank you!
-Rob

On Thursday, March 1, 2018 at 5:35:59 PM UTC-5, Rob Paire wrote:
>
> Anthony, 
> This is surprising information, the server is brand new and all software 
> is freshly installed. I will research further. Thank you for your help.
>
> -Rob
>
>
> On Thursday, March 1, 2018 at 4:40:19 PM UTC-5, Anthony wrote:
>>
>> On Thursday, March 1, 2018 at 3:58:52 PM UTC-5, Rob Paire wrote:
>>>
>>> Hi Anthony, 
>>> Yes web2py PG driver works fine, except it is too old, doesn't support 
>>> Postgres v10.2
>>>
>>
>> web2py does not ship with the psycopg2 driver, so if your driver is out 
>> of date, it is up to you to update your system. If your system does not 
>> have psycopg2 installed, the DAL will default to the pure Python pg8000 
>> driver that ships with the DAL, but according to your traceback, your app 
>> is using psycopg2, which must be coming from your system.
>>
>> 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] Where is Auth table on Database Administration?

2018-03-01 Thread greenpoise
Did anything changed that now the AUth table is not displayed on the 
Database Administration tool??


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] self.error ProgrammingError(u'ERROR', u'42P07', u'relation ..., u'1066', u'heap_create_with_catalog'

2018-03-01 Thread greenpoise
Hello there.

Been trying to revive an app I had and somewhere in between updates it 
broke which is not a big deal but here is the thing. I switched (on a new 
blank .py model), to postgresql from SQLITE and all I get is errors similar 
to this:

self.errorProgrammingError(u'ERROR', u'42P07', u'relation ..., u'1066', u'
heap_create_with_catalog', u'', u'')

so..after a while I decided to go back to SQLite and the tables work and 
are created. Just wanted to throw this in here.


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.


Re: [web2py] Re: PostgreSQL 10.2

2018-03-01 Thread Rob Paire
Anthony, 
This is surprising information, the server is brand new and all software is 
freshly installed. I will research further. Thank you for your help.

-Rob


On Thursday, March 1, 2018 at 4:40:19 PM UTC-5, Anthony wrote:
>
> On Thursday, March 1, 2018 at 3:58:52 PM UTC-5, Rob Paire wrote:
>>
>> Hi Anthony, 
>> Yes web2py PG driver works fine, except it is too old, doesn't support 
>> Postgres v10.2
>>
>
> web2py does not ship with the psycopg2 driver, so if your driver is out of 
> date, it is up to you to update your system. If your system does not have 
> psycopg2 installed, the DAL will default to the pure Python pg8000 driver 
> that ships with the DAL, but according to your traceback, your app is using 
> psycopg2, which must be coming from your system.
>
> Anthony
>

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


Re: [web2py] Re: PostgreSQL 10.2

2018-03-01 Thread Anthony
On Thursday, March 1, 2018 at 3:58:52 PM UTC-5, Rob Paire wrote:
>
> Hi Anthony, 
> Yes web2py PG driver works fine, except it is too old, doesn't support 
> Postgres v10.2
>

web2py does not ship with the psycopg2 driver, so if your driver is out of 
date, it is up to you to update your system. If your system does not have 
psycopg2 installed, the DAL will default to the pure Python pg8000 driver 
that ships with the DAL, but according to your traceback, your app is using 
psycopg2, which must be coming from your system.

Anthony

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


Re: [web2py] Re: PostgreSQL 10.2

2018-03-01 Thread Rob Paire
Hi Anthony,
Yes web2py PG driver works fine, except it is too old, doesn't support
Postgres v10.2
-Rob

On Mar 1, 2018 3:53 PM, "Anthony"  wrote:

> Looks like it's finding the psycopg2 driver just fine -- the problem is
> that it is not finding a database named booster_i. You might need to
> specify the port in the connection string (e.g., "localhost:5432").
>
> Anthony
>
> On Thursday, March 1, 2018 at 3:32:14 PM UTC-5, Rob Paire wrote:
>>
>> Hi Richard,
>> Thank you for your helpful reply. I am running the latest version of
>> web2py 2_16_1. In order to query the version of psycpg2 which web2py is
>> running put the following code into a view:
>> {{import psycopg2}}
>> {{=psycopg2.__version__}}
>>
>> This show web2py is running version  2.5.4 (dt dec pq3 ext)
>>
>>
>> I used PIP to install the latest version of psycpg2: 2.7.4 into my local
>> Python2.7 directory and I can talk to the database as expected. I am
>> wondering how to get the latest version of Psycpg into web2py.
>>
>> Error message below:.. note changing "localhost" to a server running
>> postgres 9.3 everythings works fine.
>>
>> Ticket ID
>>
>> 192.168.1.45.2018-03-01.15-25-12.2fa3bdd3-d668-4487-874a-3ca86557ad66
>>  Failure to connect, tried 5 times:
>> Traceback (most recent call last): File 
>> "C:\web2py_2_16_1\gluon\packages\dal\pydal\base.py",
>> line 454, in __init__ self._adapter = adapter(**kwargs) File
>> "C:\web2py_2_16_1\gluon\packages\dal\pydal\adapters\postgres.py", line
>> 25, in __call__ return AdapterMeta.__call__(cls, *args, **kwargs) File
>> "C:\web2py_2_16_1\gluon\packages\dal\pydal\adapters\__init__.py", line
>> 40, in __call__ obj = super(AdapterMeta, cls).__call__(*args, **kwargs)
>> File "C:\web2py_2_16_1\gluon\packages\dal\pydal\adapters\postgres.py",
>> line 48, in __init__ driver_args, adapter_args, do_connect,
>> after_connection) File "C:\web2py_2_16_1\gluon\packag
>> es\dal\pydal\adapters\base.py", line 368, in __init__ super(SQLAdapter,
>> self).__init__(*args, **kwargs) File "C:\web2py_2_16_1\gluon\packag
>> es\dal\pydal\adapters\base.py", line 52, in __init__ self.reconnect()
>> File "C:\web2py_2_16_1\gluon\packages\dal\pydal\helpers\classes.py",
>> line 181, in _reconnect_and_configure self._connection_reconnect() File
>> "C:\web2py_2_16_1\gluon\packages\dal\pydal\connection.py", line 172, in
>> reconnect self.connection = self.connector() File
>> "C:\web2py_2_16_1\gluon\packages\dal\pydal\adapters\postgres.py", line
>> 105, in connector return self.driver.connect(**self.driver_args) File
>> "psycopg2/__init__.py", line 164, in connect OperationalError: FATAL:
>> database "booster_i" does not existVersion
>> web2py™ Version 2.16.1-stable+timestamp.2017.11.14.05.54.25Traceback
>>
>> 1.
>> 2.
>> 3.
>> 4.
>> 5.
>> 6.
>> 7.
>> 8.
>> 9.
>> 10.
>> 11.
>> 12.
>> 13.
>> 14.
>> 15.
>> 16.
>> 17.
>> 18.
>> 19.
>> 20.
>> 21.
>> 22.
>> 23.
>> 24.
>> 25.
>> 26.
>> 27.
>> 28.
>> 29.
>> 30.
>> 31.
>> 32.
>> 33.
>> 34.
>>
>> Traceback (most recent call last):
>>   File "C:\web2py_2_16_1\gluon\restricted.py", line 219, in restricted
>> exec(ccode, environment)
>>   File "C:/web2py_2_16_1/applications/Booster_I/models/db.py" 
>> , line 
>> 20, in 
>> db = 
>> DAL('postgres://username:password@localhost/booster_i',pool_size=1,check_reserved=['all'],migrate_enabled=False)
>>   File "C:\web2py_2_16_1\gluon\packages\dal\pydal\base.py", line 169, in 
>> __call__
>> obj = super(MetaDAL, cls).__call__(*args, **kwargs)
>>   File "C:\web2py_2_16_1\gluon\packages\dal\pydal\base.py", line 474, in 
>> __init__
>> "Failure to connect, tried %d times:\n%s" % (attempts, tb)
>> RuntimeError: Failure to connect, tried 5 times:
>> Traceback (most recent call last):
>>   File "C:\web2py_2_16_1\gluon\packages\dal\pydal\base.py", line 454, in 
>> __init__
>> self._adapter = adapter(**kwargs)
>>   File "C:\web2py_2_16_1\gluon\packages\dal\pydal\adapters\postgres.py", 
>> line 25, in __call__
>> return AdapterMeta.__call__(cls, *args, **kwargs)
>>   File "C:\web2py_2_16_1\gluon\packages\dal\pydal\adapters\__init__.py", 
>> line 40, in __call__
>> obj = super(AdapterMeta, cls).__call__(*args, **kwargs)
>>   File "C:\web2py_2_16_1\gluon\packages\dal\pydal\adapters\postgres.py", 
>> line 48, in __init__
>> driver_args, adapter_args, do_connect, after_connection)
>>   File "C:\web2py_2_16_1\gluon\packages\dal\pydal\adapters\base.py", line 
>> 368, in __init__
>> super(SQLAdapter, self).__init__(*args, **kwargs)
>>   File "C:\web2py_2_16_1\gluon\packages\dal\pydal\adapters\base.py", line 
>> 52, in __init__
>> self.reconnect()
>>   File "C:\web2py_2_16_1\gluon\packages\dal\pydal\helpers\classes.py", line 
>> 181, in _reconnect_and_configure
>> self._connection_reconnect()
>>   File "C:\web2py_2_16_1\gluon\packages\dal\pydal\connection.py", line 172, 
>> in reconnect
>> self.connection = self.connector()
>>   File "C:\web2py_2_16_1\gluo

[web2py] Re: Option to load modified appconfig in rocket server

2018-03-01 Thread 'Yan Wong' via web2py-users
Great, thanks both.

On Thursday, 1 March 2018 12:23:44 UTC, Anthony wrote:
>
> On Thursday, March 1, 2018 at 7:02:53 AM UTC-5, Leonel Câmara wrote:
>>
>> An easy way would be to simply check for the port where the request was 
>> made and simply run rocket on a different port for testing e.g.  then 
>> you would do something like this in the models
>>
>> if request.env.server_port == :
>> # load alternate config
>>
>
> And if you want to pass the config filename directly to Rocket, you can 
> re-purpose its "args" argument (which is typically only used when running 
> scripts via the command line):
>
> import os
> from gluon.contrib.appconfig import AppConfig
>
> config_filename = request.env.cmd_options and request.env.cmd_options.args
> [-1] or 'appconfig.ini'
> config_path = os.path.join(request.folder, 'private', config_filename)
> myconf = AppConfig(config_path, reload=True)
>
> Then start Rocket with:
>
> python web2py.py --args test_appconfig.ini
>
> 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: PostgreSQL 10.2

2018-03-01 Thread Anthony
Looks like it's finding the psycopg2 driver just fine -- the problem is 
that it is not finding a database named booster_i. You might need to 
specify the port in the connection string (e.g., "localhost:5432").

Anthony

On Thursday, March 1, 2018 at 3:32:14 PM UTC-5, Rob Paire wrote:
>
> Hi Richard,
> Thank you for your helpful reply. I am running the latest version of 
> web2py 2_16_1. In order to query the version of psycpg2 which web2py is 
> running put the following code into a view: 
> {{import psycopg2}}
> {{=psycopg2.__version__}}
>
> This show web2py is running version  2.5.4 (dt dec pq3 ext)  
>
>
> I used PIP to install the latest version of psycpg2: 2.7.4 into my local 
> Python2.7 directory and I can talk to the database as expected. I am 
> wondering how to get the latest version of Psycpg into web2py.
>
> Error message below:.. note changing "localhost" to a server running 
> postgres 9.3 everythings works fine.
>
> Ticket ID
>
> 192.168.1.45.2018-03-01.15-25-12.2fa3bdd3-d668-4487-874a-3ca86557ad66
>  Failure to connect, tried 5 times: 
> Traceback (most recent call last): File 
> "C:\web2py_2_16_1\gluon\packages\dal\pydal\base.py", line 454, in __init__ 
> self._adapter = adapter(**kwargs) File 
> "C:\web2py_2_16_1\gluon\packages\dal\pydal\adapters\postgres.py", line 25, 
> in __call__ return AdapterMeta.__call__(cls, *args, **kwargs) File 
> "C:\web2py_2_16_1\gluon\packages\dal\pydal\adapters\__init__.py", line 40, 
> in __call__ obj = super(AdapterMeta, cls).__call__(*args, **kwargs) File 
> "C:\web2py_2_16_1\gluon\packages\dal\pydal\adapters\postgres.py", line 48, 
> in __init__ driver_args, adapter_args, do_connect, after_connection) File 
> "C:\web2py_2_16_1\gluon\packages\dal\pydal\adapters\base.py", line 368, in 
> __init__ super(SQLAdapter, self).__init__(*args, **kwargs) File 
> "C:\web2py_2_16_1\gluon\packages\dal\pydal\adapters\base.py", line 52, in 
> __init__ self.reconnect() File 
> "C:\web2py_2_16_1\gluon\packages\dal\pydal\helpers\classes.py", line 181, 
> in _reconnect_and_configure self._connection_reconnect() File 
> "C:\web2py_2_16_1\gluon\packages\dal\pydal\connection.py", line 172, in 
> reconnect self.connection = self.connector() File 
> "C:\web2py_2_16_1\gluon\packages\dal\pydal\adapters\postgres.py", line 105, 
> in connector return self.driver.connect(**self.driver_args) File 
> "psycopg2/__init__.py", line 164, in connect OperationalError: FATAL: 
> database "booster_i" does not existVersion
> web2py™ Version 2.16.1-stable+timestamp.2017.11.14.05.54.25Traceback
>
> 1.
> 2.
> 3.
> 4.
> 5.
> 6.
> 7.
> 8.
> 9.
> 10.
> 11.
> 12.
> 13.
> 14.
> 15.
> 16.
> 17.
> 18.
> 19.
> 20.
> 21.
> 22.
> 23.
> 24.
> 25.
> 26.
> 27.
> 28.
> 29.
> 30.
> 31.
> 32.
> 33.
> 34.
>
> Traceback (most recent call last):
>   File "C:\web2py_2_16_1\gluon\restricted.py", line 219, in restricted
> exec(ccode, environment)
>   File "C:/web2py_2_16_1/applications/Booster_I/models/db.py" 
> , line 
> 20, in 
> db = 
> DAL('postgres://username:password@localhost/booster_i',pool_size=1,check_reserved=['all'],migrate_enabled=False)
>   File "C:\web2py_2_16_1\gluon\packages\dal\pydal\base.py", line 169, in 
> __call__
> obj = super(MetaDAL, cls).__call__(*args, **kwargs)
>   File "C:\web2py_2_16_1\gluon\packages\dal\pydal\base.py", line 474, in 
> __init__
> "Failure to connect, tried %d times:\n%s" % (attempts, tb)
> RuntimeError: Failure to connect, tried 5 times:
> Traceback (most recent call last):
>   File "C:\web2py_2_16_1\gluon\packages\dal\pydal\base.py", line 454, in 
> __init__
> self._adapter = adapter(**kwargs)
>   File "C:\web2py_2_16_1\gluon\packages\dal\pydal\adapters\postgres.py", line 
> 25, in __call__
> return AdapterMeta.__call__(cls, *args, **kwargs)
>   File "C:\web2py_2_16_1\gluon\packages\dal\pydal\adapters\__init__.py", line 
> 40, in __call__
> obj = super(AdapterMeta, cls).__call__(*args, **kwargs)
>   File "C:\web2py_2_16_1\gluon\packages\dal\pydal\adapters\postgres.py", line 
> 48, in __init__
> driver_args, adapter_args, do_connect, after_connection)
>   File "C:\web2py_2_16_1\gluon\packages\dal\pydal\adapters\base.py", line 
> 368, in __init__
> super(SQLAdapter, self).__init__(*args, **kwargs)
>   File "C:\web2py_2_16_1\gluon\packages\dal\pydal\adapters\base.py", line 52, 
> in __init__
> self.reconnect()
>   File "C:\web2py_2_16_1\gluon\packages\dal\pydal\helpers\classes.py", line 
> 181, in _reconnect_and_configure
> self._connection_reconnect()
>   File "C:\web2py_2_16_1\gluon\packages\dal\pydal\connection.py", line 172, 
> in reconnect
> self.connection = self.connector()
>   File "C:\web2py_2_16_1\gluon\packages\dal\pydal\adapters\postgres.py", line 
> 105, in connector
> return self.driver.connect(**self.driver_args)
>   File "psycopg2/__init__.py", line 164, in connect
> OperationalError: FATAL:  database "booster_i" does not exist
>
>
> In fi

[web2py] Re: PostgreSQL 10.2

2018-03-01 Thread Rob Paire
Hi Richard,
Thank you for your helpful reply. I am running the latest version of web2py 
2_16_1. In order to query the version of psycpg2 which web2py is running 
put the following code into a view: 
{{import psycopg2}}
{{=psycopg2.__version__}}

This show web2py is running version  2.5.4 (dt dec pq3 ext)  


I used PIP to install the latest version of psycpg2: 2.7.4 into my local 
Python2.7 directory and I can talk to the database as expected. I am 
wondering how to get the latest version of Psycpg into web2py.

Error message below:.. note changing "localhost" to a server running 
postgres 9.3 everythings works fine.

Ticket ID

192.168.1.45.2018-03-01.15-25-12.2fa3bdd3-d668-4487-874a-3ca86557ad66
 Failure to connect, tried 5 times: 
Traceback (most recent call last): File 
"C:\web2py_2_16_1\gluon\packages\dal\pydal\base.py", line 454, in __init__ 
self._adapter = adapter(**kwargs) File 
"C:\web2py_2_16_1\gluon\packages\dal\pydal\adapters\postgres.py", line 25, 
in __call__ return AdapterMeta.__call__(cls, *args, **kwargs) File 
"C:\web2py_2_16_1\gluon\packages\dal\pydal\adapters\__init__.py", line 40, 
in __call__ obj = super(AdapterMeta, cls).__call__(*args, **kwargs) File 
"C:\web2py_2_16_1\gluon\packages\dal\pydal\adapters\postgres.py", line 48, 
in __init__ driver_args, adapter_args, do_connect, after_connection) File 
"C:\web2py_2_16_1\gluon\packages\dal\pydal\adapters\base.py", line 368, in 
__init__ super(SQLAdapter, self).__init__(*args, **kwargs) File 
"C:\web2py_2_16_1\gluon\packages\dal\pydal\adapters\base.py", line 52, in 
__init__ self.reconnect() File 
"C:\web2py_2_16_1\gluon\packages\dal\pydal\helpers\classes.py", line 181, 
in _reconnect_and_configure self._connection_reconnect() File 
"C:\web2py_2_16_1\gluon\packages\dal\pydal\connection.py", line 172, in 
reconnect self.connection = self.connector() File 
"C:\web2py_2_16_1\gluon\packages\dal\pydal\adapters\postgres.py", line 105, 
in connector return self.driver.connect(**self.driver_args) File 
"psycopg2/__init__.py", line 164, in connect OperationalError: FATAL: 
database "booster_i" does not existVersion
web2py™ Version 2.16.1-stable+timestamp.2017.11.14.05.54.25Traceback

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.

Traceback (most recent call last):
  File "C:\web2py_2_16_1\gluon\restricted.py", line 219, in restricted
exec(ccode, environment)
  File "C:/web2py_2_16_1/applications/Booster_I/models/db.py" 
, line 20, 
in 
db = 
DAL('postgres://username:password@localhost/booster_i',pool_size=1,check_reserved=['all'],migrate_enabled=False)
  File "C:\web2py_2_16_1\gluon\packages\dal\pydal\base.py", line 169, in 
__call__
obj = super(MetaDAL, cls).__call__(*args, **kwargs)
  File "C:\web2py_2_16_1\gluon\packages\dal\pydal\base.py", line 474, in 
__init__
"Failure to connect, tried %d times:\n%s" % (attempts, tb)
RuntimeError: Failure to connect, tried 5 times:
Traceback (most recent call last):
  File "C:\web2py_2_16_1\gluon\packages\dal\pydal\base.py", line 454, in 
__init__
self._adapter = adapter(**kwargs)
  File "C:\web2py_2_16_1\gluon\packages\dal\pydal\adapters\postgres.py", line 
25, in __call__
return AdapterMeta.__call__(cls, *args, **kwargs)
  File "C:\web2py_2_16_1\gluon\packages\dal\pydal\adapters\__init__.py", line 
40, in __call__
obj = super(AdapterMeta, cls).__call__(*args, **kwargs)
  File "C:\web2py_2_16_1\gluon\packages\dal\pydal\adapters\postgres.py", line 
48, in __init__
driver_args, adapter_args, do_connect, after_connection)
  File "C:\web2py_2_16_1\gluon\packages\dal\pydal\adapters\base.py", line 368, 
in __init__
super(SQLAdapter, self).__init__(*args, **kwargs)
  File "C:\web2py_2_16_1\gluon\packages\dal\pydal\adapters\base.py", line 52, 
in __init__
self.reconnect()
  File "C:\web2py_2_16_1\gluon\packages\dal\pydal\helpers\classes.py", line 
181, in _reconnect_and_configure
self._connection_reconnect()
  File "C:\web2py_2_16_1\gluon\packages\dal\pydal\connection.py", line 172, in 
reconnect
self.connection = self.connector()
  File "C:\web2py_2_16_1\gluon\packages\dal\pydal\adapters\postgres.py", line 
105, in connector
return self.driver.connect(**self.driver_args)
  File "psycopg2/__init__.py", line 164, in connect
OperationalError: FATAL:  database "booster_i" does not exist


In file: C:\web2py_2_16_1\applications\Booster_I\models\db.py

1.

 at 0C8CBA40, file 
"C:\web2py_2_16_1\applications\Booster_I\models\db.py", line 12>




On Thursday, March 1, 2018 at 2:39:18 PM UTC-5, Rob Paire wrote:
>
> Hello web2py community!
>
> I am in the process of moving a 4 year old web2py application to a new 
> server and I am having trouble getting the application to connect to 
> PostgreSQL 10.2.  I am guessing because the version of psycopg2 driver in 
> web2py is: 2.5.4 (dt dec pq3 ext) 
>
> I installed the latest

[web2py] Re: PostgreSQL 10.2

2018-03-01 Thread Anthony
If you have a local installation of Python, it is generally better to run 
web2py from source, as it will be able to use whatever Python packages you 
have installed on your system.

Anthony

On Thursday, March 1, 2018 at 2:39:18 PM UTC-5, Rob Paire wrote:
>
> Hello web2py community!
>
> I am in the process of moving a 4 year old web2py application to a new 
> server and I am having trouble getting the application to connect to 
> PostgreSQL 10.2.  I am guessing because the version of psycopg2 driver in 
> web2py is: 2.5.4 (dt dec pq3 ext) 
>
> I installed the latest version of psycopg2 to my local Python installation 
> and I can talk to the database, but how do I make web2py use the latest 
> drivers? It is necessary to run from source to do this?   
>
> Comments are appreciated.
>
> Thank you for your help!
> -Rob
>

-- 
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] PostgreSQL 10.2

2018-03-01 Thread Richard Vézina
Base on this :
https://github.com/web2py/pydal/blob/466a39f13e443bbcc54db2d1ba6ed10196abf440/pydal/drivers.py#L45

web2py shouldn't enforce a specific version of psycopg2...

Are you using python 2 or python 3 and is your last psycopg2 version you
mention is install for the python version that you use web2py with??

Richard

On Thu, Mar 1, 2018 at 2:39 PM, Rob Paire  wrote:

> Hello web2py community!
>
> I am in the process of moving a 4 year old web2py application to a new
> server and I am having trouble getting the application to connect to
> PostgreSQL 10.2.  I am guessing because the version of psycopg2 driver in
> web2py is: 2.5.4 (dt dec pq3 ext)
>
> I installed the latest version of psycopg2 to my local Python installation
> and I can talk to the database, but how do I make web2py use the latest
> drivers? It is necessary to run from source to do this?
>
> Comments are appreciated.
>
> Thank you for your help!
> -Rob
>
> --
> 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] PostgreSQL 10.2

2018-03-01 Thread Rob Paire
Hello web2py community!

I am in the process of moving a 4 year old web2py application to a new 
server and I am having trouble getting the application to connect to 
PostgreSQL 10.2.  I am guessing because the version of psycopg2 driver in 
web2py is: 2.5.4 (dt dec pq3 ext) 

I installed the latest version of psycopg2 to my local Python installation 
and I can talk to the database, but how do I make web2py use the latest 
drivers? It is necessary to run from source to do this?   

Comments are appreciated.

Thank you for your help!
-Rob

-- 
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] gevent and web2py

2018-03-01 Thread Pierre
Hi,

Can I use* gevent* to build a homemade redis task queue and to execute 
these tasks?  Does it make sense ? sorry if this is naiv questions i'm new 
to async programming...

http://web2py.com/books/default/chapter/29/08/emails-and-sms?search=homemade


from http://www.gevent.org/intro.html:


The following example shows how to run tasks concurrently:


>>> import gevent>>> from gevent import socket>>> urls = ['www.google.com', 
>>> 'www.example.com', 'www.python.org']>>> jobs = 
>>> [gevent.spawn(socket.gethostbyname, url) for url in urls]>>> 
>>> gevent.joinall(jobs, timeout=2)>>> [job.value for job in 
>>> jobs]['74.125.79.106', '208.77.188.166', '82.94.164.162'

-- 
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: Double left join syntax

2018-03-01 Thread Anthony
On Wednesday, February 28, 2018 at 11:16:32 AM UTC-5, Anthony wrote:
>
> SELECT * 
>> FROM
>>   OnResource 
>> LEFT JOIN Contact Owner ON Owner.id = OnResource.Contact
>> LEFT JOIN Contact Proxy ON Proxy.id = OnResource.Proxy
>> ORDER BY
>>   Owner.LastName, Owner.FirstName
>>
>> I tried this DAL select syntax
>>
>> timesheet_owners = db().select(db.OnResource.ALL,
>>   db.Contact.with_alias('Owner').ALL,
>>   db.Contact.with_alias('Proxy').ALL,
>>   left=[db.Contact.with_alias('Owner').on(db.Contact.id == 
>> db.OnResource.Contact),
>> db.Contact.with_alias('Proxy').on(db.Contact.id == 
>> db.OnResource.Proxy)],
>>
>
> Looks like the cross join might be a separate issue. But regarding the 
> left joins, if using aliases, you will have to manually write the SQL for 
> the "ON" clause rather than using DAL syntax:
>
> db.Contact.with_alias('Owner').on('Owner.id  = 
> OnResource.Contact')
>
>
Correction, you can also do something like:

owner = db.Contact.with_alias('Owner')
owner.on(owner.id == db.OnResource.Contact)

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] Unexpected behaviour executing a query with DAL and record versioning enabled

2018-03-01 Thread 'Awe' via web2py-users
Hello,
I post a simple step by step example, to explain.
Doing a left join and using a where clause like: table.field==None
Depending on _enable_record_versioning is enabled or not, I get different 
results when executing the identical query.
The result when versioning is DISABLED is the correct one.

2.15.4-stable+timestamp.2017.09.02.04.02.22
(läuft auf Rocket 1.2.6, Python 2.7.12)
SQLite DB

Example:

#simple table:
current.db.define_table('test',
   Field('title', 'string'),
   Field('granny', 'reference test'),  # convenience - 
topmost
   Field('type_marker', 'string'),
   auth.signature,
   )
#versioning, enable/disable it
current.db.test._enable_record_versioning(archive_db=current.db,
  archive_name='test_archive',
  current_record='current_record',
  is_active='is_active'
  )

#put some data in
#current.db.test.insert(**{'title': 'Peter', 'granny': None, 'type_marker': 
'person'})
#current.db.test.insert(**{'title': 'Paul', 'granny': None, 'type_marker': 
'person'})
#current.db.test.insert(**{'title': 'Laptop', 'granny': 2, 'type_marker': 
'object'})

#so you get table content (enabled)t:
test.idtest.titletest.grannytest.type_marker
test.is_activetest.created_ontest.created_by
test.modified_ontest.modified_by
1  Peter Noneperson
True2018-03-01 08:11:40Me2018-03-01 
08:11:40Me
2  Paul  Noneperson
True2018-03-01 08:11:40Me2018-03-01 
08:11:40Me
3  Laptop   2  object
True2018-03-01 08:11:40Me2018-03-01 
08:11:40Me

#simple controller function
def demo():
test1=current.db.test.with_alias('test1')
test2=current.db.test.with_alias('test2')
query = (test2.type_marker=='object') | (test2.type_marker==None) & 
(test1.type_marker=='person')
tbl = current.db().select(current.db.test.ALL)
rows = current.db(query).select(test1.title, test2.title, 
left=test2.on(test1.id==test2.granny))
prn =  current.db(query)._select(test1.title, test2.title, 
left=test2.on(test1.id==test2.granny))
return dict(tbl=tbl, rows=rows, prn=prn)

Result/Output:
test1.titletest2.title
PaulLaptop

Raw SQL:
SELECT "test1"."title", "test2"."title" FROM "test" AS "test1" LEFT JOIN 
"test" AS "test2" ON (("test1"."id" = "test2"."granny") AND 
(("test1"."is_active" = 'T') AND ("test2"."is_active" = 'T'))) WHERE 
"test2"."type_marker" = 'object') OR (("test2"."type_marker" IS NULL) 
AND ("test1"."type_marker" = 'person'))) AND (("test1"."is_active" = 'T') 
AND ("test2"."is_active" = 'T'))) AND (("test1"."is_active" = 'T') AND 
("test2"."is_active" = 'T')));


NOW DISABLED Record versioning:

Result/Output:
test1.titletest2.title
PeterNone
PaulLaptop

Raw SQL:
SELECT "test1"."title", "test2"."title" FROM "test" AS "test1" LEFT JOIN 
"test" AS "test2" ON ("test1"."id" = "test2"."granny") WHERE 
(("test2"."type_marker" = 'object') OR (("test2"."type_marker" IS NULL) AND 
("test1"."type_marker" = 'person')));

QUESTION:
The result with versioning turned off looks right.
It seems that the automatically inserted "AND... is_active" clauses are not 
correct.
Many thanks for your help and assistance.
Andreas

-- 
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: How to verify woocommerce webhook signature in web2py auth decorator

2018-03-01 Thread Anthony

>
> On Wednesday, February 28, 2018 at 3:50:16 PM UTC-8, Anthony wrote:
>>
>> I think you're on the right track. If you need the original request body 
>> to verify the signature, request.body.read() should do it. Does that not 
>> work?
>>
>> Also, I don't think you need the decorator and nested function. Just 
>> write a simple function and call it at the beginning of the handler:
>>
>> def verify_signature():
>> secret = ''
>> body = request.body.read()
>> dig = hmac.new(secret.encode(), msg=body.encode(), digestmod=hashlib.
>> sha256).digest()
>> if request.env.http_x_wc_webhook_signature != base64.b64encode(dig).
>> decode():
>> raise HTTP(403)  
>>
>> @service.json
>> def listenToHooks():
>> verify_signature()
>> # do stuff
>>
>> Anthony
>>
>>
>
> Don't you want a dummy parameter on verify_signature(), to prevent it 
> being a URL-visible function?
>

Instead of a dummy parameter, you can start the name with a double 
underscore. But if verify_signature is needed in multiple places, I would 
move it to a model or module. If only needed in this one place, I probably 
wouldn't make a separate function and simply add those few lines directly 
to listenToHooks.

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: Option to load modified appconfig in rocket server

2018-03-01 Thread Anthony
On Thursday, March 1, 2018 at 7:02:53 AM UTC-5, Leonel Câmara wrote:
>
> An easy way would be to simply check for the port where the request was 
> made and simply run rocket on a different port for testing e.g.  then 
> you would do something like this in the models
>
> if request.env.server_port == :
> # load alternate config
>

And if you want to pass the config filename directly to Rocket, you can 
re-purpose its "args" argument (which is typically only used when running 
scripts via the command line):

import os
from gluon.contrib.appconfig import AppConfig

config_filename = request.env.cmd_options and request.env.cmd_options.args[-
1] or 'appconfig.ini'
config_path = os.path.join(request.folder, 'private', config_filename)
myconf = AppConfig(config_path, reload=True)

Then start Rocket with:

python web2py.py --args test_appconfig.ini

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: Table doesn't exist - in mySQL migrate

2018-03-01 Thread Dmitri Ermolaev
!!! in appconfig I use not boolean - it need in DB!

if myconf.take('db.migrate'):
migrate = True ## ONLY BOOLEAN!
else:
migrate = False ## ONLY BOOLEAN!

if myconf.take('db.fake_migrate'):
fake_migrate = True ## ONLY BOOLEAN!
else:
fake_migrate = False ## ONLY BOOLEAN!


db = DAL(myconf.take('db.uri'), 
pool_size=myconf.take('db.pool_size', cast=int), check_reserved=['all'],
#migrate = Not (Not (myconf.take('db.migrate'))),
migrate = migrate,
fake_migrate = fake_migrate,
)


четверг, 1 марта 2018 г., 14:52:50 UTC+3 пользователь Dmitri Ermolaev 
написал:
>
> *Error in string:*
> *   format='%(name)s',*
>
> *db.define_table('systems',**   Field('name', length=25, readable=False, 
> comment='name of tokenized system'),**   Field('from_block', 'integer', 
> comment='block was tested'),*
> *   #migrate=False,**   format='%(name)s',**   )*
>  (1146, u"Table 
> 'ipay4_free.systems' doesn't exist")Version
> web2py™ Version 2.14.6-stable+timestamp.2016.05.10.00.21.47Traceback
>
> 1.
> 2.
> 3.
> 4.
> 5.
> 6.
> 7.
> 8.
> 9.
> 10.
> 11.
> 12.
> 13.
> 14.
> 15.
> 16.
> 17.
> 18.
> 19.
> 20.
> 21.
> 22.
> 23.
>
> Traceback (most recent call last):
>   File "C:\web2py\gluon\restricted.py", line 227, in restricted
> exec ccode in environment
>   File "C:/web2py/applications/ipay4_in_free/models/db1.py" 
> , line 
> 57, in 
> format='%(name)s',
>   File "C:\web2py\gluon\packages\dal\pydal\base.py", line 834, in define_table
> table = self.lazy_define_table(tablename,*fields,**args)
>   File "C:\web2py\gluon\packages\dal\pydal\base.py", line 873, in 
> lazy_define_table
> polymodel=polymodel)
>   File "C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 510, in 
> create_table
> fake_migrate=fake_migrate
>   File "C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 623, in 
> migrate_table
> self.execute(sub_query)
>   File "C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 1388, in 
> execute
> return self.log_execute(*a, **b)
>   File "C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 1382, in 
> log_execute
> ret = self.get_cursor().execute(command, *a[1:], **b)
>   File "C:\web2py\gluon\contrib\pymysql\cursors.py", line 117, in execute
> self.errorhandler(self, exc, value)
>   File "C:\web2py\gluon\contrib\pymysql\connections.py", line 202, in 
> defaulterrorhandler
> raise errorclass, errorvalue
> ProgrammingError: (1146, u"Table 'ipay4_free.systems' doesn't exist")
>
>

-- 
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: Option to load modified appconfig in rocket server

2018-03-01 Thread Leonel Câmara
An easy way would be to simply check for the port where the request was 
made and simply run rocket on a different port for testing e.g.  then 
you would do something like this in the models

if request.env.server_port == :
# load alternate config

-- 
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] Table doesn't exist - in mySQL migrate

2018-03-01 Thread Dmitri Ermolaev
*Error in string:*
*   format='%(name)s',*

*db.define_table('systems',**   Field('name', length=25, readable=False, 
comment='name of tokenized system'),**   Field('from_block', 'integer', 
comment='block was tested'),*
*   #migrate=False,**   format='%(name)s',**   )*
 (1146, u"Table 
'ipay4_free.systems' doesn't exist")Version
web2py™ Version 2.14.6-stable+timestamp.2016.05.10.00.21.47Traceback

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.

Traceback (most recent call last):
  File "C:\web2py\gluon\restricted.py", line 227, in restricted
exec ccode in environment
  File "C:/web2py/applications/ipay4_in_free/models/db1.py" 
, line 
57, in 
format='%(name)s',
  File "C:\web2py\gluon\packages\dal\pydal\base.py", line 834, in define_table
table = self.lazy_define_table(tablename,*fields,**args)
  File "C:\web2py\gluon\packages\dal\pydal\base.py", line 873, in 
lazy_define_table
polymodel=polymodel)
  File "C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 510, in 
create_table
fake_migrate=fake_migrate
  File "C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 623, in 
migrate_table
self.execute(sub_query)
  File "C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 1388, in 
execute
return self.log_execute(*a, **b)
  File "C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 1382, in 
log_execute
ret = self.get_cursor().execute(command, *a[1:], **b)
  File "C:\web2py\gluon\contrib\pymysql\cursors.py", line 117, in execute
self.errorhandler(self, exc, value)
  File "C:\web2py\gluon\contrib\pymysql\connections.py", line 202, in 
defaulterrorhandler
raise errorclass, errorvalue
ProgrammingError: (1146, u"Table 'ipay4_free.systems' doesn't exist")

-- 
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: Option to load modified appconfig in rocket server

2018-03-01 Thread 'Yan Wong' via web2py-users
Thanks. I really need to modify this programmatically for a functional test 
suite - it's not so much a dev vs prod thing. If I have a modified 
appconfig, how do I set web2py to use it for a particular rocket instance, 
but not normally?

On Thursday, 1 March 2018 11:33:15 UTC, 黄祥 wrote:
>
> i think you can do it programmitacally, using the variable or create 
> multiple appconfig.ini e.g. (dev_appconfig.ini), for the first suggestion, 
> usually do this 
> *models/db.py*
> from gluon.contrib.appconfig import AppConfig
> config_path = os.path.join(request.folder, 'private')
> configuration = AppConfig('%s/appconfig.ini' % config_path, reload = True)
> configuration_env = configuration.get('environment.type')
> # this the example, to get the value of dev_smtp.sender
> mail.settings.sender = configuration.get(configuration_env + '_' + 
> 'smtp.sender')
>
> *private/appconfig.ini*
> [environment]
> type = dev
> ;type = test
> ;type = stage
> ;type = prod
> [dev_smtp]
> sender = We Care >
> [test_smtp]
> sender = We Care >
> [stage_smtp]
> sender = We Care >
> [prod_smtp]
> sender = We Care >
>
> for the later suggestion, just adapt it on the file name instead 
> (dev_appconfig.ini)
>
> 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: Option to load modified appconfig in rocket server

2018-03-01 Thread 黄祥
i think you can do it programmitacally, using the variable or create 
multiple appconfig.ini e.g. (dev_appconfig.ini), for the first suggestion, 
usually do this 
*models/db.py*
from gluon.contrib.appconfig import AppConfig
config_path = os.path.join(request.folder, 'private')
configuration = AppConfig('%s/appconfig.ini' % config_path, reload = True)
configuration_env = configuration.get('environment.type')
# this the example, to get the value of dev_smtp.sender
mail.settings.sender = configuration.get(configuration_env + '_' + 
'smtp.sender')

*private/appconfig.ini*
[environment]
type = dev
;type = test
;type = stage
;type = prod
[dev_smtp]
sender = We Care 
[test_smtp]
sender = We Care 
[stage_smtp]
sender = We Care 
[prod_smtp]
sender = We Care 

for the later suggestion, just adapt it on the file name instead 
(dev_appconfig.ini)

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] Option to load modified appconfig in rocket server

2018-03-01 Thread 'Yan Wong' via web2py-users
For testing purposes, I would like to set up some functional tests that 
check that web2py scripts work properly with different parameters set in 
appconfig.ini. Is there any way to fire up rocketsever and point it to a 
modified appconfig.ini file?

-- 
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: How to verify woocommerce webhook signature in web2py auth decorator

2018-03-01 Thread Manuele Pesenti



On 01/03/2018 03:25, Dave S wrote:


Don't you want a dummy parameter on verify_signature(), to prevent it 
being a URL-visible function? 
well actually it can even stay inside the models not a controller... in 
that case if it's not decorate as a service it cannot be visible. right?


       M.

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

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