Re: [web2py] Re: web2py -> py4web

2024-07-15 Thread Christian Varas
Hi Massimo,
In my case I have still one app in production using web2py, I haven’t
migrated yet because is quite big. For the rest of my apps, are all
migrated to py4web and they work so much faster :).

In my opinion, drop the support of python 2.7 is recommended to avoid
security issues, and also to minimize the work load of maintenance.

For web2py, maybe it is better just do bug fixes and no more upgrades.
Web2py is an amazing framework that work out of the box. But Py4web is just
better !

I don’t use GAE with web2py, I’ve always used in a VPS.

Thanks you  and all the team behind. 🍻

Chris.
El El lun, 15 jul. 2024 a la(s) 7:25 a. m., Raul Monares 
escribió:

> Hi Massimo
> I have several web2py applications in production. Big systems that would
> be difficult to move to py4web as they are growing all the time. But we're
> using Python 3.8.
>
> Also, GAE is not relevant to us
>
> Web2py has been fantastic.
>
> On Sunday, July 14, 2024 at 2:11:23 AM UTC-6 Clemens wrote:
>
>> Hello Massimo,
>>
>> I'm a vital web2py user with a 3 systems in production. I've moved to
>> python 3.7+ (currently 3.8) a long time ago.  I'm using postgres as
>> database, thus for me GAE would not be relevant.
>>
>> But I'm really interested in any support and security updates of web2py.
>>
>> I would like to migrate to py4web. The only but big obstacle is time. As
>> soon as I find the time I'm gonna move to py4web.
>>
>> Thanks a lot for web2py and your work!
>>
>> Best regards
>> Clemens
>>
>>
>> On Sunday, July 14, 2024 at 4:10:05 AM UTC+2 Massimo Di Pierro wrote:
>>
>>> Hello everybody,
>>>
>>> You may have noticed I am not very active on this mailing list. That is
>>> mostly because I have been concentrating my energy on py4web which I think
>>> is must more modern and faster than web2py.
>>>
>>> Once again I want to encourage you to move.
>>> If you look at this page
>>>
>>>  https://py4web.com/#why
>>>
>>> You will find it to be very familiar:
>>> - has an admin interface (called _dashboard)
>>> - has an dbadmin interface
>>> - same pyDAL
>>> - same template language
>>> - same helpers
>>> - same session interface
>>> - similar but better Form
>>> - similar but better Grid (still evolving)
>>> - different request object but compatible with bottlepy
>>> - different auth logic but support for more Oauth2 services (github,
>>> okta, facebook, etc.)
>>> - different but similar background scheduler
>>>
>>> Here are some instructions about how to move from web2py to py4web
>>>
>>> web2py currently works for python2.7 and python3.7+ but they are using a
>>> frozen version of pydal. This no longer works on Google App Engine. So how
>>> do we fix it?
>>>
>>> I am considering the following:
>>> - freezing web2py for Python 2.7 and stopping support.
>>> - continuing limited support of web2py for python3.7+ and specifically
>>> upgrade pydal for the lastest.
>>> - upgrade pydal so that it continues to work on Google App Engine for
>>> both web2py and py4web.
>>>
>>> My questions are: Is this worth it? Have people moved from python2.7 to
>>> 3.7+ already? Are people here interested in continuing to use web2py with
>>> GAE?
>>>
>>>
>>> Massimo
>>>
>>>
>>>
>>> --
> 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/6794728c-4c38-4826-ad07-d7b9827d0585n%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%2Bs%2BuJth8X2yJBhi1n97%3Dyho3bLQNGM9Q2e-GNLt3Yb1X%2B6yfw%40mail.gmail.com.


[web2py] Re: cibersecurity audit issue about login

2023-11-16 Thread Christian Varas
Hello António.

Bruteforce in login is a common weakness that can be easy to solve.

The most effective solution is implementing a CAPTCHA, in web2py I use
google recaptcha because the implementation is easy and stops all the
automations.
In py4web I'm still unable to implement it in the login form and there is
no to much information about how to make it.

In web2py I'm quite sure that it is not possible to submit the same form
twice because it has a csrf token or similar so the bruteforce is not that
simple like repeating the login post. If a script resends the same post
will be not processed due the token is reused.

In py4web forms have csrftoken but I'm not sure if they work the same like
in web2py. Months ago it was possible to resend twice the same post data
and accepted. I haven't tested in those days, but I will, because it is
something that makes noise.

In my experience an account lockout policy is effective but very
annoying to the users.

I would not say that brute force in login forms is a big task and consumes
too much CPU. These functions usually are small and make small queries to
the database. Most of the time a public endpoint like index or a landing
page can consume more CPU than the login task.

Greetings.
Chris.

El jue, 16 nov 2023 a las 14:32, António Ramos ()
escribió:

> Hello friends, i guess this is a similar issue between web2py and py4web
> so im posting to both groups. Sorry if im abusing ...
>
> We had a cibersecurity audit in our web2py app and they found this issue
>
> QUOTE
> During
> the application audit process, it was possible to identify that the the
> company portal does not implement the restriction of
> blocking accounts due to invalid login attempts This allows an attacker to
> use brute force attacks to attempt a valid credential indefinitely
>
> *Recommendation*
> We
> recommend implementing account lockout policies for invalid login
> attempts, as well as captcha and multi factor
> authentication ( mechanisms, as well as session timeouts to log out a user
> who has been inactive on the system for
> some time
> UNQUOTE
>
> I already activated the mfa in my app but it only works if the password is
> correct.
> An attacker trying to guess the password could have a forever loop trying
> to login and it can stress the sever CPU.
>
> Any comments on this ?
>
> Regards
> António
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "py4web" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to py4web+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/py4web/CAEM0BxN7fY6Ymy8Fihb7UKWarT%2B9CsuQnH%3D9tYo1JFSFVH%2BgdA%40mail.gmail.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%2Bs%2BuJtjPvFYEPwoy9r19bARLmsoN4fk6Rbeirxb%2BFkX6Uh49A%40mail.gmail.com.


Re: [web2py] Re: web2py 2.26.1 released

2023-10-30 Thread Christian Varas
In my opinion Web2py is really comfortable but I strongly recommend to move
to py4web.
The scheduler in web2py is replaced with celery which is more powerful and
py4web framework is really fast, light and is easy to code like in web2py.
I’ve moved all my apps from web2py to py4web and I can’t complain of the
results.
I totally recommend to move from web2py to py4web.

Greetings.
Chris

El El lun, 30 oct 2023 a la(s) 12:48, António Ramos 
escribió:

> I´m so comfortable with web2py, the admin dashboard and the scheduler are
> blocking me from moving to py4web...
> Regards
>
> Em seg., 30 de out. de 2023 às 04:48, Raul Monares 
> escreveu:
>
>> Great news. I appreatiate your work on both platforms
>>
>> On Sunday, October 29, 2023 at 3:13:31 PM UTC-6 Massimo Di Pierro wrote:
>>
>>> Changelog:
>>> - adds support of python up to version 3.11
>>> - fixes a bug with serialization of headers introduced in version 2.25.1
>>> - improves handling of unstable db connections in the scheduler
>>>
>>> I remind you that py4web has been out for 5 years now as successor of
>>> web2py.
>>> It has the same template language and dal as web2py but it is a lot
>>> faster.
>>> It has a better grid, form handling, and auth integrations.
>>>
>>> Massimo
>>>
>>
>>> --
>> 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/22e4071c-f4e6-4b67-b63b-087db6fd2645n%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/CAEM0BxO5q87Ec9AxmPkpjUxpMdA0xcDk0xAjnzdXCMVLgFb5vQ%40mail.gmail.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%2Bs%2BuJsg8T5-4QuP1wbwS4U9h6KKL8vTDm22zxJaXMSn5tCzeA%40mail.gmail.com.


Re: [web2py] Re: uwsgi with web2py hard crash/locking with nginx

2023-10-17 Thread Christian Varas
While I can't provide a specific solution, it might be a better approach to
keep resource-intensive tasks separate from web2py, using a tool like
Celery. This way, these tasks can run in the background without impacting
the web server.

This is a small docx about how to put it together:
https://docs.google.com/document/d/1JXToOdSSeDlxV_ev2NYYPeVKtY8eJS2v/edit?usp=sharing&ouid=107281473670459955205&rtpof=true&sd=true

Greetings

El mar, 17 oct 2023 a las 4:43, Tom Clerckx () escribió:

> Maybe you should review the 'high calculation/high plotly' pages for
> memory usage?
> As the 'OOM killer' kicked in, it looks like the process is using too much
> memory.
>
> One thing to verify this is to monitor the VmRSS of the processes involved
> (VmRSS is one of the fields in the output when you do 'cat
> /proc//status')
> VmRSS gives you an idea about the amount of RAM memory your process is
> using.
>
> If it's growing out of proportion, you're claiming too much memory and the
> process will be killed by the OOM-killer.
>
>
> On Monday, October 16, 2023 at 8:15:20 PM UTC+2 lucas wrote:
>
>> hello one and all,
>>
>> i'm using web2py 2.25.1 with uwsgi 2.0.22 which was downloaded and
>> compiled using pip3 under python 3.10.12 under ubuntu 22.04.  the nginx is
>> apt installed version 1.18.
>>
>> with that being said, if i install and run my high calculation / high
>> plotly plot pages about 6 to 12 times, the whole damn system comes to a
>> crash.  hard crash.  this also seems to be the case under redhat / amazon
>> linux 2023 similar setup and config.
>>
>> so i tried crashing the system under just "python3 web2py.py -i 0.0.0.0
>> -p 80 --no_gui" and also under "uwsgi --http :80 --chdir
>> /opt/web2py_apps/web2py -w wsgihandler:application" but i could NOT get
>> either to crash.  it is only when i nginx daemon it with uwsgi and web2py
>> layered/socketed under nginx that it DOES crash hard.  i think i found
>> under the systemctl logs for uwsgi a logging of the crash, or:
>>
>> Oct 16 13:48:30 iquanta.info systemd[1]: uwsgi.service: A process of
>> this unit has been killed by the OOM killer.
>> Oct 16 13:48:30 iquanta.info uwsgi[1264]: [emperor] *** RAGNAROK EVOKED
>> ***
>> Oct 16 13:48:30 iquanta.info uwsgi[1265]: SIGINT/SIGTERM
>> received...killing workers...
>> Oct 16 13:48:30 iquanta.info uwsgi[1264]: Mon Oct 16 13:48:30 2023 -
>> [emperor] stop the uwsgi instance web2py.ini
>> Oct 16 13:48:30 iquanta.info uwsgi[1265]: Mon Oct 16 13:48:30 2023 -
>> received message 0 from emperor
>> Oct 16 13:48:31 iquanta.info uwsgi[1265]: worker 5 buried after 1 seconds
>> Oct 16 13:48:32 iquanta.info uwsgi[1265]: worker 1 buried after 2 seconds
>> Oct 16 13:48:32 iquanta.info uwsgi[1265]: worker 2 buried after 2 seconds
>> Oct 16 13:48:32 iquanta.info uwsgi[1265]: worker 3 buried after 2 seconds
>> Oct 16 13:48:32 iquanta.info uwsgi[1265]: worker 4 buried after 2 seconds
>> Oct 16 13:48:32 iquanta.info uwsgi[1265]: goodbye to uWSGI.
>> Oct 16 13:48:32 iquanta.info uwsgi[1265]: VACUUM: unix socket
>> /run/uwsgi/web2py.sock removed.
>> Oct 16 13:48:33 iquanta.info uwsgi[1264]: Mon Oct 16 13:48:33 2023 -
>> [emperor] removed uwsgi instance web2py.ini
>> Oct 16 13:48:34 iquanta.info uwsgi[1264]: Mon Oct 16 13:48:34 2023 - The
>> Emperor is buried.
>> Oct 16 13:48:34 iquanta.info systemd[1]: uwsgi.service: Failed with
>> result 'oom-kill'.
>> Oct 16 13:48:34 iquanta.info systemd[1]: uwsgi.service: Consumed 10.241s
>> CPU time.
>> Oct 16 13:48:34 iquanta.info systemd[1]: uwsgi.service: Scheduled
>> restart job, restart counter is at 1.
>> Oct 16 13:48:34 iquanta.info systemd[1]: Stopped uWSGI Emperor service.
>> Oct 16 13:48:34 iquanta.info systemd[1]: uwsgi.service: Consumed 10.241s
>> CPU time.
>>
>> with not much to say under the nginx logs.  so, does anyone know what i
>> can be dealing with?  thank you in advance, lucas
>>
> --
> 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/af50af3f-2764-4cbf-8bfd-06c802d0ff93n%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.c

[web2py] web2py with rocket server + nginx ?

2023-02-16 Thread Christian Varas
Hello!

I'm wondering if it is a good idea to use web2py with rocket server in
combination with nginx as a reverse proxy like in py4web.
I need to run py4web and web2py on the same server and using nginx without
uwsgi for web2py would be easier for me.


Cheers.
Chris.

-- 
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%2Bs%2BuJtgieZnEee-M%3Db5G%2BzA2Nwy2kyOnMiZxrfvAS26pizdGg%40mail.gmail.com.


Re: [web2py] web2py 2.23.0 released

2022-12-27 Thread Christian Varas
Thanks you Massimo!

Cheers!

El El mar, 27 de dic. de 2022 a la(s) 04:26, Massimo Di Pierro <
massimo.dipie...@gmail.com> escribió:

> Hello Everybody,
>
> My apologies for not being as engaged in this group as I used to be.
>
> web2py 2.23.0 was released.
>
> It includes:
> - DKIM support to emails
> - More configuration options for 2-factor authentication
> - Fixed an open redirect vulnerability
> - Some bugs fixes.
>
> Thanks everybody who contributed, especially Leonel.
>
> As you noticed the pace of changes in web2py is very slow. Once again I
> recommend that you take a look at py4web, also based on pydal and the same
> template language and helpers as web2py. Yet it is much faster and designed
> from scratch to work with python 3.
>
> Massimo
>
> --
> 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/84e0b47f-84bc-4b9f-9704-d2fbd96bcf0cn%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%2Bs%2BuJu5irJhtKwTNM0UudDoWc6%2BXqq7V1AyqQH6OtCT_8XJ%2Bw%40mail.gmail.com.


Re: [web2py] Re: Issue password in plain text before sending when login in the website via HTTPS

2022-11-23 Thread Christian Varas
Hello.

TLS is enough to encrypt and secure the connection, the whole point of
HTTPS protocol is to make a clear text channel secure.

If someone is sniffing your HTTPS connection, will be not able to read the
traffic, except if the attacker performs a Man In the Middle and replace
the TLS certificate like burpsuite do, but  if something like that happens,
there is no point to hash the username and password because capturing the
cookie session will be enough to enter the application, or even reutilizing
the transmitted hash.

I'm not aware of any mechanism in web2py to hash the username/password.
Maybe you can achieve this by adding some javascript code that hash these
values when click on submit, and probably you will have to modify an
internal component in web2py to make the auth validation able to read your
hashed data.

I've been working in the world of cyber security for a lot of years and
most of the times when someone point this like a vulnerability is because
probably he doesn't understand really well the materia and make an alarm
for something that is already protected. In this case HTTPS is enough. If
your cyber security officer is saying that the app is not protected even
using HTTPS and gives you examples with burpsuite, is clear that he/she
does not understand why burpsuite is able to decrypt data (due their own
certificate) and will think that everything is unencrypted.

I've some banks  that like to hash the transmitted data even with the HTTPS
protection. But again... this is not really secure because hashing data
before sending, would need to be performed in the browser via javascript
and if the hash process happens in the client side, you can see how
encryption is made and reverse it . Even if javascript functions are
obfuscated, you just have to put some breakpoints on the javascript console
(browser console) and catch events until you find where the hashing process
is made, and perform a reverse of that function.


Cheers.
Chris,

El mié, 23 nov 2022 a las 15:59, Arglanir () escribió:

> Hello,
> It is a big question, and does not concern only web2py. You can find
> people asking the same general question in StackOverflow. And the aswers
> are generic : The most important is the TLS communication.
>
> https://security.stackexchange.com/questions/110415/is-it-ok-to-send-plain-text-password-over-https
> (and see linked duplicate questions)
> Do you know any website that does hash the password client-side ?
> Arglanir
>
>
> Le mardi 22 novembre 2022 à 01:20:06 UTC+1, silvia...@gmail.com a écrit :
>
>> Thank you, but do you have any suggestions what to do cause our
>> cybersecurity officer keeps complaining about that wo I need change some
>> settings in web2py or do you have an idea how I can sort it out ?
>>
>> Kind regards
>>
>> Am Di., 22. Nov. 2022 um 02:23 Uhr schrieb Christian Varas <
>> chriii...@gmail.com>:
>>
>>> Hi,
>>> It's OK, it's the way it works, If you put s local proxy like burp and
>>> then you go and capture traffic, it is ok that you can see clear text data
>>> because burp proxy puts their own certificate between client and backend,
>>> because of that burp proxy can decrypt and show you clear text data. If you
>>> sniff with a packet capture like wireshark, you will see everything is
>>> encrypted.
>>>
>>> Salting your password/username before sending it is not really secure,
>>> because hashing the username/password before sending, would need to be
>>> performed in the browser via javascript and if the hash process happens in
>>> the client side, you can see how encryption is made and reverse it .
>>>
>>> Cheers.
>>> Chris.
>>>
>>> El lun, 21 nov 2022 a las 5:01, Silvian “Top 10 Answers” Cedru (<
>>> silvia...@gmail.com>) escribió:
>>>
>>>> Its weird why does web2py do not salt username and password before
>>>> sending it ?
>>>>
>>>> Silvian Cedru schrieb am Montag, 21. November 2022 um 09:25:05 UTC+7:
>>>>
>>>>> Here is a screenshot after sniffing the network and it is weird since
>>>>> it has HTTPS I thought you could not sniff out the password when someone
>>>>> logs ins so I need to salt or Hash it but I am not sure where I find the
>>>>> file and what to change . Would be awesome if someone could help.
>>>>>
>>>>> Silvian Cedru schrieb am Donnerstag, 17. November 2022 um 11:05:34
>>>>> UTC+7:
>>>>>
>>>>>> Hello everyone ,
>>>>>>
>>>>>> I just found out that when you login in my application my password
>>>>>>

Re: [web2py] Re: Issue password in plain text before sending when login in the website via HTTPS

2022-11-21 Thread Christian Varas
Hi,
It's OK, it's the way it works, If you put s local proxy like burp and then
you go and capture traffic, it is ok that you can see clear text data
because burp proxy puts their own certificate between client and backend,
because of that burp proxy can decrypt and show you clear text data. If you
sniff with a packet capture like wireshark, you will see everything is
encrypted.

Salting your password/username before sending it is not really secure,
because hashing the username/password before sending, would need to be
performed in the browser via javascript and if the hash process happens in
the client side, you can see how encryption is made and reverse it .

Cheers.
Chris.

El lun, 21 nov 2022 a las 5:01, Silvian “Top 10 Answers” Cedru (<
silvian.ce...@gmail.com>) escribió:

> Its weird why does web2py do not salt username and password before sending
> it ?
>
> Silvian Cedru schrieb am Montag, 21. November 2022 um 09:25:05 UTC+7:
>
>> Here is a screenshot after sniffing the network and it is weird since it
>> has HTTPS I thought you could not sniff out the password when someone logs
>> ins so I need to salt or Hash it but I am not sure where I find the file
>> and what to change . Would be awesome if someone could help.
>>
>> Silvian Cedru schrieb am Donnerstag, 17. November 2022 um 11:05:34 UTC+7:
>>
>>> Hello everyone ,
>>>
>>> I just found out that when you login in my application my password gets
>>> send in plain text even I thought it gets hashed does someone know a
>>> solution how to salt or hash the password before sending ?
>>>
>>>
>>> --
> 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/3b380bb2-b908-4e8e-be5a-bc465196c38fn%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%2Bs%2BuJv2ddys7nQV5%3DCu7xbM%3DQ-vqu09%3DDL2ZMHoN2TNBYsO7A%40mail.gmail.com.


[web2py] Google Recaptcha v3 in forms

2022-09-20 Thread Christian Varas
Hi!, is there an implementation for google recaptcha v3 in web2py?
If it exists, can someone point me in the right direction to add it?

Cheers.
Chris.

-- 
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%2Bs%2BuJtCjJtst_SXwZqD-k3cfksQDr9VqSoUuedWcY%3DzUQXFRg%40mail.gmail.com.


Re: [web2py] owasp anyone ?

2022-05-30 Thread Christian Varas
Hi, well i can say based in my experience developing in web2py:

"Cross Site Scripting (XSS):

   - XSS doesn't affect components in web2py (forms, grid,  and returned
   data in view). XSS are effective here only when you use the data
   supplied by the user in a insecure way like:
  -  returning user input and using it with javascript DOM. Ex:
  document.getElementById('some_div').innerHtml = 'xss code'


   - also with datatables loading data via ajax
  - when you return the user input in view inside the XML() helper,
  this converts the code into an executable code. Ex:
  {{=XML('malicius_user_input')}}

"Injection Flaws:`

   - sql injection doesn't affect DAL, dal indeed sanitizes the input
   before doing the sql query. The only exception could be when you execute
   raw sql queries with DAL.

Malicious File Execution

   - This doesn't affect the framework until you do a vulnerable function
   like: using the user input directly to call an internal/external file and
   read it.

Insecure Direct Object Reference

   - web2py is not affected by this until the developer do a vulnerable
   code. Always depend on what you do with the user input.

Cross Site Request Forgery (CSRF)

   - web2py Is not affected when you use the components in web2py, like
   forms (the have csrf token). Is affected if you custom ajax call or forms
   that are not part of the framework, in that case you have to implement a
   custom csrf token.

Information Leakage and Improper Error Handling

   - *This doesn't affect web2p. Web2py includes a ticketing system. No
   error can result in code being exposed to the users. All errors are logged
   and a ticket is issued to the user that allows error tracking. But errors
   and source code are accessible only to the administrator. *

Broken Authentication and Session Management

   - Session and authentication is strong. Web2py uses encrypted cookies,
   stores passwords as hashes, and has decorators like :
@auth.requires_login(),
@auth.requires_membership(), etc...

Insecure Cryptographic Storage

   - WEb2py stores password hashes, so clear text passwords are never
   stored.

Insecure Communications

   - This is more concerned with the infrastructure where you deploy the
   framework. Nginx, Apache, and others. Always use SSL

Failure to Restrict URL Access

   - Auth system in web2py is strong. You can't access other functions if
   they have the decorators like : @auth.requires_login(),
@auth.requires_membership(), etc...


I don't know about the "certificated status". But web2py has good security
in general, there have not been any known vulnerabilities in years.

Cheers.
Chris.


El dom, 29 may 2022 a las 17:30, António Ramos ()
escribió:

> Hello all
> I read this part of the book about owasp
> Security
>
> The Open Web Application Security Project[owasp
> ] (OWASP) is a free
> and open worldwide community focused on improving the security of
> application software.
>
> OWASP has listed the top ten security issues that put web applications at
> risk. That list is reproduced here, along with a description of how each
> issue is addressed by web2py:
>
>- "Cross Site Scripting (XSS): XSS flaws occur whenever an application
>takes user supplied data and sends it to a web browser without first
>validating or encoding that content. XSS allows attackers to execute
>scripts in the victim's browser which can hijack user sessions, deface web
>sites, possibly introduce worms, etc." *web2py, by default, escapes
>all variables rendered in the view, preventing XSS.*
>- "Injection Flaws: Injection flaws, particularly SQL injection, are
>common in web applications. Injection occurs when user-supplied data is
>sent to an interpreter as part of a command or query. The attacker's
>hostile data tricks the interpreter into executing unintended commands or
>changing data." *web2py includes a Database Abstraction Layer that
>makes SQL injection impossible. Normally, SQL statements are not written by
>the developer. Instead, SQL is generated dynamically by the DAL, ensuring
>that all inserted data is properly escaped.*
>- "Malicious File Execution: Code vulnerable to remote file inclusion
>(RFI) allows attackers to include hostile code and data, resulting in
>devastating attacks, such as total server compromise." *web2py allows
>only exposed functions to be executed, preventing malicious file execution.
>Imported functions are never exposed; only actions are exposed. web2py uses
>a Web-based administration interface which makes it very easy to keep track
>of what is exposed and what is not.*
>- "Insecure Direct Object Reference: A direct object reference occurs
>when a developer exposes a reference to an internal implementation object,
>such as a file, directory, database record, or key, as a URL or form
>parameter. A

Re: [web2py] Web2py and database integration

2021-05-14 Thread Christian Varas
Could you share your db.py ? Maybe there are declared 2 connections to db
 and one might be overwriting the one who connects to postgresql.


Cheers.
Chris.

El El vie, 14 de may. de 2021 a la(s) 15:22, F.C. 
escribió:

> I  need some help. I have started web2py development with a passion to
> really master it. I love python and really want to see if I can find some
> excellent uses for writing online applications.
>
> The weird problem I am running into is the following and I need some help.
>
> I have an application where I have setup a connection string to an online
> postgresql database. When I run a select query it shows that it is a sqlite
> database connection to a local database on disk but that is not how I set
> it up.
>
> The effect is that my login and registration screens do not work and I am
> not sure what I am doing wrong.
>
> What is the best way to debug this issue?
>
>
> --
> 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/1becabf7-c5ab-4e68-acd1-f803c18a6548n%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%2Bs%2BuJuRN0t92ckr6i53C-nMeF243nt4avyF0zx1cYCh_wRjUw%40mail.gmail.com.


Re: [web2py] Re: Push Notifications

2020-11-20 Thread Christian Varas
Hi! I need to implement this and receive the notifications in the phone
android/iOS. For this do I need to make my own app? Or do you use an app
who can subscribe to push notifications in pusher.com ?
This is off topic but any recommendation is appreciated

Cheers.
Chris

El El vie, 20 de nov. de 2020 a la(s) 13:45, mostwanted <
godirao...@gmail.com> escribió:

> Gratitude
>
> On Friday, November 20, 2020 at 10:33:10 AM UTC+2 Ramos wrote:
>
>> create a module inside web2py
>> API_Pusher.py
>>
>> import pusher
>>
>> def pusher_client():
>> return pusher.Pusher(
>>   app_id='yourid',
>>   key='yourkey',
>>   secret='yoursecret',
>>   cluster='eu',
>>   ssl=True
>> )
>>
>>
>> Then inside your controllers
>>
>> from API_Pusher import pusher_client
>> ...
>> pusher_client().trigger('fileit', 'plannerPesos',  {'message':
>> "PlaySound('ok')"})
>>
>> Em sex., 20 de nov. de 2020 às 07:41, mostwanted 
>> escreveu:
>>
>>> Hey Ramos, I was able to successfully register the app on pusher.com.
>>> towards step 4 its says i should copy this code:
>>> *CODE:*
>>> curl -H "Content-Type: application/json" \
>>>  -H "Authorization: Bearer
>>> 9C9232906DFC6C8F8115926CC30D637945EB75F60467DA77977C399C4235E61C" \
>>>  -X POST "
>>> https://733e2240-aca0-4a12-a5a9-c3b1422b9063.pushnotifications.pusher.com/publish_api/v1/instances/733e2240-aca0-4a12-a5a9-c3b1422b9063/publishes";
>>> \
>>>  -d
>>> '{"interests":["hello"],"web":{"notification":{"title":"Hello","body":"Hello,
>>> world!"}}}'
>>>
>>> to my console! Which console is this one? My desktop console? I'm hosted
>>> with pythonanywhere.com, can i use the Bash console in my dashboard?
>>>
>>> On Tuesday, November 17, 2020 at 7:53:20 AM UTC+2 mostwanted wrote:
>>>
 Thanks alot Ramos, think this will work, very little work needs to be
 done here, I'll try it out.

 On Tuesday, November 17, 2020 at 1:06:10 AM UTC+2 Ramos wrote:

> Why reiventing the wheel ???
> https://pusher.com/
>
> I use it with web2py and works like a charm
>
>
> Em seg., 16 de nov. de 2020 às 08:44, mostwanted 
> escreveu:
>
>> So far all I have been able achieve is asking the user for permission
>> to send them notifications & if they accept all that happens is that
>> everytime they open the app they get a greetings notification, achieving
>> that was not complicated because it was straight forward, I placed the 
>> code
>> in my main.js script & it runs everytime the service worker gets 
>> registered.
>>
>> *CODE:*
>> Notification.requestPermission(result => {
>>   if (result === 'granted') {
>> showNotification('Welcome to My App™', 'Everything Services™')
>>   }
>> });
>>
>> function showNotification(title, message) {
>>   if ('Notification' in window) {
>> navigator.serviceWorker.ready.then(registration => {
>>   registration.showNotification(title, {
>> body: message,
>> tag: 'my-app',
>> icon:'/init/static/images/icon_192x192.png',
>> badge:'/init/static/images/icon_128x128.png',
>> vibrate: [200, 100, 200, 100, 200, 100]
>>   });
>> });
>>   }
>> }
>>
>>
>> On Monday, November 16, 2020 at 10:31:10 AM UTC+2 mostwanted wrote:
>>
>>>
>>> Has anyone been able to implement push notifications on their web2py
>>> apps?
>>>
>>> I need a working application with some examples on how to implement
>>> this for one of my applications.
>>>
>>> I've been looking at the "web-push-book (
>>> https://web-push-book.gauntface.com/how-push-works/)" but I cant
>>> put it together in my head.
>>>
>>> What I wanna achieve is relatively basic, I have an applivcation
>>> that offers information on services & products sold in my area, so what 
>>> I
>>> want is to be able to send notifications everytime a new service or 
>>> product
>>> is registered.
>>>
>>> If anyone has any idea on how I can easily implement this please
>>> help me.
>>>
>>> Regards;
>>>
>>> Mostwanted
>>>
>> --
>> 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+un...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/web2py/01da1065-f7d3-4394-9014-a424639bef03n%40googlegroups.com
>> 

Re: [web2py] Dashboard library for Web2py performance/recommendation python vs. js

2020-11-17 Thread Christian Varas
I would recommend to use a client side chart (JavaScript) because is less
load to the server. The one that I use often is ChartJS is easy to
configure and really nice looking.
For a dashboard I use this 2 templates:
Paper dashboard and AdminLTE.

Cheers.
Chris.

El El mar, 17 de nov. de 2020 a la(s) 05:47, Jon Subscripted <
jonsubscripti...@gmail.com> escribió:

> Hi everyone,
> I need to implement a dashboard and some charts in my webapp. And honestly
> I'm a little bit lost and overwhelmed.
>
> From a Web2py perspective which is the best approach?
> a) a python based solution (e.g. plotly)
> b) a JS based solution
>
> My app is hosted in Pythonanywhere.
>
> Is there any recommended dashboard and chart library for web2py?
> Thanks, Jon.
>
>
> 
>  Libre
> de virus. www.avast.com
> 
> <#m_2342288305175885681_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>
> --
> 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/CAK8tz30J5HwWqY8au9YzxTNd%3Dz9E3N%3D1xkdiM9ei1-XBDRsMJQ%40mail.gmail.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%2Bs%2BuJtKHC4smZzfA0u0mMdq95Xvw48sWD60%2BfYwpY03MzdyDw%40mail.gmail.com.


