[web2py] Google analytics

2019-02-05 Thread Константин Комков
Hello!
I tried to include google analytics like that:
db.py

> response 
> .google_analytics_id = 
> configuration.get('google.analytics_id')
>
> layout.html

> {{if response.google_analytics_id:}}
> 
> 
> analytics.initialize({
> 'Google 
> Analytics':{trackingId:'{{=response.google_analytics_id}}'}
> });
> {{pass}}

 appconfig.ini

> [google]
> analytics_id = XX-X-X

and I cannot have result. If I use standart google method all work:

> 
>  src="https://www.googletagmanager.com/gtag/js?id=XX-X-X";>
> 
> window.dataLayer = window.dataLayer || [];
> function gtag(){dataLayer.push(arguments);}
> gtag('js', new Date());
> gtag('config', 'XX-X-X');
> 

 

-- 
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: Folder sessions

2019-02-05 Thread Константин Комков
In book I see:
>
> You will probably need to include the full path to both web2py.py and the 
> scripts folder, and the trailing & is not needed.

Why both? I have only one file which called web2py.
Services with Argument c:\XXX\XXX\web2py.py -p 8041 -i "0.0.0.0" 
--password="XX" work but I don't know what it do.
Services with Argument c:\XXX\XXX\web2py.py -p 8041 -i "0.0.0.0" 
--password="XX" --shell=stud -M -R 
c:\XXX\XXX\scripts\sessions2trash.py -A -o -x 3600 -f -v don't work.

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


Re: [web2py] install script for web2py using python 3

2019-02-05 Thread Richard Vézina
Share you change here, we may point you in the right direction, so you can
submit a PR on github... It shouldn't be hard to get the actual script to
work.

Richard

On Tue, Feb 5, 2019 at 2:28 PM Ben Lawrence  wrote:

> HI
> If anyone has a working install script for web2py using python3 + a
> webserver, can you please share with me?
> I am using setup-web2py-nginx-uwsgi-ubuntu.sh and modified it to use
> python3 but the emporer uwsgi service always fails (with no error code).
> thank you in advance.
> Ben
>
> --
> 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] Web2py with python3: difference in error reporting

2019-02-05 Thread Brian M
Reported the same a few days ago but have heard nothing. :( 
https://groups.google.com/forum/m/#!topic/web2py/dTsDZJ8jhyg

-- 
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 do I Select in a FORM using a database.

2019-02-05 Thread Dave S


On Tuesday, February 5, 2019 at 4:31:33 AM UTC-8, Ben Duncan wrote:
>
> This is to have a drop down list appear.
> Currently sqlform.factory works only if you have all the labels etc in the 
> sqlform.factory.
>
> I have a custom html using flex boxes and modal in the views but following 
> these instructions:
>
> http://web2py.com/books/default/chapter/29/07/forms-and-validators#SQLFORM-in-HTML
>
> Using IS_IN_DB doesn't work when included in the sqlform.factory ...
>
> *Ben Duncan*
> DBA / Chief Software Architect 
> Mississippi State Supreme Court
> Electronic Filing Division
>
>
I'm going to defer to the experts, but I think you've explained your use 
case much better this time.

/dps
 

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


[web2py] Re: Clear a form after submit

2019-02-05 Thread Dave S


On Tuesday, February 5, 2019 at 1:17:50 PM UTC-8, Ben Duncan wrote:
>
> What is the best way to clear a form in web2py after it has been submitted.
>
> Thanks
>
> *Ben Duncan*
> DBA / Chief Software Architect 
> Mississippi State Supreme Court
> Electronic Filing Division
>

If you're using the  usual FORM() and SQLFORM() helpers, your controller 
will either redirect away from the form, or return it again.  Unless you 
use "keepvalues=True"), the form will be cleared when it is redrawn.  Note 
that the user's browser may suggest previous input when the user starts 
entering values.

If you're using an HTML FORM tag directly, you may need to refresh the 
page.  I don't speak from experience (although I've done FORM tags in other 
contexts).

I don't know much about SQLFORM.factory/grid as I've only made limited use 
of them.  SQLTABLE falls outside your question.

/dps

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


[web2py] Re: Why is scheduler creating so many files at /var/spool/postfix/maildrop?

2019-02-05 Thread Dave S


