[web2py] Re: web2py -> py4web

2024-07-21 Thread Gaël Princivalle
Hello Massimo.

I'm still using for 5 Web2py applications with Python 2.7.
Developing is 2% of my time work, so I need a platform reliable and simple, 
Web2py is perfect for that.

I must begin a new application and I'll do it with py4web.

Thanks Massimo and to all the guys that have supported Web2py.
Anyway I hope to have in future some Web2py support if needed.
Il giorno domenica 14 luglio 2024 alle 04:10:05 UTC+2 Massimo Di Pierro ha 
scritto:

> Hello everybody,
>
> You may have noticed I am not very active on this mailing list. That is 
> mostly because I have been concentrating my energy on py4web which I think 
> is must more modern and faster than web2py.
>
> Once again I want to encourage you to move.
> If you look at this page
>
>  https://py4web.com/#why
>
> You will find it to be very familiar:
> - has an admin interface (called _dashboard)
> - has an dbadmin interface
> - same pyDAL
> - same template language
> - same helpers
> - same session interface
> - similar but better Form
> - similar but better Grid (still evolving)
> - different request object but compatible with bottlepy
> - different auth logic but support for more Oauth2 services (github, okta, 
> facebook, etc.)
> - different but similar background scheduler
>
> Here are some instructions about how to move from web2py to py4web
>
> web2py currently works for python2.7 and python3.7+ but they are using a 
> frozen version of pydal. This no longer works on Google App Engine. So how 
> do we fix it?
>
> I am considering the following:
> - freezing web2py for Python 2.7 and stopping support.
> - continuing limited support of web2py for python3.7+ and specifically 
> upgrade pydal for the lastest. 
> - upgrade pydal so that it continues to work on Google App Engine for both 
> web2py and py4web.
>
> My questions are: Is this worth it? Have people moved from python2.7 to 
> 3.7+ already? Are people here interested in continuing to use web2py with 
> GAE?
>  
>
> Massimo
>
>
>
>

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


[web2py] 2.19.0 vs 2.27.1

2024-02-12 Thread Gaël Princivalle
Hello everybody.

I've actually some instances of web2py running with the 2.19.0 version.
0 problems, thank you web2py.

One of these is this one:
https://www.hydrover.it/ 

It uses the web2py grid, Bootstrap 2.3.2.

I must install a new web2py instance, where I'll copy the 
https://www.hydrover.it/  app, that'll be modified for fitting to another 
company.

Can I use the 2.27.1 without problems?

Thanks.

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


[web2py] Front end framework

2024-02-12 Thread Gaël Princivalle
Hello all.

I've to update a Web2py app that uses Bootstrap 2.3.2.

Now the Web2py 2.27.1 uses Bootstrap 4?

Is it possible to use Bootstrap 5?

Thanks.

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


Re: [web2py] Module error

2020-12-07 Thread Gaël Princivalle
That's crazy for sure.
The modules are in the modules folder .
I don't understand why they don't appear in the modules list and why 
they're not found by my application.
Il giorno lunedì 7 dicembre 2020 alle 15:36:28 UTC+1 lbjc...@gmail.com ha 
scritto:

> Easier and crazy way I do is install the requests module in modules folder 
> or site packages. 
>
> On Mon, Dec 7, 2020, 16:51 Gaël Princivalle  wrote:
>
>>
>> Hello.
>>
>> Moving an app to another server I've this error:
>>  No module named 
>> applications.myapp.modules.requests 
>>
>> Of course I've the modules in my app.
>> The previous Web2py version was 2.14.16.
>> Now I use 2.20.4.
>>
>> Someone knows what's the problem?
>>
>> 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+un...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/web2py/70c43a4c-6698-4068-8f7e-9b322a647e1dn%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/web2py/70c43a4c-6698-4068-8f7e-9b322a647e1dn%40googlegroups.com?utm_medium=email_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/2a412953-7ec1-41df-ae9e-a872baf47371n%40googlegroups.com.


[web2py] Module error

2020-12-07 Thread Gaël Princivalle

Hello.

Moving an app to another server I've this error:
 No module named 
applications.myapp.modules.requests 

Of course I've the modules in my app.
The previous Web2py version was 2.14.16.
Now I use 2.20.4.

Someone knows what's the problem?

Thanks.

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


[web2py] Re: Cloning DB with Web2py

2020-11-25 Thread Gaël Princivalle
Thank you Clemens.

I'm using Python2.
I was thinking about moving from PosgreSQL to MariaDB becuse the 
'import_from_csv_file' don't works.
I was thinking that is was a Psycog2 library problem, but it's the same 
with mariaDB.

Now I have a MariaDB DB, and for achieving your suggestions I must use 
import_from_csv_file.
And it don't works, there's not any error.

[user@server web2py7]$ source env/bin/activate
(env) [user@server web2py7]$ cd web2py
(env) [user@server web2py]$ python web2py.py -S myapp -M -P
web2py Web Framework
Created by Massimo Di Pierro, Copyright 2007-2020
Version 2.20.4-stable+timestamp.2020.05.03.05.18.50
Database drivers available: sqlite3, psycopg2, pyodbc, pymysql, imaplib
Python 2.7.16 (default, Nov  1 2020, 19:29:00)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> filename = 'myfile.csv'
>>> db.import_from_csv_file(open(filename, 'rb')); db.commit()

After that there's no feedback and the DB still empty.

What could affect like that the import_from_csv_file function?
Il giorno mercoledì 25 novembre 2020 alle 20:29:00 UTC+1 Clemens ha scritto:

> I'm using the csv export in a simple controller, thus the user (admin) can 
> have a db backup on one click:
> (the path and filename in my app is dynamic and not fixed as follows, 
> simplified for better understanding)
> if sys.version_info[0] == 2:
> db.export_to_csv_file(open('/.csv', 
> 'wb'))
> else:
> db.export_to_csv_file(open('/.csv', 
> 'w', encoding='utf-8', newline=''))
>
> To recover a database I'm using the console as follows:
> python /web2py/web2py.py -S 
>  -M -P
> >>> filename = '/.csv'
> >>> db.import_from_csv_file(open(str(filename), 'r', encoding='utf-8')); 
> db.commit()
> or for python2
> >>> db.import_from_csv_file(open(filename, 'rb')); db.commit()
>
> Regards
> Clemens
>
>
>
>
> On Wednesday, November 25, 2020 at 6:53:45 PM UTC+1 gaelpri...@gmail.com 
> wrote:
>
>> Hello.
>>
>> After the migration from Webfaction to Opalstack I'm still having some 
>> troubles with PostgreSQL.
>> In a first time I was unable to run he scheduler workers, but now 
>> installing the Psycog2 library like that this problem is resolved.
>> pip2 install uwsgi psycopg2-binary http://effbot.org/downloads/
>> Imaging-1.1.7.tar.gz 
>>
>> My scheduler tasks import in tables some csv files.
>> Depending of the functions I have:
>> No errors, but the tables still empty.
>> This ticket:  line contains NULL byte
>>
>> That's quite difficult to understand where's the problem.
>>
>> I was thinking to clone the PostgreSQL db to a MariaDB one.
>>
>> How can I do that?
>>
>> Thanks.
>>
>

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


[web2py] Re: Cloning DB with Web2py

2020-11-25 Thread Gaël Princivalle
I've tried also like that.
http://www.web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Copy-data-from-one-db-into-another

(env) [user@server web2py]$ python scripts/cpdb.py -f 
applications/myapp/databases -y 
postgres://user:pass@localhost:5432/mypostgdb -Y 
mysql://user:pass@localhost:3306/mymariadb -d ../gluon
gluon path not found
EXCEPTION: could not set DAL
No module named dal
EXCEPTION: could not make a copy of the database
global name 'DAL' is not defined

Of course the web2py directory have the gluon folder and inside there's the 
dal.py file:
Il giorno mercoledì 25 novembre 2020 alle 18:53:45 UTC+1 Gaël Princivalle 
ha scritto:

> Hello.
>
> After the migration from Webfaction to Opalstack I'm still having some 
> troubles with PostgreSQL.
> In a first time I was unable to run he scheduler workers, but now 
> installing the Psycog2 library like that this problem is resolved.
> pip2 install uwsgi psycopg2-binary http://effbot.org/downloads/
> Imaging-1.1.7.tar.gz 
>
> My scheduler tasks import in tables some csv files.
> Depending of the functions I have:
> No errors, but the tables still empty.
> This ticket:  line contains NULL byte
>
> That's quite difficult to understand where's the problem.
>
> I was thinking to clone the PostgreSQL db to a MariaDB one.
>
> How can I do that?
>
> Thanks.
>

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


[web2py] Cloning DB with Web2py

2020-11-25 Thread Gaël Princivalle
Hello.

After the migration from Webfaction to Opalstack I'm still having some 
troubles with PostgreSQL.
In a first time I was unable to run he scheduler workers, but now 
installing the Psycog2 library like that this problem is resolved.
pip2 install uwsgi psycopg2-binary http://effbot.org/downloads/
Imaging-1.1.7.tar.gz 

My scheduler tasks import in tables some csv files.
Depending of the functions I have:
No errors, but the tables still empty.
This ticket:  line contains NULL byte

That's quite difficult to understand where's the problem.

I was thinking to clone the PostgreSQL db to a MariaDB one.

How can I do that?

Thanks.

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


Re: [web2py] Cron instead of Scheduler

2020-11-24 Thread Gaël Princivalle
Thank you for your reply.

The problem was in the psycop2 library.
Running these commands now I'm able to run the web2py workers:

mv env env.old2
virtualenv --python $HOME/opt/bin/python2.7 env
source env/bin/activate
pip2 install uwsgi psycopg2-binary http://effbot.org/downloads/
Imaging-1.1.7.tar.gz 
./stop
sleep 3
./start 

Il giorno martedì 24 novembre 2020 alle 08:04:19 UTC+1 roge...@gmail.com ha 
scritto:

> Have you tried running it as sudo? 
> What does it say in the nohup.out file? Maybe a permissions issue?
>
> ___
> *www.TenOutOfTen.org* <https://www.TenOutOfTen.org>
> roge...@gmail.com
> (+95) 09 250018669 <+95%209%20250%20018%20669> (Myanmar)
>
>
>
> On Sat, 21 Nov 2020 at 05:51, Gaël Princivalle  
> wrote:
>
>> Hi.
>>
>> I'm still having troubles to start a worker on Opalstack for my 
>> schedulers.
>> I've this error:
>> --
>> [myuser web2pyfolder]$ nohup env/bin/python web2py/web2py.py -K myapp &
>> [1] 21916
>> [ myuser web2pyfolder ]$ nohup: ignoring input and appending output to 
>> ‘nohup.out’
>>
>> [1]+  Exit 1  nohup env/bin/python web2py/web2py.py -K 
>> myapp
>> -
>>
>> If I don't put the & at the end it sometimes runs, sometimes not.
>>
>> I've tried to use the older Web2py version that I was using on Webfaction 
>> and the error still the same.
>>
>> Is there another way to start a worker?
>>
>> Or can I run some functions of my application with cron?
>>
>> Thanks, regards.
>>
>> -- 
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "web2py-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to web2py+un...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/web2py/bff7c13e-7766-4d78-973a-1a075352c61cn%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/web2py/bff7c13e-7766-4d78-973a-1a075352c61cn%40googlegroups.com?utm_medium=email_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/20ebb757-2434-403f-b3ed-5fe49f93cd85n%40googlegroups.com.


[web2py] Cron instead of Scheduler

2020-11-20 Thread Gaël Princivalle
Hi.

I'm still having troubles to start a worker on Opalstack for my schedulers.
I've this error:
--
[myuser web2pyfolder]$ nohup env/bin/python web2py/web2py.py -K myapp &
[1] 21916
[ myuser web2pyfolder ]$ nohup: ignoring input and appending output to 
‘nohup.out’

[1]+  Exit 1  nohup env/bin/python web2py/web2py.py -K myapp
-

If I don't put the & at the end it sometimes runs, sometimes not.

I've tried to use the older Web2py version that I was using on Webfaction 
and the error still the same.

Is there another way to start a worker?

Or can I run some functions of my application with cron?

Thanks, regards.

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


Re: [web2py] Scheduler on Opalstack

2020-11-12 Thread Gaël Princivalle
I can see if I create a new app in Webpy 2.20.4 that the db file have this:
if configuration.get('scheduler.enabled'):
from gluon.scheduler import Scheduler
scheduler = Scheduler(db, 
heartbeat=configuration.get('scheduler.heartbeat'))

In my db.py file I don't have that, the scheduler is called at the end of 
the scheduler.py file and that's all.

