[web2py] Re: Pass variable from JavaScript function to controller: Using JSQueryBuilder

2019-08-01 Thread Paco Bernal
Hi

ajax('{{=URL('default', 'showfilters')}}' + '?result1=' + result1 + 
'='+result2, [], ':eval');

result1 = request.vars.result1
result2 = request.vars.result2

or 

ajax('{{=URL('default', 'showfilters')}}/' + result1 + '/' + result2, [], 
':eval');

result1 = request.args(0)
result2 = request.args(1)

to will need to take care about the strings you pass to the url or you will 
bad results back to the app.

ajax('{{=URL('default','save_user')}}/'+agent_id+'?first_name='+encodeURIComponent($('#first_name').val())+'_name='+encodeURIComponent($('#last_name').val())+'='+encodeURIComponent($('#email').val())+'='+encodeURIComponent($('#phone').val()),[],':eval');
>

Regards 

El jueves, 1 de agosto de 2019, 3:32:40 (UTC+2), Aydin escribió:
>
> Anthony, how to pass multiple variables, say result1 and result2?
>
> On Thursday, September 22, 2016 at 2:18:01 PM UTC-4, Anthony wrote:
>>
>> "result" is a Javascript variable, so it does not exist in the Python 
>> context in which the URL() function is evaluated. Instead, you must add 
>> that part of the URL via Javascript:
>>
>> ajax('{{=URL('default', 'showfilters')}}' + '?result=' + result, [], 
>> ':eval');
>>
>> Anthony
>>
>> On Thursday, September 22, 2016 at 8:49:47 AM UTC-4, Madhavi wrote:
>>>
>>> Hi,
>>>
>>>  
>>>
>>> I am trying to use JavaScript Query Builder plugin (querybuilder.js.org) 
>>> with web2py. The plugin is installed successfully and I can see the 
>>> querybuilder object in my view. I want to finally pass the string 
>>> containing the filters selected from the view to another controller 
>>> function for further processing. The code I am using on the view is below:
>>>
>>>  
>>>
>>> Get rules
>>>
>>> 
>>>
>>> function myFunction();{
>>>
>>> var result = 
>>> JSON.stringify($('#builder-basic').queryBuilder('getRules'), null, 2);
>>>
>>> ajax('{{=URL('default', 'showfilters', 
>>> vars=dict(result=result))}}', [], ':eval');
>>>
>>> }
>>>
>>> 
>>>
>>>  
>>>
>>> I want to pass ‘result’ variable to ‘showfilters’ controller function 
>>> and call ‘showfilters’ view on clicking on ‘Get rules’ button. But the 
>>> above code doesn’t work and gives this error:
>>>
>>> * name 'result' is not defined*
>>>
>>> I understand this could be because 'result' variable is not defined in 
>>> my controller function corresponding to this view. What is the correct way 
>>> to pass the value of a variable declared through Java Script to a 
>>> controller function in web2py?
>>>
>>> Please help me here – I am novice to both web2py and Java Script and 
>>> have been struggling with this for quite some time. I would prefer to pass 
>>> the variable result through dictionary and not as an argument, as it will 
>>> contain spaces and special characters which I want to preserve in the 
>>> string.
>>>
>>> Thanks,
>>>
>>> Madhavi
>>>
>>

-- 
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/b4b76238-b689-422c-af77-85537e5e3d6a%40googlegroups.com.


[web2py] Re: How can I get value from my extra_fields?

2019-08-01 Thread Константин Комков
I did'n try to login/logout. I do it and all 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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/abcd46d1-225c-42bd-a7f9-3ea23d4cb4a1%40googlegroups.com.


Re: [web2py] How can I get value from my extra_fields?

2019-08-01 Thread Val K
Should be stored in the session too, did you try to logout/login?

-- 
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/49834975-956d-49e6-9817-929c66504a54%40googlegroups.com.


Re: [web2py] Re: Hosting question

2019-08-01 Thread Jose C
Strange...

1) First of all, can you confirm this is a routes.py file in the web2py 
root directory and that there are not any routes.py (app-specific routers) 
files present in the app directories as well (that could be overriding the 
main routes.py)?

2) The config I posted is my live config (other then changing domain names 
and apps to make it easier to read).  It routes to the relevant apps based 
on the domains as expected, even with the one app set as default.

3) Also in the routes.py code you posted, the default_function key is 
misspelt as default_*fucn*tion, which would mean it is ignored (although I 
think web2py looks for 'index' anyway if none specified, but am not 100% 
certain).

