Re: [web2py] Re: How to make this code work ...

2019-06-04 Thread Val K
Try xhttp.withCredentials = true

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


[web2py] Re: web2py on Raspbian and Python 2 or 3?

2019-06-04 Thread 黄祥
dont mess with the /usr/bin/ by create the symbolic link, the safest way 
perhaps you can create a shell script
e.g.
*start_web2py.sh*
python3 /path_to_web2py/web2py.py

then start your web2py server with 
./start_web2py.sh

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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/233b33e6-877f-45ab-9d27-72317d2f9038%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: How to make this code work ...

2019-06-04 Thread Dave S
$

On Tuesday, June 4, 2019 at 6:00:44 PM UTC-7, Dave S wrote:
>
>
>
> On Tuesday, June 4, 2019 at 3:16:12 PM UTC-7, Ben Duncan wrote:
>>
>> I've been trying to run it ... When you click on the button it does 
>> nothing
>>
>> *Ben Duncan*
>> DBA / Chief Software Architect 
>> Mississippi State Supreme Court
>> Electronic Filing Division
>>
>>
>>
>
> When I replace the "ajax-info.txt" with a real URL (that is, one for a 
> web2py function on my server, and which returns a txt file), I see the 
> network access, including a response with HTTP status 303.  For some reason 
> (cookie management?) it doesn't work for me to login via a separate tab, 
> and each time I click the button I get a different cookie.  I've been 
> poking at sending credentials, but I still get the 303 response and I 
> apparently am not setting the Authorization header as I think I am, but 
> only setting Access-Control-Request-Headers to "authorization".  And there 
> is also "allow origin" issues, because file://tmp/test.html comes from a 
> different address than the server.
>
> HTH
> /dps
>
>

The cross-site and authorization issues go away when you host the file on 
the server (say, .../applications/myapp/static/test.html)

/dps
 

>
> On Tue, Jun 4, 2019 at 4:35 PM Anthony  wrote:
>>
>>> What are you trying to do? That code should work fine in web2py, as it's 
>>> just Javascript. You just need to have it call a web2py URL. Of course, 
>>> web2py includes some built-in mechanisms for handling Ajax requests, such 
>>> as the ajax() Javascript function and the LOAD() helper to create Ajax 
>>> components.
>>>
>>> Anthony
>>>
>>> On Tuesday, June 4, 2019 at 3:23:11 PM UTC-4, Ben Duncan wrote:

 Ok, the following is code from w3 schools:
 https://www.w3schools.com/js/js_ajax_intro.asp

 The code is as follows :

 
 
 

 
 The XMLHttpRequest Object
 Change Content
 

 
 function loadDoc() {
   var xhttp = new XMLHttpRequest();
   xhttp.onreadystatechange = function() {
 if (this.readyState == 4 && this.status == 200) {
   document.getElementById("demo").innerHTML =
   this.responseText;
 }
   };
   xhttp.open("GET", "ajax_info.txt", true);
   xhttp.send();
 }
 

 
 

 The question is how do I get this code to run under web2py ?

 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 web...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/web2py/9b9fa219-3038-4d61-9206-a5ab134f783e%40googlegroups.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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/c78b2647-cd05-42d5-9c9b-26e067309eb9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: web2py on Raspbian and Python 2 or 3?

2019-06-04 Thread lucas
so, what is the best way to direct web2py to use the python3 instead of the 
default python/python2.7?

-- 
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/1df07b9b-2f98-4ac9-b7d6-fdd338fe7e12%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: How to make this code work ...

2019-06-04 Thread Dave S


On Tuesday, June 4, 2019 at 3:16:12 PM UTC-7, Ben Duncan wrote:
>
> I've been trying to run it ... When you click on the button it does nothing
>
> *Ben Duncan*
> DBA / Chief Software Architect 
> Mississippi State Supreme Court
> Electronic Filing Division
>
>
>

When I replace the "ajax-info.txt" with a real URL (that is, one for a 
web2py function on my server, and which returns a txt file), I see the 
network access, including a response with HTTP status 303.  For some reason 
(cookie management?) it doesn't work for me to login via a separate tab, 
and each time I click the button I get a different cookie.  I've been 
poking at sending credentials, but I still get the 303 response and I 
apparently am not setting the Authorization header as I think I am, but 
only setting Access-Control-Request-Headers to "authorization".  And there 
is also "allow origin" issues, because file://tmp/test.html comes from a 
different address than the server.

HTH
/dps