Re: [web2py] web2py docker container

2020-09-21 Thread Christian Varas
Thanks! Is really useful :)

El El lun, 21 de sep. de 2020 a la(s) 13:43, cabildocl 
escribió:

> Hello, I share with you the web2py docker container. include web2py,
> python3, nginx and gunicorn.
>
>
> https://hub.docker.com/r/cabildocl/web2py
>
>
>
>
>
>
>
> --
>
>
> 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/3cd625dc-24c5-4ef2-94d2-a6d147247db4n%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%2Bs%2BuJuksRYzih_HheF9S%3DoLkmp_J-BQ41pZUab9UXCNaFun2Q%40mail.gmail.com.


Re: [web2py] Re: WAF2PY 1.0

2020-08-05 Thread Christian Varas
I will port it to py4web :), is the next step.

I have a custom py4web app (non vuejs) managing sensors and gpio (relés) in
a raspberry pi, so I am already familiar with it :). Py4web is so fast and
good!

Cheers.
Chris,

El mié., 5 ago. 2020 a las 13:12, Massimo Di Pierro (<
massimo.dipie...@gmail.com>) escribió:

> Fantastic! we need to port this to py4web. ;-)
>
>
> On Monday, 3 August 2020 15:53:22 UTC-7, Christian Varas wrote:
>>
>> Thank you.
>>
>> I just tested on Debian 10, but it should work for any other OS as long
>> the dependencies are met.
>> The line “apt-get install **dependencies**” I’m the installation file
>> needs to adjusted for a non Debian based system.
>>
>> Cheers.
>> Chris.
>>
>>
>> El El lun, 3 de ago. de 2020 a la(s) 18:28, mostwanted <
>> godirao...@gmail.com> escribió:
>>
>>> Complements Chris, this is really impressive work. I see you have tested
>>> on debian is it platform specific or will it run on any OS?
>>>
>>> On Monday, August 3, 2020 at 8:25:23 AM UTC+2, Christian Varas wrote:
>>>>
>>>> Hello all.
>>>> I'm glad to announce  WAF2PY 1.0 🎉🎉🎊
>>>>
>>>> *What is this?*
>>>>
>>>> WAF2PY is a Web Application Firewall using NGINX and ModSecurity.
>>>> WAF2PY provides a nice and easy to use web interface *powered by*
>>>> *WEB2PY* that controls modsecurity and nginx configuration in an easy
>>>> way, allowing you to configure protection for any web application in just
>>>> minutes.
>>>>
>>>>
>>>>
>>>> *Features*
>>>>
>>>>- Protect a site in just minutes
>>>>- Create global or local exclusions for any rule
>>>>- Add virtual interfaces
>>>>- Create static routes for the desired app
>>>>- Analyze debug, access, error and audit logs
>>>>- Download logs
>>>>- Check the stats for every application
>>>>- Disable/Enable protection with just 1 click
>>>>- Enable/Disable rules
>>>>- Modify rules
>>>>- Restrict paths or files
>>>>- Insert headers
>>>>- Start/Stop/Reload/Check Syntax of NGINX
>>>>- CAPTCHA on login (Google Recaptcha2)
>>>>- Two-step Login Authentication (Email code)
>>>>- Written on Python3
>>>>
>>>>
>>>> *Images*
>>>>
>>>> https://photos.app.goo.gl/kXrsQTPPMuAXi8Tr5
>>>>
>>>> *Download*
>>>>
>>>> You can download WAF2PY from github:
>>>>  https://github.com/ITSec-Chile/Waf2Py
>>>> <https://github.com/ITSec-Chile/Waf2Py>
>>>>
>>>> *About this bundle*
>>>>
>>>> Tested in Debian 10 (No docker).
>>>>
>>>> *Components for this build:*
>>>>
>>>>- Waf2Py 1.0 App
>>>>- Web2Py 2.20.2
>>>>- Nginx version: openresty 1.17.6.2
>>>>- ModSecurity v3 - libmodsecurity3
>>>>- Modsecurity Nginx connector OWASP ModSecurity Core Rule Set (CRS)
>>>>3.3
>>>>
>>>>
>>>>
>>>> I know this can be off topic in this list, but web2py users may want to
>>>> have a look at it :)
>>>>
>>>>
>>>> Cheers.
>>>> Chris.
>>>>
>>> --
>>> 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/f7e4baa1-487f-4793-9d31-2c675609e893o%40googlegroups.com
>>> <https://groups.google.com/d/msgid/web2py/f7e4baa1-487f-4793-9d31-2c675609e893o%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>> --
> 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/7308fb83-3cca-45aa-9181-7d522aac7d85o%40googlegroups.com
> <https://groups.google.com/d/msgid/web2py/7308fb83-3cca-45aa-9181-7d522aac7d85o%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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%2Bs%2BuJt-RYNDPnK0NLLfAwaHE_jo35wwrUeio5DMPsU_%3DmsEbg%40mail.gmail.com.


Re: [web2py] Re: WAF2PY 1.0

2020-08-03 Thread Christian Varas
Thank you.

I just tested on Debian 10, but it should work for any other OS as long the
dependencies are met.
The line “apt-get install **dependencies**” I’m the installation file needs
to adjusted for a non Debian based system.

Cheers.
Chris.


El El lun, 3 de ago. de 2020 a la(s) 18:28, mostwanted 
escribió:

> Complements Chris, this is really impressive work. I see you have tested
> on debian is it platform specific or will it run on any OS?
>
> On Monday, August 3, 2020 at 8:25:23 AM UTC+2, Christian Varas wrote:
>>
>> Hello all.
>> I'm glad to announce  WAF2PY 1.0 🎉🎉🎊
>>
>> *What is this?*
>>
>> WAF2PY is a Web Application Firewall using NGINX and ModSecurity. WAF2PY
>> provides a nice and easy to use web interface *powered by* *WEB2PY* that
>> controls modsecurity and nginx configuration in an easy way, allowing you
>> to configure protection for any web application in just minutes.
>>
>>
>>
>> *Features*
>>
>>- Protect a site in just minutes
>>- Create global or local exclusions for any rule
>>- Add virtual interfaces
>>- Create static routes for the desired app
>>- Analyze debug, access, error and audit logs
>>- Download logs
>>- Check the stats for every application
>>- Disable/Enable protection with just 1 click
>>- Enable/Disable rules
>>- Modify rules
>>- Restrict paths or files
>>- Insert headers
>>- Start/Stop/Reload/Check Syntax of NGINX
>>- CAPTCHA on login (Google Recaptcha2)
>>- Two-step Login Authentication (Email code)
>>- Written on Python3
>>
>>
>> *Images*
>>
>> https://photos.app.goo.gl/kXrsQTPPMuAXi8Tr5
>>
>> *Download*
>>
>> You can download WAF2PY from github:
>>  https://github.com/ITSec-Chile/Waf2Py
>> <https://github.com/ITSec-Chile/Waf2Py>
>>
>> *About this bundle*
>>
>> Tested in Debian 10 (No docker).
>>
>> *Components for this build:*
>>
>>- Waf2Py 1.0 App
>>- Web2Py 2.20.2
>>- Nginx version: openresty 1.17.6.2
>>- ModSecurity v3 - libmodsecurity3
>>- Modsecurity Nginx connector OWASP ModSecurity Core Rule Set (CRS)
>>3.3
>>
>>
>>
>> I know this can be off topic in this list, but web2py users may want to
>> have a look at it :)
>>
>>
>> Cheers.
>> Chris.
>>
> --
> 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/f7e4baa1-487f-4793-9d31-2c675609e893o%40googlegroups.com
> <https://groups.google.com/d/msgid/web2py/f7e4baa1-487f-4793-9d31-2c675609e893o%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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%2Bs%2BuJuS4e6wkU%3DXX8oDGxS4T4G0RS9acDQiAo0xweG-iu0Z%2Bg%40mail.gmail.com.


[web2py] WAF2PY 1.0

2020-08-02 Thread Christian Varas
Hello all.
I'm glad to announce  WAF2PY 1.0 🎉🎉🎊

*What is this?*

WAF2PY is a Web Application Firewall using NGINX and ModSecurity. WAF2PY
provides a nice and easy to use web interface *powered by* *WEB2PY* that
controls modsecurity and nginx configuration in an easy way, allowing you
to configure protection for any web application in just minutes.



*Features*

   - Protect a site in just minutes
   - Create global or local exclusions for any rule
   - Add virtual interfaces
   - Create static routes for the desired app
   - Analyze debug, access, error and audit logs
   - Download logs
   - Check the stats for every application
   - Disable/Enable protection with just 1 click
   - Enable/Disable rules
   - Modify rules
   - Restrict paths or files
   - Insert headers
   - Start/Stop/Reload/Check Syntax of NGINX
   - CAPTCHA on login (Google Recaptcha2)
   - Two-step Login Authentication (Email code)
   - Written on Python3


*Images*

https://photos.app.goo.gl/kXrsQTPPMuAXi8Tr5

*Download*

You can download WAF2PY from github: https://github.com/ITSec-Chile/Waf2Py


*About this bundle*

Tested in Debian 10 (No docker).

*Components for this build:*

   - Waf2Py 1.0 App
   - Web2Py 2.20.2
   - Nginx version: openresty 1.17.6.2
   - ModSecurity v3 - libmodsecurity3
   - Modsecurity Nginx connector OWASP ModSecurity Core Rule Set (CRS) 3.3



I know this can be off topic in this list, but web2py users may want to
have a look at it :)


Cheers.
Chris.

-- 
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%2Bs%2BuJvbsBAkMPnVTqjGYaMYL_AqGbJ5M9NqUyC5m-AEBZLjSQ%40mail.gmail.com.


Re: [web2py] how do i escape some characters when saving to db

2020-07-12 Thread Christian Varas
You welcome, just keep in mind when you decode a value with XML() it might
be interpreted as HTML, and may lead to Cross Site Scripting (XSS) attacks.

If an user craft an input like #something”>

Re: [web2py] how do i escape some characters when saving to db

2020-07-12 Thread Christian Varas
Maybe you can try something like:

db.something.insert(str(XML(request.vars.somevalue, sanitize=True)))

I use this method to escape everything and convert all to string

Then in the view to see the values not encoded use: {{=XML(value)}}

Maybe helps

Cheers.

El El dom, 12 de jul. de 2020 a la(s) 10:53, Maurice Waka <
mauricew...@gmail.com> escribió:

> I have some strings in *request.vars* that I'm trying to save to db.
>
> An example is this : ["sure","iii!@#$%^&*()_"]. These strings/lists come
> from users in an natural language processing (NLP) app being used.
>
> For example in medical language a bone fracture represented as '#' instead
> of the whole noun, while 'and' used as '&'. These are commonly used
> characters that I can avoid to process.
>
> The problem is that when I check the DB, it does not save strings with
> characters after '#' and '&' characters e.g. 'abcdef!@#$%%%' being saved as
> 'abcdef!@' or in medical terms: "my patient recently had a # while jogging"
> is saved .. "my patient recently had a
>
> How can I make sure to save the whole string.
>
> Kind regards
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/web2py/f10fa835-ce3b-491f-a2b2-c057bf38cb5eo%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%2Bs%2BuJsC6EW%2Bw89x%2BeJ_RyZjYZwTJSJO-RoEqFrLouAs%2B0jqYw%40mail.gmail.com.


Re: [web2py] Security Issue??????

2020-07-09 Thread Christian Varas
Hi,

There is not much to worry about, they are just best practices, informational
or low issues. Except by CSRF but web2py already handle this

   - X-Frame-Options Header Not Set (15)

Prevent that your site is used under an iframe on another site. Depends of
the usage of the app

   - Cross-Domain JavaScript Source File Inclusion (2)

This is optional. Is not mandatory to have all the js in the same app.

   - Incomplete or No Cache-control and Pragma HTTP Header Set (26)

This header prevents the client from caching the response.

   - Server Leaks Information via "X-Powered-By" HTTP Response Header
   Field(s) (50)

It just discloses "web2py", like every other server header or technology.
Is easy to hide if necessary

   - X-Content-Type-Options Header Missing (48)

The HTTP 'X-Content-Type-Options' response header prevents the browser from
MIME-sniffing a response away from the declared content-type when. This
allows older versions of Internet Explorer and Chrome to perform
MIME-sniffing on the response body, potentially causing the response body
to be interpreted and displayed as a content type other than the intended
content type.


   - Absence of Anti-CSRF Tokens (13)

All forms from web2py have an unique token to prevent this and also double
submission.
http://web2py.com/books/default/chapter/29/01/introduction#Security

Anyway... all of this headers misconfiguration are classified as best
practices, informational or low issues. Only csrf could be taken as medium
or high issue, but web2py handles this.

You can handle the headers at server (apache/nginx) level or at the
application level.

Cheers!

El El jue, 9 de jul. de 2020 a la(s) 09:42, mikel...@gmail.com <
mikele@gmail.com> escribió:

> Hi, in this days I'm acting pen-test on my web2py application, all tools
> used report me that there're some "important"  header are missing..
> In particular:
>
>- X-Frame-Options Header Not Set (15)
>- Cross-Domain JavaScript Source File Inclusion (2)
>- Incomplete or No Cache-control and Pragma HTTP Header Set (26)
>- Server Leaks Information via "X-Powered-By" HTTP Response Header
>Field(s) (50)
>- X-Content-Type-Options Header Missing (48)
>
> End also:
>
>- Absence of Anti-CSRF Tokens (13)
>
> Where's the mistake?
> There's a security Issue???
>
> BR
>
> MS
>
> --
> 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/55974bec-0b1a-4c30-affe-f3fe2d162d64n%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%2Bs%2BuJub1BLTQo55Tv-YLz7AkCBPvf-o_t2Uws5yHS5Xq-J8uQ%40mail.gmail.com.