4) Not sure about the www part.  I have a frontend redirect for my www. 
domains to the normal domain.  But, what if you specify www.domain.com as 
well as domain.com going to 'app1'.  Haven't tested this but would expect 
it to work.

5) Earlier I accessed both your sites at site.in/welcome and was served the 
welcome app.  Now I retried and get the expected error message that it is 
invalid.  Not sure if that helps.

6) Critical... you must restart the server for any change you make to 
routes.py to come into effect.  Not sure if you saw this on the last post.



-- 
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/030d7db3-c097-4e97-82c8-55c0ae80b57d%40googlegroups.com.


Re: [web2py] How can I get value from my extra_fields?

2019-08-01 Thread Константин Комков
It's query to database I thought that I can get it from session like
auth.user. Thank you for answer!

чт, 1 авг. 2019 г., 21:21 Val K :

> Try db.auth_user(auth.user_id).language
>
> --
> 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/7cgw04bcOiA/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/2b60f329-b68f-4cc5-b5a2-fc9f23483d74%40googlegroups.com
> .
>

-- 
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-V%3Drr9yfMqZmLeWTdw%3D-s42HsehwzG8cpO%3DkiJyLzdb_oQ%40mail.gmail.com.


[web2py] How can I get value from my extra_fields?

2019-08-01 Thread Val K
Try db.auth_user(auth.user_id).language

-- 
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/2b60f329-b68f-4cc5-b5a2-fc9f23483d74%40googlegroups.com.


[web2py] Re: py4web: how to import Template and change delimiters

2019-08-01 Thread Alex Beskopilny

Thanks Massimo! 

it works: deliniters="X0X0X0 Y1Y1Y1"
and delimiters="[Z[ ]]"

py4web was tested with   urls  lte-2.14.15 
and ThreadPoolExecutor(max_workers=10)

results:
execution time: 98.3 sec, data_size=  3794965000, urls= 56000
 bytes/sec= 38596744.13, req/sec= 569.54




четверг, 1 августа 2019 г., 10:48:02 UTC+3 пользователь Alex Beskopilny 
написал:
>
> Hi! 
> I put lte-2.4.15  to py4web  and lte works  with controllers.py :
>
> from py4web import action, request, abort, redirect, URL
> from yatl.helpers import A
> from . common import db, session, T, cache, auth
>
> @action('index')
> @action.uses('index.html', )
> #@action.uses(Template('index.html', delimiters='[[ ]]'))
> def index():
> message= "index.html"
> user= "first second third"
> return dict(message=message, user=user)
> ..
> but does not works with :
> from py4web import action, request, abort, redirect, URL , Template
>   
>  
> 
> error message:
> WARNING:tornado.access:404 GET /lte2 (127.0.0.1) 1.20ms
> WARNING:tornado.access:404 GET /lte2 (127.0.0.1) 1.55ms
> WARNING:tornado.access:404 GET /favicon.ico (127.0.0.1) 1.45ms
>
> how to fix it ?
>
> Is it possible to use some characters for delimiters, 
> for example  delimiters='XXX ' ?
> what is limits for delimiters ?
>
>

-- 
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/caaf1e92-773b-496c-9bf9-d87884d53ece%40googlegroups.com.


[web2py] Re: py4web: how to import Template and change delimiters

2019-08-01 Thread Massimo Di Pierro
Try 

from py4web.core import Template

On Thursday, 1 August 2019 00:48:02 UTC-7, Alex Beskopilny wrote:
>
> Hi! 
> I put lte-2.4.15  to py4web  and lte works  with controllers.py :
>
> from py4web import action, request, abort, redirect, URL
> from yatl.helpers import A
> from . common import db, session, T, cache, auth
>
> @action('index')
> @action.uses('index.html', )
> #@action.uses(Template('index.html', delimiters='[[ ]]'))
> def index():
> message= "index.html"
> user= "first second third"
> return dict(message=message, user=user)
> ..
> but does not works with :
> from py4web import action, request, abort, redirect, URL , Template
>   
>  
> 
> error message:
> WARNING:tornado.access:404 GET /lte2 (127.0.0.1) 1.20ms
> WARNING:tornado.access:404 GET /lte2 (127.0.0.1) 1.55ms
> WARNING:tornado.access:404 GET /favicon.ico (127.0.0.1) 1.45ms
>
> how to fix it ?
>
> Is it possible to use some characters for delimiters, 
> for example  delimiters='XXX ' ?
> what is limits for delimiters ?
>
>