How can I adapt my db.py file to that?
In my db.py file I have the connection strin of the db database (main 
tables) and the db_sc database (scheduler database):
db = DAL('postgres://myuser:mypassword@localhost:5432/postg_db', 
check_reserved=['all'], pool_size=1, entity_quoting=True, bigint_id=True, 
migrate=False, fake_migrate_all=False)
db_sc = DAL('postgres://myuser:mypassword@localhost:5432/postg_db_sc', 
check_reserved=['all'], pool_size=1, entity_quoting=True, bigint_id=True, 
migrate=False, fake_migrate_all=False)

Thanks in advance for your help.
Il giorno giovedì 12 novembre 2020 alle 11:52:32 UTC+1 Gaël Princivalle ha 
scritto:

> Sure, here is the complete scheduler.py file:
> My main DB is db, the DB with the scheduler tables is db_sc.
> # -*- coding: utf-8 -*-
>
> def e_db():
> today = datetime.datetime.today()
> file_name = '%s_%s_%s_%s_%s:%s.csv' % (request.application, today.day, 
> today.month, today.year, today.hour, today.minute)
> file_url = '%s/static/z_backup/csv/%s' % (request.folder, file_name)
> db.export_to_csv_file(open(file_url, 'wb'))
> subject = 'Backup CSV %s' % request.application
> message = 'Il backup CSV di %s è stato salvato in %s.' % 
> (request.application, file_url)
> '''email_sent = mail.send(
> to = 'm...@domain.com',
> subject = subject,
> reply_to = 'm...@domain.com',
> message = message)'''
> db.commit()
>
> def sitemap_txt_auto():
> import os
> from gluon.myregex import regex_expose
> # Statics URLs
> exclusions = 
> ['make_slugs','get_fabbisogno','e_db','get_cart','get_product_cart','test_query','carrellon','ordine_verifican','order_sendn','brands',
>  
> 'cart_qty', 'cart_weight', 'carrello', 'ordine_verifica', 
> 'ordine_modifica_indirizzo', 'order_send', 'e_deb', 'fuzz', 
> 'googleaf365ee20ab65216', 'insert_product_enquiry', 
> 'insert_service_enquiry', 'prodotto', 'attivita_fattoria_didattica', 
> 'test', 'edit', 'user','unsubscribe','sitemap_txt','download', 'call', 
> 'data', 'upload', 'browse', 'delete']
> ctldir = os.path.join(request.folder,"controllers")
> ctls=os.listdir(ctldir)
> if 'appadmin.py' in ctls: ctls.remove('appadmin.py')
> if 'manage.py' in ctls: ctls.remove('manage.py')
> if 'admin.py' in ctls: ctls.remove('admin.py')
> if 'prod.py' in ctls: ctls.remove('prod.py')
> if 'default.py.1' in ctls: ctls.remove('default.py.1')
> sitemap='https://www.sitedomain.com'
> for ctl in ctls:
> if ctl.endswith(".bak") == False:
> filename = os.path.join(ctldir,ctl)
> data = open(filename, 'r').read()
> functions = regex_expose.findall(data)
> for f in functions:
> if not any(f in s for s in exclusions): # if function is 
> not in exclustions
> sitemap += '\r\n'
> sitemap += 'https://www.sitedomain.com/%s' % (f)
> # Dynamic URLs
> # News
> news = db(db.news.on_line == True).select(db.news.ALL)
> for item in news:
> sitemap += '\r\n'
> sitemap += 'https://www.sitedomain.com/news?id=%s' % (str(item.id
> ))
> # Products
> products = db(db.products.on_line == True).select(db.products.ALL)
> for item in products:
> sitemap += '\r\n'
> sitemap += 'https://www.sitedomain.com/prodotti?product_id=' + 
> (str(item.id)) + '_slug=' + item.product_slug
> # Categories
> sitemap += '\r\n'
> sitemap += 'https://www.sitedomain.com /prodotti?category_id=0'
> categories = db().select(db.products_categories.ALL)
> for item in categories:
> sitemap += '\r\n'
> sitemap += 'https://www. sitedomain.com /prodotti?category_id=%s' 
> % (str(item.id))
> # Servizi
> services = db().select(db.services.ALL)
> for item in services:
> sitemap += '\r\n'
> sitemap += '
> https://www.sitedomain.com/attivita_fattoria_didattica?id=%s' % (str(
> item.id))
> file = open('%s/static/sitemap.txt' %request.folder, 'w')
> file.write(sitemap)
> file.close()
> file = open('%s/static/sitemaps/sitemap.txt' %request.folder, 'w')
> file.write(sitemap)
> file.close()
> """email_sent = mail.send(
> 

Re: [web2py] Scheduler on Opalstack

2020-11-12 Thread Gaël Princivalle
Sure, here is the complete scheduler.py file:
My main DB is db, the DB with the scheduler tables is db_sc.
# -*- coding: utf-8 -*-

def e_db():
today = datetime.datetime.today()
file_name = '%s_%s_%s_%s_%s:%s.csv' % (request.application, today.day, 
today.month, today.year, today.hour, today.minute)
file_url = '%s/static/z_backup/csv/%s' % (request.folder, file_name)
db.export_to_csv_file(open(file_url, 'wb'))
subject = 'Backup CSV %s' % request.application
message = 'Il backup CSV di %s è stato salvato in %s.' % 
(request.application, file_url)
'''email_sent = mail.send(
to = 'm...@domain.com',
subject = subject,
reply_to = 'm...@domain.com',
message = message)'''
db.commit()

def sitemap_txt_auto():
import os
from gluon.myregex import regex_expose
# Statics URLs
exclusions = 
['make_slugs','get_fabbisogno','e_db','get_cart','get_product_cart','test_query','carrellon','ordine_verifican','order_sendn','brands',
 
'cart_qty', 'cart_weight', 'carrello', 'ordine_verifica', 
'ordine_modifica_indirizzo', 'order_send', 'e_deb', 'fuzz', 
'googleaf365ee20ab65216', 'insert_product_enquiry', 
'insert_service_enquiry', 'prodotto', 'attivita_fattoria_didattica', 
'test', 'edit', 'user','unsubscribe','sitemap_txt','download', 'call', 
'data', 'upload', 'browse', 'delete']
ctldir = os.path.join(request.folder,"controllers")
ctls=os.listdir(ctldir)
if 'appadmin.py' in ctls: ctls.remove('appadmin.py')
if 'manage.py' in ctls: ctls.remove('manage.py')
if 'admin.py' in ctls: ctls.remove('admin.py')
if 'prod.py' in ctls: ctls.remove('prod.py')
if 'default.py.1' in ctls: ctls.remove('default.py.1')
sitemap='https://www.sitedomain.com'
for ctl in ctls:
if ctl.endswith(".bak") == False:
filename = os.path.join(ctldir,ctl)
data = open(filename, 'r').read()
functions = regex_expose.findall(data)
for f in functions:
if not any(f in s for s in exclusions): # if function is 
not in exclustions
sitemap += '\r\n'
sitemap += 'https://www.sitedomain.com/%s' % (f)
# Dynamic URLs
# News
news = db(db.news.on_line == True).select(db.news.ALL)
for item in news:
sitemap += '\r\n'
sitemap += 'https://www.sitedomain.com/news?id=%s' % (str(item.id))
# Products
products = db(db.products.on_line == True).select(db.products.ALL)
for item in products:
sitemap += '\r\n'
sitemap += 'https://www.sitedomain.com/prodotti?product_id=' + 
(str(item.id)) + '_slug=' + item.product_slug
# Categories
sitemap += '\r\n'
sitemap += 'https://www.sitedomain.com /prodotti?category_id=0'
categories = db().select(db.products_categories.ALL)
for item in categories:
sitemap += '\r\n'
sitemap += 'https://www. sitedomain.com /prodotti?category_id=%s' % 
(str(item.id))
# Servizi
services = db().select(db.services.ALL)
for item in services:
sitemap += '\r\n'
sitemap += 
'https://www.sitedomain.com/attivita_fattoria_didattica?id=%s' % 
(str(item.id))
file = open('%s/static/sitemap.txt' %request.folder, 'w')
file.write(sitemap)
file.close()
file = open('%s/static/sitemaps/sitemap.txt' %request.folder, 'w')
file.write(sitemap)
file.close()
"""email_sent = mail.send(
to = 'm...@domain.com',
subject = 'Sitemap',
reply_to = 'm...@domain.com',
message = 'La sitemap è stata generata con 
successo.')"""
db.commit()

from gluon.scheduler import Scheduler
Scheduler(db_sc,dict(e_db=e_db, sitemap_txt_auto=sitemap_txt_auto))


Il giorno giovedì 12 novembre 2020 alle 10:58:48 UTC+1 snide...@gmail.com 
ha scritto:

>
>
> On Wednesday, November 11, 2020 at 11:17:21 PM UTC-8, Gaël Princivalle 
> wrote:
>>
>> Running it without nohup I can see this error. How can I debug that?
>> This app was running first on Web2py 2.14.16 and now it runs on the 
>> 2.20.4 version.
>>
>>  ~/apps/web2py_folder2/env/bin/python 
>> ~/apps/web2py_folder2/web2py/web2py.py -K myapp2
>>
>> Traceback (most recent call last): File 
>> "apps/web2py_folder2/web2py/web2py.py", line 41, in  import 
>> gluon.widget File "/home/user/apps/web2py_folder2/web2py/gluon/widget.py", 
>> line 27, in  from gluon.shell import die, run, test File 
>> "/home/user/apps/web2py_folder2/web2py/gluon/shell.py", line 285 
>> exec(read_pyc(pycfile), _env) SyntaxError: unqualified exec is not allowed 
>> in function 'run' it contains a nested function with free variables 
>>
>>>
>>>>>
> I

Re: [web2py] Scheduler on Opalstack

2020-11-11 Thread Gaël Princivalle
Running it without nohup I can see this error. How can I debug that?
This app was running first on Web2py 2.14.16 and now it runs on the 2.20.4 
version.

 ~/apps/web2py_folder2/env/bin/python ~/apps/web2py_folder2/web2py/web2py.py 
-K myapp2

Traceback (most recent call last): File "apps/web2py_folder2/web2py/web2py.py", 
line 41, in  import gluon.widget File 
"/home/user/apps/web2py_folder2/web2py/gluon/widget.py", line 27, in 
 from gluon.shell import die, run, test File 
"/home/user/apps/web2py_folder2/web2py/gluon/shell.py", line 285 
exec(read_pyc(pycfile), _env) SyntaxError: unqualified exec is not allowed 
in function 'run' it contains a nested function with free variables 

Il giorno mercoledì 11 novembre 2020 alle 09:41:56 UTC+1 Gaël Princivalle 
ha scritto:

> Ok the problem was that the python command must be the one of the env.
> So this works:
> nohup ~/apps/web2py_folder1/env/bin/python 
> ~/apps/web2py_folder1/web2py/web2py.py -K myapp1 &
>
> However I've another another web2py in another folder with another app and 
> it don't works:
> nohup ~/apps/web2py_folder2/env/bin/python 
> ~/apps/web2py_folder2/web2py/web2py.py -K myapp2 & 
> [1] 29291
> $ nohup: ignoring input and appending output to ‘nohup.out’
> [1]+  Exit 1  nohup env/bin/python web2py/web2py.py -K 
> myapp2
>
> What a headache...
> Il giorno martedì 10 novembre 2020 alle 12:55:35 UTC+1 Ramos ha scritto:
>
>> it worked for me. 
>>
>> Em ter., 10 de nov. de 2020 às 09:25, Gaël Princivalle <
>> gaelpri...@gmail.com> escreveu:
>>
>>>
>>> Hello.
>>>
>>> Did someone tried to use the scheduler on Opalstack?
>>>
>>> I was used to run this command to start a worker in Webfaction but in 
>>> Opalstack it don't works:
>>> nohup python web2py.py -K applicationname & 
>>>
>>> I've tried in also in the virtualenv no way.
>>>
>>> Someone knows how I can do it?
>>>
>>> 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+un...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/web2py/58d806b1-48e1-473b-82d4-5e2aaa0c8002n%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/web2py/58d806b1-48e1-473b-82d4-5e2aaa0c8002n%40googlegroups.com?utm_medium=email_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/1d083dd4-2957-4fb1-b34e-26b0c0b0f2b2n%40googlegroups.com.


Re: [web2py] Scheduler on Opalstack

2020-11-11 Thread Gaël Princivalle
Ok the problem was that the python command must be the one of the env.
So this works:
nohup ~/apps/web2py_folder1/env/bin/python 
~/apps/web2py_folder1/web2py/web2py.py -K myapp1 &

However I've another another web2py in another folder with another app and 
it don't works:
nohup ~/apps/web2py_folder2/env/bin/python 
~/apps/web2py_folder2/web2py/web2py.py -K myapp2 & 
[1] 29291
$ nohup: ignoring input and appending output to ‘nohup.out’
[1]+  Exit 1  nohup env/bin/python web2py/web2py.py -K 
myapp2

What a headache...
Il giorno martedì 10 novembre 2020 alle 12:55:35 UTC+1 Ramos ha scritto:

> it worked for me. 
>
> Em ter., 10 de nov. de 2020 às 09:25, Gaël Princivalle <
> gaelpri...@gmail.com> escreveu:
>
>>
>> Hello.
>>
>> Did someone tried to use the scheduler on Opalstack?
>>
>> I was used to run this command to start a worker in Webfaction but in 
>> Opalstack it don't works:
>> nohup python web2py.py -K applicationname & 
>>
>> I've tried in also in the virtualenv no way.
>>
>> Someone knows how I can do it?
>>
>> 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+un...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/web2py/58d806b1-48e1-473b-82d4-5e2aaa0c8002n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/web2py/58d806b1-48e1-473b-82d4-5e2aaa0c8002n%40googlegroups.com?utm_medium=email_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/9704318e-b8c2-49d8-949a-aff0db094227n%40googlegroups.com.


[web2py] Re: InFailedSqlTransaction

2020-11-10 Thread Gaël Princivalle
> Did you go in to the application so that db.py would be executed, thereby 
triggering the migration to happen? 
Yes, after each modification of the DB connection string I reload a website 
page.

I've resolved this problem moving the scheduler tables in another DB.

Thanks for your help.
Il giorno martedì 10 novembre 2020 alle 15:45:43 UTC+1 Jim S ha scritto:

> Did you go in to the application so that db.py would be executed, thereby 
> triggering the migration to happen?
>
> -Jim
>
> On Tuesday, November 10, 2020 at 8:33:41 AM UTC-6, Gaël Princivalle wrote:
>>
>> Thank you Jim.
>>
>> I've setted migrate to False and fake-migrate to True.
>> Deleted the scheduler tables in the database folder
>> Setted migrate to True and fake-migrate to False
>> And the tables are not rebuild in the DB.
>> The error still the same.
>>
>> I'll try to delete the scheduler.py file, export the db, import it in a 
>> new db and add again the scheduler...
>>
>> Il giorno martedì 10 novembre 2020 alle 15:20:36 UTC+1 Jim S ha scritto:
>>
>>> Can you go to the databases directory in your app and delete the 
>>> scheduler tables from there?  Then make sure your db connection has 
>>> migrate=True specified along with fake-migrate=False.
>>>
>>> I'm thinking that should force a rebuild of the scheduler tables in your 
>>> database.
>>>
>>> -Jim
>>>
>>>
>>> On Tuesday, November 10, 2020 at 3:02:15 AM UTC-6, Gaël Princivalle 
>>> wrote:
>>>>
>>>> I've deleted the scheduler.py file and deleted the scheduler tables.
>>>> Now if I add again the scheduler.py file the scheduler tables are in 
>>>> the admin but not in the DB, and the error is the same for all the 
>>>> scheduler tables, InFailedSqlTransaction.
>>>>
>>>> Someone can help me?
>>>>
>>>> Il giorno domenica 8 novembre 2020 alle 21:08:45 UTC+1 Gaël Princivalle 
>>>> ha scritto:
>>>>
>>>>> We talk about the db.scheduler_task table. I've deleted all the 
>>>>> records from this table, and also from db.scheduler_run and 
>>>>> db.scheduler_worker.
>>>>>
>>>>> No way.
>>>>>
>>>>> Il giorno domenica 8 novembre 2020 alle 20:57:23 UTC+1 Gaël 
>>>>> Princivalle ha scritto:
>>>>>
>>>>>> Hi.
>>>>>>
>>>>>> Someone knows what it means?
>>>>>>
>>>>>> After a server change I'm able in the Admin to modify the table 
>>>>>> records but not the one of the scheduler.
>>>>>>
>>>>>> Any idea?
>>>>>>
>>>>>> Traceback (most recent call last):
>>>>>>   File "/home/user/apps/web2py_folder/web2py/gluon/main.py", line 
>>>>>> 456, in wsgibase
>>>>>> session._try_store_in_db(request, response)
>>>>>>   File "/home/user/apps/web2py_folder/web2py/gluon/globals.py", line 
>>>>>> 1251, in _try_store_in_db
>>>>>> if not table._db(table.id == record_id).update(**dd):
>>>>>>   File 
>>>>>> "/home/user/apps/web2py_folder/web2py/gluon/packages/dal/pydal/objects.py",
>>>>>>  
>>>>>> line 2686, in update
>>>>>> ret = db._adapter.update(table, self.query, row.op_values())
>>>>>>   File 
>>>>>> "/home/user/apps/web2py_folder/web2py/gluon/packages/dal/pydal/adapters/base.py",
>>>>>>  
>>>>>> line 579, in update
>>>>>> raise e
>>>>>> InFailedSqlTransaction: current transaction is aborted, commands 
>>>>>> ignored until end of transaction block
>>>>>>
>>>>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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/a695a2a6-06a1-421d-b42e-6949ca33c84cn%40googlegroups.com.


[web2py] Re: InFailedSqlTransaction

2020-11-10 Thread Gaël Princivalle
Thank you Jim.

I've setted migrate to False and fake-migrate to True.
Deleted the scheduler tables in the database folder
Setted migrate to True and fake-migrate to False
And the tables are not rebuild in the DB.
The error still the same.

I'll try to delete the scheduler.py file, export the db, import it in a new 
db and add again the scheduler...

Il giorno martedì 10 novembre 2020 alle 15:20:36 UTC+1 Jim S ha scritto:

> Can you go to the databases directory in your app and delete the scheduler 
> tables from there?  Then make sure your db connection has migrate=True 
> specified along with fake-migrate=False.
>
> I'm thinking that should force a rebuild of the scheduler tables in your 
> database.
>
> -Jim
>
>
> On Tuesday, November 10, 2020 at 3:02:15 AM UTC-6, Gaël Princivalle wrote:
>>
>> I've deleted the scheduler.py file and deleted the scheduler tables.
>> Now if I add again the scheduler.py file the scheduler tables are in the 
>> admin but not in the DB, and the error is the same for all the scheduler 
>> tables, InFailedSqlTransaction.
>>
>> Someone can help me?
>>
>> Il giorno domenica 8 novembre 2020 alle 21:08:45 UTC+1 Gaël Princivalle 
>> ha scritto:
>>
>>> We talk about the db.scheduler_task table. I've deleted all the records 
>>> from this table, and also from db.scheduler_run and db.scheduler_worker.
>>>
>>> No way.
>>>
>>> Il giorno domenica 8 novembre 2020 alle 20:57:23 UTC+1 Gaël Princivalle 
>>> ha scritto:
>>>
>>>> Hi.
>>>>
>>>> Someone knows what it means?
>>>>
>>>> After a server change I'm able in the Admin to modify the table records 
>>>> but not the one of the scheduler.
>>>>
>>>> Any idea?
>>>>
>>>> Traceback (most recent call last):
>>>>   File "/home/user/apps/web2py_folder/web2py/gluon/main.py", line 456, 
>>>> in wsgibase
>>>> session._try_store_in_db(request, response)
>>>>   File "/home/user/apps/web2py_folder/web2py/gluon/globals.py", line 
>>>> 1251, in _try_store_in_db
>>>> if not table._db(table.id == record_id).update(**dd):
>>>>   File 
>>>> "/home/user/apps/web2py_folder/web2py/gluon/packages/dal/pydal/objects.py",
>>>>  
>>>> line 2686, in update
>>>> ret = db._adapter.update(table, self.query, row.op_values())
>>>>   File 
>>>> "/home/user/apps/web2py_folder/web2py/gluon/packages/dal/pydal/adapters/base.py",
>>>>  
>>>> line 579, in update
>>>> raise e
>>>> InFailedSqlTransaction: current transaction is aborted, commands 
>>>> ignored until end of transaction block
>>>>
>>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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/1731a012-c710-4c1a-b133-ff2c1e8d04ban%40googlegroups.com.


[web2py] Scheduler on Opalstack

2020-11-10 Thread Gaël Princivalle

Hello.

Did someone tried to use the scheduler on Opalstack?

I was used to run this command to start a worker in Webfaction but in 
Opalstack it don't works:
nohup python web2py.py -K applicationname & 

I've tried in also in the virtualenv no way.

Someone knows how I can do it?

Thanks.

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


[web2py] Re: InFailedSqlTransaction

2020-11-10 Thread Gaël Princivalle
I've deleted the scheduler.py file and deleted the scheduler tables.
Now if I add again the scheduler.py file the scheduler tables are in the 
admin but not in the DB, and the error is the same for all the scheduler 
tables, InFailedSqlTransaction.

Someone can help me?

Il giorno domenica 8 novembre 2020 alle 21:08:45 UTC+1 Gaël Princivalle ha 
scritto:

> We talk about the db.scheduler_task table. I've deleted all the records 
> from this table, and also from db.scheduler_run and db.scheduler_worker.
>
> No way.
>
> Il giorno domenica 8 novembre 2020 alle 20:57:23 UTC+1 Gaël Princivalle ha 
> scritto:
>
>> Hi.
>>
>> Someone knows what it means?
>>
>> After a server change I'm able in the Admin to modify the table records 
>> but not the one of the scheduler.
>>
>> Any idea?
>>
>> Traceback (most recent call last):
>>   File "/home/user/apps/web2py_folder/web2py/gluon/main.py", line 456, in 
>> wsgibase
>> session._try_store_in_db(request, response)
>>   File "/home/user/apps/web2py_folder/web2py/gluon/globals.py", line 
>> 1251, in _try_store_in_db
>> if not table._db(table.id == record_id).update(**dd):
>>   File 
>> "/home/user/apps/web2py_folder/web2py/gluon/packages/dal/pydal/objects.py", 
>> line 2686, in update
>> ret = db._adapter.update(table, self.query, row.op_values())
>>   File 
>> "/home/user/apps/web2py_folder/web2py/gluon/packages/dal/pydal/adapters/base.py",
>>  
>> line 579, in update
>> raise e
>> InFailedSqlTransaction: current transaction is aborted, commands ignored 
>> until end of transaction block
>>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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/d107a783-6289-42bd-9f61-d5d9abace70fn%40googlegroups.com.


[web2py] Re: InFailedSqlTransaction

2020-11-08 Thread Gaël Princivalle
We talk about the db.scheduler_task table. I've deleted all the records 
from this table, and also from db.scheduler_run and db.scheduler_worker.

No way.

Il giorno domenica 8 novembre 2020 alle 20:57:23 UTC+1 Gaël Princivalle ha 
scritto:

> Hi.
>
> Someone knows what it means?
>
> After a server change I'm able in the Admin to modify the table records 
> but not the one of the scheduler.
>
> Any idea?
>
> Traceback (most recent call last):
>   File "/home/user/apps/web2py_folder/web2py/gluon/main.py", line 456, in 
> wsgibase
> session._try_store_in_db(request, response)
>   File "/home/user/apps/web2py_folder/web2py/gluon/globals.py", line 1251, 
> in _try_store_in_db
> if not table._db(table.id == record_id).update(**dd):
>   File 
> "/home/user/apps/web2py_folder/web2py/gluon/packages/dal/pydal/objects.py", 
> line 2686, in update
> ret = db._adapter.update(table, self.query, row.op_values())
>   File 
> "/home/user/apps/web2py_folder/web2py/gluon/packages/dal/pydal/adapters/base.py",
>  
> line 579, in update
> raise e
> InFailedSqlTransaction: current transaction is aborted, commands ignored 
> until end of transaction block
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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/76594fde-e910-4f70-b028-a82c147f5671n%40googlegroups.com.


[web2py] InFailedSqlTransaction

2020-11-08 Thread Gaël Princivalle
Hi.

Someone knows what it means?

After a server change I'm able in the Admin to modify the table records but 
not the one of the scheduler.

Any idea?

Traceback (most recent call last):
  File "/home/user/apps/web2py_folder/web2py/gluon/main.py", line 456, in 
wsgibase
session._try_store_in_db(request, response)
  File "/home/user/apps/web2py_folder/web2py/gluon/globals.py", line 1251, 
in _try_store_in_db
if not table._db(table.id == record_id).update(**dd):
  File 
"/home/user/apps/web2py_folder/web2py/gluon/packages/dal/pydal/objects.py", 
line 2686, in update
ret = db._adapter.update(table, self.query, row.op_values())
  File 
"/home/user/apps/web2py_folder/web2py/gluon/packages/dal/pydal/adapters/base.py",
 
line 579, in update
raise e
InFailedSqlTransaction: current transaction is aborted, commands ignored 
until end of transaction block

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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/3789c695-c583-40a2-9e77-bd6ee9a00c1bn%40googlegroups.com.


[web2py] Re: No such file or directory UPLOAD

2020-11-08 Thread Gaël Princivalle
> An interesting routine, but I just use PIL's thumbnail() method.  Could 
you explain the advantages of your routine? 
I've no idea. I've followed an example years ago and I'm still working like 
that.

Can you post here and example of how do you use the PIL's thumbnail() 
method?
Il giorno sabato 7 novembre 2020 alle 23:35:43 UTC+1 snide...@gmail.com ha 
scritto:

>
>
> On Sunday, November 1, 2020 at 1:46:51 PM UTC-8, Gaël Princivalle wrote:
>>
>> I've found that in this function the upload folder was without a '/' at 
>> the beginning.
>> On Webfaction it was working fine, on Opalstack no.
>>
>> I think it's due more to the Web2py version than to the hosting.
>> On Webfaction I've PIL (not Pillow) Python 2.7.5 with Web2py 2.14.6. and 
>> it works fine.
>> On Opalstack I've Pillow Python 2.7.5 with Web2py 2.20.4.
>> Anyway I've updated 'upload/' to '/upload/' and it works.
>> If it could be useful for someone else, as this SMARTHUMB function has 
>> been shared here.
>>
>> def SMARTHUMB(image, box, fit=False, name="thumb"):
>> #Downsample the image.
>> #@param img: Image -  an Image-object
>> #@param box: tuple(x, y) - the bounding box of the result image
>> #@param fit: boolean - crop the image to fill the box
>> if image:
>> request = current.request
>> img = Image.open(request.folder +* 'uploads/'* + image)
>> #preresize image with factor 2, 4, 8 and fast algorithm
>> factor = 1
>> while img.size[0] / factor > 2 * box[0] and img.size[1] * 2 / 
>> factor > 2 * box[1]:
>> factor *= 2
>> if factor > 1:
>> img.thumbnail((img.size[0] / factor, img.size[1] / factor), 
>> Image.NEAREST)
>>
>> #calculate the cropping box and get the cropped part
>> if fit:
>> x1 = y1 = 0
>> x2, y2 = img.size
>> wRatio = 1.0 * x2 / box[0]
>> hRatio = 1.0 * y2 / box[1]
>> if hRatio > wRatio:
>> y1 = int(y2 / 2 - box[1] * wRatio / 2)
>> y2 = int(y2 / 2 + box[1] * wRatio / 2)
>> else:
>> x1 = int(x2 / 2 - box[0] * hRatio / 2)
>> x2 = int(x2 / 2 + box[0] * hRatio / 2)
>> img = img.crop((x1, y1, x2, y2))
>>
>> #Resize the image with best quality algorithm ANTI-ALIAS
>> img.thumbnail(box, Image.ANTIALIAS)
>>
>> root, ext = os.path.splitext(image)
>> thumb = '%s_%s%s' % (root, name, ext)
>> img.save(request.folder +  *'uploads/'* + thumb)
>> return thumb
>>
>
> An interesting routine, but I just use PIL's thumbnail() method.  Could 
> you explain the advantages of your routine?
>
> /dps
>  
>

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


[web2py] Re: No such file or directory UPLOAD

2020-11-01 Thread Gaël Princivalle
I've found that in this function the upload folder was without a '/' at the 
beginning.
On Webfaction it was working fine, on Opalstack no.

I think it's due more to the Web2py version than to the hosting.
On Webfaction I've PIL (not Pillow) Python 2.7.5 with Web2py 2.14.6. and it 
works fine.
On Opalstack I've Pillow Python 2.7.5 with Web2py 2.20.4.
Anyway I've updated 'upload/' to '/upload/' and it works.
If it could be useful for someone else, as this SMARTHUMB function has been 
shared here.

def SMARTHUMB(image, box, fit=False, name="thumb"):
#Downsample the image.
#@param img: Image -  an Image-object
#@param box: tuple(x, y) - the bounding box of the result image
#@param fit: boolean - crop the image to fill the box
if image:
request = current.request
img = Image.open(request.folder +* 'uploads/'* + image)
#preresize image with factor 2, 4, 8 and fast algorithm
factor = 1
while img.size[0] / factor > 2 * box[0] and img.size[1] * 2 / 
factor > 2 * box[1]:
factor *= 2
if factor > 1:
img.thumbnail((img.size[0] / factor, img.size[1] / factor), 
Image.NEAREST)

#calculate the cropping box and get the cropped part
if fit:
x1 = y1 = 0
x2, y2 = img.size
wRatio = 1.0 * x2 / box[0]
hRatio = 1.0 * y2 / box[1]
if hRatio > wRatio:
y1 = int(y2 / 2 - box[1] * wRatio / 2)
y2 = int(y2 / 2 + box[1] * wRatio / 2)
else:
x1 = int(x2 / 2 - box[0] * hRatio / 2)
x2 = int(x2 / 2 + box[0] * hRatio / 2)
img = img.crop((x1, y1, x2, y2))

#Resize the image with best quality algorithm ANTI-ALIAS
img.thumbnail(box, Image.ANTIALIAS)

root, ext = os.path.splitext(image)
thumb = '%s_%s%s' % (root, name, ext)
img.save(request.folder +  *'uploads/'* + thumb)
return thumb 

Il giorno domenica 1 novembre 2020 alle 20:18:49 UTC+1 Gaël Princivalle ha 
scritto:

>
> Hello.
>
> I've migrated 3 Web2py apps from Webfaction to Opalstack.
> For all these 3 apps I've the same ticket.
>
> When I save a table record with an upload field Web2py tried to save in 
> the myappupload folder instead of the myapp/upload folder.
>
> Of course Web2py is unable to find this folder.
>
> Someone knows why?
> Could it be because Web2py 2.20.4 is not compatible with Python 2.7.5, so 
> I must update Python to 2.7.16 or the last one 2.7.18?
> Or perhaps it's a PIL problem?
> from PIL import Image
>
> userweb2py™ Version 2.20.4-stable+timestamp.2020.05.03.05.18.50
> Python Python 2.7.5: /home/user/apps/web2py_folder/env/bin/uwsgi 
> (prefix: /home/user/apps/web2py_folder/env)
> Traceback
>
> Traceback (most recent call last):
>   File "/home/user/apps/web2py_folder/web2py/gluon/restricted.py", line 
> 219, in restricted
> exec(ccode, environment)
>   File 
> "/home/user/apps/web2py_folder/web2py/applications/my_app/controllers/appadmin.py",
>  
> line 635, in 
>   File "/home/user/apps/web2py_folder/web2py/gluon/globals.py", line 430, 
> in 
> self._caller = lambda f: f()
>   File 
> "/home/user/apps/web2py_folder/web2py/applications/my_app/controllers/appadmin.py",
>  
> line 325, in update
> if form.accepts(request.vars, session):
>   File "/home/user/apps/web2py_folder/web2py/gluon/sqlhtml.py", line 1992, 
> in accepts
> self.id_field_name]).update(**fields)
>   File 
> "/home/user/apps/web2py_folder/web2py/gluon/packages/dal/pydal/objects.py", 
> line 2681, in update
> row = table._fields_and_values_for_update(update_fields)
>   File 
> "/home/user/apps/web2py_folder/web2py/gluon/packages/dal/pydal/objects.py", 
> line 878, in _fields_and_values_for_update
> return self._compute_fields_for_operation(new_fields, to_compute)
>   File 
> "/home/user/apps/web2py_folder/web2py/gluon/packages/dal/pydal/objects.py", 
> line 849, in _compute_fields_for_operation
> row.set_value(name, field.compute(row), field)
>   File 
> "/home/user/apps/web2py_folder/web2py/applications/my_app/models/db.py", 
> line 497, in 
> db.news.image_file_oleodinamica_thumb.compute = lambda row: 
> SMARTHUMB(row.image_file_oleodinamica, box)
>   File 
> "/home/user/apps/web2py_folder/web2py/applications/my_app/models/db.py", 
> line 140, in SMARTHUMB
> img = Image.open(request.folder + 'uploads/' + image)
>   File 
> "/home/user/apps/web2py_folder/env/lib/python2.7/site-packages/PIL/Image.py", 
> line 2766, in open
> fp = builtins.open(filename, "rb")
> IOError: [Errno 2] No such file or directory: 
>