Re: [web2py] CON Abandoned framework with (almost) no community

2020-05-17 Thread Christian Varas
In my opinion the comparative is just crap :)

Cheers.

El El dom, 17 de may. de 2020 a la(s) 17:10, António Ramos <
ramstei...@gmail.com> escribió:

> How is that possible ?
> https://www.slant.co/versus/1397/1746/~web2py_vs_django
> I´m here and many others are here...
> Who is trying to make us look like dead people ??
>
> Regards to you all :)
>
> --
> 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/CAEM0BxPiBP5fh3uzUZMx2rtV44x%2BRoLet7UKogjsx5JixmdKug%40mail.gmail.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%2Bs%2BuJvfuaCEL%3DEQLY2m4mTmMKknk83JAfjG3%3DNte4E%2BJD2hFA%40mail.gmail.com.


Re: [web2py] Re: How to customize "Invalid function/someview" ?

2020-04-30 Thread Christian Varas
Thanks for the help!

Now I have a custom 40x error pages :)

Cheers.
Chris.


El jue., 30 abr. 2020 a las 5:13, 'Annet' via web2py-users (<
web2py@googlegroups.com>) escribió:

> I think routes_onerror = [] in routes.py is whar you're
> looking for:
>
> routes_onerror = [
>,(r'*/404', r'/handler/default/on_404_error')
>,(r'*/*', r'/handler/default/onerror')
> ]
>
> Kind regards,
>
> Annet
>
> --
> 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/0c7cfbd8-9a1f-4f07-ae3e-b23c9731a038%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%2Bs%2BuJs0W-7kf6vgWLSgd%2BjycwCmjBQCa9m4kgE4aM4Ai%3D0nhQ%40mail.gmail.com.


Re: [web2py] Pack a big app

2020-04-27 Thread Christian Varas
Hi,

To transfer big apps, I do the following: Go to "applications" folder in
web2py of serverv1, then zip your app,  then move it through SSH or other
method to the new server, and place it in the "applications" folder of
web2py of server 2. Reload routes in web2py admin app. I haven't
experienced troubles with this method.


Cheers.

El lun., 27 abr. 2020 a las 11:29, L c () escribió:

> Hello,
>
> I would like to transfer an app from server 1 to server 2 (size of the app
> 700Mb)
> first test : try to pack to build a w2p package --> internal error  (it
> works for app 400 Mb)
> Second test : i create a tar from server 1 and i transfer to server 2 -->
> the app tells me no function (note that she works very well on server 1)
>
> Server 1 : debian jessie
> Server 2 : debian buster
>
> Any idea ?
>
> thank you very much
>
> --
> 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/ccaf7e88-5332-473d-bc2b-b2c2e6ee8933%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%2Bs%2BuJvcBFgkCZEh2waf2WA4zOhQz3w6Gn%3DyQqcnzw485oOjzQ%40mail.gmail.com.


Re: [web2py] Android and ios aops

2020-04-24 Thread Christian Varas
Hi, i did this in android some years ago, you can run web2py using SL4A and
installing the python package, then you have to move the web2py folder into
the SL4A folder and run the web2py with no GUI.
Other option could be Termux, is more easy, you can install packages with
like “apt install python”, download web2py with wget or curl and then run
web2py, (I haven’t tried this but i think it should  work)
And you don’t need to be root for this.
For making an apk, I don’t have idea 🤷‍♂️

Cheers.
Chris.


El El vie, 24 de abr. de 2020 a la(s) 06:45, Maurice Waka <
mauricew...@gmail.com> escribió:

> Just following on this discussion :
>
>
> "Can we use a web2py app on Android mobile? - Google Groups"
> https://groups.google.com/forum/m/#!topic/web2py/1ZxFEB5j4XA
>
> Anyone who has latest information on creating a download able app?
>
> --
> 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/c412427f-d694-4ba8-beca-98f2d5090464%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%2Bs%2BuJv87xbQB_HcR4n_g_grtHVO%3DTOVXFyLvHgFyesHYkPgFg%40mail.gmail.com.


Re: [web2py] Which 4 or 2?

2020-04-17 Thread Christian Varas
Hi,

I think is better to start with *web2py*, is easy to learn and I believe
that fit better to your site, py4web is really good and more faster, but in
web2py you have more tools to do things.
The transition after from web2py to py4web is not difficult.

Cheers.
Chris.

El vie., 17 abr. 2020 a las 16:02, David Swarbrick ()
escribió:

> I have a UK case law database presently viewable at swarb.co.uk. The
> output is via WordPress. In better times we have had over 30k page views in
> a day. Presently I maintain it entirely using an ancient MS Access
> database.
> I need to move to a point where I have a sustainable and up to date
> editing. All that is local at the moment, and SQLite seems an appropriate
> starting point. W2P and P4W seem to offer ideal ways forward. I am a
> retired lawyer with some historic programming skills, not a developer. I
> tend to find modern programming documentation dense, and most of my time
> and attention has to go on content.
>
> Is P4W ready yet for a dumbo?  Is there an obvious transition from W2P to
> p4W?
>
> Where do I start?
>
> In any event, congratulations and thank yu.
>
>
>
> --
> 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/702249ab-643c-496c-8a91-2db2ae775ab6%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%2Bs%2BuJuSofme-2p4SqP2erjCivhWgdCR-t0ocFeU7MYiJgvDyg%40mail.gmail.com.


Re: [web2py] Re: many users logged in, at the same time.

2020-04-09 Thread Christian Varas
You can try:

Apache benchmark
Load impact (free account)
Blazemeter (free account)

Cheers.

El El jue, 9 de abr. de 2020 a la(s) 17:44, Dave S 
escribió:

>
>
> On Thursday, April 9, 2020 at 4:10:21 AM UTC-7, Wep2buy wrote:
>>
>> Hi every body:
>>
>> how can i test an app (like chat) from my desktop
>>
>> many users logged in, at the same time.
>>
>> I mean that i don't want to login and the logout , for each user.
>>
>> Any help is highly appreciated.
>>
>
> There are websites for that sort of testing ... they have a farm of
> clients that you script.  Some have been mentioned here in the past, and I
> probably still have a book mark for one done by the blogger who uses "cat"
> in his blog name (big help, I know).
>
> You could also maybe do something with curl in a script.
>
> /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/b88e237f-b3c7-4cb3-9eff-365e57332f6a%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%2Bs%2BuJviOmvBPbC-LuVXKHYvQcLx3M1_NHgYbKJKBQUt23tTdw%40mail.gmail.com.


Re: [web2py] web2py 2.19.1 is OUT

2020-03-21 Thread Christian Varas
Thanks! 🎉🎉🎉🎊

El El sáb, 21 de mar. de 2020 a la(s) 18:52, Massimo Di Pierro <
massimo.dipie...@gmail.com> escribió:

> Sorry it took so long.
>
> Web2py 2.19.1 is finally out.
>
> It contains many small bug fixes including better support for python 3.6,
> 3.7, and 3.8
>
> https://travis-ci.org/github/web2py/web2py
>
> --
> 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/c432d75b-bfdc-414c-b110-f6e7bfc0265d%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%2Bs%2BuJsMSc4GhYHR9VpsJycKAdCzSr8vQK30WwBPmJOLQg2BLA%40mail.gmail.com.


Re: [web2py] Re: Py4Web "tags" should be SCOPES

2020-02-26 Thread Christian Varas
About the signed URLs, is already implemented on this pull request
https://github.com/web2py/py4web/pull/114
I haven’t tried yet.

Cheers.

El El mié, 26 de feb. de 2020 a la(s) 13:33, villas 
escribió:

> Hi Kevin
>
> JWT seems to have everything we might need,  although I am not
> knowledgable enough to really help in implementing it.
>
> However, perhaps you know whether there is a *documented way for py4web
> to generate and verify signed urls?*  (Hopefully with expiry).
> If at least that mechanism existed,  I would be able to start writing the
> app I have in mind,  without having to invent my own method.
>
> Thanks for your efforts in trying to create JWT funcionality!
>
>
>
>
>
>
> --
> 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/dc6d8b74-e684-4365-b75e-563c384d7c9a%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%2Bs%2BuJt8wyXsSnYa_LgDehnN6b_9odTiH9BzT6mJyCuuEEM-Qg%40mail.gmail.com.


Re: [web2py] Re: LOAD in py4web

2020-02-25 Thread Christian Varas
I think it can be usefull if you use another template not based in vue.

Cheers.

El El lun, 24 de feb. de 2020 a la(s) 03:31, Massimo Di Pierro <
massimo.dipie...@gmail.com> escribió:

> We can add it in utils. But before we do. Do other peopl find it useful?
> Is that a pattern we should encourage vs, for example, vue.js?
>
> On Sunday, 23 February 2020 10:18:51 UTC-8, RHC wrote:
>>
>> HI,
>>
>> I am beginning to experiment with py4web, I like the sound of it and I am
>> looking to convert a web2py project to py4web to see how they compare.
>>
>> It appears that the LOAD (helper?) that was available in web2py templates
>> is not available in py4web. I was using this to populate part of a web
>> page, I liked the way you had the option to use LOAD to call a separate URL
>> (within the same app) and insert the result into your page before returning
>> the page to the client.
>>
>> What is the reason for the absence of LOAD in py4web? is there a
>> recommended alternative method of achieving the same effect? I have used a
>> mixture of ajax=True and ajax=False options for this feature.
>>
>> Thanks,
>>
>> Richard.
>>
>
>> --
> 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/7cfaf6be-8be3-41dc-8745-ab59716f68af%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%2Bs%2BuJsTJwf1sw%3D-oR4MyZqVhyDcjkn-xYaQA-fbHyBAXyb%2Bqw%40mail.gmail.com.


Re: [web2py] py4web issue on get requests

2020-02-22 Thread Christian Varas
Hi Torrini,

I don’t know what is causing the error but you can use a local proxy like
burp suite to catch your client request and see what’s wrong with that
request. If is malformed you can see with with this.

Cheers.

El El sáb, 22 de feb. de 2020 a la(s) 01:38, Edoardo Torrini <
edoardo.torr...@gmail.com> escribió:

> Good morning,
>
> I am a software developer and I want to create a project client-server.
> The client is wrote in c# with xamarine and the server on py4web.
> The client create request with some parameters and the server reply with a
> data in json form.
> I use celery for scheduling the request and I create a task for each type
> of requests.
>
> When with the client application I create a request [like the example
> below], the function await.response.Content.ReadAsStringAsync create an
> exception: *unexpected end of stream*
>
> [image: Exception - Xamarine.png]
>
>
> Server side the situation is that I create for each request a DAL and I
> define a table where I took the date to send to the client.
> in this way:
> [image: Controller - py4web.png]
>
> I invoke  the task that reply the json file to the client in this way:
>
> [image: task prd - py4web.png]
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> Someone know why the operation create this type of exception, I try using
> a request with chrome but the page was displayed correctly.
> Thanks for the help.
>
> Edoardo Torrini
>
>
>
>
> --
> 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/a25df1ac-50b3-4033-a661-374577da6281%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%2Bs%2BuJtGtB6AQxAq6C9rDU%3D7vS1s4Jy1%3Df84AmicV2KL%3DXDYwQ%40mail.gmail.com.


Re: [web2py] list index out of range when removing some fields in SQLFORM.grid & clicking the remaining button

2020-02-15 Thread Christian Varas
i’m quite sure that exist a switch like “searchable=False” to disable the
search field.
Usually I get this error when the attribute on sqlform that I’m trying to
modified does not exist, maybe check the correct Index of the list.


Cheers.

El El sáb, 15 de feb. de 2020 a la(s) 17:13, mostwanted <
godirao...@gmail.com> escribió:

> I am facing a little challenge here, I was able to remove some fields as I
> wanted from the SQLFORM.grid because I just wanted to use it Edit field
> alone & so i wanted it alone to be visible.
>
> grid = SQLFORM.grid(db.professionalsummary.posted_by==user.id, editable=
> True, deletable=False, user_signature=True,create=False, details=False,
>  exportclasses=dict(export=False, xml=False, html=False, json=False, csv=
> False, tsv=False, tsv_with_hidden_cols=False, csv_with_hidden_cols=False))
> grid[0][1][0][0] = ' ' #remove search field
> #grid[0][1][0][1] = '' #remove search button
> grid[0][1][0][2] = '' #remove clear button
> ..
> ..
>
> But now when I click on the edit button for the field I want to edit I get
> an error:
>
>  list index out of range
>
> Whats causing this error & how can I fix it??
>
> Regards;
>
> Mostwanted
>
> --
> 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/001f952f-9839-483c-af11-9534c403f731%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%2Bs%2BuJvo9riG5Bihy6y1C4LHK%2BAVpg2Y5dUmYEQPLfQBCT25YA%40mail.gmail.com.


Re: [web2py] webp2y XML helper sanitize line breaks under python3.6

2020-02-13 Thread Christian Varas
Great!

El El jue, 13 de feb. de 2020 a la(s) 09:22, Clemens <
clemens.odend...@claret-clover.de> escribió:

> Tim Nyborg has got the solution:
> It's a bug in yatl/sanitizer.py, which can be fixed as described:
>
> https://stackoverflow.com/questions/60176267/webp2y-xml-helper-sanitize-line-breaks-under-python3
>
> Thanks Tim!
>
> On Wednesday, February 12, 2020 at 5:17:31 PM UTC+1, Clemens wrote:
>>
>> Hi Chris,
>>
>> thanks a lot for your help! But the problem still exists even replacing
>> my str_replace routine by str.replace() as proposed by you. Yes, I had the
>> same problem with line breaks crashing the view. And replacing the line
>> breaks by 
 fixed it. But switching form python 2.7 to 3.6 raises the