On Monday, August 13, 2018 at 2:44:59 PM UTC-7, Lisandro wrote:
>
> To be honest, that's the way I do it since long time ago, never thought 
> about changing it. But now that you've pointed that out, I've taken another 
> look to the book.
> The book explains how to run the scheduler via upstart [1], but I'm using 
> CentOS 7, which uses *systemd* instead of *upstart.*
>
> In case it helps someone else, here is what I did to run the scheduler via 
> systemd:
>
>
> 1) I've created the file */home/myuser/web2py/scheduler.sh* with this 
> content:
>
> #!/bin/bash
> /bin/python /home/myuser/web2py/web2py.py -K myapp
>
>
> 2) Then I've created the file */etc/systemd/system/scheduler.service* 
> with this content:
>
> [Unit]
>  Description=web2py Scheduler
>
> [Service]
>  ExecStart=/home/myuser/web2py/scheduler.sh
>  User=nginx
>
> [Install]
>  WantedBy=default.target
>
>
> 3) Then run this commands to start the service:
> sudo systemctl daemon-reload
> sudo systemctl start scheduler
>
> If you need to check the status of the service, run:
> sudo systemctl status scheduler
>
> If you need to enable the service to run on startup, run:
> sudo systemctl enable scheduler
>
>
> Thank you very much Dave for your time!
> Best regards,
> Lisandro.
>
>
>
> [1] 
> http://web2py.com/books/default/chapter/29/13/deployment-recipes#Start-the-scheduler-as-a-Linux-service-upstart-
>
>
> El lunes, 13 de agosto de 2018, 16:18:57 (UTC-3), Dave S escribió:
>>
>>
>>
>> On Monday, August 13, 2018 at 5:43:13 AM UTC-7, Lisandro wrote:
>>>
>>> Thanks for that clarification.
>>> The files were being created every minute, in concordance with the 
>>> frequence I run the scheduler.
>>> I was able to solve it adding ">/dev/null 2>&1" to the end of the line 
>>> in crontab, so it ended up like this:
>>>
>>> * * * * * python /var/www/medios/web2py.py -K webmedios >/dev/null 2>&1
>>>
>>> That did the trick, and those files are not created anymore.
>>> Thank you for your help!
>>>
>>> Best regards,
>>> Lisandro.
>>>
>>
>> I don't understand why you are starting the scheduler every minute, 
>> instead of starting it once, and then scheduling tasks to repeat on a 1 
>> minute schedule.
>>
>> /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] Clear a form after submit

2019-02-05 Thread Ben Duncan
What is the best way to clear a form in web2py after it has been submitted.

Thanks

*Ben Duncan*
DBA / Chief Software Architect
Mississippi State Supreme Court
Electronic Filing Division

-- 
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] install script for web2py using python 3

2019-02-05 Thread Ben Lawrence
HI
If anyone has a working install script for web2py using python3 + a 
webserver, can you please share with me?
I am using setup-web2py-nginx-uwsgi-ubuntu.sh and modified it to use 
python3 but the emporer uwsgi service always fails (with no error code).
thank you in advance.
Ben

-- 
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: fixing .table appears corrupted on a compiled application

2019-02-05 Thread Marcelo Huerta

El domingo, 3 de febrero de 2019, 18:19:34 (UTC-3), Dave S escribió:
>
>
> Back-ups are the nectar of the gods (nodding toward Greek mythonlogy)
>
>
>>>
Versioning systems for code, more so.

Mostwanted, if you don't want to start with something heavy and unwieldy as 
git, at the very least try Fossil  

-- 
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 do I Select in a FORM using a database.

2019-02-05 Thread Ben Duncan
This is to have a drop down list appear.
Currently sqlform.factory works only if you have all the labels etc in the
sqlform.factory.

I have a custom html using flex boxes and modal in the views but following
these instructions:
http://web2py.com/books/default/chapter/29/07/forms-and-validators#SQLFORM-in-HTML

Using IS_IN_DB doesn't work when included in the sqlform.factory ...

*Ben Duncan*
DBA / Chief Software Architect
Mississippi State Supreme Court
Electronic Filing Division


On Mon, Feb 4, 2019 at 3:44 PM Dave S  wrote:

>
>
> On Monday, February 4, 2019 at 9:32:02 AM UTC-8, Ben Duncan wrote:
>>
>> Ok, I have a standard FORM doing a web page.
>> How do you do a select from a a database table in a FORM helper:
>>
>> ie what is equivalent to the sqlform.factory of:
>> 
>> Field('companyid',
>>
>> requires=IS_IN_DB(db,db.company.company_number,'%(company_name)s')),
>>
>> Thanks
>>
>>
>>
>> *Ben Duncan*
>> DBA / Chief Software Architect
>> Mississippi State Supreme Court
>> Electronic Filing Division
>>
>
>
> I'm not sure I understand your question.  If you want a *requires()* to
> be applied, I don't think you have to do anything extra after putting in
> the requirement.  If you want to do a lookup after form.accepts(), you just
> use form.vars, no?
>
> Most of my use of plain FORM() is for stuff that isn't in the DB.
>
> /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.


Re: [web2py] Re: problem with cpdb.py "EXCEPTION: could not set DAL"

2019-02-05 Thread Jon Subscripted
Hi everyone,
I took a look at cpdb.py code and saw that "-d" option is just used to find
where "dal.py" and add the folder sys.path.

So, instead of the relative path, I decided to use the absolute path. I do
not get the "could not set DAL" exception anymore, but now I get the
following error:

"Field auth_cas.id is already bound to a table"