[web2py] No such file or directory UPLOAD

2020-11-01 Thread Gaël Princivalle

Hello.

I've migrated 3 Web2py apps from Webfaction to Opalstack.
For all these 3 apps I've the same ticket.

When I save a table record with an upload field Web2py tried to save in the 
myappupload folder instead of the myapp/upload folder.

Of course Web2py is unable to find this folder.

Someone knows why?
Could it be because Web2py 2.20.4 is not compatible with Python 2.7.5, so I 
must update Python to 2.7.16 or the last one 2.7.18?
Or perhaps it's a PIL problem?
from PIL import Image

userweb2py™ Version 2.20.4-stable+timestamp.2020.05.03.05.18.50
Python Python 2.7.5: /home/user/apps/web2py_folder/env/bin/uwsgi 
(prefix: /home/user/apps/web2py_folder/env)
Traceback

Traceback (most recent call last):
  File "/home/user/apps/web2py_folder/web2py/gluon/restricted.py", line 
219, in restricted
exec(ccode, environment)
  File 
"/home/user/apps/web2py_folder/web2py/applications/my_app/controllers/appadmin.py",
 
line 635, in 
  File "/home/user/apps/web2py_folder/web2py/gluon/globals.py", line 430, 
in 
self._caller = lambda f: f()
  File 
