[web2py] Re: Does anyone have a stripe connect demo or example for web2py?

2022-04-05 Thread Jose C
Here's some code that I use... hopefully should get you started.

In your python environment:  pip install stripe

Then in a controller (donations):
```
def __create_stripe_session(item_name='', amount_cents=0, success_url='', 
cancel_url='', item_description='', customer_email=None):
"""
Creates a Stripe session (with a payment intent id), valid for 24 
hrs, which we can then submit later.
"""
import stripe

stripe.api_key = 'stripe_key_secret'
stripe_session = stripe.checkout.Session.create(
  payment_method_types=['card'],
  customer_email = customer_email, 
  # prepopulates, but readonly - user can't change it.
  line_items=[{
'name': item_name,
'description': item_description,
'amount': amount_cents,
'currency': 'cad',
'quantity': 1,
  }],
  success_url = success_url,
  cancel_url = cancel_url,
)

return stripe_session


def make_donation():
"""
display page with form to enter amount.
"""
# display form.
form = SQLFORM.factory(Field('amount', type='string', label='Donation 
Amount'))

if form.process().accepted:
#  create a Stripe session
stripe_session = __create_stripe_session(
item_name = 'Donation',
amount_cents = 
int(round(float(form.vars.amount),2)*100),
success_url = 
'http://localhost:8055/donations/done?action=payment_complete',   # stripe 
redirects here on success.
cancel_url = 
'http://localhost:8055/donations/done?action=cancelled'# stripe 
redirects here if cancelled.
)

# Save record so can compare with stripe returned event...
# Store the PI in the description temporarily and overwrite when 
transaction is sucessful.
db.donations.insert(user_id = session.user_id, 
description=stripe_session.payment_intent, 
amount=round(float(form.vars.amount),2))

# Now submit to Stripe for execution.
context = dict(public_key = '', 
 stripe_session_id = stripe_session.id)
return response.render('donations/do_stripe_payment.html', context)
elif form.errors:
response.error = form.errors.amount 

return dict(form = form)


@request.restful()
def my_stripe_webhook():
"""
On event, Stripe POSTs this json `webhook` via http.
We need to respond with simple 200-ok or it will attempt to resend 
a few more times.
"""
import stripe

def POST(*args, **vars):
# Alternatively can take the `id` from the POST info and turn it 
into a stripe object that can be used and queried.
# e.g.  See https://stripe.com/docs/api/python#retrieve_event for 
details of the object.

if request.vars.id == 'evt_00': # Test event from 
Stripe - can't query it with api...silly as that seems.
log.warning("dummy Stripe event evt_00 received. 
Not processing further.")
return "Ok, thanks. (dummy/test event received)."

else:
# Set the secret key.
stripe.api_key =  'stripe_key_secret' 
# see:https://stripe.com/docs/api/events/object
event = stripe.Event.retrieve(request.vars.id)
log.info(f"Stripe event received.  id: {event.id} type: 
{event.type}")

if event.type == 'charge.succeeded':
# Check if donation.
rec = db(db.donations.description == 
event.data.object.payment_intent).select().first()

if rec:
log.info(f"Donation made by user: {rec.user_id}")
# Overwrite the PI code in the description with actual 
action/message visible to user.
# This is final step and confirms money has been 
received.
rec.update_record(description = "Funds received, thank 
you!")
else:
log.error(f"Unknown payment received, see: 
{event.data.object.payment_intent}")

elif event.type == 'charge.refunded':
# Refund processing here...

elif event.type == 'checkout.session.completed':
return "Ok, thanks"

else:
# process other possible other event types.
return "Thanks again"

return locals()
```