-- 
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/a536b649-a4c8-42a3-a0c4-7741a6f8bdb2%40googlegroups.com.


[web2py] invoice table missing in estore appliance

2019-08-01 Thread Saranya S
Yes.. Even I got the same error with EStore application. Invoice table is 
referenced in the model,  but no such table is defined in the model.

Could anybody please help to fix this issue.  I need to explore and understand 
the EStore application developed by Massimo.

Thank you very much in advance.. 

-- 
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/395ede14-67e0-4d04-9a84-02c643a7127c%40googlegroups.com.


Re: [web2py] Web2Py with LDAP and SAML : Is it worth it for Windows ?

2019-08-01 Thread Davidiam
We are working on a Shibboleth implementation now. So far it is working better 
than the other tests we did on Windows.

We wanted to test it using a localhost Shibboleth sp and idp but it wasn't 
clear to us how we needed to configure it.

Thanks for the tip! 

-- 
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/214e0d91-b159-4768-99c3-46ee708897b3%40googlegroups.com.


[web2py] Re: Web2Py and ldap integration

2019-08-01 Thread Davidiam
Thank you very much for the info.  In the mean time we have decided to use 
shibboleth because we had a lot of issues with the python modules on Windows 
and because the project added the requirement for sso. I will keep your 
solution as a reference for the future. 

-- 
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/3fc54c21-a081-4f72-a8d7-e2a1f354e7ee%40googlegroups.com.


[web2py] Re: Hosting question

2019-08-01 Thread Paco Bernal
Thank you,

Now it's working as spected.

appconfig.ini

[host]
> names = subdomain:*
>

I removed the virtualhost regarding the dedicated ips and set DocumentRoot 
in port 80 for my subdomain to /dev/null

Not sure if it's the right way but it's working now without expliciting 
having a virtualhost for each ip to avoid ip direct access.

About nginx, of course it's much better, but old customs are hard to avoid 
:)

Regards

El jueves, 1 de agosto de 2019, 12:00:01 (UTC+2), Dave S escribió:
>
>
>
> On Thursday, August 1, 2019 at 1:37:37 AM UTC-7, Jose C wrote:
>>
>> I use Lets encrypt certificates and redirecting from 80 to 443, and I 
>>> don't touch virtualhost file in port 80 so for sure, i'm doing something 
>>> wrong with apache3 and for sure with host names in appconfig.ini
>>>
>>> [host]
 names = localhost:*, 127.0.0.1:*, *:*, *


>> That is worrying.  I can only suspect some kind of misconfiguration with 
>> apache to be causing this.  Unfortunately I know nothing about apache conf 
>> so can't help.  I'd recommend creating a new post with this issue you're 
>> having... one of the more knowledgeable folks might be able to help you 
>> figure out what is going on.
>>
>  
> I'd agree that it is an Apache issue.  With my Nginx configuration, I get 
> the expected "invalid function" response from web2py.  
>
> The group wisdom seems to be that Apache setup is arcane and complicated, 
> and Massimo and others explicitly recommend Nginx for production.  If you 
> are constrained to Apache, though, that could be tough.  And I'm no help 
> there.
>
> /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/98e74b5e-bc06-4ef3-9dbf-f3d10502a36f%40googlegroups.com.


[web2py] Re: Hosting question

2019-08-01 Thread Dave S


On Thursday, August 1, 2019 at 1:37:37 AM UTC-7, Jose C wrote:
>
> I use Lets encrypt certificates and redirecting from 80 to 443, and I 
>> don't touch virtualhost file in port 80 so for sure, i'm doing something 
>> wrong with apache3 and for sure with host names in appconfig.ini
>>
>> [host]
>>> names = localhost:*, 127.0.0.1:*, *:*, *
>>>
>>>
> That is worrying.  I can only suspect some kind of misconfiguration with 
> apache to be causing this.  Unfortunately I know nothing about apache conf 
> so can't help.  I'd recommend creating a new post with this issue you're 
> having... one of the more knowledgeable folks might be able to help you 
> figure out what is going on.
>
 
I'd agree that it is an Apache issue.  With my Nginx configuration, I get 
the expected "invalid function" response from web2py.  

The group wisdom seems to be that Apache setup is arcane and complicated, 
and Massimo and others explicitly recommend Nginx for production.  If you 
are constrained to Apache, though, that could be tough.  And I'm no help 
there.

