Re: [web2py] Re: Web2py, nginx, installation on Raspberry Pi

2016-07-23 Thread Ben Lawrence
Marcelo has a beta script at
https://github.com/motasmarcelo/setup-web2py-nginx-uwsgi-debian8.git


On Wednesday, May 25, 2016 at 3:45:23 PM UTC-7, Ben Lawrence wrote:
>
> Hi
> Did you finally manage to upload the modified script for raspberry pi ?
>
> On Tuesday, August 26, 2014 at 12:09:44 PM UTC-7, Encompass solutions 
> wrote:
>>
>> Thanks. I will probably try with the repos version and submit a pull 
>> request with a script for the web2py source. Also making a tool to publish 
>> to Qt cloud services. Perhaps we could add it to admin.
>> On Aug 26, 2014 9:31 PM, "Paolo Valleri"  wrote:
>>
>>> For rpi I see few alternatives:
>>> - switch to upstart (mind that would be a big change for your operating 
>>> system)
>>> - create your own uwsgi script in /etc/init.d/ (google for it)
>>> - place the command line a posted before in /etc/rc.local (mind to add 
>>> an & at the end)
>>> - uninstall the uwsgi installed by pip and install the one from the 
>>> raspbian repository (it comes with the /etc/init.d/... script). In this 
>>> case, I suggest to install uwsgi-emperor and uwsgi-plugin-python using 
>>> apt-get, add the line 'plugin=python' in web2py.ini and place that file in 
>>> /etc/uwsgi-emperor/vassals. 
>>>
>>>  Paolo
>>>
>>> 2014-08-24 20:46 GMT+02:00 Jason (spot) Brower :
>>>
 Yeah. Looks like that was it! How do I make this change permanent?
 On Aug 24, 2014 6:26 PM, "Paolo Valleri"  wrote:

> The script you mentioned is based on upstart but on the raspberry-pi 
> the init script are handled by sysvinit.
> So that, I'd say that uwsgi is not running? 
> Try to run it manually:
>
> sudo uwsgi --master --die-on-term --emperor /etc/uwsgi --logto /var/
> log/uwsgi/uwsgi.log
>
> Paolo
>
> On Sunday, August 24, 2014 11:00:49 AM UTC+2, Encompass solutions 
> wrote:
>>
>> Hi,
>> Currently I am getting a 502 Bad Gateway Error when trying to access 
>> my web2py server running on Raspberry Pi.
>> I first tried the setup with the script setup-web2py-nginx-ubuntu.sh 
>> as it's nearly identical to the instructoins found here.
>> http://web2py.com/books/default/chapter/29/13#Nginx
>> After doing the script I got the 502 Bad Gateway error.
>> I know I am on the right server as I can see the request in the logs.
>> I then went through the tutorial on the website I previously 
>> mentioned and still got the error.
>> There were a few differences in the script.  For example web2py.ini 
>> verses web2py.xml (which is informationally the same.)
>>
>> Any ideas on how to diagnose this and find the correct solution?
>>
>> -- 
> 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/Bx_9u0iC86o/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to 
> web2py+un...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
 -- 
 Resources:
 - http://web2py.com
 - http://web2py.com/book (Documentation)
 - http://github.com/web2py/web2py (Source code)
 - https://code.google.com/p/web2py/issues/list (Report Issues)
 --- 
 You received this message because you are subscribed to a topic in the 
 Google Groups "web2py-users" group.
 To unsubscribe from this topic, visit 
 https://groups.google.com/d/topic/web2py/Bx_9u0iC86o/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to 
 web2py+un...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.

>>>
>>> -- 
>>> Resources:
>>> - http://web2py.com
>>> - http://web2py.com/book (Documentation)
>>> - http://github.com/web2py/web2py (Source code)
>>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>>> --- 
>>> You received this message because you are subscribed to a topic in the 
>>> Google Groups "web2py-users" group.
>>> To unsubscribe from this topic, visit 
>>> https://groups.google.com/d/topic/web2py/Bx_9u0iC86o/unsubscribe.
>>> To unsubscribe from this group and all its topics, send an email to 
>>> web2py+un...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>

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