And the warning regarding the "plural_rules".
This is the command I executed:

C:\Users\Jon\Downloads\web2py_winAPPLIANCES\web2py>python scripts/cpdb.py
-f applications/paravolcar10enero_tarde/databases  -y
sqlite://storage.sqlite -Y sqlite://storage3.sqlite -d
C:\Users\Jon\Downloads\web2py_winAPPLIANCES\web2py\gluon
No handlers could be found for logger "web2py"
WARNING:root:Unable to import plural rules: No module named plural_rules
creating tables...
EXCEPTION: could not make a copy of the database
Field auth_cas.id is already bound to a table

Any suggestions? What does this mean?
Thanks, Jon.

PS. I'm just using sqlite to sqlite copy for now, for the sake of
simplicity.

On Mon, Feb 4, 2019 at 10:06 AM Jon Subscripted 
wrote:

> Hi Dave,
> Yes, if you refer to the Python installed in the computer I'm using Python
> 2.7.5.
>
> C:\Users\Jon\Downloads\web2py_winAPPLIANCES\web2py>python scripts/cpdb.py
> -f applications/paravolcar10enero_tarde/databases  -y
> sqlite://storage.sqlite -Y sqlite://storage3.sqlite -d ../gluon
> No handlers could be found for logger "web2py"
> WARNING:root:Unable to import plural rules: No module named plural_rules
> EXCEPTION: could not set DAL
> No module named dal
> creating tables...
> EXCEPTION: could not make a copy of the database
> 'NoneType' object is not iterable
>
> C:\Users\Jon\Downloads\web2py_winAPPLIANCES\web2py>python.exe
> Python 2.7.15 (v2.7.15:ca079a3ea3, Apr 30 2018, 16:22:17) [MSC v.1500 32
> bit (Intel)] on win32
> Type "help", "copyright", "credits" or "license" for more information.
> >>>
>
> Thanks, Jon.
>
> PS. I'm not fully aware of the relationship between the existing Python
> installation in the computer and the pre-packed Python (delivered as part
> of Web2py).
>
> On Sun, Feb 3, 2019 at 10:21 PM Dave S  wrote:
>
>>
>>
>> On Saturday, February 2, 2019 at 6:05:55 AM UTC-8, Jonsubs wrote:
>>>
>>> Hi everyone,
>>> I'm trying to copy my database (already populated) using cbpd.py but I
>>> get an error.
>>> (I'm working in Windows 10 with Web2py
>>> 2.17.2-stable+timestamp.2018.10.06.18.54.02)
>>>
>>>
>> So you're using the in-box python, which is python2?
>>
>> /dps
>>
>>
>>> 1st I changed the database URI in appconfig.ini from
>>> sqlite://storage.sqlite to sqlite://storage3.sqlite
>>> 2nd I checked with SQLite Browser that sqlite://storage3.sqlite was
>>> created and tables are created also (but empty)
>>> 3rd I launched the command below, but I does not work.
>>>
>>> C:\Users\Jon\Downloads\web2py_winAPPLIANCES\web2py>python
>>> scripts/cpdb.py -f applications/paravolcar10enero_tarde/databases  -y
>>> sqlite://storage.sqlite -Y sqlite://storage3.sqlite -d ../gluon
>>> No handlers could be found for logger "web2py"
>>> WARNING:root:Unable to import plural rules: No module named plural_rules
>>> EXCEPTION: could not set DAL
>>> No module named dal
>>> creating tables...
>>> EXCEPTION: could not make a copy of the database
>>> 'NoneType' object is not iterable
>>>
>>> Any suggestions? I do not really know how to interpret the error.
>>> Thanks, Jon.
>>>
>> --
>> 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: Folder sessions

2019-02-05 Thread 黄祥
port is available port to run web2py server
example.com.au.crt is certificate file
ref:
http://web2py.com/books/default/chapter/29/04/the-core#Command-line-options

seems doesn't need the password to run session_2_trash.py
ref:
http://web2py.com/books/default/chapter/29/13/deployment-recipes#Cleaning-up-sessions

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: Folder sessions

2019-02-05 Thread Константин Комков
Don't work, maybe I need put password and port? Like here in book:
>
> c:\web2py.py -p 8041 -i "0.0.0.0" --password="112233" 
> --folder="d:\web2py_internet" --socket-timeout=10 --timeout=120 -c 
> "d:\web2py_internet\applications\example.com.au.crt" -k 
> "d:\web2py_internet\applications\web2py.key
>
> But I don't know port and what means .com.au.crt after example folder?

-- 
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: Folder sessions

2019-02-05 Thread 黄祥
pls try in arguments (not tested):
c:\XXX\X\web2py.py -S stud -M -R c:\XXX\X\scripts\sessions2trash.py 
-A -o -x 3600 -f -v

different from your value is just the 'python', because it's already define 
in path, so no need to pass python again in arguments value

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.