[web2py] Scheduler on PythonAnywhere not working since Dec 1

2017-12-06 Thread Scott Hunter
Since Dec 1, I can no longer schedule tasks in the scheduler for my web2py 
(Version 2.14.6-stable+timestamp.2016.05.10.00.21.47) app on 
PythonAnywhere.com; the task log is a LONG permutation of the following 3 
lines:

ERROR:web2py.scheduler.giles-livetask1#7087:error popping tasks
ERROR:web2py.scheduler.giles-livetask1#7087:Error retrieving status
ERROR:web2py.scheduler.giles-livetask1#7087:Error coordinating TICKER

interspersed every hour with something like

Failed to acquire lock, task must already be running
2017-12-06 08:04:12 -- Completed task, took 6.00 seconds, return code 
was 0.

I have tried restarting the scheduler, to no (helpful) effect.  So my 
question is: how do I get this scheduler working again?

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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] Problem enabling Email services

2017-12-06 Thread Sandeep Patel

Hello
I am trying to send a welcome message to user as an email. To achieve this, 
I have followed all the steps as they are described in the official 
documentation. Additionally all the settings that I have adopted for the 
purported functionality, can be found in the trailing email thread. 
However, I am still receiving an Error Message -* WARNING:web2py:email not 
send.* Can anyone help me out here please? Any help would be greatly 
appreciated. 

Thanks
Sandeep
---
from: patelsandeep...@gmail.com
to: sand...@robodia.com
subject: welcome

welcome to web2py

-
-


In My private/appconfig.ini
[smtp]
server = smtp.gmail.com:587
sender = patelsandeep...@gmail.com
login  = patelsandeep...@gmail.com:*

# IN db.py
mail = auth.settings.mailer
mail.settings.server = 'logging' if request.is_local else 
myconf.take('smtp.server')
mail.settings.sender = myconf.take('smtp.sender')
mail.settings.login = myconf.take('smtp.login')
mail.settings.tls = myconf.take('smtp.tls') or False
mail.settings.ssl = myconf.take('smtp.ssl') or False

# -
# configure auth policy
# -
auth.settings.registration_requires_verification = True
auth.settings.registration_requires_approval = False
auth.settings.reset_password_requires_verification = True