"/home/user/apps/web2py_folder/web2py/applications/my_app/controllers/appadmin.py",
 
line 325, in update
if form.accepts(request.vars, session):
  File "/home/user/apps/web2py_folder/web2py/gluon/sqlhtml.py", line 1992, 
in accepts
self.id_field_name]).update(**fields)
  File 
"/home/user/apps/web2py_folder/web2py/gluon/packages/dal/pydal/objects.py", 
line 2681, in update
row = table._fields_and_values_for_update(update_fields)
  File 
"/home/user/apps/web2py_folder/web2py/gluon/packages/dal/pydal/objects.py", 
line 878, in _fields_and_values_for_update
return self._compute_fields_for_operation(new_fields, to_compute)
  File 
"/home/user/apps/web2py_folder/web2py/gluon/packages/dal/pydal/objects.py", 
line 849, in _compute_fields_for_operation
row.set_value(name, field.compute(row), field)
  File 
"/home/user/apps/web2py_folder/web2py/applications/my_app/models/db.py", 
line 497, in 
db.news.image_file_oleodinamica_thumb.compute = lambda row: 
SMARTHUMB(row.image_file_oleodinamica, box)
  File 
"/home/user/apps/web2py_folder/web2py/applications/my_app/models/db.py", 
line 140, in SMARTHUMB
img = Image.open(request.folder + 'uploads/' + image)
  File 
"/home/user/apps/web2py_folder/env/lib/python2.7/site-packages/PIL/Image.py", 
line 2766, in open
fp = builtins.open(filename, "rb")
IOError: [Errno 2] No such file or directory: 
'/home/gael/apps/web2py_folder/web2py/applications/my_appuploads/news.image_file_oleodinamica.844c80079e794fbd.62726f777361626c655f636174616c6f6775652e6a7067.jpg'

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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/44c4dbe1-09fb-4634-bdfe-7c8254d82193n%40googlegroups.com.


[web2py] Re: Web2py adn Gzip

2020-10-31 Thread Gaël Princivalle
Hi.

I was working on a http website.
Anyway the https protocol don't accept gzip, so as all websites now are 
https, it don't have any interest to have gzip.
My https websites load really faster compare to Webfaction.

Good deal.

Il giorno sabato 24 ottobre 2020 alle 22:14:21 UTC+2 Jose C ha scritto:

> 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 and assigns 
> to the static_path variable (by either hardcoding or passing 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/764974e7-2ae2-4f6a-9141-2d0ba32fe3b6n%40googlegroups.com.


[web2py] Appadmin to Welcome app?

2020-10-27 Thread Gaël Princivalle
Hello.

I'm still trying to migrate my apps from Webfaction to Opalstack.
Migrating Web2py apps is not so easy...
I've 3 apps, 2 are now ok.

Using the same steps I'm unable to migrate the third one.
When I click on the appadmin button for checking the DB records, or when I 
try to display the app, I've got always the welcome app.
Of course without ticket, so I cannot know what's the problem.

Someone knows what can be the problem?

Thanks.

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


[web2py] Migrate a PostgreSQL Webfaction DB to Opalstack

2020-10-26 Thread Gaël Princivalle
Hi.

I'm still trying to migrate my Web2py applications from Webfaction to 
Opalstack.

Well here what I do:
1 I export the DB form Webfaction in the dump.sql file 
What are the best options?
For one website only the Data's in the Copy mode has worked well.
For another one I've loose some records.
Any suggestion?

2 I create a new PostgreSQL DB in Opalstack.

3 I modify my DB string connection in Web2py like that:
db = DAL('postgres://mydbuser:mydbpassword@localhost:5432/mydb', 
check_reserved=['all'], pool_size=1, entity_quoting=True, bigint_id=True, 
migrate=True, fake_migrate_all=False)
The idea is to create the tables before importing the data.
So here there is the problem to understand if setting migrate and 
fake:migrate_all to True or False. Any suggestion?

4 I import the data in the new DB:
psql -U mydbuser mydb < dump.sql 

Depending of the attempts I have these errors:
relation "table..." does not exist
Some tables are not imported (empty)
Web2py don't find the images stored in records

Any idea is interesting, thanks.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/5dac3729-f70c-405b-81c8-a0c7fa0112d7n%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 Gaël Princivalle
Thank you Carlos that works perfectly.

Il giorno lunedì 26 ottobre 2020 alle 02:55:05 UTC+1 carlos@gmail.com 
ha scritto:

> 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
>
>
>
> El miércoles, 21 de octubre de 2020 a las 12:03:04 UTC-7, Jose C escribió:
>
>> 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/ef832094-5ac9-4bc9-9309-4a82f25af9b7n%40googlegroups.com.


[web2py] Re: Web2py adn Gzip

2020-10-24 Thread Gaël Princivalle
It seems that for a similar error the solution was to update Python to 
almost 2.7.9.
>https://github.com/numba/numba/issues/2642

On Opalstack in the virtualenv I've 2.7.5.
Checking the latest version with python2 --version I obtain 2.7.5.
That's strange as it exists 2.7.16.

Il giorno sabato 24 ottobre 2020 alle 20:38:45 UTC+2 Gaël Princivalle ha 
scritto:

> >Perhaps you can +1 them on this feature request. 
> Done.
>
> > 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.
>
> [user@vpsXX web2py]$ python web2py.py -S myapp -R 
> scripts/zip_static_files.py
> Traceback (most recent call last):
>   File "web2py.py", line 41, in 
> import gluon.widget
>   File "/home/user/apps/web2py_folder/web2py/gluon/widget.py", line 27, in 
> 
> from gluon.shell import die, run, test
>   File "/home/user/apps/web2py_folder/web2py/gluon/shell.py", line 285
> exec(read_pyc(pycfile), _env)
> SyntaxError: unqualified exec is not allowed in function 'run' it contains 
> a nested function with free variables
>
> Do you know why?
> Il giorno sabato 24 ottobre 2020 alle 19:00:18 UTC+2 Jose C ha scritto:
>
>> 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 <https://en.wikipedia.org/wiki/BREACH>.
>>>
>>> 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/5b4211de-b5a0-49eb-adeb-b58ee1c35295n%40googlegroups.com.


[web2py] Re: Web2py adn Gzip

2020-10-24 Thread Gaël Princivalle
>Perhaps you can +1 them on this feature request. 
Done.

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

[user@vpsXX web2py]$ python web2py.py -S myapp -R 
scripts/zip_static_files.py
Traceback (most recent call last):
  File "web2py.py", line 41, in 
import gluon.widget
  File "/home/user/apps/web2py_folder/web2py/gluon/widget.py", line 27, in 

from gluon.shell import die, run, test
  File "/home/user/apps/web2py_folder/web2py/gluon/shell.py", line 285
exec(read_pyc(pycfile), _env)
SyntaxError: unqualified exec is not allowed in function 'run' it contains 
a nested function with free variables

Do you know why?
Il giorno sabato 24 ottobre 2020 alle 19:00:18 UTC+2 Jose C ha scritto:

> 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/92795272-f545-4066-b022-e04cab04b1aen%40googlegroups.com.


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

2020-10-22 Thread Gaël Princivalle
I've got the same problem and I've tried to fix it installing it as 
described.
It works but you must stop and restart your virtual environment.

Il giorno lunedì 19 ottobre 2020 alle 23:10:32 UTC+2 Jose C ha scritto:

>
>
> 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/731d12e0-5f36-4c3d-8490-dddb9589ed66n%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-22 Thread Gaël Princivalle
> 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. 
I don't have it. I suggest for who wants to use it to always ask for the 
latest version to Opalstack.

Il giorno mercoledì 21 ottobre 2020 alle 21:15:44 UTC+2 Jose C ha scritto:

>
>
> 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/cecf39ce-5f20-4ee9-b669-14c1b910d813n%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 Gaël Princivalle
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' 

Il giorno mercoledì 21 ottobre 2020 alle 21:03:04 UTC+2 Jose C ha scritto:

> 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/61166f2c-eb07-49aa-ab50-5f6200025712n%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 Gaël Princivalle
er maintained. pip 21.0 
will drop support for Python 2.7 in January 2021. More details about Python 
2 support in pip can be found at 
https://pip.pypa.io/en/latest/development/release-process/#python-2-support 
pip 21.0 will remove support for this functionality.
Processing 
/home/user/.cache/pip/wheels/98/8a/d9/e6390c0269fdba2d0381e508d675b8f2569baff923b42e2b15/uWSGI-2.0.19.1-cp27-cp27mu-linux_x86_64.whl
Installing collected packages: uwsgi
Successfully installed uwsgi-2.0.19.1
(env) [user@vpsXX web2py3]$ ./stop
Stopped.
(env) [user@vpsXX web2py3]$ ./start
[uWSGI] getting INI configuration from /home/user/apps/web2py3/uwsgi.ini
Started uWSGI for web2py3.
Il giorno mercoledì 21 ottobre 2020 alle 16:56:52 UTC+2 Gaël Princivalle ha 
scritto:

> > Are you activating the virtualenv first 
> Yes I've followed all the points of the process.
>
>  > What error message(s) are you getting? At what point? 
> No error message. I'm just unable to login.
> I'll do it again and check better each step.
>
> Il giorno mercoledì 21 ottobre 2020 alle 15:41:52 UTC+2 Jose C ha scritto:
>
>>
>> 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/b35add4b-c555-42c6-8ac2-2f43d4a2626cn%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 Gaël Princivalle
> Are you activating the virtualenv first 
Yes I've followed all the points of the process.

 > What error message(s) are you getting? At what point? 
No error message. I'm just unable to login.
I'll do it again and check better each step.

Il giorno mercoledì 21 ottobre 2020 alle 15:41:52 UTC+2 Jose C ha scritto:

>
> 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/02aabcf1-1235-4b00-a094-deb06e09a72en%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 Gaël Princivalle
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...

Il giorno mercoledì 21 ottobre 2020 alle 12:42:11 UTC+2 Jose C ha scritto:

>
>
> 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/46de3a36-11e1-480b-971a-50f9f8858430n%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 Gaël Princivalle
I've installed Web2py on Opalstack but the Web2py admin password is not the 
same as my shell one. How was it for you?

Il giorno martedì 20 ottobre 2020 alle 11:41:50 UTC+2 Annet ha scritto:

> Hi,
>
> Jose, is right, I had the same problem: I did not go to my app directory 
> prior to activating the virtualenv.
> No need to switch databases.
>
> Personally I prefer Opalstack's control panel over Webfaction's control 
> panel. It's simpler and more powerful.
>
> Best,
>
> Annet
> Op dinsdag 20 oktober 2020 om 10:17:37 UTC+2 schreef 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/08fbb83a-adb6-479f-bffe-ee6b5c2a9ffan%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 Gaël Princivalle
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 

Il giorno martedì 20 ottobre 2020 alle 05:48:38 UTC+2 carlos@gmail.com 
ha scritto:

> After the oficial announce from webfaction (goDaddy)  about the inminent 
> shutdown of Web2Py support, I decided to migrate my Apps to Opalstack.com .
>
> I want to share with you the procedure what I received from the support 
> guys (It works!!!).
>
> The initial web2py installer script is attached. There are a couple of 
> manual steps that must be done before you can run the script:
>
>1. Go to https://my.opalstack.com/tokens/ and create an API token if 
>you do not have one already. Make a note of the API token value.
>2. Go to https://my.opalstack.com/applications/ and create a new 
>"Proxy Port" application. Make a note of the app's UUID. You can get the 
>UUID by clicking the edit icon for the app in the app list and then 
>retrieve the UUID from the last part of the edit page URL. For example if 
>the edit page URL is 
>https://my.opalstack.com/application/edit/abcd123-def234-123abc-678fed 
> then 
>the UUID is abcd123-def234-123abc-678fed.
>3. Upload the attached script to your app's shell user home directory 
>on the server.
>4. Run the script as follows: python3 ~/web2py_install.py -u APP_UUID 
>-t TOKEN (replace APP_UUID and TOKEN with the values from steps 1 and 2 
>above.)
>
> The script will then install web2py for you, showing its progress as it 
> goes.
>
> After the script completes, you can then run the following commands to 
> convert the application to Python 2.7 (be sure to change the app name to 
> the name of your installed app):
> *pip2.7 install --user zipp==1.1*
> * pip2.7 install --user virtualenv==16.7.10 *
> *cd ~/apps/appname *
> *mv env env.old *
> *virtualenv -p /bin/python2.7 env *
> *source env/bin/activate *
> *pip install uwsgi *
> *./stop *
> *./start *
>
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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/b982e62c-065e-457d-8a20-3bfbc46bb5e8n%40googlegroups.com.


Re: [web2py] Re: web2py hosting

2020-10-17 Thread Gaël Princivalle
I've made some confusion, you're wright it's not MDDHosting where they're 
some old Webfaction guys but Opalstack.
I'll choose a VPS from Opalstack or OVH. Did someone tried to use 
Webfaction on OVH?

Il giorno venerdì 16 ottobre 2020 alle 18:45:41 UTC+2 Jose C ha scritto:

> 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/9d084ce8-dbee-4380-b276-c4083b27af0cn%40googlegroups.com.


Re: [web2py] Re: web2py hosting

2020-10-16 Thread Gaël Princivalle
Today Webfaction has send me the confirmation that Postgress and Web2py 
will be not available on tsoHost.

Did someone tried this one?
https://www.mddhosting.com/

It seems a new company made by old Webfaction guys.
Il giorno venerdì 16 ottobre 2020 alle 16:11:40 UTC+2 Ramos ha scritto:

> 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!
>
> [image: image.png]
>
> Em sex., 16 de out. de 2020 às 10:30, Jose C  
> escreveu:
>
>> 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 
>> 
>>  
>>
>> 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+un...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/web2py/01ce7579-93dd-405b-8aad-e823f3940628n%40googlegroups.com
>>  
>> 
>> .
>>
>

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


[web2py] Re: web2py hosting

2020-10-14 Thread Gaël Princivalle
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/515e3e7a-375e-4a9c-9708-2dd0d59cda3an%40googlegroups.com.


[web2py] Re: web2py hosting

2020-10-14 Thread Gaël Princivalle
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/9b40ae01-1e3e-4f00-bf2d-e397e6650027n%40googlegroups.com.


[web2py] CKEditor on mobile devices

2020-04-28 Thread Gaël Princivalle
Hello.

In my DB I have a field like that:
Field('order_email', type='text', widget=ckeditor.widget)
The content is in HTML.

The CKEditor version is the 4.14.0 and the browser compability says it's ok 
with Chome:
https://ckeditor.com/docs/ckeditor4/latest/guide/dev_browsers.html

The demo CKEditor page works well on my mobile devices:
https://ckeditor.com/docs/ckeditor4/latest/examples/size.html

I use CKEditor with a SQLFORM.grid.

CKEditor is called in the modify mode. 
The CKEditor widget loads well on Desktop browsers.
On mobile devices (Firefox/Chrome) it don't loads.

As this 'order_email' field have an HTML content it's quite difficult to 
read it as the content is displayed with all the tags.

Someone knows how can I use CKEditor also on mobile devices?

Another feature that could be helpful could be in the display mode to 
interpretate the HTML.

Thanks.

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


[web2py] Timezone

2020-04-05 Thread Gaël Princivalle
Hello all.

How can I set the timezone of my Web2py app?

Adding it in the httpd.conf Apche2 file don't change it (also after stop 
and start):
SetEnv TZ Europe/Rome