[web2py] SQLFORM.accepts() bug - custom widget looses formstyle added classes

2016-07-23 Thread Eliot Simcoe
I have a custom currency widget (that renders a text field with a '$' at 
the front of it) and I'm using the bootstrap3_inline formstyle for 
generating forms using SQLFORM.

The formstye is executed before SQLFORM.accepts().

If an error occurs in my form, the block of code in 
sqlhtml.SQLFORM.accepts() lines 1562 - 1577 generates a new Widget and 
therefore a new INPUT after the formstyle code has been executed.

The formstyle code had previously added a 'form-control' class to the 
original INPUT tag which is then wiped out by the aforementioned code. This 
causes my form to not display the correctly.

Why does web2py generate a new widget here - shouldn't it just overwrite 
the value of the old widget with the default from the record or the field 
default?? Or am I doing something wrong?

Thanks in advance,
Eliot

-- 
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: Field type list:string in SQLFORM.grid problem new entries.

2016-07-23 Thread Dave S


On Friday, July 22, 2016 at 4:45:58 AM UTC-7, Alex Santana wrote:
>
> Thanks Dave,
>
> I was doing exactly this!
>

I spent some time prototyping a fabfile to use when a new release comes 
out, so  I've poked around some of these issues.  I did forget to mention 
that if you have some custom static files, like favicons, those should copy 
just fine.  Custom css and js files probably copy, but may need extra 
testing, and the change from Bootstrap 2 to 3 changed some things like 
nested menus.

/dps


> On Thursday, July 21, 2016 at 7:50:24 PM UTC+2, Dave S wrote:
>>
>>
>> On Thursday, July 21, 2016 at 9:02:57 AM UTC-7, Alex Santana wrote:
>>  
>>
>>> Now I need to realize how to migrate my applications to the git version.
>>>
>>
>> It's mostly a matter of copying the controllers, models, and modules you 
>> have.  If you have language files, copy those.  If you have an 
>> application-level routes.py, that will probably copy.  If your database is 
>> SQLite (okay for development and lightly used sites), then you may want to 
>> export that data.  For other engines, you can probably just reuse the 
>> connection string.  The old app probably used models/db.py to set up 
>> configuration data, but now you can used appconfig (makes your code more 
>> portable if you change server environments or between dev and production); 
>> look at the welcome app to see how that is done.
>>
>>  /dps
>>
>>

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


[web2py] Curreny

2016-07-23 Thread Carlos Zenteno
Stupid question...

When we run

>From gluon import current

Where does current is imported from? 

I have only found current defined in globals.py as :

Import threading

Current = threading.local ()

-- 
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 session disable

2016-07-23 Thread Anthony
Looks like a bug introduced a long time ago (I guess no one uses this 
feature). I just submitted an issue: 
https://github.com/web2py/web2py/issues/1406.

Anthony

On Saturday, July 23, 2016 at 10:43:21 AM UTC-4, 
luis.vallada...@metamaxzone.com wrote:
>
> Here is my ticket traceback:
>
> Traceback (most recent call last):
>   File "/usr/share/nginx/html/web2py/gluon/main.py", line 457, in wsgibase
> session._try_store_in_db(request, response)
>   File "/usr/share/nginx/html/web2py/gluon/globals.py", line 1158, in 
> _try_store_in_db
> self.save_session_id_cookie()
>   File "/usr/share/nginx/html/web2py/gluon/globals.py", line 1058, in 
> save_session_id_cookie
> if not current._session_cookie_key:
> AttributeError: 'thread._local' object has no attribute '_session_cookie_key'
>
>
>

-- 
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 session disable

2016-07-23 Thread luis . valladares
Here is my ticket traceback:

Traceback (most recent call last):
  File "/usr/share/nginx/html/web2py/gluon/main.py", line 457, in wsgibase
session._try_store_in_db(request, response)
  File "/usr/share/nginx/html/web2py/gluon/globals.py", line 1158, in 
_try_store_in_db
self.save_session_id_cookie()
  File "/usr/share/nginx/html/web2py/gluon/globals.py", line 1058, in 
save_session_id_cookie
if not current._session_cookie_key:
AttributeError: 'thread._local' object has no attribute '_session_cookie_key'


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

2016-07-23 Thread isi_jca


> Hi!!!.
>
>
When I try to print qrcode image to pdf using pyfpdf, I get the next error:

 FPDF error: Unsupported image type: 
pilimage object at 0x7f2e82f13a50>

Versión
web2py™ Version 2.14.5-stable+timestamp.2016.04.14.03.26.16
Python Python 2.7.6: /usr/bin/python (prefix: /usr)
 
Anyone have experience with this topic?

Regards.

-- 
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: Query Production Oracle database using DAL

2016-07-23 Thread Ben Lawrence
Hi Paolo the script mentioned in the book

python scripts/cpdb.py \
   -f applications/app/databases \
   -y 'sqlite://storage.sqlite' \
   -Y 'postgres://username:password@localhost/mydb' \
   -d ../gluon

can no longer find DAL. What is the correct -d ? (if you know)
thanks in advance,
Ben



On Friday, March 6, 2015 at 2:50:49 AM UTC-8, Paolo Valleri wrote:
>
> Instantiate DAL with migrate=False is enough to guarantee the 
> read-only-mode operations.
> In addition accessing the db using an user without write permissions is 
> better if you only have to dump data.
>
> To copy data from one db to an other, have a look at 
> https://github.com/web2py/web2py/blob/master/scripts/cpdb.py
>
> Paolo
>
> On Friday, March 6, 2015 at 12:30:02 AM UTC+1, Michel Krav wrote:
>>
>> Hi ,
>>  
>> I need to dump some tables from oracle db let's call it *dbo *into 
>> sqlite *db  *to allow a "disconnect/offline" mode for an app.
>>
>> I' ve already done this stuff using cx_oracle, building a cursor, then my 
>> own SQL requests..., now I'm looking to ease those tasks.
>> [So no problem to connect oracle dbo using cx_oracle even in web2py]
>>
>> But I'm not really sure about how to do it using DAL :
>>
>>1. Once define connexion to oracle dbo is done : (using lazy_tables=True 
>>to enhance performance as hundred of table have to be read but not 
>>for each request)
>>2. I've read I have to *define_table* manually for each table I want 
>>to query, (to instantiate table class  and attributes)
>>3. In the signature of define_table : I plan to secure the *"read 
>>only mode"* to *dbo *using* migration = False *and  *fake_migration* 
>>= *True *in order to never alter the source table : is it correct ? I 
>>will specify *redefine = False* for the same reason. By the way , I 
>>think there's a mistake in the online documentation in 
>>
>> http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Fixing-broken-migrations
>>  
>>: 
>>
>>db.define_table(,migrate=True,fake_migrate=True)
>>should be in this context : 
>>db.define_table(,migrate=False,fake_migrate=True)
>>
>>
>>4. Once *dbo*.table is available, I should use export_to_csv_file method 
>>then import_from_csv_file to (re)load *db.table * when needed 
>> (synchronisation 
>>on demand).
>>
>> 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] Re: web2py on android

2016-07-23 Thread eric cuver
you can use cordova wbeview and used side client brython( python) and 
backend web2py
I create the applications in this way it works very well 

Le mardi 19 juillet 2016 13:16:10 UTC+2, Paolo Amboni a écrit :
>
> Is it possible to do something like that with web2py?
>
> Android apps with Python, Flask and a WebView 
> 
> (
> https://kivy.org/planet/2016/05/android-apps-with-python-flask-and-a-webview/
> )
>
> 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.