/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/1c5dba31-c27e-4696-9560-e9c7b2a9cd9c%40googlegroups.com.


Re: [web2py] Re: Hosting question

2019-08-01 Thread Rahul Dhakate
Hi Jose,
  I did the changes as per your suggestion. Now when I specify a
default application it takes me to the same application when I access any
domain.
Secondly -
If I specify my domain name without a www. prefix (example: artpic.in)  I
am navigated to welcome however the app is not show as its not allowed in
routes.py . If I specify the complete address it works properly example:
www.artpic.in . Have a look at the screenshot. Also you can check it as I
havent reverted the changes yet. Let me know.


*My routes.py is *

routers = dict(
> #base router
> BASE=dict(
> #default_application='Target',
> domains= {
>  'www.targetsoft.co.in' : 'Target',
>  'www.artpic.in' : 'artpic',
>   },
> #default_application = 'Target',
> applications=['Target', 'artpic', ],
> default_fucntion = 'index',
> ),
> Target = dict(
> default_language = 'en',
>languages = ['en'],
> default_function = 'index',
> ),
> artpic = dict(
> default_language = 'en',
> languages = ['en'],
>default_function = 'index',
> map_hyphen = True,
> ),
>
> )


Regards,

*Rahul*


On Thu, Aug 1, 2019 at 2:07 PM Jose C  wrote:

> I use Lets encrypt certificates and redirecting from 80 to 443, and I
>> don't touch virtualhost file in port 80 so for sure, i'm doing something
>> wrong with apache3 and for sure with host names in appconfig.ini
>>
>> [host]
>>> names = localhost:*, 127.0.0.1:*, *:*, *
>>>
>>>
> That is worrying.  I can only suspect some kind of misconfiguration with
> apache to be causing this.  Unfortunately I know nothing about apache conf
> so can't help.  I'd recommend creating a new post with this issue you're
> having... one of the more knowledgeable folks might be able to help you
> figure out what is going on.
>
>
> --
> 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/lvOxb_mb6kQ/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/3611fe72-085d-459b-97b4-e5ed4fb9d34e%40googlegroups.com
> 
> .
>

-- 
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/CA%2B6uMje7cWPJtXH1h0ySDz_GYLj%3DV6ddvv8a-e89MhLigKnYHA%40mail.gmail.com.


[web2py] Re: Hosting question

2019-08-01 Thread Jose C

>
> I use Lets encrypt certificates and redirecting from 80 to 443, and I 
> don't touch virtualhost file in port 80 so for sure, i'm doing something 
> wrong with apache3 and for sure with host names in appconfig.ini
>
> [host]
>> names = localhost:*, 127.0.0.1:*, *:*, *
>>
>>
That is worrying.  I can only suspect some kind of misconfiguration with 
apache to be causing this.  Unfortunately I know nothing about apache conf 
so can't help.  I'd recommend creating a new post with this issue you're 
having... one of the more knowledgeable folks might be able to help you 
figure out what is going on.


-- 
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/3611fe72-085d-459b-97b4-e5ed4fb9d34e%40googlegroups.com.


Re: [web2py] Re: Hosting question

2019-08-01 Thread Jose C


> >
>  Have you removed welcome application from web2py applications folder 
> or it still resides there but when accessed gives 404? I am using python 
> 2.7.13 . I will try your settings for routes and get back to you. 
>

Normally I always delete the app, but for testing this issue I left it 
there, accessed it to check was ok.  Then just set routes.py as above and 
get 404's when trying to access it.

Both your sites seem to be working well for me.  And from both I can access 
the welcome app by just typing domain.com/welcome.  Have you made changes 
to routes.py.   

Important... note that you have to restart teh web2py server each time you 
make a change to routes.py.





-- 
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/214a7e02-0d8b-473f-9df4-506b7667fe27%40googlegroups.com.


[web2py] Re: Hosting question

2019-08-01 Thread Paco Bernal
Yes, I discovered a few days ago that private folder can be accessed using 
the vps ip, so I have been playing with host names in appconfig.ini and 
with apache2 configuration and the only way to stop accessing private 
folder was adding a new virtualhost in apache for each vps ip with this:


> Redirect 403 /
> ErrorDocument 403 "Sorry, direct IP access not allowed."
> DocumentRoot /dev/null
> UseCanonicalName Off
> 
>
>
I use Lets encrypt certificates and redirecting from 80 to 443, and I don't 
touch virtualhost file in port 80 so for sure, i'm doing something wrong 
with apache3 and for sure with host names in appconfig.ini