# In my controller file
def form():
form = SQLFORM.factory(

Field('Frist_Name',type='string',requires=IS_NOT_EMPTY(),label=T('Your 
First Name')),
Field('Last_Name',type='string',requires=IS_NOT_EMPTY(), 
label=T('Your Last Name')),
Field('email',type='string',requires=IS_EMAIL(), label=T('Your 
Email Address')),
Field('password',type='password',requires = 
[IS_STRONG(),CRYPT(key='sha512:thisisthekey')],label=T('password')),

Field('confirm_password',type='password',requires=IS_EQUAL_TO(request.vars.password),label=T('confirm-password')),
Field('Gender',type='string', requires=IS_IN_SET(['male','female 
']),label=T('Your Sex')))
if form.process().accepted:
if mail:
if mail.send(to=['sand...@robodia.com'], subject='welcome', 
message='welcome to web2py'):
response.flash = T('mail sand successful')
else :
response.flash = T('mail not send')
else :
response.flase = T('unable o send mail')
elif form.errors:
response.flase = 'form error'
return locals()

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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] postgres field optimization smallint

2017-12-06 Thread lucas
hey one and all,

i would like to make some fields of type smallint, which postgresql allows. 
 is there a way to do this under the DAL in the model file, under the Field 
designator?

thank you in advance, lucas

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


[web2py] Re: About Restful with web2py

2017-12-06 Thread pbreit
What you are doing is different from what the guide shows.

If you just want to GET the entries:

curl http://127.0.0.1:8000/RT/default/api/entries.json

If you want to POST/add a new entry you may need to have authentication:

curl --user user:pass -d "f_entry=something" 
http://127.0.0.1:8000/RT/default/api/entries.json




On Saturday, December 2, 2017 at 11:27:48 AM UTC-8, Enrique Acosta wrote:
>
> Hello from Cuba,
>
> I followed the guide at 
> http://www.web2pyslices.com/slice/show/1533/restful-api-with-web2py but 
> whe i try to make a post in the webservice curl show me a mistake:
>
> curl -d "f_entry=something" 
> http://127.0.0.1:8000/RT/default/api/entries.json
>
> errorid
>
> The id is autoincrement but the value is an empty string.
>
> I will appreciate if anybody help me,
>
> Best regards, Enrique
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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: Web2Py + VueJS SPA (Webpack)

2017-12-06 Thread Milton A
All the build tools are the hell. Not for a fullstack js programmer, but
for us we use a better programming language for our tasks on server (better
programming language is relative for what you need) but we need to use js
on client because we can not use python.

Those new build tools come to solve problems we did not have before than.
=-) So, let's try to keep web2py as simple as we can or we will lose to
others more complex frameworks our best advantages. The simplicity and high
productive.

On Wed, Dec 6, 2017 at 6:55 PM, pbreit  wrote:

> How would the "Browser" install method work? Just a matter of adding those
> lines to layout.html? Possible to implement this without all the build
> tools?
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: [web2py] Re: Web2Py + VueJS SPA (Webpack)

2017-12-06 Thread pbreit
How would the "Browser" install method work? Just a matter of adding those 
lines to layout.html? Possible to implement this without all the build 
tools?

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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: Web2Py + VueJS SPA (Webpack)

2017-12-06 Thread Carlos Costa
This bootstrap-vue.js transparently integrated with web2py  backend woud be
a dream.
IMO this would be half the web3py.

2017-12-04 11:42 GMT-02:00 :

> Hi Massimo, I thought you might be interested in this:
> https://bootstrap-vue.js.org/
>
> Quite a new project, MIT license, currently under very active development
> mainly by a Canadian and an Iranian.
>
>
>
> On Tuesday, November 14, 2017 at 12:36:52 PM UTC-7, Massimo Di Pierro
> wrote:
>>
>> This is fantastic. Thank you Carlos,
>> please email me personally about you work. I think this is the path to
>> the future of web2py.
>>
>> On Tuesday, 14 November 2017 10:48:03 UTC-6, Carlos A. Armenta Castro
>> wrote:
>>>
>>> I have using Web2Py for too many years for commercial websites and for
>>> Intranets in México, I want to say that Web2Py is an AMAZING Framework!!!
>>> For my new project I need to use an SPA VueJs + Webpack for the
>>> FrontEnd  ( http://quasar-framework.org/ ) and a Web2Py as my BackEnd
>>> API Server.
>>> I'm curious about to integrate his two web frameworks using web2py
>>> routes to serve this two apps in the same port but different URL.
>>>
>>> Example:
>>> http://127.0.1.1/welcome/api ---> My Web2py API Controller
>>> http://127.0.1.1/welcome   ---> My VueJS APP with webpack  (
>>> http://quasar-framework.org/ ) <-- Pointing to index.html in *dist/ *
>>> and permit to use all the static files deposited in the same path
>>> *dist/**
>>>
>>> *VueJS + Webpack APP Structure*
>>>
>>> ├── *dist/ * *# Compiled APP (Serve this files as the 
>>> static SPA)*
>>> │   *└── index.html
>>> │   ├── fonts/
>>> │   │   └── ...
>>> │   ├── static/
>>> │   │   └── ...
>>> │   ├── js/
>>> │   │   └── ...*
>>> ├── config/
>>> │   ├── index.js# main project config
>>> │   └── ...
>>> ├── src/
>>> │   ├── main.js # app entry file
>>> │   ├── App.vue # main app component
>>> │   ├── components/ # ui components
>>> │   │   └── ...
>>> │   └── assets/ # module assets (processed by webpack)
>>> │   └── ...
>>> ├── static/ # pure static assets (directly copied)
>>> ├── test/
>>> ...
>>>
>>> Actually I am doing this work in my NginX Server but I Will be happy if I 
>>> can do the same thing easily using pure web2py
>>>
>>> Why using the same port?  Because the CORS issues, this is the best and 
>>> easy way to deal with CORS. I know I can use sub-domains in the same port, 
>>> I know I can use ALLOW ORIGIN headers in W2P side but that are not options 
>>> for me in this case.
>>>
>>> NginX config working:
>>>
>>> location / {
>>> index index.html index.htm;
>>> root /home/www-data/vue/applications/simott;
>>> try_files $uri $uri/ /index.html;
>>> }
>>>
>>> location /api {
>>> uwsgi_pass  unix:///tmp/web2py.socket;
>>> include uwsgi_params;
>>> uwsgi_param UWSGI_SCHEME $scheme;
>>> uwsgi_param SERVER_SOFTWARE nginx/$nginx_version;
>>>
>>>}
>>>
>>> Any recommendations? Thanks in advance!
>>>
>>> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>



-- 


Carlos J. Costa
Cientista da Computação  | BS Computer Science
Esp. Gestão em Telecom   | PgC Telecom Mangement
<º))><

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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: {Disarmed} Re: {Disarmed} [web2py] Re: grid IS_IMAGE validator behavior

2017-12-06 Thread Dave S


On Wednesday, December 6, 2017 at 11:06:02 AM UTC-8, Carlos Cesar Caballero 
wrote:
>
> That's the issue, I don't want null values, the user shouldn't remove the 
> image without upload a new one, but when I use the grid's edit form, the 
> validation error is triggered if the user edit another field, so the form 
> can't be submitted without uploading a new image.
>
>
Does the edit form ... and that field in particular ... get pre-populated?  
If so, the existing value should be what is submitted.

But I'm a bit vague about SQLFORM.grid(), so I'm not going to be much help.

/dps

El 06/12/17 a las 13:06, Val K escribió:
>
> yes, if you want to allow null-value  - use IS_EMPTY_OR wrapper  
>
> IS_EMPTY_OR(IS_IMAGE(...))
>
>
> On Wednesday, December 6, 2017 at 8:48:06 PM UTC+3, Carlos Cesar Caballero 
> wrote: 
>>
>> Hi, I have being using web2py for some time, but I don't use files too 
>> often, now I am using the IS_IMAGE, but using the grid on edit it's 
>> throwing a validation error if the user don't set a new image. 
>>
>> It's a bug or is the default behavior? 
>>
>> -- 
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> --- 
> You received this message because you are subscribed to the Google Groups 
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to web2py+un...@googlegroups.com .
> For more options, visit *MailScanner ha detectado un intento de fraude en 
> la siguiente página web "groups.google.com". No confíe en esta página web:* 
> *MailScanner 
> ha detectado un intento de fraude en la siguiente p�gina web 
> "groups.google.com". No conf�e en esta p�gina web:* 
> 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.


{Disarmed} Re: {Disarmed} [web2py] Re: grid IS_IMAGE validator behavior

2017-12-06 Thread Carlos Cesar Caballero Díaz
That's the issue, I don't want null values, the user shouldn't remove 
the image without upload a new one, but when I use the grid's edit form, 
the validation error is triggered if the user edit another field, so the 
form can't be submitted without uploading a new image.



El 06/12/17 a las 13:06, Val K escribió:

yes, if you want to allow null-value  - use IS_EMPTY_OR wrapper
IS_EMPTY_OR(IS_IMAGE(...))

On Wednesday, December 6, 2017 at 8:48:06 PM UTC+3, Carlos Cesar 
Caballero wrote:


Hi, I have being using web2py for some time, but I don't use files
too
often, now I am using the IS_IMAGE, but using the grid on edit it's
throwing a validation error if the user don't set a new image.

It's a bug or is the default behavior?

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the 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 *MailScanner ha detectado un intento de fraude 
en la siguiente p�gina web "groups.google.com". /No/ conf�e en esta 
p�gina web:* https://groups.google.com/d/optout 
.


--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups "web2py-users" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: grid IS_IMAGE validator behavior

2017-12-06 Thread Val K
yes, if you want to allow null-value  - use IS_EMPTY_OR wrapper 

IS_EMPTY_OR(IS_IMAGE(...))


On Wednesday, December 6, 2017 at 8:48:06 PM UTC+3, Carlos Cesar Caballero 
wrote:
>
> Hi, I have being using web2py for some time, but I don't use files too 
> often, now I am using the IS_IMAGE, but using the grid on edit it's 
> throwing a validation error if the user don't set a new image. 
>
> It's a bug or is the default behavior? 
>
>

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


[web2py] Re: Scheduler workers crash on usage of urllib

2017-12-06 Thread Val K
Hi! 
Consider that is NameError, not ImportError. i.e. there is trying to use 
urllib without  import  

On Wednesday, December 6, 2017 at 6:39:11 PM UTC+3, Ryan Herbert wrote:
>
> Hello,
> I am currently experiencing an issue with my scheduler workers crashing on 
> startup with the following error:
>
> Exception in thread Thread-1:
> Traceback (most recent call last):
>   File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
> self.run()
>   File "/usr/share/vidjil/server/web2py/gluon/scheduler.py", line 637, in 
> run
> self.send_heartbeat(counter)
>   File "/usr/share/vidjil/server/web2py/gluon/scheduler.py", line 1161, in 
> send_heartbeat
> self.db._uri, folder=self.db._adapter.folder, decode_credentials=True)
>   File "/usr/share/vidjil/server/web2py/gluon/packages/dal/pydal/base.py", 
> line 169, in __call__
> obj = super(MetaDAL, cls).__call__(*args, **kwargs)
>   File "/usr/share/vidjil/server/web2py/gluon/packages/dal/pydal/base.py", 
> line 474, in __init__
> "Failure to connect, tried %d times:\n%s" % (attempts, tb)
> RuntimeError: Failure to connect, tried 5 times:
> Traceback (most recent call last):
>   File "/usr/share/vidjil/server/web2py/gluon/packages/dal/pydal/base.py", 
> line 454, in __init__
> self._adapter = adapter(**kwargs)
>   File 
> "/usr/share/vidjil/server/web2py/gluon/packages/dal/pydal/adapters/__init__.py"
> , line 40, in __call__
> obj = super(AdapterMeta, cls).__call__(*args, **kwargs)
>   File 
> "/usr/share/vidjil/server/web2py/gluon/packages/dal/pydal/adapters/base.py"
> , line 368, in __init__
> super(SQLAdapter, self).__init__(*args, **kwargs)
>   File 
> "/usr/share/vidjil/server/web2py/gluon/packages/dal/pydal/adapters/base.py"
> , line 50, in __init__
> self._initialize_(do_connect)
>   File 
> "/usr/share/vidjil/server/web2py/gluon/packages/dal/pydal/adapters/mysql.py"
> , line 24, in _initialize_
> user = self.credential_decoder(m.group('user'))
>   File "/usr/share/vidjil/server/web2py/gluon/packages/dal/pydal/base.py", 
> line 403, in 
> credential_decoder = lambda cred: urllib.unquote(cred)
> NameError: global name 'urllib' is not defined
>
> The workers are running inside a docker container and are started with the 
> following command:
> /usr/local/bin/gosu www-data python web2py.py -K myapp
>
>
> I have made sure urllib is correctly installed, and as far as I can tell, 
> it is. Or at least running a python shell and importing the module works. 
> Does anyone have any insight as to why this might be happening ?
>
> 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] grid IS_IMAGE validator behavior

2017-12-06 Thread Carlos Cesar Caballero Díaz
Hi, I have being using web2py for some time, but I don't use files too 
often, now I am using the IS_IMAGE, but using the grid on edit it's 
throwing a validation error if the user don't set a new image.


It's a bug or is the default behavior?

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups "web2py-users" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: How to prohibit delete of row in parent table if is refwrenced by child tables

2017-12-06 Thread rafi farchi
Hi
Thks its a good solution . wlll test it .
Many thanks for your detailed expkanations 

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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] Get reference format representation on dal callbacks

2017-12-06 Thread Carlos Cesar Caballero Díaz
Hi, I am building a module (plugin) that is using some "after insert" 
and "after uptade" dal callbacks. The tables has references (relations) 
and I need to obtain the referenced table string format instead of it's 
id in the callback, and I need it to be generic. How can I achieve that?


Greetings.

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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: serve static files in deployment on pythonanywhere

2017-12-06 Thread Anthony
On Wednesday, December 6, 2017 at 10:19:12 AM UTC-5, Manuele wrote:
>
> Hi Anthony,
>
> thank you for your reply,
>
> On 06/12/2017 15:36, Anthony wrote:
>
> I followed what indicated in the web configuration panel setting up two 
>> static configuration considering that my application is accessible both 
>> as init and as . 
>>
>
> First, what do you mean by this -- do you have two exact copies of the 
> same application, one in /applications/init and one in 
> /applications/appname? If so, why?
>
>
> I simply create a local symlink in the application folder called init that 
> point to the parallel application folder in order to let the web server 
> respond to the requests with no specified application with the one I want.
>

A better approach is to use the parameter-based rewrite system to make your 
app the default application (that way, you will never see /init in the URL).
 

> web2py will not generate any URLs matching /init/ to point to 
> static files (or for any requests). What is the point of that mapping?
>
>
> as far as I can see in the headers of my web application pages static 
> files are linked accordingly to the requested path, so:
>
> if http://myhost/app/default is requested static file links looks like: 
> http://myhost/app/static/...
> on the other hand if http://myhost/init/default is requested static file 
> links looks like: http://myhost/init/static/...
>
> isn't it correct??
>

Yes, correct. My comment was in reference to your /init/ URL, 
which apparently was just a mistake.
 

>
>  
>
>>
>> than (after reloaded the application) I tried to access the same static 
>> file from the browser using the two options: 
>>
>> 1. http:///init/static//.js 
>> 2. http:static//.js 
>>
>
> Mapping #2 above is for /init/, so it will not affect requests to 
> //static. If you want to re-route requests for //static, 
> then you need a mapping for that pattern.
>
>
> you're right... I wrote an errata corrige for that above. Sorry.
>
>
> What exactly are you trying to achieve? Why are you trying to map some 
> static requests to a non-existent folder?
>
>
> I just wanted to check the effect of my configuration.
>

Maybe the browser has cached the files -- try a force refresh. Otherwise, 
check with Pythonanywhere support.

Anthony

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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] Scheduler workers crash on usage of urllib

2017-12-06 Thread Ryan Herbert
Hello,
I am currently experiencing an issue with my scheduler workers crashing on 
startup with the following error:

Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
self.run()
  File "/usr/share/vidjil/server/web2py/gluon/scheduler.py", line 637, in 
run
self.send_heartbeat(counter)
  File "/usr/share/vidjil/server/web2py/gluon/scheduler.py", line 1161, in 
send_heartbeat
self.db._uri, folder=self.db._adapter.folder, decode_credentials=True)
  File "/usr/share/vidjil/server/web2py/gluon/packages/dal/pydal/base.py", 
line 169, in __call__
obj = super(MetaDAL, cls).__call__(*args, **kwargs)
  File "/usr/share/vidjil/server/web2py/gluon/packages/dal/pydal/base.py", 
line 474, in __init__
"Failure to connect, tried %d times:\n%s" % (attempts, tb)
RuntimeError: Failure to connect, tried 5 times:
Traceback (most recent call last):
  File "/usr/share/vidjil/server/web2py/gluon/packages/dal/pydal/base.py", 
line 454, in __init__
self._adapter = adapter(**kwargs)
  File 
"/usr/share/vidjil/server/web2py/gluon/packages/dal/pydal/adapters/__init__.py"
, line 40, in __call__
obj = super(AdapterMeta, cls).__call__(*args, **kwargs)
  File 
"/usr/share/vidjil/server/web2py/gluon/packages/dal/pydal/adapters/base.py", 
line 368, in __init__
super(SQLAdapter, self).__init__(*args, **kwargs)
  File 
"/usr/share/vidjil/server/web2py/gluon/packages/dal/pydal/adapters/base.py", 
line 50, in __init__
self._initialize_(do_connect)
  File 
"/usr/share/vidjil/server/web2py/gluon/packages/dal/pydal/adapters/mysql.py"
, line 24, in _initialize_
user = self.credential_decoder(m.group('user'))
  File "/usr/share/vidjil/server/web2py/gluon/packages/dal/pydal/base.py", 
line 403, in 
credential_decoder = lambda cred: urllib.unquote(cred)
NameError: global name 'urllib' is not defined

The workers are running inside a docker container and are started with the 
following command:
/usr/local/bin/gosu www-data python web2py.py -K myapp


I have made sure urllib is correctly installed, and as far as I can tell, 
it is. Or at least running a python shell and importing the module works. 
Does anyone have any insight as to why this might be happening ?

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: serve static files in deployment on pythonanywhere

2017-12-06 Thread Manuele Pesenti

Hi Anthony,

thank you for your reply,


On 06/12/2017 15:36, Anthony wrote:


I followed what indicated in the web configuration panel setting
up two
static configuration considering that my application is accessible
both
as init and as .


First, what do you mean by this -- do you have two exact copies of the 
same application, one in /applications/init and one in 
/applications/appname? If so, why?


I simply create a local symlink in the application folder called init 
that point to the parallel application folder in order to let the web 
server respond to the requests with no specified application with the 
one I want.



In order to be sure the configuration takes effect I used a broken
path
for one of the two configuration as follows:

1. '/init/static/'             ->    '/home//web2py/applications//static/'
2. '/init//' ->    '/home//web2py/applications//static_broken/'



errata corrige:

2. '//static/' ->    '/home/user>/web2py/applications//static_broken/'




web2py will not generate any URLs matching /init/ to point to 
static files (or for any requests). What is the point of that mapping?


as far as I can see in the headers of my web application pages static 
files are linked accordingly to the requested path, so:


if http://myhost/app/default is requested static file links looks like: 
http://myhost/app/static/...
on the other hand if http://myhost/init/default is requested static file 
links looks like: http://myhost/init/static/...


isn't it correct??



than (after reloaded the application) I tried to access the same
static
file from the browser using the two options:

1. http:///init/static//.js
2. http:static//.js


Mapping #2 above is for /init/, so it will not affect 
requests to //static. If you want to re-route requests for 
//static, then you need a mapping for that pattern.


you're right... I wrote an errata corrige for that above. Sorry.



What exactly are you trying to achieve? Why are you trying to map some 
static requests to a non-existent folder?


I just wanted to check the effect of my configuration.



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

For more options, visit https://groups.google.com/d/optout.


--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups "web2py-users" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: serve static files in deployment on pythonanywhere

2017-12-06 Thread Anthony

>
> I followed what indicated in the web configuration panel setting up two 
> static configuration considering that my application is accessible both 
> as init and as . 
>

First, what do you mean by this -- do you have two exact copies of the same 
application, one in /applications/init and one in /applications/appname? If 
so, why?
 

> In order to be sure the configuration takes effect I used a broken path 
> for one of the two configuration as follows: 
>
> 1. '/init/static/' ->'/home/ user>/web2py/applications//static/' 
> 2. '/init//' ->'/home/ user>/web2py/applications//static_broken/' 
>

web2py will not generate any URLs matching /init/ to point to 
static files (or for any requests). What is the point of that mapping?
 

>
> than (after reloaded the application) I tried to access the same static 
> file from the browser using the two options: 
>
> 1. http:///init/static//.js 
> 2. http:static//.js 
>

Mapping #2 above is for /init/, so it will not affect requests to 
//static. If you want to re-route requests for //static, 
then you need a mapping for that pattern.

What exactly are you trying to achieve? Why are you trying to map some 
static requests to a non-existent folder?

Anthony

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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] serve static files in deployment on pythonanywhere

2017-12-06 Thread Manuele Pesenti

Hi!

I'm trying to setup static files mapping for my application loaded on 
pythonanywhere service.
I followed what indicated in the web configuration panel setting up two 
static configuration considering that my application is accessible both 
as init and as .


In order to be sure the configuration takes effect I used a broken path 
for one of the two configuration as follows:


1. '/init/static/'             ->    '/home/user>/web2py/applications//static/'
2. '/init//' ->    '/home/user>/web2py/applications//static_broken/'


than (after reloaded the application) I tried to access the same static 
file from the browser using the two options:


1. http:///init/static//.js
2. http:static//.js

but (even after reloading file using ctrl+F5) I get the same correct result.

Is there some other configuration or changes to be made on the web2py 
side to be made for thees porpuses?


Thanks a lot.

    Manuele

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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.