>> new problem that the sanitizer can't process 
-coded line breaks.
>> Without sanitize=True (i.e. False by default) it also works with python
>> 3.6. But sanitize=True doesn't work for 
-coded line breaks under
>> python 3.6. And this is the case only for line breaks, all other special
>> character are no problem.
>>
>> I really think, that the XML sanitizer under python 3.6 is the problem.
>> Do you have an idea for a work around except of eliminating all line
>> breaks, cause I can't do this?
>>
>> Best regards
>> Clemens
>>
>>
>> On Wednesday, February 12, 2020 at 4:42:53 PM UTC+1, Christian Varas
>> wrote:
>>>
>>> Hi Clemens,
>>>
>>> Replace can handle big text it does not matter if is 1 - 1000 lines or
>>> more, It will replace all the occurrences in the text, also is faster.
>>> chaining "replace" is more faster than other methods.
>>>
>>> description = his_item.description.replace("\n","
").replace("\r","
>>> 
").replace("<","<").replace(">",">")
>>> XML(description, sanitize=True)
>>>
>>> or in one line
>>>
>>> XML(his_item.description.replace("\n","
").replace("\r","
")
>>> .replace("<","<").replace(">",">"), sanitize=True)
>>>
>>>
>>> A(this_item.title, \
>>>   callback = URL('item', 'select', \
>>>  vars=dict(uuid=this_item.uuid), user_signature=True), \
>>>   _title=XML(his_item.description.replace("\n","
").replace("\r","
>>> 
").replace("<","<").replace(">",">"), sanitize=True)
>>>
>>> I had this issue with line breaks and XML helper also, the input
>>> containing line breaks was breaking my view, and replacing the bad
>>> characters before pass it to the helper fixed my problem.
>>>
>>> Try in a console with a custom text and see the results.
>>>
>>> Hope this helps
>>> Cheers.
>>> Chris.
>>>
>>> El mié., 12 feb. 2020 a las 10:08, Clemens ()
>>> escribió:
>>>
>>>> Hello Chris,
>>>>
>>>> thanks for your answer! But just kicking out all line breaks is a
>>>> little harsh, since in my case the description is mostly a few lines long
>>>> with 2 or 3 paragraphs. And I had the problem already solved by this
>>>> procedure and the call as described in my question:
>>>>
>>>> def str_replace(string, replacement_dict):
>>>>> if not isinstance(string, str):
>>>>> string = str(string)
>>>>> pattern = re.compile('|'.join([re.escape(k) for k in
>>>>> list(replacement_dict.keys())]), re.M)
>>>>> return pattern.sub(lambda x: replacement_dict[x.group(0)], string)
>>>>>
>>>>
>>>> And this solution worked very well with python 2.7, having even line
>>>> breaks in link titles. Then I moved to python 3.6 and the problem was
>>>> there. Thus, I think, that the XML sanitizer under Python 3.6 is the
>>>> problem, since it can't handle 
>>>>
>>>> Do you have any other ideas?
>>>>
>>>> Best regards
>>>> Clemens
>>>>
>>>>
>>>> On Wednesday, February 12, 2020 at 12:08:17 PM UTC+1, Christian Varas
>>>> wrote:
>>>>>
>>>>> I had an issue with line breaks too, I remove lie breaks like this
>>>>> with python 3.7
>>>>>
>>>>> some_string = s

Re: [web2py] webp2y XML helper sanitize line breaks under python3.6

2020-02-12 Thread Christian Varas
Hi Clemens,

Replace can handle big text it does not matter if is 1 - 1000 lines or
more, It will replace all the occurrences in the text, also is faster.
chaining "replace" is more faster than other methods.

description = his_item.description.replace("\n","
").replace("\r","
").replace("<","<").replace(">",">")
XML(description, sanitize=True)

or in one line

XML(his_item.description.replace("\n","
").replace("\r","
")
.replace("<","<").replace(">",">"), sanitize=True)


A(this_item.title, \
  callback = URL('item', 'select', \
 vars=dict(uuid=this_item.uuid), user_signature=True), \
  _title=XML(his_item.description.replace("\n","
").replace("\r","
").replace("<","<").replace(">",">"), sanitize=True)

I had this issue with line breaks and XML helper also, the input containing
line breaks was breaking my view, and replacing the bad characters before
pass it to the helper fixed my problem.

Try in a console with a custom text and see the results.

Hope this helps
Cheers.
Chris.

El mié., 12 feb. 2020 a las 10:08, Clemens (<
clemens.odend...@claret-clover.de>) escribió:

> Hello Chris,
>
> thanks for your answer! But just kicking out all line breaks is a little
> harsh, since in my case the description is mostly a few lines long with 2
> or 3 paragraphs. And I had the problem already solved by this procedure and
> the call as described in my question:
>
> def str_replace(string, replacement_dict):
>> if not isinstance(string, str):
>> string = str(string)
>> pattern = re.compile('|'.join([re.escape(k) for k in
>> list(replacement_dict.keys())]), re.M)
>> return pattern.sub(lambda x: replacement_dict[x.group(0)], string)
>>
>
> And this solution worked very well with python 2.7, having even line
> breaks in link titles. Then I moved to python 3.6 and the problem was
> there. Thus, I think, that the XML sanitizer under Python 3.6 is the
> problem, since it can't handle 
>
> Do you have any other ideas?
>
> Best regards
> Clemens
>
>
> On Wednesday, February 12, 2020 at 12:08:17 PM UTC+1, Christian Varas
> wrote:
>>
>> I had an issue with line breaks too, I remove lie breaks like this with
>> python 3.7
>>
>> some_string = some_string.replace(“\n”, ””).replace(“\r”, ””)
>>
>> XML(some_string, sanitize=True)
>>
>> Cheers
>> Chris
>>
>> El El mié, 12 de feb. de 2020 a la(s) 04:37, Clemens <
>> clemens...@claret-clover.de> escribió:
>>
>>> Hello!
>>>
>>> In my web2py app I’m processing a list of items, where the user can
>>> click on a link for each item to select this. An item has an UUID, a title
>>> and a description. For a better orientation the item description is also
>>> displayed as link title. To prevent injections by and to escape tags in the
>>> description I’m using the XML sanitizer as follows:
>>>
>>> A(this_item.title, \
>>>   callback = URL('item', 'select', \
>>>  vars=dict(uuid=this_item.uuid), user_signature=True), \
>>>   _title=XML(str_replace(this_item.description, {'\r\n':'
',
>>> '<':'<', '>':'>'}), sanitize=True))
>>>
>>> Using Python 2.7 everything was fine. Since I have switched to Python
>>> 3.6 I have the following problem. When the description contains line breaks
>>> the sanitizer is not working anymore. For example the following string
>>> produces by my str_replace routine is fine to be sanitized by the XML
>>> helper under Python 2.7 but not under Python 3.6:
>>>
>>> Header

Line1
Line2
Line3
>>>>
>>>
>>> Sanitizing line breaks escaped by 
 is the problem with Python 3
>>> (but not with Python 2). Everything else is no problem for the XML helper
>>> to sanitize (e.g. less than or greater than, I need these, since if there
>>> is no description it is generated as ).
>>>
>>> How can be line breaks sanitized by the XML helper running web2py under
>>> Python3?
>>>
>>> Thanks for any support!
>>>
>>> Best regards Clemens
>>> 
>>>
>>> --
>>> Resources:
>>> - http://web2py.com
>>> - http://web2py.com/book (Documentation)
>>> - http://github.com/web2py/web2py 

Re: [web2py] webp2y XML helper sanitize line breaks under python3.6

2020-02-12 Thread Christian Varas
I had an issue with line breaks too, I remove lie breaks like this with
python 3.7

some_string = some_string.replace(“\n”, ””).replace(“\r”, ””)

XML(some_string, sanitize=True)

Cheers
Chris

El El mié, 12 de feb. de 2020 a la(s) 04:37, Clemens <
clemens.odend...@claret-clover.de> escribió:

> Hello!
>
> In my web2py app I’m processing a list of items, where the user can click
> on a link for each item to select this. An item has an UUID, a title and a
> description. For a better orientation the item description is also
> displayed as link title. To prevent injections by and to escape tags in the
> description I’m using the XML sanitizer as follows:
>
> A(this_item.title, \
>   callback = URL('item', 'select', \
>  vars=dict(uuid=this_item.uuid), user_signature=True), \
>   _title=XML(str_replace(this_item.description, {'\r\n':'
',
> '<':'<', '>':'>'}), sanitize=True))
>
> Using Python 2.7 everything was fine. Since I have switched to Python 3.6
> I have the following problem. When the description contains line breaks the
> sanitizer is not working anymore. For example the following string produces
> by my str_replace routine is fine to be sanitized by the XML helper under
> Python 2.7 but not under Python 3.6:
>
> Header

Line1
Line2
Line3
>>
>
> Sanitizing line breaks escaped by 
 is the problem with Python 3 (but
> not with Python 2). Everything else is no problem for the XML helper to
> sanitize (e.g. less than or greater than, I need these, since if there is
> no description it is generated as ).
>
> How can be line breaks sanitized by the XML helper running web2py under
> Python3?
>
> Thanks for any support!
>
> Best regards Clemens
> 
>
> --
> 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/319d22e0-d1be-452c-8c25-d1ec76df1a5e%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%2Bs%2BuJuw-nsFkRiXaeiC6JmJ%2B-gFwN3E5MTSzZLTp%2ByL0btQ3g%40mail.gmail.com.


Re: [web2py] Raspberry pi cannot connect to postgreSQL

2020-02-06 Thread Christian Varas
Hi, looks like the problem is the password...
The error says:

FATAL:  password authentication failed for user "posgres


Doble check the password for the user, try to connect manually to pg to
ensure you have the correct password. If password is ok, maybe is a bug or
something else, I think I saw a issue like this in older mails.

Cheers.

El El jue, 6 de feb. de 2020 a la(s) 08:01, 'Annet' via web2py-users <
web2py@googlegroups.com> escribió:

> I just installed psycopg2 to connect to my PostgreSQl database
> on Raspberry Pi 4. When starting web2py I get the following error
> ticket:
>
>
> Traceback (most recent call last):
>   File "/home/pi/web2py/gluon/restricted.py", line 227, in restricted
> exec ccode in environment
>   File "/home/pi/web2py/applications/init/models/00_init_db.py" 
> , line 
> 42, in 
> ignore_field_case = myconf.get('db.ignore_field_case'))
>   File "/home/pi/web2py/gluon/packages/dal/pydal/base.py", line 174, in 
> __call__
> obj = super(MetaDAL, cls).__call__(*args, **kwargs)
>   File "/home/pi/web2py/gluon/packages/dal/pydal/base.py", line 473, in 
> __init__
> "Failure to connect, tried %d times:\n%s" % (attempts, tb)
> RuntimeError: Failure to connect, tried 5 times:
> Traceback (most recent call last):
>   File "/home/pi/web2py/gluon/packages/dal/pydal/base.py", line 446, in 
> __init__
> self._adapter = ADAPTERS[self._dbname](**kwargs)
>   File "/home/pi/web2py/gluon/packages/dal/pydal/adapters/base.py", line 60, 
> in __call__
> obj = super(AdapterMeta, cls).__call__(*args, **kwargs)
>   File "/home/pi/web2py/gluon/packages/dal/pydal/adapters/postgres.py", line 
> 155, in __init__
> self.reconnect()
>   File "/home/pi/web2py/gluon/packages/dal/pydal/connection.py", line 104, in 
> reconnect
> self.connection = f()
>   File "/home/pi/web2py/gluon/packages/dal/pydal/adapters/postgres.py", line 
> 152, in connector
> return self.driver.connect(**driver_args)
>   File "/usr/local/lib/python2.7/dist-packages/psycopg2/__init__.py", line 
> 126, in connect
> conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
> OperationalError: FATAL:  password authentication failed for user "posgres"
> FATAL:  password authentication failed for user "posgres"
>
>
>
> This is the connection string:
>
> uri   = postgres://posgres:password@localhost:5432/database_name
>
>
> Kind regards,
>
> Annet
>
> --
> 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/c677044e-7bc0-432b-a700-0af961ebfc82%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%2Bs%2BuJua4GDongnHtTo3Q-kVc9rS-5tsQK7CpQBKQTNJN%3D1LuA%40mail.gmail.com.


Re: [web2py] py4web in Google App Engine route app

2020-02-04 Thread Christian Varas
Hi I haven’t tried GAE but maybe is the controller.

Are you using the decorator ’action()’ to expose the function ?.

Ex:
@action('some_name')
def some_function():

  return locals()

Then you acces like http://IP/your_app/some_name

Cheers.
Chris.

El El mar, 4 de feb. de 2020 a la(s) 15:46, Jacinto Parga 
escribió:

> I cannot properly deploy a simple py4web app in GAE. I think it's just a
> .gcloudignore or a app.yaml configuration issue. The only thing I've got is
> a not found page.
>
> [image: minimal-py4web.png]
>
> Some help about how to route the right app in the google app engine?
>
> Thanks
>
>
>
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/web2py/a7ba6f1c-2c53-4f30-8197-9c0b51d3229d%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%2Bs%2BuJtjDF5iq78NtUcd%3DLT_ax3pL50aX69CYbYmMtYoj4cHzg%40mail.gmail.com.


Re: [web2py] Re: Web2py or py4web for a brand new project

2020-01-23 Thread Christian Varas
Hi Jim.

Yes I'm using the auth system permission.
I'm using 2 decorators in fact
@auth.requires_membership() and @auth.requires_login()

I'm gonna port my app to py4web then :)

Thanks

Cheers.
Chris

El jue., 23 de ene. de 2020 11:27, Jim Steil  escribió:

> Sounds like a great app to do in py4web.
>
>1. You are already comfortable with javascript.
>2. You're not using grid/smartgrid.
>3. Are you using the web2py auth system with permissions?  If only
>using groups (roles) then this would be great to do with py4web.
>4. Much faster and you get to use Python3.
>
> -Jim
>
>
> On Thu, Jan 23, 2020 at 6:44 AM Christian Varas 
> wrote:
>
>> Thanks for all that you share guys.
>>
>> I would like to ask for a recommendation.
>>
>> I have a web interface made with web2py, this interface manage a web
>> application firewall (nginx and modsecurity). It does commands and file
>> modifications in the system to manage properly the WAF, the database is
>> SQLite.
>> I don't use sqlform.grid, most of the things in the view are made with
>> pure JavaScript and Html, and all the commands to the system are with
>> subprocess.
>> Works pretty fast and without any issue.
>>
>> My question is if py4web is ok to do this tasks too, like editing files
>> in system, executing commands and task more oriented to the system and not
>> to a db.
>>
>>
>> Now I have to a small adpatation to my app because modsecurity has a new
>> version and they changed some things, and I was thinking that maybe I can
>> port all to py4web and have a fresh new start, but I'm not sure..., I love
>> web2py and now is easy to me to do things with him.
>>
>> Should I stay in web2py?
>> Or I should start using py4web for this kind of project?
>>
>> Cheers!
>> Chris.
>>
>>
>> El mié., 22 de ene. de 2020 20:29, Carlos Costa 
>> escribió:
>>
>>> Thanks for sharing you experience with py4web, Jim.
>>>
>>>
>>> Em qua., 22 de jan. de 2020 às 20:04, Kevin Keller 
>>> escreveu:
>>>
>>>> The datatables integration for web2py would be super useful. I'm sure
>>>> we could port it over to py4web easily.
>>>>
>>>> I just feel like with all the stuff web2py gave us to get something
>>>> quickly going missing, it'd just another api framework and there are
>>>> fastapi and apistar as well falcon out..
>>>>
>>>> I think having these ease of use stuff back would really hit home and
>>>> would also make it easier to port from web2py.
>>>>
>>>> And we would be pretty much the Jhipster  of the python world no?
>>>>
>>>>
>>>>
>>>> On Wed, 22 Jan 2020, 23:50 Jim S,  wrote:
>>>>
>>>>> Yes, I will post my main utils.py when I have it working better.  I
>>>>> still have to clean up a couple pieces.  It would be up to Massimo if he
>>>>> wanted to add it.  But in response to one of my earlier questions I was
>>>>> told Massimo kept a utility like this out of py4web so people might use
>>>>> better tools like datatables.  And, I doubt my code is 'framework-ready'.
>>>>> But it could give others insight into how you can work with py4web.
>>>>>
>>>>> Speaking of datatables, I wrote a datatables integration for web2py
>>>>> last summer.  I think I could also add that to my utils.py pretty easily.
>>>>> Actually, the datatables piece would be easier that what I've done writing
>>>>> my own.  Would you use datatables for complete CRUD, or just to list your
>>>>> table for record selection, etc.?
>>>>>
>>>>> Now that you mentioned mtable, I too recall hearing that before, but
>>>>> haven't gotten in to it at all.  Like I said, I haven't jumped in to the
>>>>> client-side javascript much yet, other than jquery.
>>>>>
>>>>> -Jim
>>>>>
>>>>> On Wednesday, January 22, 2020 at 4:31:11 PM UTC-6, Kevin Keller wrote:
>>>>>>
>>>>>> Jim,
>>>>>>
>>>>>> Could your helpers be considered to be added to thr py4web code base?
>>>>>>
>>>>>> If you say you have a sqlform.grid equivalent or something in that
>>>>>> direction?
>>>>>>
>>>>>> I think there was mtable that should take the spot, b

Re: [web2py] Re: Web2py or py4web for a brand new project

2020-01-23 Thread Christian Varas
Thanks for all that you share guys.

I would like to ask for a recommendation.

I have a web interface made with web2py, this interface manage a web
application firewall (nginx and modsecurity). It does commands and file
modifications in the system to manage properly the WAF, the database is
SQLite.
I don't use sqlform.grid, most of the things in the view are made with pure
JavaScript and Html, and all the commands to the system are with subprocess.
Works pretty fast and without any issue.

My question is if py4web is ok to do this tasks too, like editing files in
system, executing commands and task more oriented to the system and not to
a db.


Now I have to a small adpatation to my app because modsecurity has a new
version and they changed some things, and I was thinking that maybe I can
port all to py4web and have a fresh new start, but I'm not sure..., I love
web2py and now is easy to me to do things with him.

Should I stay in web2py?
Or I should start using py4web for this kind of project?

Cheers!
Chris.


El mié., 22 de ene. de 2020 20:29, Carlos Costa 
escribió:

> Thanks for sharing you experience with py4web, Jim.
>
>
> Em qua., 22 de jan. de 2020 às 20:04, Kevin Keller 
> escreveu:
>
>> The datatables integration for web2py would be super useful. I'm sure we
>> could port it over to py4web easily.
>>
>> I just feel like with all the stuff web2py gave us to get something
>> quickly going missing, it'd just another api framework and there are
>> fastapi and apistar as well falcon out..
>>
>> I think having these ease of use stuff back would really hit home and
>> would also make it easier to port from web2py.
>>
>> And we would be pretty much the Jhipster  of the python world no?
>>
>>
>>
>> On Wed, 22 Jan 2020, 23:50 Jim S,  wrote:
>>
>>> Yes, I will post my main utils.py when I have it working better.  I
>>> still have to clean up a couple pieces.  It would be up to Massimo if he
>>> wanted to add it.  But in response to one of my earlier questions I was
>>> told Massimo kept a utility like this out of py4web so people might use
>>> better tools like datatables.  And, I doubt my code is 'framework-ready'.
>>> But it could give others insight into how you can work with py4web.
>>>
>>> Speaking of datatables, I wrote a datatables integration for web2py last
>>> summer.  I think I could also add that to my utils.py pretty easily.
>>> Actually, the datatables piece would be easier that what I've done writing
>>> my own.  Would you use datatables for complete CRUD, or just to list your
>>> table for record selection, etc.?
>>>
>>> Now that you mentioned mtable, I too recall hearing that before, but
>>> haven't gotten in to it at all.  Like I said, I haven't jumped in to the
>>> client-side javascript much yet, other than jquery.
>>>
>>> -Jim
>>>
>>> On Wednesday, January 22, 2020 at 4:31:11 PM UTC-6, Kevin Keller wrote:

 Jim,

 Could your helpers be considered to be added to thr py4web code base?

 If you say you have a sqlform.grid equivalent or something in that
 direction?

 I think there was mtable that should take the spot, but haven't seen
 any examples yet or at least none thst would replace a sqlform or
 smartgrid.

 If it is not coming I would probaly consider using datatables js in the
 future.




 On Wed, 22 Jan 2020, 21:47 Jim S,  wrote:

> For me, there is no porting, it is re-writing.  While a lot of the
> capabilities are there in py4web not all are part of py4web.  Due to the
> nature of how things work, a lot of the 'global' structures in web2py have
> to be handled differently in py4web.
>
> SQLFORM.grid is gone.  FORM replaces SQLFORM but doesn't have all the
> features -
> https://py4web.com/_documentation/static/index.html#chapter-10
> auth_group and auth_membership and auth_permission are gone -
> authentication/authorization have changed -
> https://py4web.com/_documentation/static/index.html#chapter-11
>
> With those things being what they are, I've been playing with py4web
> for a few days now and really am liking it.  It is crazy fast.  You may
> have to write some more helpers to do some things that web2py did for you,
> but that's half the fun, isn't it?  For instance, I used the grid that
> web2py's SQLFORM.grid provides for lots of listing pages.  py4web doesn't
> have one so I've written a helper that displays  pages the way my app 
> wants
> to see them.
>
> I believe py4web is going to make it easier to use Vue.js in your
> pages, but I haven't made the just to using Vue yet so I can't really
> comment on that part.
>
> -Jim
>
> On Wednesday, January 22, 2020 at 12:33:10 PM UTC-6, Carlos Costa
> wrote:
>>
>> Hey Massimo, thanks for the great info.
>>
>> How about porting apps from web2py to py4web?
>>
>> What steps would you recommend?
>>
>>

Re: [web2py] Re: post file to a server

2019-10-17 Thread Christian Varas
Hi, I have an app that use CKeditor who send images to the server and the
function who catch this file is more or less like this:

Server TWO
def ImgUpload():
a = stuffs.Stuffs() #Custom library
name = a.password(20)
rand_name = a.password(20)


   #path where the files will be saved
path_img = '/some/folder/here/'

#save the data of the image in db (if you need it)
db.images.insert(project_id=session.project_id, path=path_img,
 rand_name=rand_name, name=str(name)+'.png')

#save the file uploaded in disk
open(path_img+str(name)+'.png',
'wb').write(request.vars['upload'].file.read())

in the server ONE goes the form that send the file to the server two.

this example does not contain any token to avoid that anyone can upload
files.

Using sftp is good, but maybe can be a slower due the use of credentials


Cheers.
Chris.

El vie., 18 oct. 2019 a las 1:22, Auden RovelleQuartz (<
auden.rovellequa...@gmail.com>) escribió:

> I found a solution
>
> step one: install the Paramiko library on the application server
> (SERVER_ONE)
>
> step two: import the paramiko library
>
> step three: use the "putfo" method
>
> here is an example
>
> def file_upload():
> import paramiko
> form = FORM(
> DIV(
> INPUT(
> _type = "file",
> _name = "file",
> )
> ),
> DIV(
> INPUT(
> _type = "submit",
> _value = "UPLOAD IMAGE"
> )
> ),
> _enctype="multipart/form-data",
> )
> if (form.process().accepted):
> client = paramiko.SSHClient()
> client.load_system_host_keys()
> t = paramiko.Transport("www.server_two_url.com", 22)
> t.connect(username = SERVER_TWO_LOGIN_STRING, password =
> SERVER_TWO_PASSWORD_STRING)  # for example:
> t.connect(username = "root", password = "abc123")
> sftp = paramiko.SFTPClient.from_transport(t)
> sftp.putfo(form.vars.file.file, "/root/auden.jpg")
> sftp.close()
> t.close()
> return dict(
> form = form,
> )
>
> THAT WORKS FINE!  (on SERVER_TWO server using WinSCP I go to the /root
> folder on the VPS and there is the file)
>
>
>
>
>
>
> On Monday, October 14, 2019 at 8:23:25 AM UTC-5, Auden RovelleQuartz wrote:
>>
>> Please let me know how to do this
>>
>> SERVER_ONE: this is the application server
>> SERVER_TWO: this is the file storage server
>>
>> The objective is to
>>
>> >>> have the user select a file via a form (this is via a Web2py app
>> running on SERVER_ONE)
>> >>> when user clicks the submit button, the file is posted to an API
>> endpoint on SEVER_TWO
>> >>> the web2py app on SERVER_TWO then saves the file to disk
>>
>>
>> Here is my code for SERVER_ONE:
>>
>> def file_upload():
>> form = FORM(
>> DIV(
>> INPUT(
>> _type = "file",
>> _name = "file",
>> requires = IS_LENGTH(MAX_IMAGE_UPLOAD_SIZE, MIN_IMAGE_UPLOAD_SIZE),
>> )
>> ),
>> DIV(
>> INPUT(
>> _type = "submit",
>> _value = "UPLOAD IMAGE"
>> )
>> ),
>> _method = "post",
>> _enctype="multipart/form-data",
>> )
>> if (form.process().accepted):
>> r = requests.post(
>> SERVER_TWO_APP_BASE_URL + "/default/get_file",
>> files={'file': form.vars.file.file.read()}
>> )
>> return dict(
>> form = form,
>> )
>>
>>
>>
>> Here is my code for in default.py controller of SERVER_TWO:
>>
>> import requests
>>
>> def get_file():
>> try:
>> file = request.files['file']
>> file.save('', file.filename)
>> except Exception as e:
>> with open("_probe_20191013_001", "w") as f:
>> f.write(str(e))
>> with open("_probe_20191013_002", "w") as f:
>> f.write("\n\nthis is a test\n\n")
>> f.write(str(request))
>> return dict()
>>
>> ==
>>
>> The file is not getting saved on SERVER_TWO
>>
>> does anyone have any advice on how to accomplish that?
>>
> --
> 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/ee5f2127-18b8-4840-a298-a9d806100710%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%2Bs%2BuJuOca-L7KdEWaxf1OgM2OsqbsPATcu5Wo89s80Lxe63FA%40mail.gmail.com.


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

2019-08-21 Thread Christian Varas
I run web2py in a raspberry with Apache or nginx.
Then the auto start is automatically.

Cheers.


El jue., 22 de ago. de 2019 04:02, lucas  escribió:

> sorry for the long delay on this post.  I've been theme parking with the
> kids all summer.
>
> ok, I've got rocket running on the pi with python 3.5.  very well.
>
> what's the best way to auto startup
>
> /home/www-data/web2py/anyserver.py &
>
> on the pi?  when I manually type execute the above in a bash window, it
> starts fine and the server is accessible via the chromium browser.  when I
> try to put it in /etc/rc.local the command will not run when I reboot.  any
> suggestions on that latter point.
>
> thanx in advance and have a great day, Lucas
>
> --
> 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/20a52d68-50ea-4a86-98fb-a8f32ebf1f39%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%2Bs%2BuJvjYBiRp8rQyb14sTE0waYwfgQ9PUmGShw7j%3DB8HYsm9Q%40mail.gmail.com.


Re: [web2py] Re: How to add vertical Scroll bar to the table in SQLGORM.grid

2019-08-05 Thread Christian Varas
+1, datatables is your friend

Cheers

El lun., 5 de ago. de 2019 22:27, Jim S  escribió:

> I'd look at implementing datatables.net to do that.
>
> https://datatables.net/
>
> -Jim
>
> On Saturday, August 3, 2019 at 9:22:26 PM UTC-5, Ryan wrote:
>>
>> Hi all, instead of having multiple page of table, i would like to have 1
>> table with vertical scroll bar in SQLFORM.grid so that the user can view
>> all by scrolling up and down instead of go to multiple pages 1 2 3
>> Thanks
>>
>> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/web2py/4e212364-9988-489d-a947-c34e37171c3e%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%2Bs%2BuJstByARBPU4yBwqoPLbHVbusgBP8CRuBtC2tSNAmBJM3Q%40mail.gmail.com.


Re: [web2py] Como retornar apenas um item apartir de uma busca no campo usando web2py

2019-08-05 Thread Christian Varas
Hi, why doesn't work good  with first() ?
 if you do: db(db.table.xx==request.vars.xx).select().first() it will
return just the first record, if it doesn't is because the record does not
exist.

other way to do this is with limitby:

db().select(db.person.ALL, limitby=(0, 2)):

http://www.web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#orderby-groupby-limitby-distinct-having-orderby_on_limitby-join-left-cache


Cheers.
El lun., 5 ago. 2019 a las 15:51, Kimus () escribió:

> Ola , estou tentando fazer uma busca no banco usando db(db.table.id ==
> request.vars.id).select()
>
> só que esse select retorna uma lista/rows dai queria saber como retornar
> apenas um item, ja tentei usar o .firts() mas não ta funcionando direito
>
> alguem teria alguma ideia
>
> --
> 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/b61ac3fa-7ec5-4268-baaa-e9ad27c9f3f1%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%2Bs%2BuJusH3w7hbYXtbrjxRmR%3DSKzcSQgKnWDj0tbwUWOUKzfwg%40mail.gmail.com.


Re: [web2py] Re: Anthony was right... web3py has a big naming conflict

2019-07-22 Thread Christian Varas
WebThreePy?

Web4Py   ?


Cheers.

El lun., 22 de jul. de 2019 16:29, John Bannister 
escribió:

> Why not something as simple as py3web
>
>
>
> *From:* web2py@googlegroups.com [mailto:web2py@googlegroups.com] *On
> Behalf Of *Leonel Câmara
> *Sent:* 22 July 2019 16:26
> *To:* web2py-users
> *Subject:* [web2py] Re: Anthony was right... web3py has a big naming
> conflict
>
>
>
> I would call it pywebal "python web abstraction layer"
>
> --
> 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/b6450298-575f-4274-9708-4dd85c7097a2%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/09e101d54099%24e94b5560%24bbe20020%24%40gmail.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%2Bs%2BuJtVFt_Z1sNoQOzjM_HfJZb-Q7vxZ_-QqQha3GvC59b4_Q%40mail.gmail.com.


Re: [web2py] How to try - exception - finally os.path.join

2019-07-03 Thread Christian Varas
What about
try:
file_location = os.path.join(request.folder, 'views','plot')

 except Exception as error:
print (error)

El lun., 1 de jul. de 2019 23:47, Quang Lam 
escribió:

> Hi All, i try to do the try - exception - finally for os.path.join how
> somehow it does not catch the error. Please help
>
>  try:
> file_location = os.path.join(request.folder, 'views','plot')
> raise OSError
> except OSError as error:
> print (error)
>
> --
> 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/bd443e12-6318-46ae-a8c9-6228e15e3a21%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/CA%2Bs%2BuJss6Fmh3BsRD7jpjL2NjzQEwFVr2P3S1hpk_gr5p%3DH4MA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Generating graph with chartjs

2019-06-17 Thread Christian Varas
Sorry the delay, the second chart is a radar chart

Cheers.
Chris.

El mar., 11 de jun. de 2019 18:25, Dave S  escribió:

>
>
> On Sunday, June 9, 2019 at 3:06:01 PM UTC-7, Christian Varas wrote:
>>
>> II have this site www.climbersoul.cl using AdminLTE, and I with graphics
>> too.
>> https://imgur.com/HQTI1u7
>> [image: image.png]
>>
>>
>> you need to include the libraries first:
>>
>> https://www.chartjs.org/samples/latest/utils.js"</a>;>
>> https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.5.0/Chart.min.js</a>
>> ">
>>
>> This is the code for the bar chart, for other chart is similar, you just
>> need to set the values in the array (are marked)
>>
>>>
>>>
> Nice!   What type of chart is the 2nd one, some sort of polar display?
>
> /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/1b1bc784-149a-4886-9bc2-e4182ca58d8e%40googlegroups.com
> <https://groups.google.com/d/msgid/web2py/1b1bc784-149a-4886-9bc2-e4182ca58d8e%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> 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/CA%2Bs%2BuJurhgUz3TNrTDGHHwASkJox4fPpN%2BqJbG9sEGSqeej3RA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: I can not import module in app

2019-05-23 Thread Christian Varas
I'm facing the same issue, did you already found the solution?

Btw, I'm running web2py in my android phone, maybe for me is quite
different...

Cheers.
Chris.

El jue., 23 de may. de 2019 07:03, Константин Комков 
escribió:

> Maybe it info can help?
> Error snapshot [image: help]
> 
>
> (No module named application.modules)
>
> inspect attributes
> Frames
>
>-
>
>*File C:\inetpub\wwwroot\gluon\restricted.py in restricted at line 219*
> код аргументы переменные
>-
>
>*File C:\inetpub\wwwroot\applications\application\controllers\bak.py
>in  at line 2* код аргументы переменные
>-
>
>*File C:\inetpub\wwwroot\gluon\custom_import.py in custom_importer at
>line 74* код аргументы переменные
>Function argument list
>
>(name='mytest', globals={'A': , 'ANY_OF': 'pydal.validators.ANY_OF'>, 'ASSIGNJS': , 'AppConfig':
>, 'Auth': , 'B': 'gluon.html.B'>, 'BEAUTIFY': , 'BODY': 'gluon.html.BODY'>, 'BR': , 'BUTTON': 'gluon.html.BUTTON'>, ...}, locals={'A': , 'ANY_OF':
>, 'ASSIGNJS': ,
>'AppConfig': , 'Auth': , 'B':
>, 'BEAUTIFY': , 'BODY':
>, 'BR': , 'BUTTON':
>, ...}, fromlist=None, level=-1)
>Code listing
>
>69.
>70.
>71.
>72.
>73.
>74.
>75.
>76.
>77.
>78.
>
>if not fromlist:
># "import x" or "import x.y"
>result = None
>for itemname in name.split("."):
>new_mod = base_importer(
>modules_prefix, globals, locals, (itemname,), level)
>modules_prefix += "." + itemname
>if result is None:
>try:
>result = sys.modules[modules_prefix]
>
>Variables
>modules_prefix 'applications.application.modules'
>globals {'A': , 'ANY_OF': 'pydal.validators.ANY_OF'>, 'ASSIGNJS': , 'AppConfig':
>, 'Auth': , 'B': 'gluon.html.B'>, 'BEAUTIFY': , 'BODY': 'gluon.html.BODY'>, 'BR': , 'BUTTON': 'gluon.html.BUTTON'>, ...}
>itemname 'mytest'
>locals {'A': , 'ANY_OF': 'pydal.validators.ANY_OF'>, 'ASSIGNJS': , 'AppConfig':
>, 'Auth': , 'B': 'gluon.html.B'>, 'BEAUTIFY': , 'BODY': 'gluon.html.BODY'>, 'BR': , 'BUTTON': 'gluon.html.BUTTON'>, ...}
>level -1
>
> --
> 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/2d6d9fdb-50a3-480a-a4b2-8642664003b5%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/CA%2Bs%2BuJutgqNXk6XCDdRBmpQVfZHL_mmjsSZ3P1tLm2_KWR1iSQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] More then one buttons on form

2019-05-22 Thread Christian Varas
Hi, well what I do to change some attributes in the forms is modifiying the
form before to be returned/rendered:
You can access to the elements in the  form like a list
Ex:

form = SQLFORM.factory(Field('hoho'),
   Field('haha')
)

form[0][1][1]['_class'] = "nothing"

return dict(form=form)

This Will change the class of the last  tag from "w2p_fw" to "nothing"

For a massive replace maybe Javascript is the best way.

Cheers!

El mié., 22 de may. de 2019 04:12, Константин Комков 
escribió:

> Web2py automatically add event listeners and class="btn" for button. What
> if my form contain more then one button or I don't want use that class?
> Usually I have used input type="button" in that case, but now text in my
> button may contain 2 rows and I can't use input becouse it inline element.
> How can I delete all web2py event listeners for buttons?
> For class I do next:
> el = document.getElementById("bak");
> el.classList.remove("btn");
>
>
> --
> 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/e4a04290-d79f-4af0-9607-40dd9b120046%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/CA%2Bs%2BuJtGP1Jb9pHsp6V7pzx-Yi3boVEyqyA8CYe_SBDCKgMj1Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Validate image with IS_IMAGE()

2019-05-09 Thread Christian Varas
Hello guys, I'm trying to validate and save and image from FieldStorage()
of ckeditor (not from the web2py slices)

i'm using the validor IS_IMAGE() like this
IS_IMAGE()(request.vars['upload'].value)

I'm getting the following "invalid image" message.

('\x89PNG\r\n\x01\x11\x10\x81\xad\x04d\xd8le\xa1=\x11\x1\***snipedab\xe3\x04So\xe8K~\x00\x00\x00\x00IEND\xaeB`\x82',
'Invalid image')

Do i need to decode/scape the string  or something to make it work?

I'm a bit lost at this point...

Cheers.
Chris.

-- 
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%2Bs%2BuJtSO5_vNv1%3DRRjnxHXGhPeK8UU5xCA2p9kyC_%2BSiCp2JQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Improve the images load

2019-04-04 Thread Christian Varas
Hi, I would like to ask for recommendations to serve images with web2py.
I have a site (*https://climbersoul.cl *), this
site is a kind of Wikipedia for spots climbing in Chile. This site will
have a lot of images, and I would like to know how to optimize the load of
the images.
By now the images are served in the classic way like 
using the download function like in the book.
I was thinking in load the images as base64 but I don't sure if is this
will be more faster...
Another idea is moving the images to /app/static/images/ to avoid using
download function and avoid an extra processing of the server, but I'm not
sure is this will really improve the load.

I'm running web2py with Apache and modsecurity.

Any recommendations would be appreciated.

Cheers.
Chris.

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


Re: [web2py] Displaying Uploaded PDF Documents

2019-03-01 Thread Christian Varas
Your model says:
db.define_table('*pdfs')*

And you controller points to another table (db.*pdfDocs)*

Your controller should be

*CONTROLLER CODE*
def viewer():
row = db(db.*pdfs*.id 
==request.args(0)).select(db.*pdfs*.fileS).first()
redirect(URL('static','pdfs',args=row.fileS))


Cheers.
Chris.

El vie., 1 de mar. de 2019 09:40, mostwanted 
escribió:

> I am attempting Bruno's above code to display the saved PDF, i have
> created a link in my index page that takes me to the viewer page but when i
> click it i get an error message below:
>
>  'NoneType' object has no attribute
> 'fileS'
> * MODEL CODE:*
>
> db.define_table('pdfs',
>
> Field('fileS','upload',uploadfolder=request.folder+'static/pdfs'))
>
>
> *CONTROLLER CODE*
> def viewer():
> row = db(db.pdfDocs.id
> ==request.args(0)).select(db.pdfDocs.fileS).first()
> redirect(URL('static','pdfs',args=row.fileS))
>
>
> *VIEW CODE (index)*
>
>
>
>
> *{{extend 'layout.html'}}{{=A('Click to view', _href=URL('default',
> 'viewer'))}}*I changed the 'file' variable because it said its an  "ALL"
> reserved SQL/NOSQL keyword
> What can i do to make this link redirect me without an error i'm getting??
>
> Regards;
>
> Mostwanted
>
> On Tuesday, December 14, 2010 at 6:57:05 PM UTC+2, rochacbruno wrote:
>>
>> For security reasons, web2py does not expose the 'uploads' folder to the
>> user, this folder can be accessed only by the 'download' function.
>>
>> You can do that:
>>
>> change the upload folder with 'uploadfolder' parameter.
>>
>> 
>> db.define_table('pdfs',
>>
>> Field('file','upload',uploadfolder=request.folder+'static/pdfs')
>>)
>> 
>>
>> Create a viewer function wich redirects the user direct to the file,
>> then, if the user has adobe acrobat plugin to view the file in browser,
>> this file will be shown in the browser, else, will be downloaded.
>>
>> 
>> def viewer():
>> row = db(db.pdfs.id==request.args(0)).select(db.pdfs.file).first()
>> redirect(URL('static','pdfs',args=row.file))
>> 
>>
>> Now you can call this as:
>>
>> http://127.0.0.1:8000/pdfs/default/viewer/3 #record id
>>
>> which redirects the user to:
>>
>> http://127.0.0.1:8000/pdfs/static/pdfs/pdfs.file.aaf5d3f7779841d0.6e65775f64616c5f68656c702e706466.pdf
>>
>>
>> --
>>
>> Bruno Rocha
>> http://about.me/rochacbruno/bio
>>
>>
>> 2010/12/14 azarkowsky 
>>
>>> In my web2py application I'm allowing users to upload PDF documents
>>> (via an upload field) and then on another page I provide a download
>>> link, however, I think because of the file renaming security feature
>>> these PDF documents are truly being downloaded again (saved locally to
>>> each user's desktop) instead of just displayed in a new browser window
>>> as is the case with most other PDFs I encounter on other websites.  Is
>>> there any way to provide a link directly to a file that was uploaded
>>> so the browser can display it without having to download the file
>>> again?
>>>
>>> Thanks,
>>> Adam
>>
>>
>>
>>
>>
>> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: [web2py] SQLFORM with specific record

2019-02-22 Thread Christian Varas
Thanks Duncan

My fault! :P
I was pointing to another table and I was missing the ".select()" and at
the end... stupid me haha
like this: record = db((db.*lugar*.id == request.args(0)) & (db.*ruta*.user_id
== auth.user['id']))

Whit this works perfect:
record = db((db.lugar.lugar_id == request.args(0)) & (db.lugar.user_id ==
auth.user['id'])).select()[0]
form_edit_ruta = SQLFORM(db.lugar, record)

Cheers.
Chris.

El vie., 22 feb. 2019 a las 9:56, Ben Duncan ()
escribió:

> Are you trying to join to db's ?
> If not, then try :
>
> ROW = db(db.lugar.user_id == auth.user['id']).select()
> or
> ROW = db.lugar[auth_user['id']]
>
> See:
>
> http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Shortcuts
>
> *Ben Duncan*
> DBA / Chief Software Architect
> Mississippi State Supreme Court
> Electronic Filing Division
>
>
> On Thu, Feb 21, 2019 at 10:04 PM Christian Varas 
> wrote:
>
>> Hello !
>> I'm trying to get a sqlform that display a specific entry, i've been able
>> to get it work like in the book but just with one condition
>> like this: record = db.rutas(request.args(0))
>>
>> i need to do something like this:
>> record = db.rutas.id == request.args(0) and db.lugar.user_id ==
>> auth.user['id']
>>
>> I've tried:
>> record = db(db.rutas.id == request.args(0) and db.lugar.user_id ==
>> auth.user['id'])
>> record = db((db.rutas.id == request.args(0)) & (db.lugar.user_id ==
>> auth.user['id']))
>> but it doesn't work.
>> i'm getting this error:
>> * argument of type 'Query' is not iterable*
>>
>> this is my function
>> @auth.requires_login()
>> def EditarRutaIngresada():
>> record = db.rutas.id == request.args(0) and db.lugar.user_id ==
>> auth.user['id']
>> form_edit_ruta = SQLFORM(db.rutas, record)
>>
>> return dict(form_edit_ruta=form_edit_ruta)
>>
>> anybody knows how to do this right ?
>>
>>
>> Thanks in advanced.
>> Cheers.
>> Chris.
>>
>> --
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "web2py-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to web2py+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

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


[web2py] SQLFORM with specific record

2019-02-21 Thread Christian Varas
Hello !
I'm trying to get a sqlform that display a specific entry, i've been able
to get it work like in the book but just with one condition
like this: record = db.rutas(request.args(0))

i need to do something like this:
record = db.rutas.id == request.args(0) and db.lugar.user_id ==
auth.user['id']

I've tried:
record = db(db.rutas.id == request.args(0) and db.lugar.user_id ==
auth.user['id'])
record = db((db.rutas.id == request.args(0)) & (db.lugar.user_id ==
auth.user['id']))
but it doesn't work.
i'm getting this error:
* argument of type 'Query' is not iterable*

this is my function
@auth.requires_login()
def EditarRutaIngresada():
record = db.rutas.id == request.args(0) and db.lugar.user_id ==
auth.user['id']
form_edit_ruta = SQLFORM(db.rutas, record)

return dict(form_edit_ruta=form_edit_ruta)

anybody knows how to do this right ?


Thanks in advanced.
Cheers.
Chris.

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


[web2py] Different layout.html

2019-01-09 Thread Christian Varas
Hi everyone!
I'm wonder if there is another layout.html to use in web2py?

I have adapted the adminlte template (
https://adminlte.io/themes/AdminLTE/index2.html) and but is not adapted at
100% (menu.py is not working and grid doesnt look good, but if you dont
mind to add the menu manually on the layout is ok. Response.flash works
perfect and the forms looks great.)

i have a site using this (www.climbersoul.com)
i can share a n empty app with this layout if someone wants to play.
I wil try to adapt the layout in a 100%, when is finished i will share it !

Cheers.
Chris.

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


Re: [web2py] DAL's fake_migrat and fake_migrate_all and migration problem with auth tables

2019-01-05 Thread Christian Varas
I never tryed fake migrate before but every time that I move an app to
another server first I put the app in the server then I delete everything
inside the database folder, then run the app via web browser (this create
the structure of the database)? then resotre the db backup and done app +
database working in the new server. I always do this with mysql but should
be the same for pg.
If you create the database first and the run the web2py will say that all
ready exist.


Cheers.

El vie., 4 ene. 2019 9:37 p. m., icodk  escribió:

> First both fake_migrate and fake_migrate_all  are part of the DAL
> signature in the book,  However fake_migrate is only explained when it is
> used in a table definition, not in DAL.
>
>
> Second issue that might be related:
> I try to move web2py application to another server, including a pg
> database in the following order:
> 1. took a backup of the database on the old server
> 2. restored the database on the new server
> 3. Copy the web2py application to the new server include the databases
> files
> 4. my first attempt to run the app resulted in  error: relation
> "auth_user" already exists
> 6. I verified that a file
>  63e111e1d2096351b383c8ebce6b217f_auth_user.table EXIST so why the error?
> 7. Deleted the auth_user table from the database and file
> 63e111e1d2096351b383c8ebce6b217f_auth_user.table
> 8. a new table was created and a new auth_user.table file but with another
> hex prefix: c8b669d15150d7109e5f7ab36744a5b7_auth_user.table
> 9. But now I got the same error on auth_group.
> 10.I solved it by just changing all the files with the old hex prefix to
> the new prefix and everything was working.
> There are only hex prefix to the auth tables because I Can't/didn't set
> the migrate table settings
>
> I also attempted to use the fake_migrate_all=True ,migrate=False but none
> of the auth files was created. Only my own tables files
> 1. deleted all the databases folder files and set DAL's
> fake_migrate_all=True ,migrate=False
> 2. Only my tables files (in databases folder), and scheduler files (with
> the new hex prefix) was created.
>
> Why not all tables files was created on fake migration?
> Why the auth tables migration file names  need a hex prefix and  why it is
> different for each web2py installation ?
> If the hex prefix can be changed and everything is working ? why need it
> in the first place ?
> Shouldn't  a complete copy of application and database just work out of
> the box ?
>
> (2.17.1-stable+timestamp.2018.08.05.17.57.00
> (Running on nginx/1.12.1, Python 2.7.14)
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: [web2py] Where does it GO?

2018-12-12 Thread Christian Varas
It goes to the console where web2py is running or in the error logs of
apache or nginx if you are running web2py in one of those.

Cheers.
Chris.

El mié., 12 dic. 2018 11:39 a. m., Ben Duncan  escribió:

> If you put a "print" statement in you application (controller or view)
> where does the output go?
>
> (such as 'print "Testpoint 1")
>
> Thanks ..
>
> *Ben Duncan*
> DBA / Chief Software Architect
> Mississippi State Supreme Court
> Electronic Filing Division
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: [web2py] Re: upload a photo to your site by >

2018-12-07 Thread Christian Varas
As Stifan says, please show us the code. If you follow the example in the
book,  image upload works perfect.

About ">" what are you trying to do with this?

Cheers.
Chris.

El vie., 7 dic. 2018 6:59 a. m., 黄祥  escribió:

> perhaps you can show the code and the traceback error
> ref:
> http://web2py.com/books/default/chapter/29/03/overview#An-image-blog
>
> best regards,
> stifan
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: [web2py] Re: mobile friendly login page

2018-10-25 Thread Christian Varas
Sorry the image in the previous mails is broken, here is it:
https://imgur.com/a/I1SsGlp

Cheers
Chris.

El jue., 25 oct. 2018 a las 10:57, Lovedie JC ()
escribió:

> Works good.
> How about app buttons in a single line/row?
> Regards
>
> On Thu, 25 Oct 2018 at 16:22, sandeep patel 
> wrote:
>
>> @lbjc
>> Add some margin between the buttons.
>>  you can try this. Add this in user.html file
>> 
>> .btn{
>>   margin-left: 10px;
>>   margin-top: 10px;
>> }
>> 
>>
>> Best/
>> SP
>>
>> On Thu, Oct 25, 2018 at 6:34 PM mostwanted  wrote:
>>
>>> The attachment link gives *error 404*
>>>
>>> On Thursday, October 25, 2018 at 2:06:15 PM UTC+2, lbjc...@gmail.com
>>> wrote:

 The default login page on the desktop looks absolutely good. The mobile
 page,see attached needs some workup. Is there a way to align the buttons?
 Regards

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

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


Re: [web2py] Re: mobile friendly login page

2018-10-25 Thread Christian Varas
hi, this is my login page, I'm using adminLTE as template, try this
example, i might work for you, adminLTE works with boostrap like web2py, so
I think that should work.

[image: image.png]

controller:
def user():
return dict(page="Bienvenido", icon="", title="", form=auth())

*this is the view:*

{{extend 'layout_climbersoul.html'}}




  {{=T('Sign Up') if request.args(0) ==
'register' else T('Log In') if request.args(0) == 'login' else
T(request.args(0).replace('_',' ').title())}}



  
   {{
if request.args(0)=='login':
if not 'register' in auth.settings.actions_disabled:
form.add_button(T('Sign Up'),URL(args='register',
vars={'_next': request.vars._next} if request.vars._next else
None),_class='btn btn-default')
pass
if not 'request_reset_password' in
auth.settings.actions_disabled:
form.add_button(T('Lost
Password'),URL(args='request_reset_password'),_class='btn btn-default')
pass
pass
}}
{{=form}}
  
  
  



If the above doesn't work, I think you can customize the auth form like in
the SQLFORM.
Example:

form_add_lugar = SQLFORM.factory(
Field("Nombre", requires=IS_NOT_EMPTY()),
Field("Pais", default=1, requires=IS_IN_SET(range(1,
(len(country_list) + 1)), country_list)),
Field("Region", label="Región", default='Ninguna',
requires=IS_IN_SET(regiones)),
# captcha_field(),
_name="form_add_Lugar",
submit_button="Agregar",
)

*# Here you can add/change **attributes*
form_add_lugar[0][0][0]['_class'] = "control-label col-sm-2"
form_add_lugar[0][1][0]['_class'] = "control-label col-sm-2"
form_add_lugar[0][2][0]['_class'] = "control-label col-sm-2"


I hope this can help

Cheers.
Chris.

El jue., 25 oct. 2018 a las 10:57, Lovedie JC ()
escribió:

> Works good.
> How about app buttons in a single line/row?
> Regards
>
> On Thu, 25 Oct 2018 at 16:22, sandeep patel 
> wrote:
>
>> @lbjc
>> Add some margin between the buttons.
>>  you can try this. Add this in user.html file
>> 
>> .btn{
>>   margin-left: 10px;
>>   margin-top: 10px;
>> }
>> 
>>
>> Best/
>> SP
>>
>> On Thu, Oct 25, 2018 at 6:34 PM mostwanted  wrote:
>>
>>> The attachment link gives *error 404*
>>>
>>> On Thursday, October 25, 2018 at 2:06:15 PM UTC+2, lbjc...@gmail.com
>>> wrote:

 The default login page on the desktop looks absolutely good. The mobile
 page,see attached needs some workup. Is there a way to align the buttons?
 Regards

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

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


Re: [web2py] Re: Multiples requieres in SQLFORM

2018-10-24 Thread Christian Varas
Thanks Anthony,

Sorry is my fault, i didn't knew how to explain the issue...

I ended up like this:

Field("Grado", default=grados_roca[2], requires=IS_IN_SET([],
multiple=False)),

and works perfect, now I have a empty set that I can populate in the view


Thank you!
☺

Cheers.
Chris.

El mar., 23 oct. 2018 a las 17:07, Anthony () escribió:

> Not sure I fully understand your requirements, but maybe:
>
> requires=IS_IN_SET(..., multiple=(0, MAX_SIZE_OF_SET))
>
> The "multiple" arguments indicates multiple items can be selected, and it
> can either be a boolean or a list/tuple specifying a minimum and maximum
> number of values. In the latter case, the minimum can be 0, allowing an
> empty set.
>
> Anthony
>
> On Monday, October 22, 2018 at 11:07:14 PM UTC-4, Chris V. wrote:
>>
>> Hello list,
>>
>> I need to have 2 requires in the same field, one requires must be a
>> select multiple, but also it can be a different value of initial select
>> multiple, this because in the view the select multiple values are changed
>> with javascript .
>>
>> It is possible to make something like the following?:
>> Field("Grado", default=grados_roca[2],* requires=IS_NOT_EMPTY()
>> OR IS_IN_SET(range(2, (len(grados_roca) + 1)), grados_roca)), ??*
>>
>> And if is possible, how could I make this ?
>>
>>
>> I tryied with this but i had no lucky:
>> Field("Grado", default=grados_roca[2], requires=[IS_NOT_EMPTY(),
>> IS_IN_SET(range(2, (len(grados_roca) + 1)), grados_roca))]),
>>
>> this is my sql form:
>>
>> SQLFORM.factory(Field("nombre_ruta", requires=IS_NOT_EMPTY()),
>>Field("Modalidad",
>> default=modalidades[1],requires=IS_IN_SET(modalidades)),
>>Field("Tipo",
>> default='Monolargo', requires=IS_IN_SET(tipo)),
>>Field("Grado",
>> default=grados_roca[2], requires=IS_IN_SET(range(2, (len(grados_roca) +
>> 1)), grados_roca)),
>>Field("Largos",
>> default="3",
>>
>>  requires=IS_IN_SET(range(1, 51))),
>>Field("Zona",
>> default=zonas_list[0],
>>
>>  requires=IS_IN_SET(zonas_list, zonas_list_name)),
>>Field("Observacion",
>> 'text', length=300,
>>  default='No se han
>> registrado observaciones', label="Observaciones"),
>>_name="agregar_ruta",
>>submit_button="Agregar",
>>)
>>
>>
>> Cheers!
>> Chris.
>>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

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


[web2py] Login form and facebook oauth

2018-09-18 Thread Christian Varas
Hello, I have an app with a facebook login (oauth),I took the example from
the documentation and works fine. But I need to enable the login form
included in web2py.

Does anybody know how to make this 2 login methods works ? or if someone
have an example about this?

Any help would be very appreciated.

Cheers!
Chris.

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


Re: [web2py] global name 'Recaptcha' is not defined error when my app is run in web2py 2.17.1 (latest)

2018-08-31 Thread Christian Varas
Use Recaptcha2()

I have an app with new web2py and recaptcha2 working like a charm.

Cheers.
Chris

El vie., 31 ago. 2018 9:48 a. m., Rahul  escribió:

> Hi All,
> There seems to be an issue with latest version of web2py 2.17.1. I am
> getting an exception like below for my project . However the same seems to
> be working fine in web2py 2.15.3 but it gives the message shown in attached
> image.
>
>  global name 'Recaptcha' is not defined
>
>
> File "web2py/applications/artpic/controllers/default.py", line 1759, in
> register
> crud.settings.create_captcha= Recaptcha(request, publickey, privatekey
> )
> NameError: global name 'Recaptcha' is not defined
>
> Any idea ?
>
> Rahul
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

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


[web2py] Error processing form with select multiple

2018-08-27 Thread Christian Varas
Hi everyone!, I'm developing a site which have 3 forms in one page, and one
of them have multiples selection fields.

I'm facing an error when the form is processed and I have not been able to
fix it.

Error:


* string indices must be integers, not str*


*locals*

*c*

:

''

*component_list*

:

[[''], [], [],
[], []]

*options*

:



*self*

:



*value*

:

'Boulder'



*Function argument list*

(self=)

*Code listing*

value *= **self**[*'value'*]*

*if *value *is not None**:*

*if not self**[*'_multiple'*]:*

*for *c *in *options*:  **# my patch*

*print**(**c**[**'_value'**])*

*if **(*value *is not None**) **and **(*str*(*c*[*
'_value'*]) == *str*(*value*)):*

c*[*'_selected'*] = *'selected'

*else**:*

c*[*'_selected'*] = **None*


Looks like the problem is in: Field("Modalidad",
requires=IS_IN_SET(modalidades)),

“modalidades” is a list of strings, it works good when I call this form,
but when is processed it shows the above error…


Any help is really  appreciated



Part of the db.py


grados = ["todos","Rutas escuelas",

  "5.9","5.10a","5.10b","5.10c","5.10d","5.11a",

  "5.11b","5.11c","5.11d","5.12a","5.12b","5.12c",

  "5.12d","5.13a","5.13b","5.13c","5.13d","5.14a",

  "5.14b","5.14c","5.14d","5.15a","5.15b","5.15c"]

grados_roca = ["todos","Rutas escuelas","5.9/5c","5.10a/6a","5.10b/6a+",
"5.10c/6b","5.10d/6b+","5.11a/6c","5.11b/6c/c+","5.11c/6c+",

   "5.11d/7a","5.12a/7a+","5.12b/7b","5.12c/7b+","5.12d/7c",
"5.13a/7c+","5.13b/8a","5.13c/8a+","5.13d/8b",

   "5.14a/8b+","5.14b/8c","5.14c/8c+","5.14d/9a","5.15a/9a+",
"5.15b/9b"]

grados_boulder = ["todos","V1/5","V2/5+","V3/6a","V3/4/6a+","V4/6b",
"V4/5/6b+","V5/6c","V5/6/6c+","V6/7a","V7/7a+","V8/7b","V8/9/7b+","V9/7c",

  "V10/7c+","V11/8a","V12/8a+","V13/8b","V14/8b+","V15/8c",
"V16/8c+"]


modalidades = ["todas", "Boulder", "Deportiva", "Tradicional", "Multilargo",
"Hielo"]

modalidades_add_ruta = ["Boulder", "Deportiva", "Tradicional", "Multilargo",
"Hielo"]

tipo = ["Monolargo","Multilargo"]



Form with problems:


agregar_ruta = SQLFORM.factory(Field("nombre_ruta", requires=IS_NOT_EMPTY())
,



   Field("Tipo", default='Monolargo', requires
=IS_IN_SET(tipo)),

   Field("Grado", default=grados_roca[2],

 requires=IS_IN_SET(range(1,
(len(grados_roca)
+ 1)), grados_roca)),

   Field("Zona", default=zonas_list[0],

 requires=IS_IN_SET(zonas_list,
zonas_list_name)),

   Field("Descripcion", 'text', length=300,

 default='No se ha registrado
descripción', label="Descripción"),

   _name="agregar_ruta",

   submit_button="Agregar",

   )




Cheers!

Chris.

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


Re: [web2py] Re: Handling "Invalid function", "Invalid request", "Invalid controller"

2018-06-27 Thread Christian Varas
Thank you, i will try this.

Cheers.
Chris.

2018-06-26 21:47 GMT-04:00 黄祥 :

> perhaps this link can be used:
> http://www.web2pyslices.com/slice/show/1529/custom-error-routing
>
> best regards,
> stifan
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

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


[web2py] Handling "Invalid function", "Invalid request", "Invalid controller"

2018-06-26 Thread Christian Varas
Hello,

I'm trying to redirect those errors to another page.
Errors:
invalid function (default/bla)invalid requestinvalid controller (bla/index)I've
been playing with routes.py but I don't know how to map those errors.
it is possible to do this without map all urls in routes.py ?

Any help would be really appreciated


Cheers!
Chris.

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