[host]
> names = localhost:*, 127.0.0.1:*, *:*, *
>
>
Regards

El jueves, 1 de agosto de 2019, 9:26:26 (UTC+2), Jose C escribió:
>
> > I added the line in routes.py  - While it restricts allowing 
>> access to other applications like welcome it does not restrict 
>> redirection - so in my case it still redirected to welcome application 
>> mentioning something is wrong message. 
>>
>> Odd.  I have a similar setup to you with multiple domains, 2.18.5, py3 
> using rocket server.  If I do not place 'welcome' in the 'allowed_apps'  
> any attempt to get to any page on the welcome app returns a 404 (as 
> expected).
>  One thing that may be different... I have additional parameters in 
> routes.py which specifies the default for each app... perhaps in the 
> absence of this it tries to go back to 'welcome'?
>
> routers = dict(
> # base router
> BASE = dict(
> domains={'domain1.com' : 'app1',
>  'domain2.com' : 'app2',
>  },
> default_application = 'app1',
> applications = ['app1', 'app2'],
> default_function = 'home',
> ),
> app1 = dict(
> default_language = 'en',
> languages = ['en'],
> default_function = 'home',
> ),
> app2 = dict(
> default_language = 'en',
> languages = ['en'],
> default_function = 'index',
> map_hyphen = True,
> ),
>
>
> )
>
> Paco:  Surely appconfig.ini should never be reachable via the url due to 
> the security risks of allowing access to config info?  I paniced for a sec 
> and tried accessing mine with a link like yours but get 404 (as expected).  
> Are you saying you can see your appconfig.ini, without specifically doing 
> something to expose it, by simply accessing a link the way you formatted 
> it? 
>  
>

-- 
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/b617507e-06b5-423d-b007-04f98734c101%40googlegroups.com.


Re: [web2py] Re: Hosting question

2019-08-01 Thread Rahul Dhakate
Hi Jose,
 Have you removed welcome application from web2py applications folder
or it still resides there but when accessed gives 404? I am using python
2.7.13 . I will try your settings for routes and get back to you.

In the meantime you may access the sites here that I referred to -
1. www.targetsoft.co.in  - is linked with app1
2. www.artpic.in is linked with app2  ( Just set-it-up yesterday but work
remains to be done for a production launch)

Regards,

Rahul

On Thu, Aug 1, 2019 at 12:56 PM Jose C  wrote:

> > I added the line in routes.py  - While it restricts allowing
>> access to other applications like welcome it does not restrict
>> redirection - so in my case it still redirected to welcome application
>> mentioning something is wrong message.
>>
>> Odd.  I have a similar setup to you with multiple domains, 2.18.5, py3
> using rocket server.  If I do not place 'welcome' in the 'allowed_apps'
> any attempt to get to any page on the welcome app returns a 404 (as
> expected).
>  One thing that may be different... I have additional parameters in
> routes.py which specifies the default for each app... perhaps in the
> absence of this it tries to go back to 'welcome'?
>
> routers = dict(
> # base router
> BASE = dict(
> domains={'domain1.com' : 'app1',
>  'domain2.com' : 'app2',
>  },
> default_application = 'app1',
> applications = ['app1', 'app2'],
> default_function = 'home',
> ),
> app1 = dict(
> default_language = 'en',
> languages = ['en'],
> default_function = 'home',
> ),
> app2 = dict(
> default_language = 'en',
> languages = ['en'],
> default_function = 'index',
> map_hyphen = True,
> ),
>
>
> )
>
> Paco:  Surely appconfig.ini should never be reachable via the url due to
> the security risks of allowing access to config info?  I paniced for a sec
> and tried accessing mine with a link like yours but get 404 (as expected).
> Are you saying you can see your appconfig.ini, without specifically doing
> something to expose it, by simply accessing a link the way you formatted
> it?
>
>
> --
> 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/lvOxb_mb6kQ/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/4cdc72a0-de86-4850-915c-35a5f8eeafd9%40googlegroups.com
> 
> .
>

-- 
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/CA%2B6uMjdusvvrEbkFNv68aXVxcP-RdTdMP-9onkReXd2MEpY4Tg%40mail.gmail.com.


[web2py] How can I get value from my extra_fields?

2019-08-01 Thread Константин Комков
I added field 'language' im my auth_user table in database. My file db.py 
contain:
auth = Auth(db, host_names=configuration.get('host.names'))