the view (donations/do_stripe_payment.html):
```
Communicating with our payment processor, Stripe...
https://js.stripe.com/v3/";>

   

[web2py] Re: Avoid colnames in executesql

2021-12-02 Thread Jose
The problem is that I had not installed pyodbc (I use MS SqlServer) and I 
was using some version of the web2py itself.

Installing pyodbc works fine 


El jueves, 2 de diciembre de 2021 a las 11:39:39 UTC-3, Jose escribió:

> I add something. If instead of making select * from MyView I doselect 
> MyField, AnotherFiel from MyView 
>
> works in this way I create the dictionary with equal keys to the first 
> letter of each field in lowercase 
>
> [{'m': 6, 'a': 'xx'}]
>
> Jose
>
> El jueves, 2 de diciembre de 2021 a las 11:30:37 UTC-3, Jose escribió:
>
>>
>> Something else if I make select * from myView I get 
>>
>> RuntimeError: Result set includes duplicate column names. Specify unique 
>> column names using the 'colnames' argument
>>
>> but I do not have duplicate fields 
>>
>> El jueves, 2 de diciembre de 2021 a las 11:15:40 UTC-3, Jose escribió:
>>
>>> If I do not define colnames I get 
>>>
>>> rows[0]['MyField']
>>> KeyError: 'MyField'
>>>
>>> El jueves, 2 de diciembre de 2021 a las 9:15:46 UTC-3, Jose escribió:
>>>
>>>> I'm migrating an old app that runs in an old version of web2py in 
>>>> python27. In a lot of places I use db.executesql with argument 
>>>> as_dict=True. The error that I am getting is that he asks me to define the 
>>>> colnames que es un nuevo argumento.
>>>>
>>>> Sometimes SQL is a query to views and others to stored procedures 
>>>>
>>>>
>>>> If I pass a list with the names of the fields it works, but it is 
>>>> something I want to avoid. 
>>>>
>>>> rows = db.executesql(_sql, as_dict=True, colnames=['MyField']) # This 
>>>> works fine
>>>>
>>>> Is there any way to avoid the list with the names of the fields? 
>>>>
>>>> Jose
>>>>
>>>

-- 
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/babadf17-3674-462c-a9a9-66d9fd14e298n%40googlegroups.com.


[web2py] Re: Avoid colnames in executesql

2021-12-02 Thread Jose
I add something. If instead of making select * from MyView I doselect 
MyField, AnotherFiel from MyView 

works in this way I create the dictionary with equal keys to the first 
letter of each field in lowercase 

[{'m': 6, 'a': 'xx'}]

Jose

El jueves, 2 de diciembre de 2021 a las 11:30:37 UTC-3, Jose escribió:

>
> Something else if I make select * from myView I get 
>
> RuntimeError: Result set includes duplicate column names. Specify unique 
> column names using the 'colnames' argument
>
> but I do not have duplicate fields 
>
> El jueves, 2 de diciembre de 2021 a las 11:15:40 UTC-3, Jose escribió:
>
>> If I do not define colnames I get 
>>
>> rows[0]['MyField']
>> KeyError: 'MyField'
>>
>> El jueves, 2 de diciembre de 2021 a las 9:15:46 UTC-3, Jose escribió:
>>
>>> I'm migrating an old app that runs in an old version of web2py in 
>>> python27. In a lot of places I use db.executesql with argument 
>>> as_dict=True. The error that I am getting is that he asks me to define the 
>>> colnames que es un nuevo argumento.
>>>
>>> Sometimes SQL is a query to views and others to stored procedures 
>>>
>>>
>>> If I pass a list with the names of the fields it works, but it is 
>>> something I want to avoid. 
>>>
>>> rows = db.executesql(_sql, as_dict=True, colnames=['MyField']) # This 
>>> works fine
>>>
>>> Is there any way to avoid the list with the names of the fields? 
>>>
>>> Jose
>>>
>>

-- 
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/44af5367-5cca-48a1-8fb2-b7c38c764695n%40googlegroups.com.


[web2py] Re: Avoid colnames in executesql

2021-12-02 Thread Jose

Something else if I make select * from myView I get 

RuntimeError: Result set includes duplicate column names. Specify unique 
column names using the 'colnames' argument

but I do not have duplicate fields 

El jueves, 2 de diciembre de 2021 a las 11:15:40 UTC-3, Jose escribió:

> If I do not define colnames I get 
>
> rows[0]['MyField']
> KeyError: 'MyField'
>
> El jueves, 2 de diciembre de 2021 a las 9:15:46 UTC-3, Jose escribió:
>
>> I'm migrating an old app that runs in an old version of web2py in 
>> python27. In a lot of places I use db.executesql with argument 
>> as_dict=True. The error that I am getting is that he asks me to define the 
>> colnames que es un nuevo argumento.
>>
>> Sometimes SQL is a query to views and others to stored procedures 
>>
>>
>> If I pass a list with the names of the fields it works, but it is 
>> something I want to avoid. 
>>
>> rows = db.executesql(_sql, as_dict=True, colnames=['MyField']) # This 
>> works fine
>>
>> Is there any way to avoid the list with the names of the fields? 
>>
>> Jose
>>
>

-- 
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/e10216fb-a102-4a06-8ef8-3a966e0b614fn%40googlegroups.com.


[web2py] Re: Avoid colnames in executesql

2021-12-02 Thread Jose
If I do not define colnames I get 

rows[0]['MyField']
KeyError: 'MyField'

El jueves, 2 de diciembre de 2021 a las 9:15:46 UTC-3, Jose escribió:

> I'm migrating an old app that runs in an old version of web2py in 
> python27. In a lot of places I use db.executesql with argument 
> as_dict=True. The error that I am getting is that he asks me to define the 
> colnames que es un nuevo argumento.
>
> Sometimes SQL is a query to views and others to stored procedures 
>
>
> If I pass a list with the names of the fields it works, but it is 
> something I want to avoid. 
>
> rows = db.executesql(_sql, as_dict=True, colnames=['MyField']) # This 
> works fine
>
> Is there any way to avoid the list with the names of the fields? 
>
> Jose
>

-- 
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/f2cc532d-5202-4e08-b256-68e1e0ae6199n%40googlegroups.com.


[web2py] Avoid colnames in executesql

2021-12-02 Thread Jose
I'm migrating an old app that runs in an old version of web2py in python27. 
In a lot of places I use db.executesql with argument as_dict=True. The 
error that I am getting is that he asks me to define the colnames que es un 
nuevo argumento.

Sometimes SQL is a query to views and others to stored procedures 


If I pass a list with the names of the fields it works, but it is something 
I want to avoid. 

rows = db.executesql(_sql, as_dict=True, colnames=['MyField']) # This works 
fine

Is there any way to avoid the list with the names of the fields? 

Jose

-- 
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/218cf021-1886-4064-88d2-d0b425e0n%40googlegroups.com.


[web2py] Re: Is it time to take redis off the features list?

2020-11-13 Thread Jose C
I have it working with python3 but only as far as web2py 2.18.5.  
Thereafter I cannot get it to work either.

Unfortunately it does begin to appear that web2py has reached end of life 
status. 

On Friday, 13 November 2020 at 03:13:18 UTC Joe Barnhart wrote:

> I know this is really old news, but redis no longer works under python 3 
> and web2py.  I'm just thinking it's time to take out all mention of redis 
> from the book and list of features of web2py.  Yes, it technically works 
> with python 2, but since that platform is now dropped in the wake of the 
> good ship SS Python, it's time to either bite the bullet and fix the 
> feature or deleted it entirely from the website, book, and promotion of 
> 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/9093074d-9d72-427e-a1cd-68d10e4875e1n%40googlegroups.com.


Re: [web2py] Re: Migrate a PostgreSQL Webfaction DB to Opalstack

2020-10-27 Thread Jose C
On Tuesday, 27 October 2020 at 14:35:23 UTC Ramos wrote:

> rsync is awesome :) 
> thank you
>

Yes, a very nifty little utility... and if you backup to any cloud 
providers, then check out rclone as well (built on 
rsync).

  

-- 
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/99e7143a-8c53-41d0-9b62-da7387ffn%40googlegroups.com.


[web2py] Re: Migrate a PostgreSQL Webfaction DB to Opalstack

2020-10-27 Thread Jose C
Opalstack have some migration tools available: 
https://community.opalstack.com/d/155-howto-migrate-stuff-automatically-from-webfaction

Also I found my old notes from when I moved my web2py apps and PG databases 
over 18 months ago, hopefully they will help.  Also includes how to sync 
images directories between servers...


1) sync photos directories between WF and OS:

rsync -avh --dry-run   @web565.webfaction.com:/home//
virtenvs//lib/web2py/applications//static/photos/home
//virtenvs//lib/web2py/applications//static 
 > results_photos.txt

logs what would happen to the results_photos.txt file.

When ready to execute, remove the --dry-run parameter above.

2) on WF server:
pg_dump -U  -d  -h localhost -p  -f 
re_livedump.sql
gzip re_livedump.sql


3) copy to OS server and gunzip the file on the server.

4) ensure web2py server is not running (remember to comment out crontab 
autostart line as well) 
delete contents of the web2py/applications//databases directory.

5) on OS server, go into psql and remove existing tables, etc. if they exist
:
psql -U  -d 
DROP OWNED BY ;

6) load new database
psql -U  -d  -f re_livedump.sql

there may be a few error messages about the owner being different, safe to 
ignore.

7) set web2py DAL flags:
migrate=True
fake_migrate=True
lazy_tables=False

8) start up web2py.  Verify all table files created in the databases 
directory.

9) shutdown web2py and set the above flags to their inverses.  Also 
uncomment the crontab autostart line.

10) startup again and verify site is working as expected.  An option is to 
mount your new OS web2py app on a temp domain, sub-domain or even on 
.opalstacked.com for testing.


HTH,

-- 
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/a7031961-424b-46c7-9c3a-4b1a02ca46f1o%40googlegroups.com.


[web2py] Re: Opalstack for ex-webfaction users or people looking for a Web2Py Web Hosting (Tutorial for Python 3 or 2.7)

2020-10-26 Thread Jose C


On Monday, 26 October 2020 01:55:05 UTC, Carlos A wrote:
>
> Try this:
>
> cd ~/apps/yourapp
> source env/bin/activate
> cd web2py/
> python -c "from gluon.main import save_password; 
> save_password(raw_input('admin password: '), )"
>
> Note: You can find your assigned port with the command  "ls"  inside of 
> the web2py path and looking for the file:  
>  parameters_.py
>
>
Yep, that works and sets the password using a pbkdf2 hash which is web2py 
default.  Quick note for anyone following: if using py3 then raw_input 
above becomes just input.

Also, given the original thread title, noting here that they have created 
WF migration scripts to move databases, sites, etc. over.   See: 
https://community.opalstack.com/d/155-howto-migrate-stuff-automatically-from-webfaction

Lots of other useful info on their forums, especially the tutorial 
section:  https://community.opalstack.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/efc9b324-07bd-4ef8-8efa-e7efbb407e6ao%40googlegroups.com.


[web2py] Re: Web2py adn Gzip

2020-10-24 Thread Jose C
On Saturday, 24 October 2020 20:13:23 UTC+1, Jose C wrote:
>
> > The zip_static_files.py utility in your web2py scripts directory will 
> create gzipped versions of all your static files for you. 
>
>> Great.
>> However something goes wrong.
>>
>
>  
As a workaround, you could probably quite easily customize the script.  

It looks like it only needs the web2py environment to get the 
request.folder variable to find the static directory of your app.  If you 
edit the script and change where it gets which folder to scan (hardcode or 
pass in via command line, for example), you should then be able to run it 
simply from python (3 or 2) externally without loading the web2py app.

That should overcome the bug. 

HTH,


-- 
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/0f54bce2-3a67-4e5c-af34-e8f4281f6455o%40googlegroups.com.


[web2py] Re: Web2py adn Gzip

2020-10-24 Thread Jose C
> The zip_static_files.py utility in your web2py scripts directory will 
create gzipped versions of all your static files for you. 

> Great.
> However something goes wrong.
>

hmmm, what is your python version?  And web2py version?  I'm suspecting 
this tool hasn't been updated to py3.

-- 
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/87dd366e-325c-4597-b906-881b19412ddao%40googlegroups.com.


[web2py] Re: Web2py adn Gzip

2020-10-24 Thread Jose C
I requested gzip as well for a static media site (https) and they said:

Our front-end Nginx server will not use gzip compression for requests 
> served over HTTPS. This is by design as a mitigation for the BREACH 
> exploit .
>
> We've an internal feature ticket open to consider making the mitigation 
> optional for customers that don't need it. I will make a note of your 
> inquiry there.
>

Perhaps you can +1 them on this feature request.

However, if you're serving your static files via web2py itself (and not via 
a static app on another domain for speed) then web2py will send the .gz 
file version of a requested asset if it exists.  For example, a request for 
mysite.css comes in, web2py sends mysite.css.gz automatically if it exists, 
else it sends mysite.css.

The zip_static_files.py utility in your web2py scripts directory will 
create gzipped versions of all your static files for you.

HTH,

-- 
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/fbf7bf49-869a-4de0-84a4-6891be8e2fafo%40googlegroups.com.


[web2py] Re: Opalstack for ex-webfaction users or people looking for a Web2Py Web Hosting (Tutorial for Python 3 or 2.7)

2020-10-21 Thread Jose C


On Wednesday, 21 October 2020 20:10:02 UTC+1, Gaël Princivalle wrote:
>
> Thank you Jose for your help. The Opalstack support have found an error in 
> the install script, now it works fine.
> ' For some reason the install script stored the wrong password hash
>

That's great!  Please post the new script here (or at least what line 
changed) so anyone else running into this problem can find it. 

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/63eadbc5-224a-45a2-be7b-a1109cf2f744o%40googlegroups.com.


[web2py] Re: Opalstack for ex-webfaction users or people looking for a Web2Py Web Hosting (Tutorial for Python 3 or 2.7)

2020-10-21 Thread Jose C
Can you try this:

Edit the parameters_.py file that was created and prepend 'md5$$' 
to the string of alphanum characters.
So it should now read (where the dots are the original text):
password='md5$$...' 

then stop and restart your app and see if you can login.

I'm just wondering if web2py is interpreting the hash as pbkdf2 instead of 
md5 (which is what the script creates).



-- 
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/b7816981-5e2b-4792-8991-a7e60d95c547o%40googlegroups.com.


Re: [web2py] Re: Opalstack for ex-webfaction users or people looking for a Web2Py Web Hosting (Tutorial for Python 3 or 2.7)

2020-10-21 Thread Jose C

On Wednesday, 21 October 2020 15:21:03 UTC+1, Ramos wrote:
>
> me too am crying a litle
> just send email to sup...@opalstack.com 
> The response time is not as fast as webfaction support but maybe the are 
> having a burst of clients from webfaction.
>
> Just looking at the volume on their forum and it looks like many people 
waited for the final announcement from WF to move... one guy alone is 
having to move 25 servers(!) each with lots of legacy apps over.  I think 
the support guys have their hands quite full at the moment.  

FWIW, in the 18 months I've been with them my support emails have generally 
all been answered within a two hour window.  I'm sure for the next few 
weeks this response time will suffer a bit.



-- 
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/fdbf0f55-0a2c-409c-af90-9b9578e5264co%40googlegroups.com.


[web2py] Re: Opalstack for ex-webfaction users or people looking for a Web2Py Web Hosting (Tutorial for Python 3 or 2.7)

2020-10-21 Thread Jose C


On Wednesday, 21 October 2020 13:50:05 UTC+1, Gaël Princivalle wrote:
>
> Thank you José, I've found the README file and the password.
> However this password is not accepted.
> I've made another Web2py installation but the result is the same.
>
> As this is quite the first step to migrate my Web2py websites to Opalstack 
> I just would like to cry...
>
>
Don't cry yet... it appears that the script and process worked ok for 
Carlos above given his (it works) comment so you must be close!  

Perhaps if you provide detailed steps of what you are doing and where you 
are trying to enter/use the password, someone may be able to help.

How are you starting web2py? 
Are you activating the virtualenv first (that was created by the script)?  
If so, it should appear within ( ) in your command prompt.
What error message(s) are you getting? At what point?


 

-- 
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/66109b3b-57da-4b8a-8152-9bc701ec47b5o%40googlegroups.com.


[web2py] Re: Opalstack for ex-webfaction users or people looking for a Web2Py Web Hosting (Tutorial for Python 3 or 2.7)

2020-10-21 Thread Jose C


On Wednesday, 21 October 2020 10:46:03 UTC+1, Gaël Princivalle wrote:
>
> I've installed Web2py on Opalstack but the Web2py admin password is not 
> the same as my shell one. How was it for you?
>

How did you install it? If you manually downloaded and installed it then 
the initial password creation procedure is detailed in:
http://www.web2py.com/books/default/chapter/29/03/overview?search=password#Overview
 

If you used the script that Carlos posted above, then it generates a random 
password and should create a README file in your app directory with these 
contents:

# Opalstack web2py README

Your web2py admin password is: {pw}

A md5 hash of the admin password is stored in:

   {appdir}/web2py/parameters_{appinfo["port"]}

Your web2py applications directory is:

   {appdir}/web2py/applications

The following scripts have been created to control
your web2py uwsgi instance:

   {appdir}/stop
   {appdir}/start


HTH,

-- 
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/9d9c581b-24fe-404f-be6b-484bcfb80205o%40googlegroups.com.


[web2py] Re: Opalstack for ex-webfaction users or people looking for a Web2Py Web Hosting (Tutorial for Python 3 or 2.7)

2020-10-20 Thread Jose C
On Tuesday, 20 October 2020 at 08:50:13 UTC+1 gaelpri...@gmail.com wrote:

> Thank you Carlos, I'll start this migration as soon as my Opalstack 
> account will be a provisioned.
> I've a doubt about the DBs. Opalstack offers MariaDB and PostgreSQL.
> It seems that it's not so easy to use PostgreSQL.
> https://groups.google.com/g/web2py/c/bc_8dg-XHpY/m/ci8A2RzzAwAJ
> I can switch my PostgreSQL DBs to MySQL, but in the connection string with 
> MariaDB I have to use the standard MySQL one?
> mysql://username:password@localhost/test?set_encoding=utf8mb4 
>

Hi Gael,
There's really no difference to the way it worked on webfaction.  That link 
above was a version issue with the psycopg2 library and Antonio shared a 
way to install the latest psycopg2 version (as did I, using psycopg2-binary 
package).

I wouldn't change databases.

HTH,

Jose

-- 
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/d7bd3a9c-60c6-4abd-8c8f-0aa2ffddecc4n%40googlegroups.com.


[web2py] Re: python3 sintax

2020-10-19 Thread Jose C


On Monday, 19 October 2020 22:06:02 UTC+1, Ramos wrote:
>
> can someone help ? understant why this worked in python 2.7 and not python 
> 3.6   
>
>   File 
> "/home/ramos/apps/fileit/web2py/applications/fileit/views/default/user.html", 
> line 75
> if 'HELP' in globals() and globals()['HELP']<>[]:
>  ^
> SyntaxError: invalid syntax
>
>

The <> operator is deprecated in python3.  Use != instead. 

-- 
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/956703c4-e8f0-4c81-921d-df5aab5343dao%40googlegroups.com.


Re: [web2py] Re: opalstack dal connection time out ?

2020-10-19 Thread Jose C


On Monday, 19 October 2020 21:51:00 UTC+1, Ramos wrote:
>
> got the answer from support
>
> Hi António, if you need psycopg2 then please install it like this:
>
> export PATH=/usr/pgsql-11/bin/:$PATH
> cd ~/apps/fileit
> source env/bin/activate
> pip install psycopg2
>
>
Glad to hear it's working.  The above is installing the latest psycopg2 
version into your virtual environment.  

-- 
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/6f94cb19-25ea-4a20-a68e-f13f7864e6d1o%40googlegroups.com.


[web2py] Re: opalstack dal connection time out ?

2020-10-19 Thread Jose C

I'm also on opal5 using postgres but still on web2py 2.18.5 (can't upgrade 
due to unresolved redis session issue).

I suspect you have a library version problem.

You're using the default system-wide python3 install, which is using 
psycopg2 version 2.7.7.  (Run psycopg2.__version__ at the command line 
after importing).

The highly recommended way to do this (to avoid conflicts and maintain your 
sanity) is to create yourself a virtual environment for your web2py app.  
Then pip install psycopg2-binary (plus whatever other packages you need for 
that app) which installs version 2.8.4 of the psycopg2 library.

Using this combo you should have no issues.

HTH,







On Monday, 19 October 2020 16:56:05 UTC+1, Ramos wrote:
>
> hello i´m starting my journey on Opalstack and my app cant connect to the 
> postgresql db
>
>  db = DAL('postgres://user:pwdXru@localhost:5432/database',
>
> the previous line does not work. I checked that psycopg2 is available in 
> python command line
> [image: image.png]
>
>  Failure to connect, tried 5 times: Traceback (most 
> recent call last): File 
> "/home/ramos/apps/fileit/web2py/gluon/packages/dal/pydal/base.py", line 
> 507, in __init__ self._adapter = adapter(**kwargs) File 
> "/home/ramos/apps/fileit/web2py/gluon/packages/dal/pydal/adapters/postgres.py",
>  
> line 28, in __call__ return AdapterMeta.__call__(cls, *args, **kwargs) File 
> "/home/ramos/apps/fileit/web2py/gluon/packages/dal/pydal/adapters/__init__.py",
>  
> line 41, in __call__ obj = super(AdapterMeta, cls).__call__(*args, 
> **kwargs) File 
> "/home/ramos/apps/fileit/web2py/gluon/packages/dal/pydal/adapters/postgres.py",
>  
> line 67, in __init__ after_connection, File 
> "/home/ramos/apps/fileit/web2py/gluon/packages/dal/pydal/adapters/base.py", 
> line 417, in __init__ super(SQLAdapter, self).__init__(*args, **kwargs) 
> File 
> "/home/ramos/apps/fileit/web2py/gluon/packages/dal/pydal/adapters/base.py", 
> line 85, in __init__ self.find_driver() File 
> "/home/ramos/apps/fileit/web2py/gluon/packages/dal/pydal/adapters/base.py", 
> line 134, in find_driver "No driver of supported ones %s is available" % 
> str(self.drivers) RuntimeError: No driver of supported ones ('psycopg2',) 
> is availableVersão
> web2py™ Version 2.20.4-stable+timestamp.2020.05.03.05.18.50Traceback
>
> 1.
> 2.
> 3.
> 4.
> 5.
> 6.
> 7.
> 8.
> 9.
> 10.
> 11.
> 12.
> 13.
> 14.
> 15.
> 16.
> 17.
> 18.
> 19.
> 20.
> 21.
> 22.
> 23.
> 24.
> 25.
> 26.
> 27.
> 28.
>
> Traceback (most recent call last):
>   File "/home/ramos/apps/fileit/web2py/gluon/restricted.py", line 219, in 
> restricted
> exec(ccode, environment)
>   File "/home/ramos/apps/fileit/web2py/applications/fileit/models/db1.py" 
> , line 
> 34, in 
> check_reserved=['mysql', 'postgres'])  # ['all'])
>   File "/home/ramos/apps/fileit/web2py/gluon/packages/dal/pydal/base.py", 
> line 209, in __call__
> obj = super(MetaDAL, cls).__call__(*args, **kwargs)
>   File "/home/ramos/apps/fileit/web2py/gluon/packages/dal/pydal/base.py", 
> line 526, 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/ramos/apps/fileit/web2py/gluon/packages/dal/pydal/base.py", 
> line 507, in __init__
> self._adapter = adapter(**kwargs)
>   File 
> "/home/ramos/apps/fileit/web2py/gluon/packages/dal/pydal/adapters/postgres.py",
>  line 28, in __call__
> return AdapterMeta.__call__(cls, *args, **kwargs)
>   File 
> "/home/ramos/apps/fileit/web2py/gluon/packages/dal/pydal/adapters/__init__.py",
>  line 41, in __call__
> obj = super(AdapterMeta, cls).__call__(*args, **kwargs)
>   File 
> "/home/ramos/apps/fileit/web2py/gluon/packages/dal/pydal/adapters/postgres.py",
>  line 67, in __init__
> after_connection,
>   File 
> "/home/ramos/apps/fileit/web2py/gluon/packages/dal/pydal/adapters/base.py", 
> line 417, in __init__
> super(SQLAdapter, self).__init__(*args, **kwargs)
>   File 
> "/home/ramos/apps/fileit/web2py/gluon/packages/dal/pydal/adapters/base.py", 
> line 85, in __init__
> self.find_driver()
>   File 
> "/home/ramos/apps/fileit/web2py/gluon/packages/dal/pydal/adapters/base.py", 
> line 134, in find_driver
> "No driver of supported ones %s is available" % str(self.drivers)
> RuntimeError: No driver of supported ones ('psycopg2',) is available
>
>
>

-- 
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/8ef9403c-b1e5-4d15-b638-360cf

[web2py] Re: routes.py and root_static

2020-10-19 Thread Jose C


On Monday, 19 October 2020 10:33:50 UTC+1, Annet wrote:
>
> Hi Jose,
>
> Thanks for your reply.
>
> One more thing. I've got routes.py in web2py's root folder, as you can see 
> I've got
> three applications, do I place the robots.txt file in all three 
> application's static
> folder?
>
>
Yes you'd have one robots.txt for each application, and they can be 
different.  So for example, assuming your init app at domain.com is public 
and allows access to everything you'd have a robots.txt with something like:

User-agent: *
Disallow: 


Then assuming that in your admin and controlpanel apps you want no indexing  
you might have a robots.txt in each app folder with something like:
User-agent: *
Disallow: /


In other words, when web2py receives a request for 
http://(www.)domain.com/robots.txt it will serve the robots.txt file in the 
init application's static dir.  If the request is for 
http://ldc.domain.com/robots.txt then it serves the robots.txt file that is in 
the admin app's static directory, and so on.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/160c8d2e-d6e6-476d-b0d3-83f90e456e8eo%40googlegroups.com.


[web2py] Re: scheduler error no such column: scheduler_task.broadcast

2020-10-18 Thread Jose C
I'm not sure if this is different with sqlite but with postgres and mysql, 
you would do the following:
1) delete all the .table files in the databases directory
2) set migrate=True and fake_migrate=True (also make sure lazy_tables is 
False)
3) start your app with the scheduler option enabled.  You should see the 
new .table files created for all tables in the db, including the scheduler.
4) shutdown your app and now you can set migrate=False (avoid any unplanned 
table changes) and lazy_tables=True.  Now restart your app and it *should* 
work as expected.

This is how I moved quite a few of my apps between servers (all on postgres 
though - but I imagine it works the same with sqlite).

More info: 
http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer?search=fake_migrate#table_migrations
 

HTH,

On Sunday, 18 October 2020 at 00:54:53 UTC+1 Ramos wrote:

> Hello i moved my app to opalstack from webfaction.
> I have a sqlite db. I deleted all files inside databases folder with 
> .table extension and changed dal connection to 
> migrate=False,fake_migrate=False
> all is ok now but i cant start scheduler.
> I went to app admin and got the same error.
> I noticed that .table files are created in databases folder for 
> scheduler_* tables
>
> any help?
> thank you
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/77e16951-7284-4777-904a-7904ef24c2edn%40googlegroups.com.


Re: [web2py] Re: web2py hosting

2020-10-16 Thread Jose C

>
> Did someone tried this one?
> https://www.mddhosting.com/
>
> It seems a new company made by old Webfaction guys.
>
> Not sure about that.  They say their company was created in 2007.  WF was 
still brilliant then.  The only 'new' company founded by ex-Webfaction guys 
that I know of is Opalstack.  See: 
https://www.opalstack.com/2019/03/13/its-time-to-switch-to-an-independently-owned-hosting-company/

 

-- 
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/ae13691f-8847-4c86-b0b3-6db17e6426a9o%40googlegroups.com.


Re: [web2py] Re: web2py hosting

2020-10-16 Thread Jose C


On Friday, 16 October 2020 15:11:40 UTC+1, Ramos wrote:
>
> This is not good for me , opalstack is offline for support sometimes.
>
> Webfaction is always on and has a ticketing system with a priority flag!
>

Not sure how you got to that screen - looks like an online chat window?   
I've always just send email direct to supp...@opalcom and someone 
responds pretty quickly.

-- 
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/296bbb92-40d6-403b-a175-d26f83f8a9e3o%40googlegroups.com.


[web2py] Re: How to use multiple bespoke 400 pages with error text

2020-10-16 Thread Jose C


On Wednesday, 14 October 2020 15:43:05 UTC+1, hyan...@googlemail.com wrote:
>
> I'm creating my own bespoke 404 / 400 error page by editing routes.py like 
> this:
>
> routes_onerror = [('app/400', '/app/default/custom_400.html')]
>
> and I have 2 questions: 
>
> 1) The custom_400 page is displayed when from within a controller, I call 
> e.g. 
>
> raise HTTP(400, "my error message text")
>
> How do I access/display the error message text within my custom_400.html 
> page?
>
> 2) If it is is not an HTML view which is being called, but a JSON view, I 
> want to return a JSON page instead which, for example, reads {"error":"my 
> error message text"}. How do I do that? Can I just create a 
> custom_400.json view, and remove the .html from my line in routes.py?
>
>
If I remember correctly, the message in your point 1) will only display if 
you do not have a custom page it overrides the default plain http error 
code text that web2py produces.
As to point 2) which may help you solve point 1) as well, I think you may 
need to use dynamic error pages.

For example, I have a controller called 'errors' that looks like this:
def error_404():
""" Dynamic 404 error page... receives 

"""
# Set response code to original error, otherwise it will be 302.
response.status = 404

is_property = '/propert' in request.vars.requested_uri.lower()

if is_property:
return response.render('errors/error_404_property.html', {})  # 
This is an ordinary view so pass variables in the dict as 2nd parameter.
else:
return response.render('errors/error_404_general.html', {})

Then I have two (normal) views in /applications/myapp/views/errors that 
correspond to the two views used above with different messages.

In routes.py:

routes_onerror = [
(r'*/400', r'/static/400.html'),# bad request
(r'*/403', r'/static/403.html'),# forbidden
(r'*/404', r'/errors/error_404'),# DYNAMIC - not found page
]

Having said all that, to return json on 400 error, I would test whether 
this works for you:

No views need to be created. In the errors controller, in the function you 
create, just return dict(error='my err message')In routes_onerror, 
try:  ('app/400', '/app/default/custom_400.json').  Web2py's automatic json 
conversion should kick in and return the json if all goes well.  Remember 
to restart your app each time you change anything in routes.py.

See: 
http://www.web2py.com/books/default/chapter/29/03/overview?search=json#Simple-examples
 
for how the .json extension should automatically work.

HTH,


-- 
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/9ec7f519-02b8-4c39-8566-fc03334d0151o%40googlegroups.com.


[web2py] Re: routes.py and root_static

2020-10-16 Thread Jose C

>
>
> BASE = dict(
> domains = { },
> root_static = ['favicon.ico', 'robots.txt'],
> ),
> )
>
> would this be correct?
>
> Should robots.txt go into the /applications/init/static/
>

Yep, any files served at the root of your site (e.g.  
https://mydomain.com/robots.txt)  go in the /static directory of your app 
and then you specify them in the root_static list as you've done.  
Reminder, you need to restart your app each time you change anything in 
routes.py for the new changes to take effect.

Jose


-- 
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/b818de18-2dd2-4859-85a7-d12a7f52960bo%40googlegroups.com.


Re: [web2py] Re: web2py hosting

2020-10-16 Thread Jose C
HI Antonio,

Can't speak as to pythonanywhere, but Opalstack definitely supports 
automatic Letsencrypt certificates - I have it set up on all my sites.  You 
just flip a switch on each website and the rest is handled automatically, 
including auto-renewals.
See: 
https://help.opalstack.com/article/35/how-can-i-use-a-lets-encrypt-ssl-certificate
 

Also for other general info you may need: 
https://help.opalstack.com/category/1/opalstack-guide 
<https://help.opalstack.com/article/35/how-can-i-use-a-lets-encrypt-ssl-certificate>
 

I also used to use the mail2script functionality when on WF to handle 
incoming bounced emails.  Last I inquired Opalstack said it was on their to 
do list as they were working on their API, but they suggested an easy 
workaround which I've been using since then with no problems.

On Opalstack I implemented the same functionality by dumping copies of 
incoming emails I wanted to process into one specific dedicated IMAP 
mailbox.  Then my script runs via cron (every 5 minutes) and checks that 
mailbox periodically for new messages, processes them and deletes them from 
the mailbox.

The code is simple (sorry, I can't find the code formatting options in this 
new google reply interface):
# Connect to imap mailbox.
ctx = ssl.create_default_context()
server = imaplib.IMAP4_SSL(host=imaphost, ssl_context=ctx)
server.login(mailbox,passwd)
server.select()
resp, items = server.search(None, "UNSEEN")
   
# process any message(s). 
for i in items:
 resp, data = server.fetch(i, "(RFC822)") 
 do whatever with the message here..
 server.store(i, '+FLAGS', '\\Deleted')   # Set delete flag 
on this message. 

server.expunge()# Physically remove messages that are 
flagged as deleted from the mailbox (actually delete). 
server.close()
server.logout()
 

There's also a near realtime example using IMAP IDLE listeners if once a 
minute via cron isn't enough.  See this thread for details:  
https://community.opalstack.com/d/13-mail2script-functionality

HTH,

Jose


On Friday, 16 October 2020 at 09:44:02 UTC+1 Ramos wrote:

> i need https ssl certificates (automatic letsencrypt). opalstack and 
> pythonanywhere dont refer this option as available.
> also i have a virtual email address that forward incoming emails to python 
> script like pic attached. Do pythonanywhare permit this ? i already 
> know that opalstack dont permit this yet..
> [image: image.png]
>  
>
>

-- 
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/01ce7579-93dd-405b-8aad-e823f3940628n%40googlegroups.com.


Re: [web2py] Re: web2py hosting

2020-10-14 Thread Jose C
Hi Antonio, 

I just saw this announcement:
https://www.webfaction.com/faq

Reading the "What will not be available when I am migrated to tsohost"...  
makes you wonder what they actually do host on their servers!  And they're 
starting migrations in a couple of weeks and shutting WF down 100% in March.

Anyone who liked the WF control panel, services offered and way of doing 
things AND who wants a seamless transfer of their sites to another host, do 
yourselves a favour and create an account on Opalstack and check them out.  
You should feel right at home.

Either way, good luck with your migrations.

Jose

On Wednesday, 14 October 2020 at 15:51:52 UTC+1 Ramos wrote:

> no python??? on TsoHost?? 
>
> Em qua., 14 de out. de 2020 às 15:50, António Ramos  
> escreveu:
>
>> no postgresql db... i´m doomed
>>
>> Em qua., 14 de out. de 2020 às 15:00, Gaël Princivalle <
>> gaelpri...@gmail.com> escreveu:
>>
>>> I think the new business TsoHost plans are the ones that will replace 
>>> the Webfaction cloud plans:
>>> https://www.tsohost.com/business-hosting
>>>
>>> Il giorno mercoledì 14 ottobre 2020 alle 15:55:32 UTC+2 Gaël Princivalle 
>>> ha scritto:
>>>
>>>> Hi Antonio.
>>>>
>>>> i'm worried about the same thing.
>>>>
>>>> It seems that all the applications gone be migrated to TsoHost, a 
>>>> Godaddy company.
>>>>
>>>> Someone have some experience about Web2py on TsoHost  ?
>>>>
>>>> Il giorno venerdì 22 maggio 2020 alle 09:45:12 UTC+2 Ramos ha scritto:
>>>>
>>>>> I´m a webfaction long time user and from another post here i got 
>>>>> worried about the godaddy acquisition.Eventually webfaction may die in a 
>>>>> short term period.
>>>>>
>>>>> Can you recommend a good alternative? 
>>>>> Can you share your experience?
>>>>>
>>>>> Opalstack
>>>>> pythonanywhere
>>>>>
>>>>> others ?
>>>>>
>>>>> regards
>>>>> António
>>>>>
>>>> -- 
>>> 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/515e3e7a-375e-4a9c-9708-2dd0d59cda3an%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/web2py/515e3e7a-375e-4a9c-9708-2dd0d59cda3an%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/4560eb38-1896-4402-9021-28da7ae5e065n%40googlegroups.com.


[web2py] Re: web2py hosting

2020-10-12 Thread Jose C
Hi Annet,  

Just FYI, I'm going on 18 months now with Opalstack and couldn´t be 
happier.  Running multiple web2py (and other) apps on servers in US and EU, 
hosted email, etc. with the same access and levels of control I'd had on 
WF.  And most importantly, always the same incredible customer focus and 
willingness to help that originally made WF famous, that is, until their 
encounter with the Borg/GD  ;)

I doubt you'll have any regrets,

Jose




On Saturday, 10 October 2020 at 17:07:20 UTC+1 Annet wrote:

> Hi Antonio,
>
> I came across your post, and thought I'd share my experience with 
> Opalstack.
>
> I am a web developer not a server administrator, I hosted at Webfaction 
> because their
> support people were very patient and helpful. After joining forces with GD 
> support no
> longer stands out from the crowd.
>
> Last week I signed up with Opalstack, https://www.opalstack.com/ and I am 
> glad I did, 
> great support and a simple but powerful control panel. One of the former 
> WF support 
> people wrote a web2py install script which got me up and running in no 
> time.
>
> Hope this was helpful,
>
> Annet V.
>
> Op vrijdag 22 mei 2020 om 09:45:12 UTC+2 schreef Ramos:
>
>> I´m a webfaction long time user and from another post here i got worried 
>> about the godaddy acquisition.Eventually webfaction may die in a short term 
>> period.
>>
>> Can you recommend a good alternative? 
>> Can you share your experience?
>>
>> Opalstack
>> pythonanywhere
>>
>> others ?
>>
>> regards
>> António
>>
>

-- 
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/f6ca004f-3e88-485b-90f8-5b3251c447fdn%40googlegroups.com.


Re: [web2py] Re: fake_migrate=True is not working

2020-08-28 Thread Jose C

>
> thank you Jim, but I don't understand...
>
> If I set 
> migrate=False
> fake_migrate= True
>
> it means that web2py create the .table files without touching the db, 
> isn'it?
>
> If I set
> migrate=True
> fake_migrate=True
>
> It means what exactly?
>

migrate=True tells web2py to do the table migration procedure (i.e. make 
any changes to your db based on your models) .   
fake_migrate=True tells web2py to *not* actually create the tables in the 
db itself but to just create the .table files (without any db action).

If migrate=False then web2py does nothing further, regardless of the 
fake_migrate setting.

For more info, see: 
http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer?search=fake_migrate#table_migrations

HTH,

>  
>

-- 
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/81112fee-308b-43fc-9671-4fb63ab124b9o%40googlegroups.com.


[web2py] Re: Samesite attribute in cookies

2020-08-08 Thread Jose C
What version of web2py are you using?  At least from 2.18.5+ it 
specifically defaults to samesite Lax (and you would have to call 
session.samesite(False) to override the Lax setting).  

You could try put session.samesite('Lax') somewhere in your model and see 
if that resolves the issue.

You can try putting session.secure() in a model (if your site uses https).

You can also have a peek inside gluons/globals.py, specifically the Session 
class definition, to see what your web2py is doing with the samesite 
setting by default.


HTH,

-- 
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/d7208f93-63c5-45d4-af11-11764d9b35d6o%40googlegroups.com.


Re: [web2py] Use cron

2020-07-29 Thread Jose C
Hi Dave,

This is a problem for you?  I've had my scheduler running on AWS and 
> Postgres for months without issue.  I actually have a second scheduler 
> running in sqlite3 on the same machine.  No issue.
>

Actually it becomes more of an issue if you are on a shared server with a 
limited shared resources plan.  Some limit number of long running processes 
as well as RAM.  Also there is the extra RAM used (my scheduler process 
started at 35Mb and slowly crept up over time).  

Things that aren't python are better run via system cron, but the scheduler 
> does a fine job for application-related pythonic work.
>
 
My main problem was I had a few situations where my main scheduler process 
would just completely hang on a task (not the same one each time).  Never 
figured out the actual cause (no errors or tickets) but I had to write a 
script that would periodically (run from cron ;)  ) interrogate the 
scheduler worker tables for last run times and status and warn me if 
something was out of bounds.  Fiddling with worker statuses, etc. in the 
tables didn't resolve the issue - I had to kill -9 the process and restart 
it.  This is with 2.18.5 on CentOS.  When I refactored the code to move to 
python3 I moved to using crontab and, with my use case, not had a single 
problem since.  Each task runs independently and one 'glitch' does not stop 
all other tasks from running which caused me some grief.




-- 
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/47d77c25-4abd-4b94-bd7c-d36a446dd52fo%40googlegroups.com.


[web2py] Re: Autocomplete JSON output format.

2020-07-28 Thread Jose C
I suspect that it has to do with the headers that are set on the response 
object.  

When calling the function with .json extension (as in my example) the 
content-type headers are automagically set by web2py to application/json 
and the content formatted accordingly.  

>From what I can tell, your method will return a string/html type.  It is 
likely that the JS code is internally checking the returned response and 
expecting json as content-type. 

If I call my controller function without the .json extension, I get the 
same JSON.parse error message.






-- 
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/2d392b8b-bd05-4a0e-b3e4-6ed890b0d169o%40googlegroups.com.


[web2py] Re: Autocomplete JSON output format.

2020-07-28 Thread Jose C
One way to get your 2nd option:

in controller:

def country_list():   
   countries = []
   for rec in db(query).select(db.vtx_vertex.name, left=left, distinct=True, 
orderby=db.vtx_vertex.name):
   countries.append(rec.name)
   return dict(suggestions = countries)

in the view (js), call the controller function above using .json 
extension:   https://mysite.com/country_list.json

Depending on your settings, you may need to add '*.json' to 
response.generic_patterns if you have overridden those at any point.

HTH,



-- 
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/d4c177ac-c8f3-459e-9f66-d43856d769e6o%40googlegroups.com.


Re: [web2py] Use cron

2020-07-28 Thread Jose C
Just FYI, the web2py book states:

Try to avoid web2py cron, and use a background process instead. web2py cron 
> can start too many Python instances and cause excessive memory usage.
>

Using scheduler means an additional long running process using up memory to 
monitor and manage the scheduler.

I'd recommend using your system crontab to run any background processes.  
This can be invoked within the full web2py environment (if needed) from 
crontab as follows:

# Runs every 5 minutes. 
*/5 * * * *  python3  /path/to/web2py.py --no_gui --no-banner -S 
 -M -R  /path/to/process/background_process.py

HTH,

-- 
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/4cb3cc28-fb91-4459-b221-695f8219da01o%40googlegroups.com.


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

2020-07-10 Thread Jose C
In addition to the other replies, you can also set the headers easily 
yourself in web2py (although depending on your own web server settings, 
some may be overwritten).  For example, in a model (say):

response.headers['Strict-Transport-Security'] = 'max-age=63072000; 
includeSubDomains; preload'
response.headers['Referrer-Policy'] = 'no-referrer-when-downgrade'
response.headers['X-Powered-By'] = ''
response.headers['X-Frame-Options'] = 'DENY' 

HTH,
Jose

-- 
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/370e6697-907c-42f0-9b8c-135df614efbdo%40googlegroups.com.


Re: [web2py] Re: Displaying errors in bootstrap collapse

2020-07-09 Thread Jose C
Glad it helped, cheers.

-- 
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/c993218b-2293-4eca-ac87-d68a9c3fdb47o%40googlegroups.com.


[web2py] Re: Displaying errors in bootstrap collapse

2020-07-08 Thread Jose C
Hi Jim,

Just got a minute... I use something like this to scroll to and highlight 
the first field in a long form (but not within a Collapse structure).   Off 
the top of my head, you're submitting to web2py, so in the controller:

if form.process().accepted:

elif form.errors:
focus_field = next(iter(form.errors.keys()))

return dict(., focus_field=focus_field)


then, in the view:

{{ if focus_field: }}

$(function() {
   $("[name='{{=focus_field}}']").focus();
});

{{pass}}

Could something like that work in your case? On field focus, does the 
collapse open automatically?

HTH,

Jose





How about in your controller,

-- 
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/d189309d-a7e4-4fac-a007-02412532c1cco%40googlegroups.com.


Re: [web2py] Re: Session / Originating IP

2020-07-08 Thread Jose C
If I recall correctly, the default login expiration for the standard web2py 
login functionality is 1 hour (from last access).

If you enable the 'remember me' checkbox on login it should set the expiry 
to 30 days (by default).  You should also be able to set a custom long 
expiration time with auth.settings.long_expiration:  

For example, I have this in one of my model files which keeps me logged in 
for a month:

auth.settings.long_expiration = 2592000# seconds in one month
auth.settings.remember_me_form = True
auth.messages.label_remember_me = "Remember me (for 30 days)"

More info:  
http://www.web2py.com/books/default/chapter/29/09#Auth-Settings-and-messages

HTH,
Jose

-- 
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/7241821b-130c-4871-bb9c-a8c4fcde554ao%40googlegroups.com.


[web2py] Re: Session / Originating IP

2020-07-08 Thread Jose C
I haven't looked into the code specifically, but can tell you that when I 
change IP's mid session, (by connecting to a VPN) it has no impact on the 
session being used at the time.  That is, the same session continues to be 
used in all interactions with the site.

I use redis to store my sessions but can't imagine that the session 
handling code would be different depending on where the session is stored.

>From mobile, the easiest way to test would be connect via your provider's 
connection (and ip), establish a session to your site,  then disconnect 
mobile data and connect to your site again with your local wi-fi connection 
(which is a different ip).  Should give you the answer.

Hope that helps,

Jose



-- 
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/4287e578-1f01-42a4-bb76-e73c44caf269o%40googlegroups.com.


[web2py] Re: 2.19.1 redis sessions problem

2020-06-10 Thread Jose C

Thanks for confirming...  issue created: 
https://github.com/web2py/web2py/issues/2330




On Wednesday, 10 June 2020 17:03:39 UTC+1, Joe Barnhart wrote:
>
> Yep.  I just confirmed the errant behavior with web2py 2.20.4 and python 
> 3.8.2.  If reds sessions are enabled the logon never completes.
>
> -- Joe B.
>
> On Sunday, March 29, 2020 at 11:39:10 PM UTC-5, Massimo Di Pierro wrote:
>>
>> Sorry. We should fix this. Will look into it asap.
>>
>> On Sunday, 29 March 2020 15:38:27 UTC-7, Jim S wrote:
>>>
>>> FWIW - I've abandoned redis for sessions.  I can't get it to work 
>>> reliably and no one seems interested in fixing it.  I submitted some 
>>> patches but they were rejected.  So, I've moved my sessions into my 
>>> database.  Not what I wanted to do, but at least that works reliably.  
>>> Sorry to be negative about this, it just seems it isn't a priority for the 
>>> project.
>>>
>>> -Jim
>>>
>>>
>>> On Saturday, March 28, 2020 at 5:30:11 AM UTC-5, Jose C wrote:
>>>>
>>>> Just started testing version 2.19.1 (prior to upgrading) with py3.6 and 
>>>> it appears that when sessions are stored in redis, a new session is being 
>>>> created each time the login is submitted which then prevents a session 
>>>> from 
>>>> logging in.  
>>>>
>>>> This issue was discussed in 
>>>> https://groups.google.com/forum/#!msg/web2py/z1ee025ghRU/qByNuEjGAgAJ  
>>>> and Jim S found a workaround with the .decode function which worked on py3 
>>>> but not on py2 (and which I've been using live).  It looks like the redis 
>>>> session code has been refactored in 2.19.1 to remove all the decodes but I 
>>>> can't get it to work correctly.
>>>>
>>>> Can anyone confirm whether they have this issue when trying to login 
>>>> using redis sessions in 2.19.1 (with py3)?  If confirmed, I'll file a bug 
>>>> report.
>>>>
>>>> Thanks,
>>>>
>>>> Jose
>>>>
>>>

-- 
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/1e28ed19-5eba-44a7-947e-ae3bc76aba1do%40googlegroups.com.


[web2py] Re: __pycache__

2020-05-21 Thread Jose C
I just wonder where the directory and the file came from. I don't
>
> think I compiled the init application.
>
>
>
It's created by Python3... There's a good discussion on it at stackoverflow 
<https://stackoverflow.com/questions/16869024/what-is-pycache#16869074>

HTH,

Jose

-- 
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/a866c5be-069c-416c-ab60-68d9b3f54881%40googlegroups.com.


[web2py] Re: Webfaction anyone ??

2020-05-21 Thread Jose C
A bit off-topic (other than the title) but given the GoDaddy buyout of 
webfaction (putting it on temporary life support) you may want to consider 
thinking about options for your hosting if they follow through and shutdown 
webfaction and enforce the godaddy migration they announced.  I'd been a 
webfaction client since they virtually started up, but have moved to opalstack 
<http://opalstack.com>and never looked back... It's founded by 3 
ex-webfaction guys who you'll probably recognise from their support forum 
posts.

Superb service, familiar webfaction-y control panel (made it ultra easy to 
move all my web2py apps, they even have a python-uwsgi one click install) 
with all the trimmings plus DKIM support for mail, choice of server and 
mailbox locations and the list just goes on.  

Nothing to gain from this post, just a satisfied client that spent many 
long hours looking for and evaluating alternatives to WF and at long last, 
found the Opalstack guys.  Been with them a year now, using their shared 
servers in Germany and the US.

Hope this helps/saves someone a lot of effort and time,

Jose

-- 
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/0590a30f-2470-4921-8fa1-2d1f3540d5c1%40googlegroups.com.


[web2py] 2.19.1 redis sessions problem

2020-03-28 Thread Jose C

Just started testing version 2.19.1 (prior to upgrading) with py3.6 and it 
appears that when sessions are stored in redis, a new session is being 
created each time the login is submitted which then prevents a session from 
logging in.  

This issue was discussed in 
https://groups.google.com/forum/#!msg/web2py/z1ee025ghRU/qByNuEjGAgAJ  and 
Jim S found a workaround with the .decode function which worked on py3 but 
not on py2 (and which I've been using live).  It looks like the redis 
session code has been refactored in 2.19.1 to remove all the decodes but I 
can't get it to work correctly.

Can anyone confirm whether they have this issue when trying to login using 
redis sessions in 2.19.1 (with py3)?  If confirmed, I'll file a bug report.

Thanks,

Jose

-- 
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/37d39ee0-c7a8-4b42-a5f3-896d2e1cf847%40googlegroups.com.


[web2py] Re: Redis session error - latest web2py master

2019-11-29 Thread Jose C
On Thursday, 28 November 2019 23:21:39 UTC, Massimo Di Pierro wrote:
>
> py4web does sessions in redis by default (if you have redis). Just saying.
>

Yep and it looks promising but I don't have the guts to migrate a mature 
site with tens of thousands of users on to it yet - a bit too bleeding edge 
still.  Plus it looks like it will take a reasonable amount of refactoring 
an existing web2py app on py4web from my (limited) testing.  But next new 
app I need to build I'll definitely give it a try.

-- 
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/06e85ba9-001f-4a70-9681-13841b832190%40googlegroups.com.


[web2py] Re: Error on model db.py

2019-11-28 Thread Jose C
Remove the bracket after 'reference person' on line 16.



On Thursday, 28 November 2019 21:07:56 UTC, Chuck G. Madamombe wrote:
>
> I have attached the code and the error message. Please help!
>

-- 
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/cbce4898-abaf-4540-88b9-05d34f60bc86%40googlegroups.com.


[web2py] Re: Redis session error - latest web2py master

2019-11-28 Thread Jose C

>
>
> Any feel for how many people are using redis for sessions?
>
> +1 on on redis for sessions.  Use it for multiple apps although they're 
all older web2py versions and python 2 setups.  Upgrading one to python 3 
and web2py 2.18.5 which is when the redis session functionality broke.  
Jim's fix is working for me on python3 with the early Nov master of web2py 
(pre 2.19.0 it appears from changelog).  Sessions appear to be working as 
intended under this setup.

I think Leonel posted earlier that they're also using redis for sessions.

HTH,

-- 
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/a1793f04-baff-4550-be1a-46117b3f712e%40googlegroups.com.


[web2py] Re: Redis session error - latest web2py master

2019-11-15 Thread Jose C
Nice catch, Jim the .decode() on line 192.  It appears to be working as 
expected now (at least in my use case).

I am going to continue testing session functionality and will report if any 
further issues arise.


-- 
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/f63eccc9-3a44-45af-ae18-9b68c7e524ec%40googlegroups.com.


Re: [web2py] Re: Error with sessions on redis

2019-11-08 Thread Jose C


> What do you think about Joe Barnhart's solution? 
> My point with redis is that I am using database sessions, finally my 
> goal is to unburden it since I have plenty of RAM on the application 
> server ... 
>

I haven't tried it but as Joe says his patch was rejected but I'm not sure 
why.  Could be it causes some other problems. 

-- 
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/bedc7b4f-03ca-4a02-905c-2bec885b004e%40googlegroups.com.


Re: [web2py] Re: Error with sessions on redis

2019-11-08 Thread Jose C
Hi Aureo,

You're hitting a bug in web2py's redis session implementation that does not 
yet have a fix.  Basically redis cannot be used for sessions at this stage 
with web2py 2.18.5 and either versions 2 or 3 of the redis python library.

see (for your bug): 
https://groups.google.com/forum/#!searchin/web2py/redis%7Csort:date/web2py/0iU2wqSik0k/P5keoe9eBAAJ
and (for latest master status):  
https://groups.google.com/forum/?fromgroups#!topic/web2py/z1ee025ghRU

Hopefully someone with more in-depth knowledge of web2py's workings will 
attack this bug soon.


-- 
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/f2570fdd-028d-48b5-8fab-d3707afa85c9%40googlegroups.com.


Re: [web2py] Re: Error with sessions on redis

2019-11-08 Thread Jose C


> Web2py: 2.18.5-stable+timestamp.2019.04.08.04.22.03 (running on 
> gunicorn/19.9.0, Python 2.7.15+) 
> py-redis: 4.0.9 
> Redis server v=4.0.9 sha=:0 malloc=jemalloc-3.6.0 bits=64 
> build=9435c3c2879311f3 
> redis-cli 4.0.9 
> OS:  Ubuntu 18.04.1 LTS 
>
>  
HI Aureo,
Which version of the python redis library is being used? You can get it by 
running:
>>> import redis
>>> redis.__version__

 

-- 
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/b02e4a12-cd5e-4a2a-9a3c-c05300fa29a4%40googlegroups.com.


[web2py] Re: Error with sessions on redis

2019-11-08 Thread Jose C
I can't reproduce this error with my particular setup.  Can you post 
details about which versions of software you're running?  Specifically 
web2py, python, py-redis module, redis itself and which os? 




-- 
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/2b63e25a-c1df-4b0d-9a85-6805f5f29fae%40googlegroups.com.


[web2py] Re: Redis session error - latest web2py master

2019-11-06 Thread Jose C
On Wednesday, 6 November 2019 15:19:07 UTC, Leonel Câmara wrote:
>
> We also got this bug when we tried to upgrade to the latest web2py and had 
> to rollback. We were using the old 2.X pyredis and then tried with 3.X you 
> get the same problem with both. Please report this issue in github, if no 
> one fixes it we will probably end up fixing it as we also need this fix.
>

Hi Leonel,

Thanks for confirming, I was pulling my hair (what little is left) out with 
this one.  I can also confirm that it is present with the 2.x as well as 
3.x versions of pyredis.  I'll report on github.

Regards,

Jose

-- 
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/a0f38fe9-fb92-4328-969d-605c289a6ffa%40googlegroups.com.


[web2py] Re: Redis session error - latest web2py master

2019-11-04 Thread Jose C
So it appears to be a bug... adding () after the decode on line 185 of 
redis_session.py appears to resolve the cause of this traceback.

However another issue has cropped up...  every page hit results in a new 
session key being created which means they're unusable.  Changing sessions 
from redis to the default disk based sessions works as expected so it 
appears to be something related to the redis implementation.

Can anyone confirm whether they are using redis for sessions successfully 
in a configuration similar to the above?

Thx,

Jose

-- 
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/351997fc-76ca-4fbc-9290-61f2e84c4222%40googlegroups.com.


[web2py] Re: session object: can't hold session.variable

2019-11-03 Thread Jose C
In principle, that should work.  However you say you're new to this so some 
basic scenarios to check below.

1) Do you have a def second() controller where the variable is being 
overridden or deleted?  Or session.forget() is called?
2) Are you navigating to /default/first?visitor_name=phil (to cause the 
variable to be set in request.vars in on that page) and being redirected 
successfully to second?  Note that if request.vars.visitor_name is not 
passed in the url it assigns python None to session.visitor_name, which 
explains why you don't see it later.
3) Does your browser have cookies enabled and is accepting cookies from 
your dev server?  The session id is stored in the cookie and if that is not 
being passed back, then each page hit is a new session (with balnk session 
variables).
4) Try putting {{=response.toolbar()}} into your html pages.  This  
generates a debug toolbar with the session and request contents in there 
(plus some other useful stuff)... might help troubleshoot.

HTH,

Jose

-- 
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/ed94f398-1f34-47b0-862a-4a2cb7b6fa85%40googlegroups.com.


[web2py] Redis session error - latest web2py master

2019-11-02 Thread Jose C
Greetings,

Attempting to enable Redis for sessions and get the following error when 
web2py attempts to retrieve the keys it set on first access.  (first page 
loads and the keys are set and can be seen in redis via redis-cli).

python 3.6.8
web2py: latest master downloaded from repo at 10:00 GMT, 2 Nov 2019.
redis: 5.0.4
python-redis:  3.3.11
os: ubuntu 18.04 LTS


Traceback (most recent call last):
 File 
"/home/jose/python-environments/winp_ca/lib/web2py/gluon/restricted.py", 
line 219, in restricted
 exec(ccode, environment)
 File 
"/home/jose/python-environments/winp_ca/lib/web2py/applications/winp_ca/models/0_init.py"
, line 56, in 
 session.connect(request, response, db = sessiondb)
 File "/home/jose/python-environments/winp_ca/lib/web2py/gluon/globals.py", 
line 971, in connect
 row = table(record_id, unique_key=unique_key)
 File 
"/home/jose/python-environments/winp_ca/lib/web2py/gluon/contrib/redis_session.py"
, line 117, in __call__
 row = q.select()
 File 
"/home/jose/python-environments/winp_ca/lib/web2py/gluon/contrib/redis_session.py"
, line 185, in select
 rtn = {to_native(k.decode): v for k, v in self.db.r_server.hgetall(key).
items()}
 File 
"/home/jose/python-environments/winp_ca/lib/web2py/gluon/contrib/redis_session.py"
, line 185, in 
 rtn = {to_native(k.decode): v for k, v in self.db.r_server.hgetall(key).
items()}
 File 
"/home/jose/python-environments/winp_ca/lib/web2py/gluon/packages/dal/pydal/_compat.py"
, line 136, in to_native
 return obj.decode(charset, errors)
AttributeError: 'builtin_function_or_method' object has no attribute 
'decode'




I know there had been issues with web2py-redis (see: 
https://groups.google.com/forum/#!topic/web2py/0iU2wqSik0k) which were 
resolved but suspect  this is another issue.  Anyone got this working with 
py3 and the py-redis 3.3 library combo?

Thanks,

Jose


-- 
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/228cd131--4732-aaab-f3009d03ea24%40googlegroups.com.


[web2py] Re: invalid function every other page view

2019-08-17 Thread Jose C


> Weird situation where I just created a new app from admin and have the 
> simplest app. When a visit the page and continue to refresh, on about every 
> other refresh I get "invalid function". I don't think I'm on any sort of 
> round robin, load balancing. It's very strange. I've reloaded routes, 
> rebooted server.
>
> https://www.pricetack.com/webhook
>

Just took a very quick look and noticed that if you refresh every couple of 
seconds you get the alternating invalid function (404) versus the 200 
(None) return.  However, if you leave it for longer between refreshes 
(around 20-30 seconds or more) and refresh you get serverd the None (200) 
page again, as expected instead of the invalid function.  

Some kind of caching issue perhaps?  Are you using a CDN (one response 
header refers to a cloudflare server)?


-- 
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/868c6456-c2a4-467c-92cd-1d57773ecaaa%40googlegroups.com.


Re: [web2py] Re: Hosting question

2019-08-02 Thread Jose C
Glad to have helped.

Cheers,


On Friday, 2 August 2019 09:40:05 UTC+1, Rahul wrote:
>
> Hi Jose,
> Thank you !! That worked ... the point #4 resolved that issue. So 
> now no need to work with Apache and all is working well. Thanks a million!!
> artpic.in and targetsoft.co.in work fine now.
>
> Regards,
>
> Rahul
>
> On Fri, Aug 2, 2019 at 1:53 PM Jose C > 
> wrote:
>
>> Hi Rahul,
>>
>> ok,..
>> 1) no the routes.examples.py files don't cause any problems.
>> 4) Can you make sure that both *'www.domain.in <http://www.domain.in>': 
>> 'app1'* as well as *'domain.in <http://domain.in>': 'app1'* are 
>> specified in the domains key of the BASE dict?  I would hope this finally 
>> resolves your issue.
>>
>> I don't have any experience at all with Apache and if point 4) above 
>> doesn't resolve your issue then the Apache config is where I would be 
>> inclined to look. Unfortunately I'm unable to help you with that, sorry.
>>
>> Jose
>>
>> -- 
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> --- 
>> You received this message because you are subscribed to a topic in the 
>> Google Groups "web2py-users" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/web2py/lvOxb_mb6kQ/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> web...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/web2py/e37f315e-0ae4-4f36-8f44-9dec2fcb3065%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/web2py/e37f315e-0ae4-4f36-8f44-9dec2fcb3065%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/78dbbac0-82c9-4ad4-8eaf-8679d0d1cf9e%40googlegroups.com.


Re: [web2py] Re: Hosting question

2019-08-02 Thread Jose C
Hi Rahul,

ok,..
1) no the routes.examples.py files don't cause any problems.
4) Can you make sure that both *'www.domain.in': 'app1'* as well as 
*'domain.in': 
'app1'* are specified in the domains key of the BASE dict?  I would hope 
this finally resolves your issue.

I don't have any experience at all with Apache and if point 4) above 
doesn't resolve your issue then the Apache config is where I would be 
inclined to look. Unfortunately I'm unable to help you with that, sorry.

Jose

-- 
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/e37f315e-0ae4-4f36-8f44-9dec2fcb3065%40googlegroups.com.


Re: [web2py] Re: Hosting question

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

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

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

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

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

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

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



-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/030d7db3-c097-4e97-82c8-55c0ae80b57d%40googlegroups.com.


[web2py] Re: Hosting question

2019-08-01 Thread Jose C

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


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/3611fe72-085d-459b-97b4-e5ed4fb9d34e%40googlegroups.com.


Re: [web2py] Re: Hosting question

2019-08-01 Thread Jose C


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

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

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

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





-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/214a7e02-0d8b-473f-9df4-506b7667fe27%40googlegroups.com.


[web2py] Re: Hosting question

2019-08-01 Thread Jose C

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

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


)

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

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/4cdc72a0-de86-4850-915c-35a5f8eeafd9%40googlegroups.com.


[web2py] Re: Hosting question

2019-07-31 Thread Jose C


> I want to avoid this and the users must only get redirected to the two 
sites that are hosted. What should I do ? Two options.

1) remove the default welcome app from your live server (simply delete the 
directory).
2) Add this key to your BASE dict (which basically tells web2py which apps 
are allowed to be accessed:
 applications = ['app1', 'app2'],

HTH,
JoseC


-- 
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/401178c4-a65e-4f3c-971e-e89992d74cfc%40googlegroups.com.


Re: [web2py] Re: web3py -> py4web

2019-07-29 Thread Jose C
Darn, I hunted around but didn't see it.  Thanks for the link...



On Monday, 29 July 2019 10:06:42 UTC+1, Nico Zanferrari wrote:
>
> Hi Jose,
>
> the documentation is already on GitHub 
> <https://github.com/web2py/py4web/tree/master/apps/_documentation/static/chapters/en>
>  , 
> and PR are always welcome ;-)
>
> Nico
>
> Il giorno lun 29 lug 2019 alle ore 10:14 Jose C  > ha scritto:
>
>> Looks promising... some questions:
>>
>> 1) Have spotted many typos in docs but can't find docs for py4web on 
>> github.  If docs are on there, like web2py book, people can submit pull 
>> requests and help massage the docs into shape.
>> 2) Should there be a new official group created for py4web (or some other 
>> repo of Q&A knowledge, StackExchange?)   A) to minimize noise in the web2py 
>> group and B) also make it easier to find py4web related stuff?  
>> 3) When are you aiming for the first "stable" release?  
>>
>> Rgds,
>>
>>
>> -- 
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "web2py-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to web...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/web2py/0693c615-1283-413e-b976-91c238da8384%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/web2py/0693c615-1283-413e-b976-91c238da8384%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/05415021-9b4a-41bb-ab6e-2c9c3648dad0%40googlegroups.com.


[web2py] Re: web3py -> py4web

2019-07-29 Thread Jose C
Looks promising... some questions:

1) Have spotted many typos in docs but can't find docs for py4web on 
github.  If docs are on there, like web2py book, people can submit pull 
requests and help massage the docs into shape.
2) Should there be a new official group created for py4web (or some other 
repo of Q&A knowledge, StackExchange?)   A) to minimize noise in the web2py 
group and B) also make it easier to find py4web related stuff?  
3) When are you aiming for the first "stable" release?  

Rgds,


-- 
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/0693c615-1283-413e-b976-91c238da8384%40googlegroups.com.


[web2py] Re: Getting a PWA set up based on web2py

2018-10-10 Thread Jose C

>
>
> The main thing about PWAs appears to be that the service worker javascript 
> files need to be accessible from the domain root.
> ...
> The main issue I'm having so far is getting a 404 error when trying to 
> load the service worker file (upup_sw.js) which I think is a path issue 
> (inside upup.js).
>
> Any ideas?
>

To serve files from root you'll need to set it up in your routes.py file  
(e.g. mine looks like this...)

routers = dict(
# base router
BASE = dict(
default_application = 'your app here',
applications = ['your app here'],
default_function = 'index',
root_static = [
'favicon.ico',
'robots.txt',
'manifest.json',
'sw.min.js',
],
),

Then I have the above files I want serving from root located in my 
app_name/static directory.

more info: 
http://web2py.com/books/default/chapter/29/04/the-core?search=routes.py#URL-rewrite
and if you view the comments in the default routes.py file it should also 
help (specifically the root_static var)

HTH,




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


[web2py] Re: web2py-ipython shell error: "list index out of range"

2018-07-08 Thread Jose C
Great Stifan,  thanks for confirming.  I'll file a bug report with the dev 
team.

Regards,
Jose


On Sunday, 8 July 2018 12:41:59 UTC+1, 黄祥 wrote:
>
> yes, have the same error too on docker, not sure on line 329, i've checked 
> it shown:
> 'import IPython error; use default python shell')
>
> *step to reproduce an error on docker*
> *python 2 docker ubuntu image with web2py nightly source*
> docker pull ubuntu
> docker run -it ubuntu /bin/bash
>
> apt update
> apt install -y  python-pip unzip wget
> pip install ipython
> wget -c https://
> mdipierro.pythonanywhere.com/examples/static/nightly/web2py_src.zip
> unzip -o web2py_src.zip
>
> root@c989eef9003b:/# ipython
> Python 2.7.15rc1 (default, Apr 15 2018, 21:51:34)
> Type "copyright", "credits" or "license" for more information.
>
> IPython 5.7.0 -- An enhanced Interactive Python.
> ? -> Introduction and overview of IPython's features.
> %quickref -> Quick reference.
> help  -> Python's own help system.
> object?   -> Details about 'object', use 'object??' for extra details.
>
> In [1]:
> Do you really want to exit ([y]/n)?
> root@c989eef9003b:/# web2py/web2py.py -S welcome
> web2py Web Framework
> Created by Massimo Di Pierro, Copyright 2007-2018
> Version 2.16.1-stable+timestamp.2018.06.02.04.50.21
> Database drivers available: sqlite3, imaplib, pymysql
> WARNING:web2py:import IPython error; use default python shell
> Python 2.7.15rc1 (default, Apr 15 2018, 21:51:34)
> [GCC 7.3.0] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> (InteractiveConsole)
> >>>
>
> *python 3 docker ubuntu image with web2py nightly source*
> docker pull ubuntu
> docker run -it ubuntu /bin/bash
>
> apt update
> apt install -y  python3-pip unzip wget
> pip3 install ipython
> wget -c https://
> mdipierro.pythonanywhere.com/examples/static/nightly/web2py_src.zip
> unzip -o web2py_src.zip
>
> root@9454510a3068:/# ipython
> Python 3.6.5 (default, Apr  1 2018, 05:46:30)
> Type 'copyright', 'credits' or 'license' for more information
> IPython 6.4.0 -- An enhanced Interactive Python. Type '?' for help.
>
> In [1]:
> Do you really want to exit ([y]/n)?
> root@9454510a3068:/# python3 web2py/web2py.py -S welcome
> web2py Web Framework
> Created by Massimo Di Pierro, Copyright 2007-2018
> Version 2.16.1-stable+timestamp.2018.06.02.04.50.21
> Database drivers available: sqlite3, imaplib, pymysql
> WARNING:web2py:import IPython error; use default python shell
> Python 3.6.5 (default, Apr  1 2018, 05:46:30)
> [GCC 7.3.0] on linux
> Type "help", "copyright", "credits" or "license" for more information.
> (InteractiveConsole)
> >>>
>
> best regards,
> stifan
>

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


[web2py] Re: web2py-ipython shell error: "list index out of range"

2018-07-08 Thread Jose C
Hi Stifan,


Many thanks for checking. I noticed you used the stable version: 
2.16.1-stable+timestamp.2017.11.14.05.54.25. I was using the latest 
nightly: 2.16.1-stable+timestamp.2018.06.02.04.50.21

I tested with the stable version you used and it works fine here too. This 
implies that a bug may have been introduced into the newer versions.

Can I ask you to please re-run your test for confirmation with the nightly 
version at: 
https://mdipierro.pythonanywhere.com/examples/static/nightly/web2py_src.zip

Thanks,
Jose


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


[web2py] web2py-ipython shell error: "list index out of range"

2018-07-07 Thread Jose C

Greetings,

In a new virtual environment using Python3's built-in venv functionality, 
with IPython installed and latest web2py source. When dropping into a 
web2py-ipython shell, starting ipython throws a "list index out of range" 
exception and the shell defaults to interactive. Steps to reproduce below.

jose@VM-ubu1804x64:~/python-environments$ python3 -m venv w2p_test

jose@VM-ubu1804x64:~/python-environments$ workon w2p_test
(w2p_test) jose@VM-ubu1804x64:~/python-environments$ pip3 install ipython
(w2p_test) jose@VM-ubu1804x64:~/python-environments$ ipython
Python 3.6.5 (default, Apr  1 2018, 05:46:30) 
Type 'copyright', 'credits' or 'license' for more information
IPython 6.4.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: 
Do you really want to exit ([y]/n)? y

(w2p_test) jose@VM-ubu1804x64:~/python-environments/w2p_test/lib/web2py$ 
python web2py.py -S welcome 
web2py Web Framework
Created by Massimo Di Pierro, Copyright 2007-2018
Version 2.16.1-stable+timestamp.2018.06.02.04.50.21
Database drivers available: sqlite3, imaplib, pymysql
WARNING:web2py:import IPython error; use default python shell.  Exception 
was: list index out of range   *<--* I edited line 329 of gluon/shell.py to 
display the Exception thrown here.
Python 3.6.5 (default, Apr  1 2018, 05:46:30) 
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> 


*** System specs...
System: Ubuntu Mate 18.04 (x64) running in Virtualbox VM
Python version:  3.6.5
web2py latest available download source (for testers):   Version 
2.16.1-stable+timestamp.2018.06.02.04.50.21
IPython version installed: 6.4.0


I am able to reproduce this consistently with steps above.  Can anyone else 
reproduce the error as well (so I can rule out an environment problem) in 
which case I can file an official bug report if necessary?

Many thanks,

Jose

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


[web2py] Re: Getting wrong Results with my grading system

2017-11-19 Thread Jose C
This is starting to look like a homework assignment.  You do not seem to 
understand what the >= (greater than or equal to) means.

The python statement:
if perc >=100:
grade='A'
elif perc >= 79:
grade='B'
...

means or reads as (in English):   
if the value in 'perc' is greater than or equal to 100, then set the value 
of 'grade' to 'A'.  
Else if the value in perc is greater than or equal to 79 , then set the 
value of grade to 'B'. 
Else if the value in perc is greater than or equal to 69, then set the 
value of grade to 'C' 
and so on


Now can you see the error in the logic? If not, I would suggest you run 
through some sample values for perc using the above statements and see if 
that helps.


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


[web2py] Re: Getting wrong Results with my grading system

2017-11-18 Thread Jose C
Simple logic error...

Your first if clause should most likely be:
if perc >= 90:

in order to trap that value.  



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


[web2py] Re: Codec MS-SQL, unicode Latin1 UTF8

2017-05-18 Thread Jose
Hi J-Michel Angers

Given:
pydal <-> pyodbc  <-> UnixODBC  <-> FreeTDS  <-> MSSQL

In freetds.conf I have:

client charset = UTF-8

and in pydal I use mssql2 adapter, db_codec is not necessary

Jose

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


[web2py] Re: Error background task with Redis

2016-12-21 Thread Jose de Soto
Hi Fabiano,

Maybe to late. Here you have a full app based in python-rq:

https://github.com/josedesoto/web2py-rq-dashboard


On Tuesday, 16 June 2015 19:15:03 UTC+2, Fabiano Faver wrote:
>
> Failed to copy the 2 error. The full traceback of the second error:
> Traceback (most recent call last):
>   File 
> "/usr/local/lib/python2.7/dist-packages/rq-0.5.3-py2.7.egg/rq/worker.py", 
> line 558, in perform_job
> rv = job.perform()
>   File 
> "/usr/local/lib/python2.7/dist-packages/rq-0.5.3-py2.7.egg/rq/job.py", line 
> 495, in perform
> self._result = self.func(*self.args, **self.kwargs)
>   File 
> "/usr/local/lib/python2.7/dist-packages/rq-0.5.3-py2.7.egg/rq/job.py", line 
> 206, in func
> return import_attribute(self.func_name)
>   File 
> "/usr/local/lib/python2.7/dist-packages/rq-0.5.3-py2.7.egg/rq/utils.py", 
> line 150, in import_attribute
> module = importlib.import_module(module_name)
>   File "/usr/lib/python2.7/importlib/__init__.py", line 37, in 
> import_module
> __import__(name)
>   File "/home/www-data/web2py/gluon/custom_import.py", line 85, in 
> custom_importer
> modules_prefix, globals, locals, [itemname], level)
> ImportError: No module named modules
>
>
>
>
> Em terça-feira, 16 de junho de 2015 14:03:42 UTC-3, Fabiano Faver escreveu:
>>
>> I have tried to follow this tutorial: 
>> http://www.web2pyslices.com/slice/show/1579/web2py-and-redis-queue
>>
>> Just changed the arguments in the enqueue function to be fixed:
>> def contato():
>> form = SQLFORM.factory(Field("name"), Field("message"))
>> if form.accepts(request):
>> # enqueue the email to be sent!
>>job =  q.enqueue(mail.send,
>>   to="som...@teste.com.br ",  # I CHANGED 
>> THE EMAIL HERE
>>   subject="test contacted you",
>>message="message")
>> # do whatever you want
>>response.flash = "email successfully sent!"
>> return dict(form=form)
>>
>> But it gives me a error. After some time I figured out it was asking the 
>> function name to be a string.
>>
>> Traceback (most recent call last):
>>   File "/home/www-data/web2py/gluon/restricted.py", line 227, in restricted
>> exec ccode in environment
>>   File "/home/www-data/web2py/applications/OPM/controllers/default.py", line 
>> 1772, in 
>>   File "/home/www-data/web2py/gluon/globals.py", line 412, in 
>> self._caller = lambda f: f()
>>   File "/home/www-data/web2py/applications/OPM/controllers/default.py", line 
>> 1750, in contato
>> message="message")
>>   File 
>> "/usr/local/lib/python2.7/dist-packages/rq-0.5.3-py2.7.egg/rq/queue.py", 
>> line 253, in enqueue
>> job_id=job_id, at_front=at_front)
>>   File 
>> "/usr/local/lib/python2.7/dist-packages/rq-0.5.3-py2.7.egg/rq/queue.py", 
>> line 215, in enqueue_call
>> return self.enqueue_job(job, at_front=at_front)
>>   File 
>> "/usr/local/lib/python2.7/dist-packages/rq-0.5.3-py2.7.egg/rq/queue.py", 
>> line 270, in enqueue_job
>> job.save(pipeline=pipeline)
>>   File 
>> "/usr/local/lib/python2.7/dist-packages/rq-0.5.3-py2.7.egg/rq/job.py", line 
>> 461, in save
>> connection.hmset(key, self.to_dict())
>>   File 
>> "/usr/local/lib/python2.7/dist-packages/rq-0.5.3-py2.7.egg/rq/job.py", line 
>> 427, in to_dict
>> obj['data'] = self.data
>>   File 
>> "/usr/local/lib/python2.7/dist-packages/rq-0.5.3-py2.7.egg/rq/job.py", line 
>> 227, in data
>> self._data = dumps(job_tuple)
>>   File "/home/www-data/web2py/gluon/storage.py", line 56, in 
>> __getnewargs__ = lambda self: getattr(dict,self).__getnewargs__(self)
>> TypeError: getattr(): attribute name must be string
>>
>>
>> But if i do it I get another error, but this time on Redis side about it 
>> could not import modules.
>>
>>  ImportError: No module named modules
>>
>> Anyone had this problem? Couldn't figured out how to solve it.
>>
>>

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


[web2py] MS SQLServer in Latin1

2016-11-04 Thread Jose
Hello,

To cut a long explanation, I have the following:

MS-SQLServer <-> FreeTDS <-> unixODBC <-> pyODBC <-> DAL

The database is in Latin1
The FreeTDS configuration adds
client charset = UTF-8


Before putting "charset = UTF-8" had throughout the application encodes and 
decodes to make it work well, but after putting it magically everything 
works fine.

At some point, I think when we update the web server (hardware and software 
versions), it began to malfunction with non-ASCII characters.

Specifically today I have:
- All readings to database work fine, the characters show good
- This fails:
sql = "INSERT INTO T_UTF8 (name) values ('Ñandú')"
db.executesql(sql)
Result: �andú

- This work fine:
sql = *u*"INSERT INTO T_UTF8 (name) values ('Ñandú')"
db.executesql(sql)
Result: Ñandú

- This fails:
tb_t_utf8.insert(name='Ñandú')
Result: �andú

- And if inserted from a form also fails

[*] With that fails I mean that inserts the record but with rare characters.
[**] All html files are in utf8

Best Regards
Jose

-- 
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] MemoryError

2016-09-02 Thread Jose
Hi

I have an account in webfaction (plan 512M).
The server is a proper installation of nginx and uwsgi
In the configuration of uwsgi use: "limit-as = 256"
Everything worked fine.

Today I migrated the account to plan 1G.
The first problem is that uwsgi not start, gave memmoy out. I saw this [1] 
thread and changed the "limit-as = 256" to "limit-as = 512".
Now starts but after a few requests uwsgi turned to fall. Error:

web2py/gluon/main.py "in wsgibase MemoryError

what I did was remove the limit-as uwsgi configuration. Now everything works 
fine. The question is: why the memory problem arose when in fact I have more 
memory 
available?

Best regards
Jose

[1] https://groups.google.com/forum/#!topic/web2py/kq6c9_av8Ps

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


[web2py] Re: logout don't kill session

2016-08-26 Thread Jose Eleudson Gurgel Queiroz
More information.

I'm debunging with

def user(): 
pdb.set_trace() #BREAKPOINT
return dict(form=auth())

Accurs that auth.navbar log out link 
(http://localhost:8000/eadnotas/default/user/logout?_next=/eadnotas/default/index)
 
do not activate the debug line.

The new item in administrator menu created with  T('Log 
Out'),URL('default','user',
args='logout')==URL(),URL('default','user',args='logout'),[] activate debug 
and require PDB command to continue.

Thanks!



Em sexta-feira, 29 de julho de 2016 13:11:17 UTC-3, Jose Eleudson Gurgel 
Queiroz escreveu:
>
> The SAME app conclude the logout operation on one server, but not on 
> another  or local server.
>
> Don't show the flash message of confirm logout.
>
> Thanks!
>
> Eleudson
>

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


[web2py] Re: logout don't kill session

2016-08-26 Thread Jose Eleudson Gurgel Queiroz
More information.

The auth.navbar generate this URL 
http://localhost:8000/eadnotas/default/user/logout?_next=/eadnotas/default/index
 
that not logout the user.

I create a new item in administrator menu with (T('Log 
Out'),URL('default','user',args='logout')==URL(),URL('default','user',args='logout'),[]),
 
that generate this URL  http://localhost:8000/eadnotas/default/user/logout 
that work fine.

Thanks.

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


[web2py] logout don't kill session

2016-07-29 Thread Jose Eleudson Gurgel Queiroz
The SAME app conclude the logout operation on one server, but not on 
another  or local server.

Don't show the flash message of confirm logout.

Thanks!

Eleudson

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


[web2py] Re: Problem sending emails. Various errors from different Ports

2016-07-28 Thread Jose C
Hi,

AFAIK you must use port 587 with gmail.  Also, I usspect setting ssl=True 
is causing issues (port 587 uses TLS).  Try removing:
mail.settings.ssl = True
mail.settings.tls = True



This is how I do it with gmail:

mail.settings.sender = 'm...@gmail.com'
mail.settings.server =  'smtp.gmail.com:587'
mail.settings.login = 'me:my_passw'

sent_ok = mail.send( 
to = [sendto_add],
sender = sender,
bcc = [bcc],
subject = subject,
message = (body_txt, body_html)
)



HTH,
Jose

-- 
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] Unable to send mail using gmail.com in web2py

2016-07-05 Thread Jose de Soto
Maybe too late, but I just found Google has added many security 
improvements. In my case the emails stop working. To fix it I have done:

1- Enable less secure apps: 
https://www.google.com/settings/security/lesssecureapps
2- Unlock Captcha for the account: 
https://accounts.google.com/DisplayUnlockCaptcha

I hope it helps...

On Sunday, 16 August 2015 20:03:47 UTC+2, Sai Harsh Tondomker wrote:
>
> I tried it still saying unable to send mail 
>
> mail = auth.settings.mailer
> mail.settings.server = 'smtp.gmail.com:587'
> mail.settings.sender = 'crazydev...@gmail.com '
> mail.settings.login = None
> mail.settings.tls = False
> ## configure auth policy
> auth.settings.registration_requires_verification = True
> auth.settings.registration_requires_approval = False
> auth.settings.reset_password_requires_verification = True
>
> Even I have uploaded all require files.
>
> Please could you suggest any other solution.
>
>
> On Sun, Aug 16, 2015 at 10:45 PM, Ovidio Marinho  > wrote:
>
>> look this: 
>> http://www.web2pyslices.com/slice/show/1473/sending-email-from-a-form-with-multiple-documents-options
>>
>>
>>
>>
>>
>>
>>[image: http://itjp.net.br] 
>>  http://itjp.net.b r
>>   *Ovidio Marinho Falcao Neto*
>>  ovid...@gmail.com 
>> Brasil
>>  
>>
>> 2015-08-16 12:26 GMT-03:00 Sai Harsh Tondomker > >:
>>
>>> mail = auth.settings.mailer
>>> mail.settings.server = 'smtp.gmail.com:587'
>>> mail.settings.sender = 'crazydev...@gmail.com '
>>> mail.settings.login = 'crazydevelope...@gmail.com:saiharshvipin'
>>>
>>> ## configure auth policy
>>> auth.settings.registration_requires_verification = True
>>> auth.settings.registration_requires_approval = False
>>> auth.settings.reset_password_requires_verification = True
>>>
>>> I am unable to send email verification using gmail account please help 
>>> me to solve the problem.
>>>
>>> -- 
>>> 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 .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> -- 
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> --- 
>> You received this message because you are subscribed to a topic in the 
>> Google Groups "web2py-users" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/web2py/iBvGhDc4t5I/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> web2py+un...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

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


[web2py] Re: Webfaction error after updating

2016-06-01 Thread Jose
I chose to use nginx + uwsgi.

Thanks
José

-- 
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] webfaction nginx + uwsgi

2016-06-01 Thread Jose
Already solved. The problem was uwsgi which was compiled by me. I tried to 
install with pip and it works all right.

Jose

-- 
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] webfaction nginx + uwsgi

2016-06-01 Thread Jose
As mentioned in a previous post [1] after updating web2py they stopped 
working my webfation applications.

Following this, I installed nginx+uwsgi instead apache+mod_wsgi.

Nginx works fine, the problem I have aparantemente uwsgi.

uwsgi configuration (/home/myuser/local/etc/uwsgi.conf) is:

[uwsgi]
pythonpath = /home/myuser/web2py/ 
module = wsgihandler:application
socket = /home/myuser/tmp/uwsgi.sock
#socket = 127.0.0.1:9001  
master = true 
chmod-socket = 660
vacuum = true
#enable-threads = true 
processes = 5
threads = 7
socket-timeout = 180 
post-buffering = 8192
max-requests = 1000 
buffer-size = 32768




when start uwsgi

/home/myuser/local/uwsgi/uwsgi -T --ini /home/myuser/local/etc/uwsgi.conf

the output is as follows:

[uWSGI] getting INI configuration from /home/myuser/local/etc/uwsgi.conf
*** Starting uWSGI 2.0.13.1 (32bit) on [Wed Jun  1 16:00:43 2016] ***
compiled with version: 4.1.2 20080704 (Red Hat 4.1.2-55) on 01 June 2016 
10:50:09
os: Linux-2.6.18-400.1.1.el5PAE #1 SMP Thu Dec 18 01:38:34 EST 2014
nodename: web34.webfaction.com
machine: i686
clock source: unix
pcre jit disabled
detected number of CPU cores: 8
current working directory: /home/myuser
detected binary path: /home/myuser/local/uwsgi/uwsgi
your processes number limit is 300
your memory page size is 4096 bytes
detected max file descriptor number: 4096
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
uwsgi socket 0 bound to UNIX address /home/myuser/tmp/uwsgi.sock fd 3
Python version: 2.4.3 (#1, Jan  9 2013, 06:49:54)  [GCC 4.1.2 20080704 (Red 
Hat 4.1.2-54)]
Python main interpreter initialized at 0xa0fc908
python threads support enabled
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 2199048 bytes (2147 KB) for 35 cores
*** Operational MODE: preforking+threaded ***
added /home/myuser/web2py/ to pythonpath.
Traceback (most recent call last):
  File "/home/myuser/web2py/wsgihandler.py", line 37, in ?
import gluon.main
  File "/home/myuser/web2py/gluon/__init__.py", line 21, in ?
import pydal
  File "/home/myuser/web2py/gluon/packages/dal/pydal/__init__.py", line 3
from .base import DAL
 ^
SyntaxError: invalid syntax
unable to load app 0 (mountpoint='') (callable not found or import error)
*** no app loaded. going in full dynamic mode ***
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI master process (pid: 27009)
spawned uWSGI worker 1 (pid: 27010, cores: 7)
spawned uWSGI worker 2 (pid: 27011, cores: 7)
spawned uWSGI worker 3 (pid: 27012, cores: 7)
spawned uWSGI worker 4 (pid: 27025, cores: 7)
spawned uWSGI worker 5 (pid: 27026, cores: 7)



Any idea how to fix it

Best regards
Jose

[1] https://groups.google.com/forum/#!topic/web2py/7mTex8ufUOo

-- 
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] Webfaction error after updating

2016-05-31 Thread Jose


Hi,

Before upgrading was this: mod_wsgi 3.4/Python 2.7 + Web2py Version 2.5.1-stable

[I have several applications in web2py]


1) upgrade to mod_wsgi 4.5.2/Python 2.7 + Web2py Version 2.14.6

After this, when starting apache the first application that came worked well, 
but the other (whatever) gave this error:


Traceback (most recent call last):
 File "/home/myuser/web2py/gluon/main.py", line 438, in wsgibase
 session.connect(request, response)
 File "/home/myuser/web2py/gluon/globals.py", line 965, in connect
 session_pickled = pickle.dumps(self, pickle.HIGHEST_PROTOCOL)
 File "/home/myuser/web2py/gluon/storage.py", line 56, in 
 __getnewargs__ = lambda self: getattr(dict,self).__getnewargs__(self)
TypeError: getattr(): attribute name must be string



If restart apache again and went to another application, this worked well, but 
the other not


2) I back to mod_wsgi 3.4/Python 2.7 keeping Web2py Version 2.14.6

now i always get the same error, regardless of whether the server restart


Any idea?

José

-- 
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.smartgrid with two references to same perent table

2015-12-25 Thread Jose Eleudson Gurgel Queiroz

*With this tables:*
db.define_table('tbProduct', \
Field('category_id','reference tbCategory', 
label='Category', ondelete='RESTRICT'), \
Field('group_id', 'reference tbGroup', label='Group', 
ondelete='RESTRICT'), \
Field('name', 'string', notnull=True, unique=True), \
...
   )
db.define_table('tbComposition', \

*Field('product_id','reference tbProduct', label='Product', 
writable=False), \Field('component_id','reference 
tbProduct', label='Component', ondelete='RESTRICT'), \*
Field('unit_id','reference tbUnit', label='Unit', 
ondelete='RESTRICT'), \
Field('quantity','double', notnull=True, default=0.00), 
\
singular='Composition', plural='Compositions' \
   )

*In the stock.py controller I have:*

def products():
form=SQLFORM.smartgrid(db.tbProduct, csv=False, maxtextlength=50, 
showbuttontext=False, \
   linked_tables=[*'tbComposition'*,'tbCostPrice'], 
links_in_grid=False)
return locals()

*Thus, I have on the product screen view the following links:*

Compositions(product_id)  
Compositions(component_id)

Cost
 
Prices 


*But I did not want* 


*Compositions link (component ID)What do I do?*

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


[web2py] Re: upload using restful

2015-11-24 Thread Jose
Hi Leonel

How it is handled on the server (web2py 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.
For more options, visit https://groups.google.com/d/optout.


[web2py] upload using restful

2015-11-24 Thread Jose
Hi

How I can upload a file using RESTful api?

Jose

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


[web2py] Re: Wizard inside a LOAD

2015-10-05 Thread Jose


El viernes, 2 de octubre de 2015, 19:49:52 (UTC-3), Niphlod escribió:
>
> tested and retested. it works. please inspect your form and see if the 
> correct url is generated and put in the action attribute.
>
>
>
You are right. It works. But in my case it will not work because it is not 
linear but follows a branching process.

Thank you so much

José 

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


[web2py] Re: Wizard inside a LOAD

2015-10-02 Thread Jose



> For now the proposed fix/workaround is to pass an explicit _action to the 
> FORM, which will prevail if explicitely found.
> Its quite easy because _action=URL() gets things done pretty quickly and 
> painless.
>
> this has not worked 

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


[web2py] Re: Wizard inside a LOAD

2015-10-01 Thread Jose
I found this [1] and [2]. it seems that with some modifications on an old 
version 
of web2py work (web2py.js and web2py_ajax.html), but I can not fix it in new 
versions

José


[1] https://groups.google.com/forum/?fromgroups#!topic/web2py/J7-SD0n8hQQ
[2] https://groups.google.com/forum/#!msg/web2py/N414q0pH7W0/pB7zIbC-fzMJ

-- 
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] Wizard inside a LOAD

2015-09-30 Thread Jose
Hi

I am embedding wizard in a LOAD

{{=LOAD('default', 'f1', ajax=True, ajax_trap=True)}}



def f1():
form = FORM(...)

if form.process().accepted:
#I do something
redirect(URL('f2'))

return form




def f2():
form = FORM(...)

if form.process().accepted:
#I do something
redirect(URL('f3'))

return form




def f3():
form = FORM(...)

if form.process().accepted:
#I do something
redirect(URL('f_end'))

return form



After submit in f1, works well and redirects to f2, but when you submit in 
f2 does what I expect and redirects to f1 (should redirect to f3)

Any idea how to fix it

Best Regards,
José

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


[web2py] Re: Upload via ajax

2015-09-03 Thread Jose


El jueves, 3 de septiembre de 2015, 14:50:37 (UTC-3), Jose escribió:
>
> Hi
>
> I want to upload a file via ajax. What I have working for when the file is 
> stored in a folder, the problem and when I want it stored in a blob field.
>
> *In upload_picture function I do not know how to put the value of 
> image_blob *
>
>
>
Ready, I know how:

image_blob = fd.value, 

-- 
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] Upload via ajax

2015-09-03 Thread Jose
Hi

I want to upload a file via ajax. What I have working for when the file is 
stored in a folder, the problem and when I want it stored in a blob field.

*In upload_picture function I do not know how to put the value of 
image_blob *

The code is as follows

==
/models/db.py
==

tb_pictures = db.define_table('pictures',
Field('name'),
Field('image', 'upload', uploadfield='image_blob'),
Field('image_blob', 'blob', writable=False, readable=False),
)



==
/controllers/default.py
==
def pictures():
return dict(f=LOAD('default', 'formpictures.load', ajax=True, ajax_trap=
True))

def formpictures():
form = SQLFORM(tb_pictures, _id="formuploadajax")

return dict(form=form)

def upload_picture():
fd=request.vars.image
tb_pictures.insert(
name=request.vars.name,
image=fd,
*image_blob=fd,* #<===
)

#return



==
/views/default/formpictures.load
==


$(function(){
$("#formuploadajax").on("submit", function(e){
e.preventDefault();
var f = $(this);
var formData = new FormData(document.getElementById(
"formuploadajax"));
$.ajax({
url: "{{=URL('upload_picture')}}",
type: "post",
//dataType: "html",
dataType: "script",
data: formData,
cache: false,
contentType: false,
processData: false,
success: function (result) {
alert(result);
}
})
});
});


{{=form}}


José

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


[web2py] Re: Embed cas login form

2015-08-31 Thread Jose


El domingo, 30 de agosto de 2015, 23:54:30 (UTC-3), Massimo Di Pierro 
escribió:
>
> If they are on the same domain you can do this:
>
> In App_A add a controller function
>
> def user_embedded(): return auth()
>
> In App_B ass a controller
>
> def login():
>   return 
> dict(form=LOAD('App_A','default','user_embedded/login',ajax=True))
>
> Problem is that you have somehow fix the workflow because App_B will not 
> redirect to your own login function. But I do not know how you want this to 
> work.
> Perhaps you can experiment and find a way.
>

 

That's what I thought about doing, but do not know how to force the use login 
() function App_B, once defined the Auth as CAS.
Perhaps something like:

auth.settings.login_form = URL(...)


-- 
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] Embed cas login form

2015-08-30 Thread Jose
Hi,

I have two applications: App_A (cas provider) and App_B (CAS consumer).

App_A and App_B have different layouts and css

In App_A I defined the user function returns the form login using return 
form [not return a dictionary]

What I want to know if there are ways to embed the form within my App_B.

All this is for the login form looks the same style App_B

José

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


[web2py] Re: Embed all process in a LOAD

2015-08-26 Thread Jose


El miércoles, 26 de agosto de 2015, 13:33:06 (UTC-3), Leonel Câmara 
escribió:
>
> Just make sure all the links inside the LOAD have a cid with the same id 
> as the container where you're loading the component. A simple way is to 
> simply put cid=request.cid in them.
>
> Example:
>
> {{=A('click me', _href=URL_TO_LOAD_INPLACE, cid=request.cid)}}
>

Thanks 

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


[web2py] Embed all process in a LOAD

2015-08-26 Thread Jose
Hi,

I have in my view a LOAD showing some data. It also has some links that call
: a form and list.

What I want is for all calls and processes to run embedded inside my 
container, similar to what would make an iframe. I tried ajax_trap = True, 
but is only for forms.

Best regards,
Jose

-- 
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.


  1   2   3   4   5   6   7   >