Thanks.




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


[web2py] Re: Building a query

2020-04-05 Thread Gaël Princivalle
Thanks a lot Val and Thiago for your help, it's perfect.

Il giorno sabato 4 aprile 2020 16:36:13 UTC+2, Gaël Princivalle ha scritto:
>
> Hello.
>
> How can I build a query in 2 steps?
>
> query = db.products.type == 1
> query = query and db.products.stock > 0
>
> The final result must do something like that:
> fruits = db((db.products.type == 1) and (db.products.stock > 0)).select()
> Made like this:
> fruits = db(query).select()
>
> Thanks!
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/6bdc4640-063f-49f4-b8f4-3aaa631dc08e%40googlegroups.com.


[web2py] Building a query

2020-04-04 Thread Gaël Princivalle
Hello.

How can I build a query in 2 steps?

query = db.products.type == 1
query = query and db.products.stock > 0

The final result must do something like that:
fruits = db((db.products.type == 1) and (db.products.stock > 0)).select()
Made like this:
fruits = db(query).select()

Thanks!

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


Re: [web2py] Re: Looking for web2py developer for Italian small company

2020-02-13 Thread Gaël Princivalle
Dear Massimo.

Did you plan to add the grid to py4web?

Il giorno lunedì 10 febbraio 2020 17:13:56 UTC+1, Massimo Di Pierro ha 
scritto:
>
> Hello Victor,
>
> I recommend everybody to move from web2py to py4web. I am using the latter 
> for my own projects and find it better.
> Honestly web2py has more features and it has been battle-tested but py4web 
> is catching up quickly and, if you do not need the grid, I think it is 
> already better.
>
> Massimo
>
>
>
> On Sunday, 9 February 2020 21:58:26 UTC-8, VJ Sosa wrote:
>>
>> Dear Massimo,
>>
>> One month ago I just started to develop some demos of a web application 
>> using web2py. I'm interested in go further with a more serious 
>> implementation,
>> but today I'm realizing that this group is also talking about py4web.
>> Considering that py4web is your new bet for a python framework, do you 
>> recommend me to go further with py4web instead of web2py?
>> Will be web2py deprecated in a close future?
>> Are you planning offer similar documentation (like a book) for py4web?
>>
>> Thanks in advance, I do appreciate your work.
>> Víctor.
>>
>> El jueves, 30 de enero de 2020, 7:10:45 (UTC+1), Massimo Di Pierro 
>> escribió:
>>>
>>> Yes. for me it is the future. It is usable. I recently tried to port 
>>> some of my apps from web2py to py4wb and f they do not use grid, the 
>>> transition is almost trivial. The code ends up cleaner and you can use 
>>> pylint and other tools to find errors. Converting complex Auth logic can be 
>>> tricky. 
>>>
>>> On Wednesday, 22 January 2020 08:12:04 UTC-8, Hugo Alberto Rivera Diaz 
>>> wrote:

 Massimo,an honor to salute you! One question so you would recommend the 
 use of py4web over web2py? Is py4web te next step for web2py developers?

 El mié., 22 ene. 2020 a las 0:23, Massimo Di Pierro (<
 massimo...@gmail.com>) escribió:

> I strongly recommend py4web + vue.js :-)
>
> On Tuesday, 21 January 2020 07:40:18 UTC-8, Ivan Gazzola wrote:
>
>> We are a small company in Italy, we need a new developer for our 
>> project (xortho.it)
>>
>> The web app is developed with jquery mobile and web2py, we are 
>> planning to move to angular and web2py or better py4web.
>>  
>> If you're interested please contact us.
>>
>> Ciao
>>
>> Ivan
>>
>> -- 
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> --- 
> You received this message because you 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/fc6ea910-acbb-45b7-9553-2e33152d2863%40googlegroups.com
>  
> 
> .
>


 -- 
   * Saludos!*
*Hugo Alberto Rivera Diaz* 


>>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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/5d5acd53-2e0c-4f40-96b1-aa798c4d022a%40googlegroups.com.


[web2py] Re: Admin password

2019-10-25 Thread Gaël Princivalle
Ciao Ivan.

I've solved it restoring the web2py folder from a backup and doing the 
wright process for changing the password.

Il giorno venerdì 25 ottobre 2019 13:53:33 UTC+2, Ivan Gazzola ha scritto:
>
> I've got the same problem
> How did you solve it?
> Thx
>
> Ivan Gazzola
>
> Il giorno giovedì 16 maggio 2019 17:32:26 UTC+2, Gaël Princivalle ha 
> scritto:
>>
>> >Does parameters_443.py exist in web2py dir?
>> Yes.
>>
>> >Check permissions - does web2py have access to this file?
>> Yes
>>
>> Il giorno giovedì 16 maggio 2019 10:10:25 UTC+2, Val K ha scritto:
>>>
>>> Hi!
>>> Does parameters_443.py exist in web2py dir?
>>> Check permissions - does web2py have access to this file?
>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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/6d806e0c-e282-4ea8-bd05-740c363c37ba%40googlegroups.com.


[web2py] Re: reCaptcha in China

2019-10-11 Thread Gaël Princivalle
The only solution I've found is adding a simple field like that:
Field('no_spam', requires=IS_EQUAL_TO('4',error_message=T('Must be 4')), 
type='integer', label=T('2 + 2 ='), comment=T('Are you human?'))

Probably too simple but I don't have yet a better solution.

Il giorno lunedì 23 settembre 2019 08:28:30 UTC+2, Gaël Princivalle ha 
scritto:
>
> Hello.
>
> I've added reCaptcha to one of my applications but one of my Chinese users 
> send me this feedback, he's not able to log in anymore.
> In fact Google is blocked in China, reCaptcha is provided by Google, so 
> the form cannot be validated.
>
>
> http://web2py.com/books/default/chapter/29/09/access-control?search=recaptcha+#CAPTCHA-and-reCAPTCHA
>
> I've removed reCaptcha.
>
> Is there another (easy) way to add another captcha system to Web2py?
>
> Thanks. 
>

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


[web2py] Re: reCaptcha in China

2019-09-27 Thread Gaël Princivalle
Any solution?

Il giorno lunedì 23 settembre 2019 08:28:30 UTC+2, Gaël Princivalle ha 
scritto:
>
> Hello.
>
> I've added reCaptcha to one of my applications but one of my Chinese users 
> send me this feedback, he's not able to log in anymore.
> In fact Google is blocked in China, reCaptcha is provided by Google, so 
> the form cannot be validated.
>
>
> http://web2py.com/books/default/chapter/29/09/access-control?search=recaptcha+#CAPTCHA-and-reCAPTCHA
>
> I've removed reCaptcha.
>
> Is there another (easy) way to add another captcha system to Web2py?
>
> Thanks. 
>

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


Re: [web2py] Speed

2019-09-23 Thread Gaël Princivalle
Dear Ramos thank you for your answer.

My analysis was superficial, in fact this fluidpowernet website is not so 
fast.

For other reasons I've upgraded my Webfaction plan from cloud 2GB to 4GB, 
it's really faster.

Il giorno mercoledì 4 settembre 2019 18:31:50 UTC+2, Ramos ha scritto:
>
> The information is already in the browser. All members are loaded at page 
> load. 
> The page loads data from this url
> https://www.fluidpowernet.net/Ws/getmlf 
>
> regards
>
> Em qua, 4 de set de 2019 às 15:07, Gaël Princivalle  > escreveu:
>
>> Well when you search for the members from the different countries the 
>> content is loaded certainly dynamically and it's done in a short time. If 
>> you take a look to the browser web console times are always under 700 ms... 
>>
>> Il giorno mercoledì 4 settembre 2019 15:34:31 UTC+2, Ramos ha scritto:
>>>
>>> Let me disagree.
>>> Not that "incredible" just static pages with litle content
>>> You dont neet a framework to do that...
>>>
>>> Em qua, 4 de set de 2019 às 13:24, Gaël Princivalle <
>>> gaelpri...@gmail.com> escreveu:
>>>
>>>> Hello.
>>>>
>>>> The user experience on this website is amazing, mostly due to the 
>>>> incredible speed:
>>>> https://www.fluidpowernet.net/
>>>> Hosting Azure
>>>> Framework ASP.NET
>>>>
>>>> As I have to think about new projects where I can choose the 
>>>> technologies, I would like to understand why this website is so fast.
>>>> Hosting?
>>>> Framework?
>>>>
>>>> Now I use web2py on webfaction. The loading speed is correct.
>>>> https://www.hydrover.it
>>>>
>>>> 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 web...@googlegroups.com.
>>>> To view this discussion on the web visit 
>>>> https://groups.google.com/d/msgid/web2py/dfded14e-c623-4d9a-8b69-663ee5b887fc%40googlegroups.com
>>>>  
>>>> <https://groups.google.com/d/msgid/web2py/dfded14e-c623-4d9a-8b69-663ee5b887fc%40googlegroups.com?utm_medium=email_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 web...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/web2py/222dcb06-dda8-42f4-a62f-1e7cdaabed0a%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/web2py/222dcb06-dda8-42f4-a62f-1e7cdaabed0a%40googlegroups.com?utm_medium=email_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/8e3a5912-8917-44af-824b-48b150d69152%40googlegroups.com.


[web2py] reCaptcha in China

2019-09-23 Thread Gaël Princivalle
Hello.

I've added reCaptcha to one of my applications but one of my Chinese users 
send me this feedback, he's not able to log in anymore.
In fact Google is blocked in China, reCaptcha is provided by Google, so the 
form cannot be validated.

http://web2py.com/books/default/chapter/29/09/access-control?search=recaptcha+#CAPTCHA-and-reCAPTCHA

I've removed reCaptcha.

Is there another (easy) way to add another captcha system to Web2py?

Thanks. 

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


Re: [web2py] Speed

2019-09-04 Thread Gaël Princivalle
Well when you search for the members from the different countries the 
content is loaded certainly dynamically and it's done in a short time. If 
you take a look to the browser web console times are always under 700 ms... 

Il giorno mercoledì 4 settembre 2019 15:34:31 UTC+2, Ramos ha scritto:
>
> Let me disagree.
> Not that "incredible" just static pages with litle content
> You dont neet a framework to do that...
>
> Em qua, 4 de set de 2019 às 13:24, Gaël Princivalle  > escreveu:
>
>> Hello.
>>
>> The user experience on this website is amazing, mostly due to the 
>> incredible speed:
>> https://www.fluidpowernet.net/
>> Hosting Azure
>> Framework ASP.NET
>>
>> As I have to think about new projects where I can choose the 
>> technologies, I would like to understand why this website is so fast.
>> Hosting?
>> Framework?
>>
>> Now I use web2py on webfaction. The loading speed is correct.
>> https://www.hydrover.it
>>
>> 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 web...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/web2py/dfded14e-c623-4d9a-8b69-663ee5b887fc%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/web2py/dfded14e-c623-4d9a-8b69-663ee5b887fc%40googlegroups.com?utm_medium=email_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/222dcb06-dda8-42f4-a62f-1e7cdaabed0a%40googlegroups.com.


[web2py] Speed

2019-09-04 Thread Gaël Princivalle
Hello.

The user experience on this website is amazing, mostly due to the 
incredible speed:
https://www.fluidpowernet.net/
Hosting Azure
Framework ASP.NET

As I have to think about new projects where I can choose the technologies, 
I would like to understand why this website is so fast.
Hosting?
Framework?

Now I use web2py on webfaction. The loading speed is correct.
https://www.hydrover.it

Thanks.

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


[web2py] Re: Too much sessions...

2019-07-29 Thread Gaël Princivalle
Hi all.

I've got several problems for moving the sessions to the memory.
Now they're in the DB, adding this to the model:
session.connect(request, response, db)

It works fine and the website is faster.