On Tue, Jun 4, 2019 at 4:35 PM Anthony > 
> wrote:
>
>> What are you trying to do? That code should work fine in web2py, as it's 
>> just Javascript. You just need to have it call a web2py URL. Of course, 
>> web2py includes some built-in mechanisms for handling Ajax requests, such 
>> as the ajax() Javascript function and the LOAD() helper to create Ajax 
>> components.
>>
>> Anthony
>>
>> On Tuesday, June 4, 2019 at 3:23:11 PM UTC-4, Ben Duncan wrote:
>>>
>>> Ok, the following is code from w3 schools:
>>> https://www.w3schools.com/js/js_ajax_intro.asp
>>>
>>> The code is as follows :
>>>
>>> 
>>> 
>>> 
>>>
>>> 
>>> The XMLHttpRequest Object
>>> Change Content
>>> 
>>>
>>> 
>>> function loadDoc() {
>>>   var xhttp = new XMLHttpRequest();
>>>   xhttp.onreadystatechange = function() {
>>> if (this.readyState == 4 && this.status == 200) {
>>>   document.getElementById("demo").innerHTML =
>>>   this.responseText;
>>> }
>>>   };
>>>   xhttp.open("GET", "ajax_info.txt", true);
>>>   xhttp.send();
>>> }
>>> 
>>>
>>> 
>>> 
>>>
>>> The question is how do I get this code to run under web2py ?
>>>
>>> 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 web...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/web2py/9b9fa219-3038-4d61-9206-a5ab134f783e%40googlegroups.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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/e58217b0-df00-4897-aa57-40a92b019ada%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: setting up pscycopg2

2019-06-04 Thread Dave S


On Saturday, June 1, 2019 at 1:41:12 AM UTC-7, Nico Zanferrari wrote:
>
> Hi Dave,
>
> I've faced the same problem  trying to add psycopg2 on MacOs binaries with 
> python 2.7. Following some advices, I've resolved it by installing unixodbc 
> (with brew) before it.
>
> I hope it helps,
> Nico
>


 Sadly, pip tells me "could not find a version that satisfies te 
requirement unixodbc"

And to help with my memory later, -t is an option to "pip install", not to 
pip in general.

Oh, and I once said

>>> Is site-packages the wrong location?
>> That's web2py/applications/myapp/site-packages

No, it's not.  It's just web2py/site-packages.

And to expand on my comments about the original traceback ... sudo pip 
--version gives the same traceback, while pip --version works.  Probably a 
path issue, but I'm not sure I want to mess around with sudoing sudos.

/dps





> Il giorno sab 1 giu 2019 alle ore 00:09 Dave S  > ha scritto:
>
>> Help!
>>
>> /dps
>>
>> On Thursday, May 16, 2019 at 6:37:42 PM UTC-7, Dave S wrote:
>>>
>>>
>>>
>>> On Wednesday, May 15, 2019 at 10:26:39 AM UTC-7, Dave S wrote:



 On Monday, May 13, 2019 at 3:48:39 PM UTC-7, Dave S wrote:
>
>
>
> On Monday, May 13, 2019 at 2:31:33 PM UTC-7, Dave S wrote:
>>
>> When I check Last week I ended up making the move to Postgres on the 
>> busier of my production servers, and the changeover appears to be 
>> successful (imported existing data via CSV).  I was interested to see 
>> that 
>> the import preserved some gaps in the id field, and that Postgres was 
>> filling some of those gaps and holding off on using id's above the 
>> imported 
>> max(id).  But I'm also getting errors about 'ERROR 23505, duplicate key 
>> value value viotlates unique contraint "updreq_y_pkey".  Key(id)=(23681) 
>> already exists.'
>>
>> Looking at this made me realize I was running pg8000 (still supplied 
>> in contrib in 2.15.4), and I wanted to switch to pscyopg2.  So I tried 
>> pip install psycopg2
>>
>> and that was progressing fine until it got to copying the built 
>> module into /usr/lib64/python2.7/dist-packages/psycogpg2 -- permission 
>> denied (not too surprising).  So I tired the obvious:
>> sudo pip install psycopg2
>> Which ends abruptly with 
>> [traceback excerpt]
>> The 'pip==9.0.3' distribution was not found and required by the 
>> application
>> [...]
>>
>  
>
>> What can I do now?
>> (AWS Linux, up to date, OS_VERSION says "2018.03")
>>
>>  
>>
>  
> Okay, I found the -t option, and from the web2py directory specified 
> site-packages
> Now, how do I get web2py.py to find the driver?
>
>
 Is site-packages the wrong location?

 That's web2py/applications/myapp/site-packages
>>>
>>> /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 web...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/web2py/b2aecb42-d28c-42a7-84fe-1de80100f735%40googlegroups.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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/413ec153-d82a-4766-834c-1280d7f00788%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: How to make this code work ...

2019-06-04 Thread Ben Duncan
I've been trying to run it ... When you click on the button it does nothing

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


On Tue, Jun 4, 2019 at 4:35 PM Anthony  wrote:

> What are you trying to do? That code should work fine in web2py, as it's
> just Javascript. You just need to have it call a web2py URL. Of course,
> web2py includes some built-in mechanisms for handling Ajax requests, such
> as the ajax() Javascript function and the LOAD() helper to create Ajax
> components.
>
> Anthony
>
> On Tuesday, June 4, 2019 at 3:23:11 PM UTC-4, Ben Duncan wrote:
>>
>> Ok, the following is code from w3 schools:
>> https://www.w3schools.com/js/js_ajax_intro.asp
>>
>> The code is as follows :
>>
>> 
>> 
>> 
>>
>> 
>> The XMLHttpRequest Object
>> Change Content
>> 
>>
>> 
>> function loadDoc() {
>>   var xhttp = new XMLHttpRequest();
>>   xhttp.onreadystatechange = function() {
>> if (this.readyState == 4 && this.status == 200) {
>>   document.getElementById("demo").innerHTML =
>>   this.responseText;
>> }
>>   };
>>   xhttp.open("GET", "ajax_info.txt", true);
>>   xhttp.send();
>> }
>> 
>>
>> 
>> 
>>
>> The question is how do I get this code to run under web2py ?
>>
>> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/web2py/9b9fa219-3038-4d61-9206-a5ab134f783e%40googlegroups.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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/CAC10dPa2-zKpNW1fMkLZz4FtDZjm-XQgB9dfd8%3Dqou-o1qyyaA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: How to make this code work ...

2019-06-04 Thread Anthony
What are you trying to do? That code should work fine in web2py, as it's 
just Javascript. You just need to have it call a web2py URL. Of course, 
web2py includes some built-in mechanisms for handling Ajax requests, such 
as the ajax() Javascript function and the LOAD() helper to create Ajax 
components.

Anthony

On Tuesday, June 4, 2019 at 3:23:11 PM UTC-4, Ben Duncan wrote:
>
> Ok, the following is code from w3 schools:
> https://www.w3schools.com/js/js_ajax_intro.asp
>
> The code is as follows :
>
> 
> 
> 
>
> 
> The XMLHttpRequest Object
> Change Content
> 
>
> 
> function loadDoc() {
>   var xhttp = new XMLHttpRequest();
>   xhttp.onreadystatechange = function() {
> if (this.readyState == 4 && this.status == 200) {
>   document.getElementById("demo").innerHTML =
>   this.responseText;
> }
>   };
>   xhttp.open("GET", "ajax_info.txt", true);
>   xhttp.send();
> }
> 
>
> 
> 
>
> The question is how do I get this code to run under web2py ?
>
> 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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/9b9fa219-3038-4d61-9206-a5ab134f783e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] route 53 or Dns record

2019-06-04 Thread Carlos Costa
That's good! Not perfect, since after the user is redirected, the URL gets
ugly anyway.
But is quite good.
My domains are not registered in godaddy, but I can migrate to it some day.
Thanks for sharing.

Em ter, 4 de jun de 2019 às 13:19, karthikeyan p <
karthikiotdevelo...@gmail.com> escreveu:

> hai carlos costa , i have an idea for that , i have domain registered with
> godaddy , go daddy subdomain forwarding is unlimited and its free too . you
> can add like this
> in subdomain section add subdomainname as *user1* , target url is 
> *your.pythonanywhere.com/welcome/default/index/user
> *1 , when*
> user1.yourdomain.com * is called you can
> redirect to  *your.pythonanywhere.com/welcome/default/index/user
> *1
>
> this is my current technique . one good thing is, you have *api* for
> adding subdomain to your dns registry in godaddy.
>
>
>
> On Mon, Jun 3, 2019 at 2:14 AM Carlos Costa 
> wrote:
>
>> It is not possible withou hiring extra web apps.
>> Pythonanywhere requires on web app per subdomain or domain.
>>
>> I move recently to pythonanywhere, because of aws costs.
>> I am happy with evertything in pythonanywhere, unless with this topic.
>> I had to give up the subdomain per user strategy.
>>
>> I moved to a single url strategy in wich I setup on main app as central
>> authentication.
>> My problem is I have one DB for each account and that was too easy to
>> achieve with sudbomains.
>>
>> Em dom, 2 de jun de 2019 às 10:48, karthikeyan p <
>> karthikiotdevelo...@gmail.com> escreveu:
>>
>>> Can i do it with pythonanywhere.com if i am a paid user??
>>>
>>> I have api and program to add/delete/edit dns record in godaddy
>>>
>>> If it is possible to make it with pythonanywhere.com , i am happy somuch
>>>
>>> On Sun, 2 Jun 2019 at 7:16 PM, karthikeyan p <
>>> karthikiotdevelo...@gmail.com> wrote:
>>>
 Thanks alot  for reply . I will try this idea and let you know

 On Sun, 2 Jun 2019 at 7:09 PM, Carlos Costa 
 wrote:

> I was about to do this before I gave up on aws because of costs.
> So I don't know exactly what have to be done.
> But what I think you have to do is:
> -use aws api or cli to insert the record on route53 dns
> -add the respective entry on routes.py on web2py folder
>  for this maybe you want to store a list of domains in a separate
> file, a yaml file for example and modify routes.py to read the domains
> configuration from it
>  a yaml or plain text file will be easier to parse and feed
> -force web2py to reload routes
>  maybe hiting the url on the button we click in admin, or calling the
> required function internally (I don't know the function now)
>
>
> Em sáb, 1 de jun de 2019 às 15:24, karthikeyan p <
> karthikiotdevelo...@gmail.com> escreveu:
>
>> i have two users  -> *ONE *and *TWO*
>>
>> www.example.com/welcome/default/index/*ONE => *if i poster args ONE
>> ,it will show user ONE's page
>>
>> www.example.com/welcome/default/index/*TWO **=> *if i poster args
>> TWO,it will show user TWO's page
>>
>> i want to do :
>>
>> one.example.com *=> *to show user ONE's page.
>>
>> two.example.com *=> *to show user TWO's page.
>>
>> i know that the url prefix record will be added to DNS record.
>>
>> i have a domain in godaddy ,they provide api to do this
>> programmatically.
>>
>> if a user signed up in my page i want to make their name as prefix of
>> my dns . (except ftp ,www. smtp etc)
>>
>> any idea ?? any altenatives ?
>>
>>
>>
>> --
>> 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/1cfce879-730d-46c0-b59b-2800d2b67954%40googlegroups.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
> --
> At.
>
> Carlos J. Costa
> --
> Cientista da Computação - Esp. Gestão em Telecom
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - 

[web2py] Re: nssm does not work

2019-06-04 Thread Dave S


On Sunday, June 2, 2019 at 11:58:02 PM UTC-7, rāma wrote:
>
> I am using the latest version of NSSM - the Non-Sucking Service Manager; 
> both 2.24 and the prelease build 2.2.4-101 .
>
> Unfortunately for me, NSSM sucked big time and trying to get it working 
> with web2py was an utter waste of time.
>
> Tried
> -K; nothing and tried
> -X; nothing anyways
>
> Env:
> Python3.7
> Windows 10
>
> Can anyone advise what is supposed to happen after issuing -K app1 ? A 
> windows pop-up or the local webserver starts ? There is no outcome clearly 
> explained in any material I have gone through so far.
>

A scheduler process has no user interface (UI).  It runs in the background, 
looking for tasks that are scheduled to start.  It then fires off a 
subprocess that runs that task, and records the results in the database.  A 
normal HTTP request can add a task to the queue, or check the status of 
task.  Tasks often do their work by "side effects": creating a file, 
sending email, changing values in a database table.

I have several tasks that generate email in response to an upload and 
automated scanning of the file.  I also handle my session cleanup with a 
task.  I keep an eye on tasks by using Appadmin or through the database 
console application (sqlite3 from the command line, or psql).  On a system 
where Appadmin isn't set up,

select * from scheduler_task where status == 'QUEUED';  -- or 'FAILED' or 
'COMPLETE'
select * from scheduler_run where id > (select max(id) from scheduler_run) - 
5;
I don't recommend doing INSERT or UPDATE on the tables; using the API is 
much safer.  The .schema should be considered implementation-dependent, 
rather than public.

One of the other things I use the Scheduler for is getting remote files.  I 
do this for a "toy" server I use at home, running on my Windows 10 laptop.  
I open a command window, and do my -K  there, and then ignore that cmd 
afterwards .. Windows doesn't have the foreground/background support in CMD 
that a Unix/Linux shell has.

I haven't used NSSM.  I have set up a buildbot client using the built-in 
Windows task tools (schtasks /create and schtasks /run with an appropriate 
xml file); those techniques should work for a Scheduler process, but I 
haven't tried that yet, as I haven't yet needed automatiion of starting the 
Scheduler process.
 
/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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/7677cb2f-e5aa-45bf-a223-937452460558%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] How to make this code work ...

2019-06-04 Thread Ben Duncan
Ok, the following is code from w3 schools:
https://www.w3schools.com/js/js_ajax_intro.asp

The code is as follows :






The XMLHttpRequest Object
Change Content



function loadDoc() {
  var xhttp = new XMLHttpRequest();
  xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
  document.getElementById("demo").innerHTML =
  this.responseText;
}
  };
  xhttp.open("GET", "ajax_info.txt", true);
  xhttp.send();
}





The question is how do I get this code to run under web2py ?

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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/CAC10dPYEQj2s3X_Ur3miceCv_j27W_L8W_QeU5zkiabbzcrgbw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: web2py managing capacity ?

2019-06-04 Thread Dave S


On Tuesday, June 4, 2019 at 9:12:24 AM UTC-7, karthikeyan p wrote:
>
> sorry , 
> Carlos Costa 
> , i typed wrongly !
>   its scalability , i want to know web2py apps scalability !
>

Well, that depends on your application (how much work your app does on a 
request), your front end, and your database.

With nginx + uwsgi as a front end on an AWS instance, I can sustain 2 
requests per second with load usually staying below 0.10 (0.8-0.09 typical).
SQLite3 was working for me until I got up around 500,000 entries, and 
"database locked" conflicts crept up.  I switched to postgres and the 
system almost fell over ... until I created an index.


Massimo has customer systems with a bigger load, and so do several others.  
I think most production systems are on a Linux host, but there are a lot of 
IIS systems, as well.  The Scheduler code works well in both enviornments.  
Rocket on either Linux or Windows works fine for development, but I've seen 
some issues with large files from Windows clients (end-of-post not 
recognized; data stored only after timeout).

Early tests of web3py are, Massimo says, "way faster".

/dps





> On Fri, May 24, 2019 at 8:22 PM Carlos Costa  > wrote:
>
>> sociability?
>>
>> Em sex, 24 de mai de 2019 às 05:18, 黄祥 > > escreveu:
>>
>>> how to use it with postgresql ? 

>>>
>>> pls set the uri connection first
>>> *e.g. private/appconfig.ini*
>>> uri = postgres://postgres:password@localhost/database_name
>>>
>>> *ref:*
>>>
>>> http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Connection-strings-the-uri-parameter-
>>>  
>>>
>>> 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 web...@googlegroups.com .
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/web2py/9a708b39-7b1e-4c77-a4b3-49b7bdac9215%40googlegroups.com
>>>  
>>> 
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>> -- 
>> At.
>>
>> Carlos J. Costa
>> --
>> Cientista da Computação - Esp. Gestão em Telecom
>>
>> -- 
>> 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/eZogykbJDOY/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> web...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/web2py/CAGsD4Nw626C_QyRFDH0wz1bJ52WROSubFequnb4-p1h1WB5BOA%40mail.gmail.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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/458cd0e6-493f-463d-a6d7-afbbb54a43dd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: web2py delimiters conflict with vue.jsz

2019-06-04 Thread Anthony
See response.delimiters 
at http://web2py.com/books/default/chapter/29/04/the-core#response. You can 
set it in a model file to apply to all views, or within a particular 
controller or view to apply to a specific view.

Anthony

On Tuesday, June 4, 2019 at 2:20:30 PM UTC-4, Craig Matthews wrote:
>
> I am currently running web2py Version 
> 2.14.6-stable+timestamp.2016.05.10.00.21.47.
>
> Even though that is old, it is meeting my needs.
>
> I am currently learning vue.js and hoping to include it in my offerings.
>
> The obvious problem is that both web2py and vue.js use "{{" and "}}" as 
> delimiters in their templates.
>
> Is there a single place in web2py that I can change this to something else?
>
> In web2py\gluon\globals.py there is:
> class Response(Storage):
> and within the __init__ there is:
> self.delimiters = ('{{', '}}')
>
> Could this be the place?
>
>

-- 
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/1a5e0320-20e8-4e04-93e7-09595ca6cdc0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: web2py delimiters conflict with vue.jsz

2019-06-04 Thread 黄祥
another way around perhaps can use response.delimiter 
ref:
http://web2py.com/books/default/chapter/29/04/the-core?search=delimiter

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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/27ffec16-9771-4203-be8a-a5ba24ae4c79%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] web2py delimiters conflict with vue.jsz

2019-06-04 Thread Craig Matthews
I am currently running web2py Version 
2.14.6-stable+timestamp.2016.05.10.00.21.47.

Even though that is old, it is meeting my needs.

I am currently learning vue.js and hoping to include it in my offerings.

The obvious problem is that both web2py and vue.js use "{{" and "}}" as 
delimiters in their templates.

Is there a single place in web2py that I can change this to something else?

In web2py\gluon\globals.py there is:
class Response(Storage):
and within the __init__ there is:
self.delimiters = ('{{', '}}')

Could this be the place?

-- 
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/810cc803-0448-402f-8d17-cd861f8af321%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] route 53 or Dns record

2019-06-04 Thread karthikeyan p
hai carlos costa , i have an idea for that , i have domain registered with
godaddy , go daddy subdomain forwarding is unlimited and its free too . you
can add like this
in subdomain section add subdomainname as *user1* , target url is
*your.pythonanywhere.com/welcome/default/index/user
*1 , when*
user1.yourdomain.com * is called you can
redirect to  *your.pythonanywhere.com/welcome/default/index/user
*1

this is my current technique . one good thing is, you have *api* for adding
subdomain to your dns registry in godaddy.



On Mon, Jun 3, 2019 at 2:14 AM Carlos Costa  wrote:

> It is not possible withou hiring extra web apps.
> Pythonanywhere requires on web app per subdomain or domain.
>
> I move recently to pythonanywhere, because of aws costs.
> I am happy with evertything in pythonanywhere, unless with this topic.
> I had to give up the subdomain per user strategy.
>
> I moved to a single url strategy in wich I setup on main app as central
> authentication.
> My problem is I have one DB for each account and that was too easy to
> achieve with sudbomains.
>
> Em dom, 2 de jun de 2019 às 10:48, karthikeyan p <
> karthikiotdevelo...@gmail.com> escreveu:
>
>> Can i do it with pythonanywhere.com if i am a paid user??
>>
>> I have api and program to add/delete/edit dns record in godaddy
>>
>> If it is possible to make it with pythonanywhere.com , i am happy somuch
>>
>> On Sun, 2 Jun 2019 at 7:16 PM, karthikeyan p <
>> karthikiotdevelo...@gmail.com> wrote:
>>
>>> Thanks alot  for reply . I will try this idea and let you know
>>>
>>> On Sun, 2 Jun 2019 at 7:09 PM, Carlos Costa 
>>> wrote:
>>>
 I was about to do this before I gave up on aws because of costs.
 So I don't know exactly what have to be done.
 But what I think you have to do is:
 -use aws api or cli to insert the record on route53 dns
 -add the respective entry on routes.py on web2py folder
  for this maybe you want to store a list of domains in a separate file,
 a yaml file for example and modify routes.py to read the domains
 configuration from it
  a yaml or plain text file will be easier to parse and feed
 -force web2py to reload routes
  maybe hiting the url on the button we click in admin, or calling the
 required function internally (I don't know the function now)


 Em sáb, 1 de jun de 2019 às 15:24, karthikeyan p <
 karthikiotdevelo...@gmail.com> escreveu:

> i have two users  -> *ONE *and *TWO*
>
> www.example.com/welcome/default/index/*ONE => *if i poster args ONE
> ,it will show user ONE's page
>
> www.example.com/welcome/default/index/*TWO **=> *if i poster args
> TWO,it will show user TWO's page
>
> i want to do :
>
> one.example.com *=> *to show user ONE's page.
>
> two.example.com *=> *to show user TWO's page.
>
> i know that the url prefix record will be added to DNS record.
>
> i have a domain in godaddy ,they provide api to do this
> programmatically.
>
> if a user signed up in my page i want to make their name as prefix of
> my dns . (except ftp ,www. smtp etc)
>
> any idea ?? any altenatives ?
>
>
>
> --
> 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/1cfce879-730d-46c0-b59b-2800d2b67954%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>


 --
 At.

 Carlos J. Costa
 --
 Cientista da Computação - Esp. Gestão em Telecom

 --
 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/H9GXvTn6fcE/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 web2py+unsubscr...@googlegroups.com.
 To view this discussion on the web visit
 

Re: [web2py] Re: web2py managing capacity ?

2019-06-04 Thread karthikeyan p
sorry ,
Carlos Costa
, i typed wrongly !
  its scalability , i want to know web2py apps scalability !

On Fri, May 24, 2019 at 8:22 PM Carlos Costa 
wrote:

> sociability?
>
> Em sex, 24 de mai de 2019 às 05:18, 黄祥 
> escreveu:
>
>> how to use it with postgresql ?
>>>
>>
>> pls set the uri connection first
>> *e.g. private/appconfig.ini*
>> uri = postgres://postgres:password@localhost/database_name
>>
>> *ref:*
>>
>> http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Connection-strings-the-uri-parameter-
>>
>>
>> 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.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/web2py/9a708b39-7b1e-4c77-a4b3-49b7bdac9215%40googlegroups.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
> --
> At.
>
> Carlos J. Costa
> --
> Cientista da Computação - Esp. Gestão em Telecom
>
> --
> 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/eZogykbJDOY/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/web2py/CAGsD4Nw626C_QyRFDH0wz1bJ52WROSubFequnb4-p1h1WB5BOA%40mail.gmail.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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/CADrkE%3DHniCoQ19ieCu6ehx0zACdHH6vHVKu1dX0J2%2Bb1oNo8AA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Routes to expose file

2019-06-04 Thread Daniel Guilhermino
Any other suggestions?

Em sexta-feira, 31 de maio de 2019 21:57:34 UTC-3, Daniel Guilhermino 
escreveu:
>
> Hi Dave,
>
> I'm running the source package on ubuntu.
>
> Show Only this message:
>
> Internal server error
>
> Doesn't created an ticket.
>
> I need to make this file available for Google to validate my PWA and run 
> the application (I made an apk and uploaded it on Google Play as TWA) 
> without showing the navigation bar.
>
> This file contains sha256_cert_fingerprints.
>
> Thanks and best regards.
>
> Em sexta-feira, 31 de maio de 2019 19:07:39 UTC-3, Dave S escreveu:
>>
>>
>>
>> On Friday, May 31, 2019 at 7:54:16 AM UTC-7, Daniel Guilhermino wrote:
>>>
>>> HI,
>>>
>>> I'm having trouble exposing a file in the following way:
>>>
>>> https://example.com/./well-known/file.json
>>>
>>> I configured my routes.py like this:
>>>
>>> routers = dict (
>>>
>>>  # base router
>>>  BASE = dict (
>>>  default_application = 'connect',
>>>  root_static = ['favicon.ico', 'sw.js', 'well-known / 
>>> file.json'],
>>>  ),
>>> )
>>> routes_in = (
>>>  ('well-known / file.json', '/app/static/file.json'),
>>>  )
>>> routes_out = ('/app/static/file.json','well-known/file.json')
>>>
>>> *Note:*
>>>
>>> *The file are in static folder, I don't created 'well-known' folder.*
>>>
>>> But web2py crashes ...
>>>
>>
>> Crashes in what way?  Does the web2py.exe (or from source, python 
>> web2py.py) exit?
>> Or do you get an entry in myapp/errors that includes a traceback?
>> What gets displayed by the crash?
>>  
>> Do you really have spaces around the '/' after 'well-known' ?
>>
>>
>>> Any suggestions on how I can resolve this issue?
>>>
>>> Thanks in advance and best regards!
>>>
>>
>> Good luck!
>>
>> /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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/bc15fa99-e965-490e-8a22-79cfa1c4cb12%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: json.loads with cyrillic string

2019-06-04 Thread Константин Комков
Val K, yes, but I get json string from client js.

вт, 4 июн. 2019 г., 17:01 Val K :

> it is maybe not convenient when storing json as text file, to solve this
> you can pass ensure_ascii=False to json.dumps
>
> --
> 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/Jf0nxpP6w2M/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/web2py/ef98ecd7-0a13-49f7-b982-b4b5c7acbce2%40googlegroups.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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/CAM7z-VkdDPdCW3jx%3D3L4Qcu0NVSTW0rGE5B_HKYV0-12zHTdaw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: json.loads with cyrillic string

2019-06-04 Thread Val K
it is maybe not convenient when storing json as text file, to solve this you 
can pass ensure_ascii=False to json.dumps

-- 
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/ef98ecd7-0a13-49f7-b982-b4b5c7acbce2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: json.loads with cyrillic string

2019-06-04 Thread Val K
In python2 it is so

-- 
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/a6dd7be4-eff8-4291-98f5-a26f16e8bde7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: json.loads with cyrillic string

2019-06-04 Thread Константин Комков
Now is nothing, but I thought if I do b.get('fac')[0] I got something like 
u'\u0421\u0430\u0434\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0430 
\u0438 \u043b\u0430\u043d\u0434\u0448\u0430\u0444\u0442\u043d\u043e\u0439 
\u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b' .

-- 
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/c892b879-aa12-4030-a05f-2e23de0edf04%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] json.loads with cyrillic string

2019-06-04 Thread Val K
As far as I understand, strings are displayed in ascii format in the context of 
objects. What is confusing you?

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


Re: [web2py] Re: string vs text db field question

2019-06-04 Thread Eliezer (Vlad) Tseytkin
Everybody is lucky sometimes :)

Thank you!

On Tue, Jun 4, 2019, 9:12 AM Anthony  wrote:

> SQLite doesn't make a distinction between string and text nor have a
> length limit, so yes, you're just "lucky" at the moment. If you plan to
> migrate to something like Postgres, either explicitly set a higher limit or
> just use a text field.
>
> Anthony
>
> On Tuesday, June 4, 2019 at 5:30:05 AM UTC-4, Vlad wrote:
>>
>> I've used a string field to keep certain info, and it works just fine,
>> but I've just noticed that the strings I ended up saving in this field were
>> around 1,000 characters long, sometimes even closer to 2,000.
>> According to the docs, the default limit for a string field is 512. The
>> limit doesn't seem to be a problem now, so I am wondering what's the nature
>> of the limit. Is it safe to use longer strings because DAL handles them
>> somehow? Or I'm just lucky at the moment, and should increase the size or
>> switch to a text field? (I am still developing, so using sqlite for the
>> time being)
>>
> --
> 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/D7E75GRRGlA/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/web2py/adc52c5a-c85d-44da-8b18-fb67f12c7f42%40googlegroups.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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/CABZ%2BKCCXoXB-fD-L5brd%3DFxXxOvhFK4%3DfMkZXoAUGK9oQXmG7A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: string vs text db field question

2019-06-04 Thread Anthony
SQLite doesn't make a distinction between string and text nor have a length 
limit, so yes, you're just "lucky" at the moment. If you plan to migrate to 
something like Postgres, either explicitly set a higher limit or just use a 
text field.

Anthony

On Tuesday, June 4, 2019 at 5:30:05 AM UTC-4, Vlad wrote:
>
> I've used a string field to keep certain info, and it works just fine, but 
> I've just noticed that the strings I ended up saving in this field were 
> around 1,000 characters long, sometimes even closer to 2,000. 
> According to the docs, the default limit for a string field is 512. The 
> limit doesn't seem to be a problem now, so I am wondering what's the nature 
> of the limit. Is it safe to use longer strings because DAL handles them 
> somehow? Or I'm just lucky at the moment, and should increase the size or 
> switch to a text field? (I am still developing, so using sqlite for the 
> time being)
>

-- 
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/adc52c5a-c85d-44da-8b18-fb67f12c7f42%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] json.loads with cyrillic string

2019-06-04 Thread Константин Комков
Hello! As I think my question is simple, but I don't find solution in 
internet yet. How can I get cyrillic symbols from that string:
{"fo":["очная","очная","очная"],"fac":["Садоводства и ландшафтной 
архитектуры","Садоводства и ландшафтной архитектуры","Технологический"],
"dir":["Садоводство","Ландшафтная архитектура","Технология производства и 
переработки сельскохозяйственной продукции"],"cg_id":["27","31","30"],
"comp_group":["Садоводство","Ландшафтная архитектура","Технология 
производства и переработки сельскохозяйственной продукции"],"bud":["Да","Да"
,"Да"]}
I do
json.loads(a)
and get
{u'cg_id': [u'27', u'31', u'30'], u'comp_group': [u
'\u0421\u0430\u0434\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e', 
u'\u041b\u0430\u043d\u0434\u0448\u0430\u0444\u0442\u043d\u0430\u044f 
\u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430', 
u'\u0422\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u044f 
\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0441\u0442\u0432\u0430 
\u0438 \u043f\u0435\u0440\u0435\u0440\u0430\u0431\u043e\u0442\u043a\u0438 
\u0441\u0435\u043b\u044c\u0441\u043a\u043e\u0445\u043e\u0437\u044f\u0439\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439
 
\u043f\u0440\u043e\u0434\u0443\u043a\u0446\u0438\u0438'], u'dir': [u
'\u0421\u0430\u0434\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e', 
u'\u041b\u0430\u043d\u0434\u0448\u0430\u0444\u0442\u043d\u0430\u044f 
\u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430', 
u'\u0422\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u044f 
\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0441\u0442\u0432\u0430 
\u0438 \u043f\u0435\u0440\u0435\u0440\u0430\u0431\u043e\u0442\u043a\u0438 
\u0441\u0435\u043b\u044c\u0441\u043a\u043e\u0445\u043e\u0437\u044f\u0439\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439
 
\u043f\u0440\u043e\u0434\u0443\u043a\u0446\u0438\u0438'], u'fac': 
[u'\u0421\u0430\u0434\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0430 
\u0438 \u043b\u0430\u043d\u0434\u0448\u0430\u0444\u0442\u043d\u043e\u0439 
\u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b', 
u'\u0421\u0430\u0434\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0430 
\u0438 \u043b\u0430\u043d\u0434\u0448\u0430\u0444\u0442\u043d\u043e\u0439 
\u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b', u
'\u0422\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0439'
], u'bud': [u'\u0414\u0430', u'\u0414\u0430', u'\u0414\u0430'], u'fo': [u
'\u043e\u0447\u043d\u0430\u044f', u'\u043e\u0447\u043d\u0430\u044f', u
'\u043e\u0447\u043d\u0430\u044f']}




-- 
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/3756778d-93a9-485f-8375-aa68c1b7a1a6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] string vs text db field question

2019-06-04 Thread Vlad
I've used a string field to keep certain info, and it works just fine, but 
I've just noticed that the strings I ended up saving in this field were 
around 1,000 characters long, sometimes even closer to 2,000. 
According to the docs, the default limit for a string field is 512. The 
limit doesn't seem to be a problem now, so I am wondering what's the nature 
of the limit. Is it safe to use longer strings because DAL handles them 
somehow? Or I'm just lucky at the moment, and should increase the size or 
switch to a text field? (I am still developing, so using sqlite for the 
time being)

-- 
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/71aba083-c255-41e5-8854-d126731cb9fd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: conditional {{include}} in view

2019-06-04 Thread Gilad Hoshmand
For those who arrive late, from the docs 
:

{{if some_condition:}}{{include 'this_view.html'}}{{else:}}{{include 
'that_view.html'}}{{pass}}

-- 
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/90d1f0d6-f2e2-45eb-81d9-e3289d439180%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: new free toys

2019-06-04 Thread Leonel Câmara
I also made something not long ago, it's an excel formula parser you can 
use in python to process excel formulas

https://github.com/aidhound/hotxlfp

-- 
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/12205f68-a1b6-40b4-a64a-42f66f2223fa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.