*auth*
*.settings.extra_fields['auth_user']= [Field('language')]*
auth.define_tables(username=False, signature=False)
How can I get value of language for current login user?
myStr = ''
for a in auth.user:
myStr += a+': '+str(auth.user.get(a))+''
myStr >>>
id: 1
first_name: Константин
last_name: Комков
email: t...@gmail.com
registration_key: 
reset_password_key: 
registration_id:
test = str(auth.settings.extra_fields.get('auth_user')[0])
test >>>
auth_user.language

-- 
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/58233646-4ca0-4b19-9e33-90536918a66e%40googlegroups.com.


[web2py] py4web: how to import Template and change delimiters

2019-08-01 Thread Alex Beskopilny
Hi! 
I put lte-2.4.15  to py4web  and lte works  with controllers.py :

from py4web import action, request, abort, redirect, URL
from yatl.helpers import A
from . common import db, session, T, cache, auth

@action('index')
@action.uses('index.html', )
#@action.uses(Template('index.html', delimiters='[[ ]]'))
def index():
message= "index.html"
user= "first second third"
return dict(message=message, user=user)
..
but does not works with :
from py4web import action, request, abort, redirect, URL , Template

   

error message:
WARNING:tornado.access:404 GET /lte2 (127.0.0.1) 1.20ms
WARNING:tornado.access:404 GET /lte2 (127.0.0.1) 1.55ms
WARNING:tornado.access:404 GET /favicon.ico (127.0.0.1) 1.45ms

how to fix it ?

Is it possible to use some characters for delimiters, 
for example  delimiters='XXX ' ?
what is limits for delimiters ?

-- 
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/1a809bdf-2659-42ef-a3ab-11350da79bbb%40googlegroups.com.


[web2py] Re: Hosting question

2019-08-01 Thread Jose C

>
> > I added the line in routes.py  - While it restricts allowing 
> access to other applications like welcome it does not restrict 
> redirection - so in my case it still redirected to welcome application 
> mentioning something is wrong message. 
>
> Odd.  I have a similar setup to you with multiple domains, 2.18.5, py3 
using rocket server.  If I do not place 'welcome' in the 'allowed_apps'  
any attempt to get to any page on the welcome app returns a 404 (as 
expected).
 One thing that may be different... I have additional parameters in 
routes.py which specifies the default for each app... perhaps in the 
absence of this it tries to go back to 'welcome'?

routers = dict(
# base router
BASE = dict(
domains={'domain1.com' : 'app1',
 'domain2.com' : 'app2',
 },
default_application = 'app1',
applications = ['app1', 'app2'],
default_function = 'home',
),
app1 = dict(
default_language = 'en',
languages = ['en'],
default_function = 'home',
),
app2 = dict(
default_language = 'en',
languages = ['en'],
default_function = 'index',
map_hyphen = True,
),


)

Paco:  Surely appconfig.ini should never be reachable via the url due to 
the security risks of allowing access to config info?  I paniced for a sec 
and tried accessing mine with a link like yours but get 404 (as expected).  
Are you saying you can see your appconfig.ini, without specifically doing 
something to expose it, by simply accessing a link the way you formatted 
it? 
 

-- 
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/4cdc72a0-de86-4850-915c-35a5f8eeafd9%40googlegroups.com.


[web2py] Re: Hosting question

2019-08-01 Thread Rahul
Hi Jose,
 I added the line in routes.py  - While it restricts allowing 
access to other applications like welcome it does not restrict redirection 
- so in my case it still redirected to welcome application mentioning 
something is wrong message. 

*Paco,*
I checked for this 
"http://vps_ip/applications/app1/private/appconfig.ini; , the problem is my 
application does not have an *appconfig.ini*. I started writing it in 2014 
or late 2013 so it does not have it as we now have in a default in 
scaffolding application. I do host the sites on web2py 2.18.5 but that's 
about it. 

Regards,

*Rahul*

On Thursday, August 1, 2019 at 2:30:25 AM UTC+5:30, Paco Bernal wrote:
>
> Hi
> Please can you test this url and tell me what you have as result?
> http://vps_ip/applications/app1/private/appconfig.ini
>
> Change vps_ip for the ip of your server and app1 for the name of your 
> application (folder name)
>
> Thx
>
>

-- 
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/48a7faaf-3559-4de9-aef6-fa0fd28ad32a%40googlegroups.com.