Il giorno venerdì 19 luglio 2019 14:31:38 UTC+2, Gaël Princivalle ha 
scritto:
>
> Hi Zoltán.
>
> python-six module is installed.
>
> 0_memcache.py is like in the documentation:
> from gluon.contrib.memcache import MemcacheClient
> memcache_servers = ['127.0.0.1:11211']
> cache.memcache = MemcacheClient(request, memcache_servers)
> cache.ram = cache.disk = cache.memcache
>
> I've added this in the model db.py:
> from gluon.contrib.memdb import MEMDB
> session.connect(request, response, db=MEMDB(cache.memcache))
>
> The last row generate this ticket:
> Ticket ID
>
>
> 2a00_23a8_400d_c001_3d4c_5b50_35a9_dfdf.2019-07-19.12-25-46.c3413f14-b228-4390-bc14-2f7092907e01
> Versione
> web2py™ Version 2.14.6-stable+timestamp.2016.05.10.00.21.47
> Python Python 2.7.5: /usr/bin/python (prefix: /usr)Traceback
>
> 1.
> 2.
> 3.
> 4.
> 5.
> 6.
> 7.
> 8.
> 9.
>
> Traceback (most recent call last):
>   File "/home/tasko/webapps/w2p_2_14_16/web2py/gluon/main.py", line 464, in 
> wsgibase
> session._try_store_in_db(request, response)
>   File "/home/tasko/webapps/w2p_2_14_16/web2py/gluon/globals.py", line 1183, 
> in _try_store_in_db
> record_id = table.insert(**dd)
>   File "/home/tasko/webapps/w2p_2_14_16/web2py/gluon/contrib/memdb.py", line 
> 264, in insert
> raise RuntimeError("Too many ID conflicts")
> RuntimeError: Too many ID conflicts
>
> Error snapshot [image: help] 
> <https://prod2.tasko.it/admin/ticket/hydrover_oleodinamica/2a00_23a8_400d_c001_3d4c_5b50_35a9_dfdf.2019-07-19.12-25-46.c3413f14-b228-4390-bc14-2f7092907e01#>
>
> (Too many ID conflicts)
>
> inspect attributes
> Frames
>
>- 
>
>*File /home/tasko/webapps/w2p_2_14_16/web2py/gluon/main.py in wsgibase 
>at line 464* code arguments variables
>- 
>
>*File /home/tasko/webapps/w2p_2_14_16/web2py/gluon/globals.py in 
>_try_store_in_db at line 1183* code arguments variables
>- 
>
>*File /home/tasko/webapps/w2p_2_14_16/web2py/gluon/contrib/memdb.py in 
>insert at line 264* code arguments variables
>Function argument list
>
>(self=}>, **fields={'client_ip': 
>'2a00.23a8.400d.c001.3d4c.5b50.35a9.dfdf', 'locked': False, 
>'modified_datetime': datetime.datetime(2019, 7, 19, 12, 25, 46, 854949), 
>'session_data': 
>
> '\x80\x02cgluon.globals\nSession\nq\x01}q\x02(U\x19_formkey[no_tab...\x13(h\x0bU\r75.0.3770.142q\x14h\rU\x06Chromeq\x15u\x85Rq\x16u\x85Rq\x17u\x85Rq\x18.',
>  
>'unique_key': '25d6cb33-4709-4b14-987d-06aef044ac67'})
>Code listing
>
>259.
>260.
>261.
>262.
>263.
>264.
>
>265.
>266.
>267.
>268.
>
>for i in range(3):
>id = self._create_id()
>if self.get(id) is None and self.update(id, **fields):
>    return long(id)
>else:
>raise RuntimeError("Too many ID conflicts")
>
>
>def get(self, id):
>val = self._tableobj.get(self._id_to_key(id))
>if val:
>
>
> Do you know why?
>
> Il giorno giovedì 18 luglio 2019 12:58:50 UTC+2, Gaël Princivalle ha 
> scritto:
>>
>> Hi Zoltán, for the moment I've modified my crontab for deleting the 
>> sessions every hour.
>>
>> I'll try to install python-six module and store the sessions in the 
>> memory in the next days.
>>
>> Il giorno giovedì 18 luglio 2019 11:03:37 UTC+2, Fekete Zoltán ha scritto:
>>>
>>> Hi Gael!
>>>
>>> Could you solve the problem? Pls. give a short feedback.
>>>
>>> Regards,
>>> Zoltán
>>>
>>> 2019. július 13., szombat 9:03:17 UTC+2 időpontban Massimo Di Pierro a 
>>> következőt írta:
>>>>
>>>> what os is this?
>>>>
>>>> On Friday, 12 July 2019 01:00:03 UTC-7, Gaël Princivalle wrote:
>>>>>
>>>>> Hi all.
>>>>>
>>>>> In my sessions folder all sessions are stored in separated 
>>>>> sub-folders, 068,069...
>>>>> The file system don't accept more than 512 sub-folders in a folder.
>>>>> When I reach 512 sub-folders the website is down.
>>>>> Now for avoiding this problem I delete all the sessions with a crontab 
>>>>> job every 12 ho

[web2py] Re: Too much sessions...

2019-07-19 Thread Gaël Princivalle
Hi Zoltán.

python-six module is installed.

0_memcache.py is like in the documentation:
from gluon.contrib.memcache import MemcacheClient
memcache_servers = ['127.0.0.1:11211']
cache.memcache = MemcacheClient(request, memcache_servers)
cache.ram = cache.disk = cache.memcache

I've added this in the model db.py:
from gluon.contrib.memdb import MEMDB
session.connect(request, response, db=MEMDB(cache.memcache))

The last row generate this ticket:
Ticket ID

2a00_23a8_400d_c001_3d4c_5b50_35a9_dfdf.2019-07-19.12-25-46.c3413f14-b228-4390-bc14-2f7092907e01
Versione
web2py™ Version 2.14.6-stable+timestamp.2016.05.10.00.21.47
Python Python 2.7.5: /usr/bin/python (prefix: /usr)Traceback

1.
2.
3.
4.
5.
6.
7.
8.
9.

Traceback (most recent call last):
  File "/home/tasko/webapps/w2p_2_14_16/web2py/gluon/main.py", line 464, in 
wsgibase
session._try_store_in_db(request, response)
  File "/home/tasko/webapps/w2p_2_14_16/web2py/gluon/globals.py", line 1183, in 
_try_store_in_db
record_id = table.insert(**dd)
  File "/home/tasko/webapps/w2p_2_14_16/web2py/gluon/contrib/memdb.py", line 
264, in insert
raise RuntimeError("Too many ID conflicts")
RuntimeError: Too many ID conflicts

Error snapshot [image: help] 
<https://prod2.tasko.it/admin/ticket/hydrover_oleodinamica/2a00_23a8_400d_c001_3d4c_5b50_35a9_dfdf.2019-07-19.12-25-46.c3413f14-b228-4390-bc14-2f7092907e01#>

(Too many ID conflicts)

inspect attributes
Frames
   
   - 
   
   *File /home/tasko/webapps/w2p_2_14_16/web2py/gluon/main.py in wsgibase 
   at line 464* code arguments variables
   - 
   
   *File /home/tasko/webapps/w2p_2_14_16/web2py/gluon/globals.py in 
   _try_store_in_db at line 1183* code arguments variables
   - 
   
   *File /home/tasko/webapps/w2p_2_14_16/web2py/gluon/contrib/memdb.py in 
   insert at line 264* code arguments variables
   Function argument list
   
   (self=}>, **fields={'client_ip': 
   '2a00.23a8.400d.c001.3d4c.5b50.35a9.dfdf', 'locked': False, 
   'modified_datetime': datetime.datetime(2019, 7, 19, 12, 25, 46, 854949), 
   'session_data': 
   
'\x80\x02cgluon.globals\nSession\nq\x01}q\x02(U\x19_formkey[no_tab...\x13(h\x0bU\r75.0.3770.142q\x14h\rU\x06Chromeq\x15u\x85Rq\x16u\x85Rq\x17u\x85Rq\x18.',
 
   'unique_key': '25d6cb33-4709-4b14-987d-06aef044ac67'})
   Code listing
   
   259.
   260.
   261.
   262.
   263.
   264.
   
   265.
   266.
   267.
   268.
   
   for i in range(3):
   id = self._create_id()
   if self.get(id) is None and self.update(id, **fields):
   return long(id)
   else:
   raise RuntimeError("Too many ID conflicts")
   
   
   def get(self, id):
   val = self._tableobj.get(self._id_to_key(id))
   if val:
   
   
Do you know why?

Il giorno giovedì 18 luglio 2019 12:58:50 UTC+2, Gaël Princivalle ha 
scritto:
>
> Hi Zoltán, for the moment I've modified my crontab for deleting the 
> sessions every hour.
>
> I'll try to install python-six module and store the sessions in the memory 
> in the next days.
>
> Il giorno giovedì 18 luglio 2019 11:03:37 UTC+2, Fekete Zoltán ha scritto:
>>
>> Hi Gael!
>>
>> Could you solve the problem? Pls. give a short feedback.
>>
>> Regards,
>> Zoltán
>>
>> 2019. július 13., szombat 9:03:17 UTC+2 időpontban Massimo Di Pierro a 
>> következőt írta:
>>>
>>> what os is this?
>>>
>>> On Friday, 12 July 2019 01:00:03 UTC-7, Gaël Princivalle wrote:
>>>>
>>>> Hi all.
>>>>
>>>> In my sessions folder all sessions are stored in separated sub-folders, 
>>>> 068,069...
>>>> The file system don't accept more than 512 sub-folders in a folder.
>>>> When I reach 512 sub-folders the website is down.
>>>> Now for avoiding this problem I delete all the sessions with a crontab 
>>>> job every 12 hours, but it's not enough.
>>>>
>>>> Obviously I can imagine that deleting all the sessions means also 
>>>> disconnecting all the users, that's not a good thing.
>>>>
>>>> Can I store the sessions in the DB instead of the file system?
>>>>
>>>> And what about that? I don't understand where I must add it, and it 
>>>> seems that the sessions storage for my website works already like that,
>>>> http://web2py.com/books/default/chapter/29/04/the-core#Separate-sessions
>>>>
>>>> Thanks.
>>>>
>>>>
>>>>

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


[web2py] Re: Too much sessions...

2019-07-18 Thread Gaël Princivalle
Hi Zoltán, for the moment I've modified my crontab for deleting the 
sessions every hour.

I'll try to install python-six module and store the sessions in the memory 
in the next days.

Il giorno giovedì 18 luglio 2019 11:03:37 UTC+2, Fekete Zoltán ha scritto:
>
> Hi Gael!
>
> Could you solve the problem? Pls. give a short feedback.
>
> Regards,
> Zoltán
>
> 2019. július 13., szombat 9:03:17 UTC+2 időpontban Massimo Di Pierro a 
> következőt írta:
>>
>> what os is this?
>>
>> On Friday, 12 July 2019 01:00:03 UTC-7, Gaël Princivalle wrote:
>>>
>>> Hi all.
>>>
>>> In my sessions folder all sessions are stored in separated sub-folders, 
>>> 068,069...
>>> The file system don't accept more than 512 sub-folders in a folder.
>>> When I reach 512 sub-folders the website is down.
>>> Now for avoiding this problem I delete all the sessions with a crontab 
>>> job every 12 hours, but it's not enough.
>>>
>>> Obviously I can imagine that deleting all the sessions means also 
>>> disconnecting all the users, that's not a good thing.
>>>
>>> Can I store the sessions in the DB instead of the file system?
>>>
>>> And what about that? I don't understand where I must add it, and it 
>>> seems that the sessions storage for my website works already like that,
>>> http://web2py.com/books/default/chapter/29/04/the-core#Separate-sessions
>>>
>>> Thanks.
>>>
>>>
>>>

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


[web2py] Re: Too much sessions...

2019-07-18 Thread Gaël Princivalle
CentOS 7 on Webfaction.

Il giorno sabato 13 luglio 2019 09:03:17 UTC+2, Massimo Di Pierro ha 
scritto:
>
> what os is this?
>
> On Friday, 12 July 2019 01:00:03 UTC-7, Gaël Princivalle wrote:
>>
>> Hi all.
>>
>> In my sessions folder all sessions are stored in separated sub-folders, 
>> 068,069...
>> The file system don't accept more than 512 sub-folders in a folder.
>> When I reach 512 sub-folders the website is down.
>> Now for avoiding this problem I delete all the sessions with a crontab 
>> job every 12 hours, but it's not enough.
>>
>> Obviously I can imagine that deleting all the sessions means also 
>> disconnecting all the users, that's not a good thing.
>>
>> Can I store the sessions in the DB instead of the file system?
>>
>> And what about that? I don't understand where I must add it, and it seems 
>> that the sessions storage for my website works already like that,
>> http://web2py.com/books/default/chapter/29/04/the-core#Separate-sessions
>>
>> Thanks.
>>
>>
>>

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


[web2py] Re: Too much sessions...

2019-07-12 Thread Gaël Princivalle
s/global/vars/cache>.memcache = 
MemcacheClient(request <https://prod2.tasko.it/examples/global/vars/request>, 
memcache_servers)
cache <https://prod2.tasko.it/examples/global/vars/cache>.ram = cache 
<https://prod2.tasko.it/examples/global/vars/cache>.disk = cache 
<https://prod2.tasko.it/examples/global/vars/cache>.memcache


>Which python version do you use (2 or 3) ?
2

>But in general, yes, I recommend to upgrade to the latest version for 
several reasons.
I'm still planing to move to a 2.18.5, I've already installed it but in the 
welcome/modules folder there's only the __init__.py file, it's an empty 
file.

>The module 'six' is a compatibility layer between API of python2 and 
python3 anyway.
That could be the problem.

>I cannot see now why it should be in your apps module dir...
I've got __init__.py and pyc, api_site.pyc, plugin_ckeditor.py and pyc.


Il giorno venerdì 12 luglio 2019 16:04:24 UTC+2, Fekete Zoltán ha scritto:
>
> Could you please copy the whole error message?
> Which python version do you use (2 or 3) ?
>
> But in general, yes, I recommend to upgrade to the latest version for 
> several reasons.
>
> The module 'six' is a compatibility layer between API of python2 and 
> python3 anyway.
> I cannot see now why it should be in your apps module dir...
>
> Regards,
> FeZ
>
> 2019. július 12., péntek 15:37:08 UTC+2 időpontban Gaël Princivalle a 
> következőt írta:
>>
>> Thank you Zoltán.
>>
>> I'm still trying this solution however when I create the 0_memcache.py 
>> model file I've got this ticket:
>>
>>  Cannot import module 
>> 'applications.my_app.modules.six'
>>
>> Could it be due to the fact that the web2py version is the old 2.14.6?
>>
>> Il giorno venerdì 12 luglio 2019 10:46:44 UTC+2, Fekete Zoltán ha scritto:
>>>
>>> Hi Gael,
>>>
>>> It is possible to store sessions in the db, however consider that it 
>>> will slow down the system if you have such a high load.
>>>
>>> A faster solution is to store sessions in memory:
>>>
>>> http://web2py.com/books/default/chapter/29/13?search=cache#Sessions-in-memcache
>>>
>>> Read that part of the doc, there are quite a few type of session 
>>> handling recipes.
>>>
>>> Regards,
>>>
>>> FeZ
>>>
>>> 2019. július 12., péntek 10:00:03 UTC+2 időpontban Gaël Princivalle a 
>>> következőt írta:
>>>>
>>>> Hi all.
>>>>
>>>> In my sessions folder all sessions are stored in separated sub-folders, 
>>>> 068,069...
>>>> The file system don't accept more than 512 sub-folders in a folder.
>>>> When I reach 512 sub-folders the website is down.
>>>> Now for avoiding this problem I delete all the sessions with a crontab 
>>>> job every 12 hours, but it's not enough.
>>>>
>>>> Obviously I can imagine that deleting all the sessions means also 
>>>> disconnecting all the users, that's not a good thing.
>>>>
>>>> Can I store the sessions in the DB instead of the file system?
>>>>
>>>> And what about that? I don't understand where I must add it, and it 
>>>> seems that the sessions storage for my website works already like that,
>>>> http://web2py.com/books/default/chapter/29/04/the-core#Separate-sessions
>>>>
>>>> Thanks.
>>>>
>>>>
>>>>

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


[web2py] Re: Too much sessions...

2019-07-12 Thread Gaël Princivalle
Thank you Zoltán.

I'm still trying this solution however when I create the 0_memcache.py 
model file I've got this ticket:

 Cannot import module 
'applications.my_app.modules.six'

Could it be due to the fact that the web2py version is the old 2.14.6?

Il giorno venerdì 12 luglio 2019 10:46:44 UTC+2, Fekete Zoltán ha scritto:
>
> Hi Gael,
>
> It is possible to store sessions in the db, however consider that it will 
> slow down the system if you have such a high load.
>
> A faster solution is to store sessions in memory:
>
> http://web2py.com/books/default/chapter/29/13?search=cache#Sessions-in-memcache
>
> Read that part of the doc, there are quite a few type of session handling 
> recipes.
>
> Regards,
>
> FeZ
>
> 2019. július 12., péntek 10:00:03 UTC+2 időpontban Gaël Princivalle a 
> következőt írta:
>>
>> Hi all.
>>
>> In my sessions folder all sessions are stored in separated sub-folders, 
>> 068,069...
>> The file system don't accept more than 512 sub-folders in a folder.
>> When I reach 512 sub-folders the website is down.
>> Now for avoiding this problem I delete all the sessions with a crontab 
>> job every 12 hours, but it's not enough.
>>
>> Obviously I can imagine that deleting all the sessions means also 
>> disconnecting all the users, that's not a good thing.
>>
>> Can I store the sessions in the DB instead of the file system?
>>
>> And what about that? I don't understand where I must add it, and it seems 
>> that the sessions storage for my website works already like that,
>> http://web2py.com/books/default/chapter/29/04/the-core#Separate-sessions
>>
>> Thanks.
>>
>>
>>

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


[web2py] Too much sessions...

2019-07-12 Thread Gaël Princivalle
Hi all.

In my sessions folder all sessions are stored in separated sub-folders, 
068,069...
The file system don't accept more than 512 sub-folders in a folder.
When I reach 512 sub-folders the website is down.
Now for avoiding this problem I delete all the sessions with a crontab job 
every 12 hours, but it's not enough.

Obviously I can imagine that deleting all the sessions means also 
disconnecting all the users, that's not a good thing.

Can I store the sessions in the DB instead of the file system?

And what about that? I don't understand where I must add it, and it seems 
that the sessions storage for my website works already like that,
http://web2py.com/books/default/chapter/29/04/the-core#Separate-sessions

Thanks.


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


[web2py] Re: Admin password

2019-05-16 Thread Gaël Princivalle
>Does parameters_443.py exist in web2py dir?
Yes.

>Check permissions - does web2py have access to this file?
Yes

Il giorno giovedì 16 maggio 2019 10:10:25 UTC+2, Val K ha scritto:
>
> Hi!
> Does parameters_443.py exist in web2py dir?
> Check permissions - does web2py have access to this file?

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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/e069e591-6144-4ebd-903c-6b212fa90b7f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Error after restore

2019-05-16 Thread Gaël Princivalle
Hello.

I've restored from backup a compiled application called 
hydrover_oleodinamica.

Now only on the files that are called from Ajax I've got this 500 internal 
server error:
(dp1 S'output' p2 S" need more than 1 value to unpack" p3 sS'layer' p4 
S'/home/tasko/webapps/w2p_2_14_16/web2py/applications/hydrover_oleodinamica/compiled/controllers.default.config.pyc'
 
p5 sS'code' p6 S' at 0x7f946e799030, file 
"/home/tasko/webapps/w2p_2_14_16/web2py/applications/hydrover_oleodinamica/compiled/controllers.default.config.py",
 
line 4>' p7 sS'snapshot' p8 (dp9 S'exception' p10 (dp11 S'__hash__' p12 S"" 
p13 sS'__setattr__' p14 S"" p15 sS'__reduce_ex__' p16 S'' p17 
sS'__getslice__' p18 S"" p19 sS'__getitem__' p20 S"" p21 sS'__setstate__' 
p22 S'' p23 sS'args' p24 S"('need more than 1 value to unpack',)" p25 
sS'__reduce__' p26 S'' p27 sS'__str__' p28 S"" p29 sS'__format__' p30 S'' 
p31 sS'__getattribute__' p32 S"" p33 sS'__class__' p34 S"" p35 
sS'__unicode__' p36 S'' p37 sS'__delattr__' p38 S"" p39 
sS'__subclasshook__' p40 S'' p41 sS'__repr__' p42 S"" p43 sS'__dict__' p44 
S'{}' p45 sS'__sizeof__' p46 S'' p47 sS'__doc__' p48 S"'Inappropriate 
argument value (of correct type).'" p49 sS'__init__' p50 S"" p51 
sS'__new__' p52 S'' p53 ssS'evalue' p54 S'need more than 1 value to unpack' 
p55 sS'request' p56 cgluon.html XML_unpickle p57 (S's\xf5s\x00\x00

For example here:
https://www.hydrover.it/en/search_product

Or here:
https://www.hydrover.it/en/applications

Someone know how I can resolve 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/c3eb1ae1-0d40-402f-bf2d-3857598c8dd8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Admin password

2019-05-16 Thread Gaël Princivalle
Hello.

I've forgot my admin password...

And I've made another mistake.
My web2py is on Webfaction and I've reset the password with the 
Pythonanywere instructions:

*Changing your Web2py Admin Password*

   1. Open a Bash console and cd to your *web2py* directory. You'll know 
   you're in the right place if there's a file called parameters_443.py in the 
   directory.
   2. Run this: python -c "from gluon.main import save_password; 
   save_password(raw_input('*admin password*: '),443)"
   3. Reload your webapp.


Now if the admin page is don't load anymore :
403 FORBIDDEN

Soemone can give me a hand?

Thanks.

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


[web2py] Delete sessions

2018-12-04 Thread Gaël Princivalle
Hello.

Is there a way to delete automatically the sessions?
I mean the folders/files inside this folder:
web2py/applications/my_app/sessions

For example deleting the sessions oldest than 1 week.

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.


Re: [web2py] Re: Back button with an Ajax LOAD page

2018-03-03 Thread Gaël Princivalle
Thanks a lot. Do you have an little example?

Il 3 mar 2018 9:01 AM, "Val K" <valq7...@gmail.com> ha scritto:

> Hi, I think when page is reloaded history.pushState happens too, so there
> are 2 identical URL on the stack after page reloading.
> If you want to manage routes by raw JS  It is simpler to use url#hash
> schema  and place  args (category_id=2 and so on) after #.
> In this case it's quite to listen hashchange event and perform ajax.load,
> no other tricks are required.
>
> On Friday, March 2, 2018 at 4:36:28 PM UTC+3, Gaël Princivalle wrote:
>>
>> Hello.
>>
>> I've made a product page with the Ajax LOAD system:
>> http://www.mompala.it/prodotti
>>
>> The idea is giving the possibility to the user to browse these products
>> without a page reload, and it works fine.
>>
>> The problem is that browsing the products don't change the url.
>>
>> I've made a script that changes the content depending of the url.
>> If the url has a category_id like http://www.mompala.it/prodotti
>> ?category_id=8 the load page will display the products of this category.
>> If the url has a product_id like http://www.mompala.it/prodotti
>> ?product_id=325 the load page will display this product.
>>
>> The problem still the history.
>> The user must have the possibility to press the browser back button for
>> displaying the last content.
>>
>> Adding this script in the load page change the url in the browser url
>> bar, new_link is a link with the category_id or product_id:
>> 
>> history.pushState("", "", "{{=new_link}}");
>> 
>>
>> Like that the back button change only the url bar content, not the page
>> content.
>>
>> For updating the page content I've added in the main page 'prodotti' this
>> script:
>> 
>> window.addEventListener('popstate', function(event) {
>>   location.reload();
>> });
>> 
>>
>> And it works, but only for turning back to the last page.
>> In other words, if the user wanted to turn back in the history 2 pages in
>> the past he can't.
>>
>> Someones knows why?
>>
>> 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 a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/web2py/yepkcmzlR1c/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

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


[web2py] Back button with an Ajax LOAD page

2018-03-02 Thread Gaël Princivalle
Hello.

I've made a product page with the Ajax LOAD system:
http://www.mompala.it/prodotti

The idea is giving the possibility to the user to browse these products 
without a page reload, and it works fine.

The problem is that browsing the products don't change the url.

I've made a script that changes the content depending of the url.
If the url has a category_id like 
http://www.mompala.it/prodotti?category_id=8 the load page will display the 
products of this category.
If the url has a product_id like 
http://www.mompala.it/prodotti?product_id=325 the load page will display 
this product.

The problem still the history.
The user must have the possibility to press the browser back button for 
displaying the last content.

Adding this script in the load page change the url in the browser url bar, 
new_link is a link with the category_id or product_id:

history.pushState("", "", "{{=new_link}}");


Like that the back button change only the url bar content, not the page 
content.

For updating the page content I've added in the main page 'prodotti' this 
script:

window.addEventListener('popstate', function(event) {
  location.reload();
});


And it works, but only for turning back to the last page.
In other words, if the user wanted to turn back in the history 2 pages in 
the past he can't.

Someones knows why?

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] Clean app by script

2018-01-12 Thread Gaël Princivalle
Hello.

Is it possible to clean an app by script?

Sometimes Web2py don't work anymore because it have too much log/error 
files to manage.

I remember a Massimo post about it but I've don't found it.

Thanks, regards.

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