Re: [web2py] Re: required class for required fields

2013-08-28 Thread Vinicius Assef
Great idea, the onrender callback.

On Wed, Aug 28, 2013 at 12:33 AM, mr.freeze nfre...@gmail.com wrote:
 Thanks Manuele.  I am hoping that a generic onrender callback for default
 widgets will simplify this.

 On Tuesday, August 27, 2013 5:38:37 AM UTC-5, Manuele wrote:

 Il 25/08/13 00:37, mr.freeze ha scritto:

 I want to take advantage of bootstrap's form validation classes so I need
 to add a class to the field.

 if could be of any help that's the ugly way how I solved it locally :)

 def dressMandatory(grid, table):
  Special representation for mandatory fields in grid 

 for fieldname in table.fields:
 myid = '_'.join((table._tablename, fieldname, ))
 # icon = I(_class=icon-warning-sign)
 app = '' # SPAN(icon, _class=add-on) if
 table[fieldname].required else ''
 class_value = control-group warning if table[fieldname].required
 else ''
 grid.elements('#%s' % myid, replace=lambda el:
 DIV(DIV(TAG.nobr(el, app), _class=input-append), _class=class_value))

 def dressMandatoryInForm(form, *tabs):
  Special representation for mandatory fields in form 

 tabs_fields = [[t[f] for f in t.fields if f != t._id.name] for t in
 tabs]
 fields_list = sum(tabs_fields[1:], tabs_fields[0])
 m = form.elements()[0].elements
 for field in fields_list:
 if field.writable and field.readable and not field.compute:
 if field.required:
 m('#no_table_%s' % field.name, replace=lambda el:
 DIV(DIV(el, _class=input-append), _class=control-group warning))


 --

 ---
 You received this message because you are subscribed to the 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/groups/opt_out.

-- 

--- 
You received this message because you are subscribed to the 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/groups/opt_out.


[web2py] Re: GoogleGroup - how do you keep track of useful code?

2013-08-28 Thread Willoughby
I paste them into OneNote as I stumble across them - and put a tag with 
them so I can search them later.  Also allows me to work offline when 
flying, etc.


On Tuesday, August 27, 2013 6:03:54 PM UTC-4, greenpoise wrote:

 I cant seem to find a way to track useful code. I can only Star really 
 helpful posts but finding a specific starred item is a pain in the nuts 
 specially when I am switching tasks between web2py and other projects here 
 at work. How do you guys keep track of that snippet of code you find on 
 Web2py google group??? 


-- 

--- 
You received this message because you are subscribed to the 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/groups/opt_out.


Re: [web2py] Begginer questions about web2py

2013-08-28 Thread Gallien Labeyrie
Hello, 

Thanks for your answers and links,everything is fine now, I connect to my 
database  and i'm able to debugg the app :)

-- 

--- 
You received this message because you are subscribed to the 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/groups/opt_out.


[web2py] Why is the plugins list empty in the wizard?

2013-08-28 Thread Razvan Teslaru
I'm trying out the New Application Wizard -- in step 1, however, the 
plugins box is empty. I searched around and came across an older bug, where 
the plugins where there but were not visible due to a 'overflow-y: auto' 
value. 

However, this is a different issue: the plugins are not listed at all (I 
inspected the page source); playing around with overflow-y' doesn't help 
either. The 'ul class=ms-list' is definitely empty. 

Tested in Windows and CentOS, with Chrome and IE.

Does anyone else experience the same issue? Or is it something I'm (not) 
doing?

Thanks!

-- 

--- 
You received this message because you are subscribed to the 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/groups/opt_out.


[web2py] ApplicationController to always call function on page load?

2013-08-28 Thread Tobias Dahlberg
Hi

I have been developing some applications using Ruby on Rails but have now 
switched to web2py. The switch have been very pleasant, I find web2py to be 
really useful and fun to develop in. I have figured out how to do most 
things that I am used to do in RoR. One thing I haven't been able to do yet 
is to create a function that ALWAYS is called before page load. In RoR I 
could create a function in ApplicationController and use a before_filter to 
make sure the function always was called before every page was loaded. 

Is there a way to ALWAYS call a function before page load? 

I guess I could create a decorator and explicitly add it before all other 
functions. Is that the best way to do it? If so, how do I create a 
decorator? 

Thanks!

BR 
Tobias Dahlberg 

-- 

--- 
You received this message because you are subscribed to the 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/groups/opt_out.


[web2py] Webhosts for Web2py

2013-08-28 Thread Vivek Jha
I am new in web development and I have started with web2py and have almost 
copleted reading the web2py book.

Now few practical issues are coming up about which I don't have any 
experience and that is chosing the right economical webhost.

I think following suits my pocket:
1. Bluehost
2. Hostgator (mainly becuase they have presence in India as well)
3. Justhost.

Do any of guys have any experience with these web hosts. As most of the 
webhosts are still not able to see the world beyond PHP and wordpress they 
have not mentioned python support specifically though they may be 
supporting Python based applications internally.

Questions:
1. Do the above webhosts will be able to support Web2Py with FastCGI.
2. Is having shell access a must for running web2py.
3. Will it be possible to run Web2Py on the main domain and Wordpress on 
subdomain or vice versa with them.
4. Whom to ask about WSGI setup? Is this a webshost specific question or 
Web2Py specific.

If you think I have not asked the right questions, then please assume me as 
a beginner in the hosting world and let me if there are any catches about 
which I should be careful of.

-- 

--- 
You received this message because you are subscribed to the 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/groups/opt_out.


[web2py] Re: Why is the plugins list empty in the wizard?

2013-08-28 Thread Massimo Di Pierro
The problem is that the plugin app has been deprecated and plugins are 
being moved to github and web2pyslices. It was a nice automatism we did not 
have enough manpower to keep the plugins updated. It was not very useful.

Massimo

On Tuesday, 27 August 2013 15:41:59 UTC-5, Razvan Teslaru wrote:

 I'm trying out the New Application Wizard -- in step 1, however, the 
 plugins box is empty. I searched around and came across an older bug, where 
 the plugins where there but were not visible due to a 'overflow-y: auto' 
 value. 

 However, this is a different issue: the plugins are not listed at all (I 
 inspected the page source); playing around with overflow-y' doesn't help 
 either. The 'ul class=ms-list' is definitely empty. 

 Tested in Windows and CentOS, with Chrome and IE.

 Does anyone else experience the same issue? Or is it something I'm (not) 
 doing?

 Thanks!


-- 

--- 
You received this message because you are subscribed to the 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/groups/opt_out.


[web2py] Re: ApplicationController to always call function on page load?

2013-08-28 Thread Massimo Di Pierro
In any model you can do 

def myfuntion():
  pass
myfunction()

models are always executed before page loads, they are executed in 
alphabetical order.

On Wednesday, 28 August 2013 02:16:04 UTC-5, Tobias Dahlberg wrote:

 Hi

 I have been developing some applications using Ruby on Rails but have now 
 switched to web2py. The switch have been very pleasant, I find web2py to be 
 really useful and fun to develop in. I have figured out how to do most 
 things that I am used to do in RoR. One thing I haven't been able to do yet 
 is to create a function that ALWAYS is called before page load. In RoR I 
 could create a function in ApplicationController and use a before_filter to 
 make sure the function always was called before every page was loaded. 

 Is there a way to ALWAYS call a function before page load? 

 I guess I could create a decorator and explicitly add it before all other 
 functions. Is that the best way to do it? If so, how do I create a 
 decorator? 

 Thanks!

 BR 
 Tobias Dahlberg 


-- 

--- 
You received this message because you are subscribed to the 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/groups/opt_out.


[web2py] puppet for web2py

2013-08-28 Thread Francisco Barretto
Hi there!

Did Anyone already made some puppet module to manage/install web2py and 
web2py's app management(install/update) through Puppet? I was thinking 
about hosting my app in a git repository and use a puppet module to keep 
web2py updated (by applying both web2py and app changes to client machines).

Thanks

-- 

--- 
You received this message because you are subscribed to the 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/groups/opt_out.


Re: [web2py] puppet for web2py

2013-08-28 Thread Vinicius Assef
I don't know puppet, but this weekend I'll be doing it through shell
script, to one customer.

On Wed, Aug 28, 2013 at 11:28 AM, Francisco Barretto
kikobarre...@gmail.com wrote:
 Hi there!

 Did Anyone already made some puppet module to manage/install web2py and
 web2py's app management(install/update) through Puppet? I was thinking about
 hosting my app in a git repository and use a puppet module to keep web2py
 updated (by applying both web2py and app changes to client machines).

 Thanks

 --

 ---
 You received this message because you are subscribed to the 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/groups/opt_out.

-- 

--- 
You received this message because you are subscribed to the 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/groups/opt_out.


[web2py] Re: Webhosts for Web2py

2013-08-28 Thread Massimo Di Pierro
Answers below.

On Tuesday, 27 August 2013 16:11:22 UTC-5, Vivek Jha wrote:

 I am new in web development and I have started with web2py and have almost 
 copleted reading the web2py book.

 Now few practical issues are coming up about which I don't have any 
 experience and that is chosing the right economical webhost.

 I think following suits my pocket:
 1. Bluehost
 2. Hostgator (mainly becuase they have presence in India as well)
 3. Justhost. 


 Do any of guys have any experience with these web hosts. As most of the 
 webhosts are still not able to see the world beyond PHP and wordpress they 
 have not mentioned python support specifically though they may be 
 supporting Python based applications internally.

 Questions:
 1. Do the above webhosts will be able to support Web2Py with FastCGI.


I just looked them up and they all they they do. They have instructions for 
Django. The same instructions apply to web2py except that 1) you do not 
need to install Django 2) you need to download and unzip web2py 3) you need 
to configure apache to point to the provided fcgihandler.py.
 

 2. Is having shell access a must for running web2py.


You don't but it is convenient for maintenance. All the hosts you listed 
have a shell.
 

 3. Will it be possible to run Web2Py on the main domain and Wordpress on 
 subdomain or vice versa with them.


That's an apache configuration issue. Yes you can. web2py does not care. If 
there is a path prefix you have to use routes.py to tell web2py to ignore 
the prefix.
 

 4. Whom to ask about WSGI setup? Is this a webshost specific question or 
 Web2Py specific.


That's a host specific issue. It is unlikely shared hosts will support it.
 

 If you think I have not asked the right questions, then please assume me 
 as a beginner in the hosting world and let me if there are any catches 
 about which I should be careful of.


As a rule of thumb, if they have instructions for any other python 
framework you can do it with web2py too. We can help you convert the 
instructions. All python frameworks use the same standard mechanisms to 
talk to web servers. web2py is actually easier than others because you do 
not need root privileges to install it nor you need virtualenv. We also 
support all adapters: wsgi, fcgi, scgi, cgi, mod_python (discouraged), 
isapi (windows only). The real issue is, if they don't allow wsgi, than 
probably you need to run web2py using fcgi. This means you need to run your 
own long running process. What tools do they offer to do that (start, 
monitor, restart). Moreover if you later need a third party module that 
requires sudo access, will they install it for you? If they are mostly a 
Ruby or PHP shop, they will not help you much.  I have worked with 
pythonanywhere.com and they were very helpful and responsive.

-- 

--- 
You received this message because you are subscribed to the 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/groups/opt_out.


[web2py] jQuery and custom form giving unwanted form submit

2013-08-28 Thread Jordan Ladora
Hi all,

I initially noticed the problem of unwanted form submits when trying to 
make elements from a custom form sortable w/ jquery, but the problem 
extends further..

I first posted the problem here - 
https://groups.google.com/forum/?fromgroups=#!topic/web2py/rPHKPqqHbsg

It also happens when I implement 
https://groups.google.com/forum/#!topic/web2py/cehv_umpS-U to check all 
checkboxes in a view..

Bottom line is, when I combine certain jQuery functions with custom forms ( 
http://web2py.com/books/default/chapter/29/07#Custom-forms ), clicking 
buttons on those forms causes the form to unwantedly accept or validate.. 
when I remove the custom form elements and just use {{=form}} in the view, 
the js code behaves as intended and the form does not accept or validate 
until I click the Submit button. 

Thanks for any help. I can't figure out why this happens..
-jl

-- 

--- 
You received this message because you are subscribed to the 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/groups/opt_out.


[web2py] Re: GoogleGroup - how do you keep track of useful code?

2013-08-28 Thread Rufus
If you use windows, you can open a folder on your desktop and drag-and-drop 
the links into it.
(if you trust that the snippet will always be available in the 'net)
I have several folders-of-shortcuts on my desktop by categories, e.g.:  
Current Projects, Diversions, Past Projects, Python Sites, etc.  
(the shortcuts don't have to be just local directories and applications).

I'm using Firefox, and I just drag the little icon to the left of the web 
URL and drag that to the folder.

On Tuesday, August 27, 2013 6:03:54 PM UTC-4, greenpoise wrote:

 I cant seem to find a way to track useful code. I can only Star really 
 helpful posts but finding a specific starred item is a pain in the nuts 
 specially when I am switching tasks between web2py and other projects here 
 at work. How do you guys keep track of that snippet of code you find on 
 Web2py google group??? 


-- 

--- 
You received this message because you are subscribed to the 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/groups/opt_out.


[web2py] Re: CAS provider and registration

2013-08-28 Thread Larry Weinberg

It look like trunk gives the same results.

   - I create two new apps up casserve and casclient
   - In casclient I create auth with this:
  - auth = Auth(db,cas_provider = 
  'http://127.0.0.1:8000/casserve/default/user/cas')
   - I launch casclient/default/index and the login menu only shows login. 
No registration.
   - If I go to login it takes me to casserve.  There I can go to 
   registration in the menu but it does not take me back to casclient once I 
   log in. It takes me to casserve/default/index

What I would wish/expect would happen is one of:

   - Cas client would show both login and  register choices that would 
   redirect to casserve for login or registration and would return to 
   casclient when done
   
or

   - Cas client would show a single login or register choice which would 
   take me to casserve.  Once logged in or registered I would return to 
   casclient




-- 

--- 
You received this message because you are subscribed to the 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/groups/opt_out.


Re: [web2py] puppet for web2py

2013-08-28 Thread Francisco Barretto
There is a .sh provided along with the web2py distribution for install 
purposes. The main thing is that when you do it through puppet (
http://puppetlabs.com/) and your machine goes bad for any reason you just 
have to apply your puppet again. Or if you want to replicate your app into 
X new machines, just apply the puppet.

imagine that you have to create a b machine so you can balance your 
incoming requests. It is quite hard to keep them synchronized manually. 
Puppet allows you to puppetize the configuration and apply at both 
machines. That's why I'm interested in using puppet.

If anybody has ever tried to apply puppet for web2py management, please 
send me a smoke signal! :)

Em quarta-feira, 28 de agosto de 2013 11h31min44s UTC-3, viniciusban 
escreveu:

 I don't know puppet, but this weekend I'll be doing it through shell 
 script, to one customer. 

 On Wed, Aug 28, 2013 at 11:28 AM, Francisco Barretto 
 kikoba...@gmail.com javascript: wrote: 
  Hi there! 
  
  Did Anyone already made some puppet module to manage/install web2py and 
  web2py's app management(install/update) through Puppet? I was thinking 
 about 
  hosting my app in a git repository and use a puppet module to keep 
 web2py 
  updated (by applying both web2py and app changes to client machines). 
  
  Thanks 
  
  -- 
  
  --- 
  You received this message because you are 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 javascript:. 
  For more options, visit https://groups.google.com/groups/opt_out. 


-- 

--- 
You received this message because you are subscribed to the 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/groups/opt_out.


Re: [web2py] puppet for web2py

2013-08-28 Thread nils
Hi,

You should take a look a http://docs.saltstack.com/ref/python-api.html

This is like fabric and puppet all in one and its really easy to use.

Regards,

Nils



On Wed, Aug 28, 2013 at 3:28 PM, Francisco Barretto
kikobarre...@gmail.comwrote:

 Hi there!

 Did Anyone already made some puppet module to manage/install web2py and
 web2py's app management(install/update) through Puppet? I was thinking
 about hosting my app in a git repository and use a puppet module to keep
 web2py updated (by applying both web2py and app changes to client machines).

 Thanks

 --

 ---
 You received this message because you are subscribed to the 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/groups/opt_out.


-- 

--- 
You received this message because you are subscribed to the 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/groups/opt_out.


[web2py] Re: GoogleGroup - how do you keep track of useful code?

2013-08-28 Thread greenpoise
Well I ended up with a firefox extension called *List.It*. It is really 
good actually as it allows me to copy and search through. It is sort of 
what Opera offers as a note taker but presented better. I am a Chrome user 
but this extension is not on Chrome. Not a deal breaker though, I can use 
Firefox. The only downfall is that cant archive by folders. Is ok. It 
works. 




On Wednesday, August 28, 2013 8:13:09 AM UTC-7, Rufus wrote:

 If you use windows, you can open a folder on your desktop and 
 drag-and-drop the links into it.
 (if you trust that the snippet will always be available in the 'net)
 I have several folders-of-shortcuts on my desktop by categories, e.g.:  
 Current Projects, Diversions, Past Projects, Python Sites, etc.  
 (the shortcuts don't have to be just local directories and applications).

 I'm using Firefox, and I just drag the little icon to the left of the web 
 URL and drag that to the folder.

 On Tuesday, August 27, 2013 6:03:54 PM UTC-4, greenpoise wrote:

 I cant seem to find a way to track useful code. I can only Star really 
 helpful posts but finding a specific starred item is a pain in the nuts 
 specially when I am switching tasks between web2py and other projects here 
 at work. How do you guys keep track of that snippet of code you find on 
 Web2py google group??? 



-- 

--- 
You received this message because you are subscribed to the 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/groups/opt_out.


Re: [web2py] puppet for web2py

2013-08-28 Thread Francisco Barretto
The main thing is that everything else is puppetized here... it would be 
probably better if it could fit in smoothly through puppet. It is possible 
to implement everything from scratch but it's a lot of work. 

Em quarta-feira, 28 de agosto de 2013 13h04min02s UTC-3, nils escreveu:

 Hi,

 You should take a look a http://docs.saltstack.com/ref/python-api.html 

 This is like fabric and puppet all in one and its really easy to use.

 Regards,

 Nils



 On Wed, Aug 28, 2013 at 3:28 PM, Francisco Barretto 
 kikoba...@gmail.comjavascript:
  wrote:

 Hi there!

 Did Anyone already made some puppet module to manage/install web2py and 
 web2py's app management(install/update) through Puppet? I was thinking 
 about hosting my app in a git repository and use a puppet module to keep 
 web2py updated (by applying both web2py and app changes to client machines).

 Thanks

 -- 
  
 --- 
 You received this message because you are 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 javascript:.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 

--- 
You received this message because you are subscribed to the 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/groups/opt_out.


[web2py] Document for Fedora Deployment

2013-08-28 Thread Xiaokui Shu
Dear all,

I like web2py very much and I created my own application. However, I find 
difficulties deploying web2py on Fedora 19. After my successful deployment, 
I write a short document that may help others overcome the issues I had in 
the deployment process.

I read the Fedora setup script 
(http://web2py.googlecode.com/hg/scripts/setup-web2py-fedora.sh), and start 
my document from the steps provided in it. This script itself does not work 
out-of-box, which may due to the rapid development of Fedora. The most 
tricky parts are firewall and SELinux. I searched online and find many 
people complaining about SELinux configurations. I did not find any 
successfully configured SELinux post for web2py. In most posts, people 
disabled SELinux to get it simple. However, this is not recommended.

In my document, I have a separate section on troubleshooting, pointing out 
the logs and the basic diagnoses.

I am posting the information here and I want it to be indexed by search 
engines, so that others can find solutions to some issues.
I am glad if someone could merge some content of my document to the 
official deployment recipe.
I am also glad if someone could help me to improve the document, or maybe 
write it into a script.

Best,
Xiaokui

-- 

--- 
You received this message because you are subscribed to the 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/groups/opt_out.
##
#
#   web2py Deployment Guide on Fedora
#
# This document serves as the guide to deploy web2py on Fedora/RHEL/CentOS.
# It contains instructions which can be run directly in a shell. This document
# is written based on the older Fedora web2py deployment script, which can be
# gotten here: http://web2py.googlecode.com/hg/scripts/setup-web2py-fedora.sh
#
# Distribution Tested: Fedora 19
# Target Web Server: Apahce 2.4
#
# Update: 2013/08/28
#
# Author: Xiaokui
# Auhtor (setup-web2py-fedora.sh): berubejd
#
##

###
###  Step/Phase List
###

# Please change to root using su or sudo -i

# 1.Install packages for web2py and web server
# 2.Fetch and install web2py
# 3.Configure SELinux
# 4.Configure firewallD/iptables
# 5.Create a self signed ssl certificate
# 6.Configure Apache
# 7.Setup web2py applications
# 8.Troubleshooting

###
###  Phase 1: Install packages for web2py and web server
###

# Verify packages are up to date
yum update

# Install required packages
yum install httpd mod_ssl mod_wsgi wget python checkpolicy policycoreutils 
policycoreutils-devel

###
### Phase 2 - Fetch and install web2py
###

# Need to pick up a directory to hold web2py
# web2py can be put in the default web server directory: /var/www/html/

# cd to the holding directory and download web2py
wget http://web2py.com/examples/static/web2py_src.zip
unzip web2py_src.zip
# apache is the default httpd (apache) user and group name
chown -R apache:apache web2py

###
### Phase 3 - Configure SELinux
###

# SELinux is on by default
# Disabling it solves the issue, but it is not recommended

# Two things needs to be done

# 3.1 set context (like privilege and ownership in normal Linux)
# The path may needs to be changed due to the deployment directory
chcon -R -t httpd_user_content_t /var/www/html/*

# 3.2 create SELinux policy
mkdir /tmp/web2py
cd /tmp/web2py
# create a file named wsgi.te, fill it with content between 

module wsgi 1.0;

require {
type urandom_device_t;
type httpd_t;
type tmp_t;
class file { write open };
class chr_file write;
class process execmem;
}

#= httpd_t ==
allow httpd_t tmp_t:file { write open };
allow httpd_t urandom_device_t:chr_file write;
allow httpd_t self:process execmem;


# generate modules for SELinux and install the module
checkmodule -M -m -o wsgi.mod wsgi.te
semodule_package -o wsgi.pp -m wsgi.mod
semodule -i wsgi.pp

###
### Phase 4 - Configure firewallD/iptables
###

# Fedora 18 and later uses firewallD by default
# Use systemctl to find whether you are running firewallD or iptables

### If you are using firewallD
# firewall-cmd [--zone=zone] --add-port=port[-port]/protocol
firewall-cmd --add-port 80/tcp
firewall-cmd --add-port 443/tcp

### If you are using iptables
# It is assumed that you replace firewallD with iptables and
# you are familar with iptables rules
# You need two new rules to access port 80 (http) and 443 (https)
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT

# The chain INPUT may need to be changed according to your configuraion
# If you edit file /etc/sysconfig/iptables, you need to restart iptables
systemctl restart iptables.service

###
### 

Re: [web2py] puppet for web2py

2013-08-28 Thread Vinicius Assef
Puppet is a provisioning system.

All provisioning can be done with shell script and I'm doing this in
Vagrant development environments.

On Wed, Aug 28, 2013 at 12:59 PM, Francisco Barretto
kikobarre...@gmail.com wrote:
 There is a .sh provided along with the web2py distribution for install
 purposes. The main thing is that when you do it through puppet
 (http://puppetlabs.com/) and your machine goes bad for any reason you just
 have to apply your puppet again. Or if you want to replicate your app into X
 new machines, just apply the puppet.

 imagine that you have to create a b machine so you can balance your
 incoming requests. It is quite hard to keep them synchronized manually.
 Puppet allows you to puppetize the configuration and apply at both
 machines. That's why I'm interested in using puppet.

 If anybody has ever tried to apply puppet for web2py management, please send
 me a smoke signal! :)

 Em quarta-feira, 28 de agosto de 2013 11h31min44s UTC-3, viniciusban
 escreveu:

 I don't know puppet, but this weekend I'll be doing it through shell
 script, to one customer.

 On Wed, Aug 28, 2013 at 11:28 AM, Francisco Barretto
 kikoba...@gmail.com wrote:
  Hi there!
 
  Did Anyone already made some puppet module to manage/install web2py and
  web2py's app management(install/update) through Puppet? I was thinking
  about
  hosting my app in a git repository and use a puppet module to keep
  web2py
  updated (by applying both web2py and app changes to client machines).
 
  Thanks
 
  --
 
  ---
  You received this message because you are subscribed to the Google
  Groups
  web2py-users group.
  To unsubscribe from this group and stop receiving emails from it, send
  an
  email to web2py+un...@googlegroups.com.
  For more options, visit https://groups.google.com/groups/opt_out.

 --

 ---
 You received this message because you are subscribed to the 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/groups/opt_out.

-- 

--- 
You received this message because you are subscribed to the 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/groups/opt_out.


[web2py] Re: web2py | Email + IMAP | Help Wanted

2013-08-28 Thread Alan Etkin
 

 How? I know that imaplib allows selection of mailbox folders using
 *mail.select(mailbox)*

 But how does one do that directly in the model while using DAL?


imap = DAL(...)
# declares a mailbox table linked to the imap server INBOX folder.
# only declared folders will be available.
imap.define_tables({inbox: INBOX})
 

 Does or does not every http request cost a lot more time and bandwidth in 
 and by itself?


http reqests cost time and bandwidth. The less the better. 

So, you strongly recommend using another DB? But would that not be 
 redundant as all the information will already be on the IMAP server, and 
 any deletion or copy-move on the server affect the integrity of the data 
 stored in the external DB?

If I'd need a fast way of retrieving imap info, I'd go with postgres or 
similar db and fetch mail periodically with a script. Nevermind the 
rendundancy and consistency as long as you use a single source and unique 
ids for handling the data.

But what might be causing that problem?

I have no idea. Maybe a gmail/imaplib issue?
 

Will it be faster to fetch a single Email's content with UID using DAL? Or 
rather which of the following is faster:
 — Query using imaplib = returns a list of UID + Fetch each email content 
using DAL
 — Query using DAL + Fetch email content using DAL


The fastest option is to use imaplib to query for uids and then get each 
message as needed. It would be possible to patch IMAPAdapter so DAL selects 
are faster when one only needs the id field.
 

Tried it briefly. Not tried it fully yet. If you do, can you add some of 
its features to the DAL adapter?


Currently I cannot, but I will when I can, specially if bulk messages work; 
but it would take to add the library to gluon and it might need approval 
from the devs.

-- 

--- 
You received this message because you are subscribed to the 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/groups/opt_out.


[web2py] Re: Can't retrieve xy.jpeg file properties (.thumbnail vs .jpeg) from PIL resized image (2.6.0-dev)

2013-08-28 Thread Adi
Thanks Ricardo and Niphlod for your help!


On Tuesday, August 27, 2013 5:59:44 PM UTC-4, Niphlod wrote:

 you kinda have to. contenttype is automatically guessed from the extension 
 only. There's no header instrospection.

 On Tuesday, August 27, 2013 9:07:56 PM UTC+2, Adi wrote:


 This is the example I used for resizing images: 
 http://stackoverflow.com/questions/273946/how-do-i-resize-an-image-using-pil-and-maintain-its-aspect-ratio,
  
 and the one with extension .thumbnail works fine, but jpeg doesn't. I 
 didn't set the content-type manually. 
  

 On Tuesday, August 27, 2013 2:39:03 PM UTC-4, Niphlod wrote:

 your thmbnail doesn't have an extension: do you set the content-type 
 manually ?



-- 

--- 
You received this message because you are subscribed to the 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/groups/opt_out.


[web2py] Re: Export not working on filtered table?

2013-08-28 Thread greenpoise
Massimo,

I opened a ticket for this. I think you couldnt reproduce the error. I now 
remember (I had not tried it since I opened the ticket) how to reproduce 
the error. The process is this:

1. Create a SQLForm.grid with a query
2. Do a Search using the SQLForm.grid search bar
3. Click on Export to CSV


You will notice that the export will come out empty. I will attach this to 
the ticket if its still open





On Thursday, July 11, 2013 10:56:49 PM UTC-7, Massimo Di Pierro wrote:

 Please open a ticket. Will review this asap.

 On Thursday, 11 July 2013 16:42:35 UTC-5, greenpoise wrote:

 I have *2.5.1 *and if I filter results and click on csv export, I also 
 get a blank csv file..




 On Monday, April 15, 2013 5:47:16 PM UTC-7, Tito Garrido wrote:

 Hi Folks,

 When I use the search field to filter the results and click on csv to 
 export the result I get a 0 byte file... is it happening there?

 2.4.6-stable+timestamp.2013.04.06.17.37.38
 (Running on Rocket 1.2.6) 

 -- 

 Linux User #387870
 .
  _/_õ|__|
 ..º[ .-.___.-._| . . . .
 .__( o)__( o).:___ 



-- 

--- 
You received this message because you are subscribed to the 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/groups/opt_out.


[web2py] Re: GoogleGroup - how do you keep track of useful code?

2013-08-28 Thread Dave S
Web2pyslices does have a variety of catagories: recipe, question, article, 
and package.  Only the last sounds like it needs to be a complete 
solution or full example, although the recipe and articles are probably 
more useful when they don't leave too much stuff out.

Also, in GG, there is a button in the left column for Starred.  (I'm 
surprised it isn't under filter actions, though.)   When I click on it, I 
get a list of my starred articles (but not just in the one group, so if you 
use stars heavily elsewhere, that could be a problem.)  In gmail, putting 
label:starred in the search box works, and can be combined with other 
lables, but that doesn't seem to work in GG, and using the advanced search 
box to set with tag - starred doesn't work, either.

(And I've been using ^D to bookmark threads, as others have mentioned.)

/dps yes, I;m new around here, too

On Tuesday, August 27, 2013 3:26:49 PM UTC-7, greenpoise wrote:

 I have been to web2pyslices and I find it useful. I thought it was for 
 full examples though. I am thinking more to place code snippets. I can go 
 on about writing them in a document but would probably lose track as well. 
 Hmm. 




 On Tuesday, August 27, 2013 3:09:56 PM UTC-7, Niphlod wrote:

 usually I invite peoples to post it to web2pyslices.com. Clearly google 
 group is useful for FAQs and so on but not for complete solutions.

 On Wednesday, August 28, 2013 12:03:54 AM UTC+2, greenpoise wrote:

 I cant seem to find a way to track useful code. I can only Star really 
 helpful posts but finding a specific starred item is a pain in the nuts 
 specially when I am switching tasks between web2py and other projects here 
 at work. How do you guys keep track of that snippet of code you find on 
 Web2py google group??? 



-- 

--- 
You received this message because you are subscribed to the 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/groups/opt_out.


[web2py] Logged in dropdown links

2013-08-28 Thread dirman
is it posible to add another link to the logged in dropdown in adding to 
the profile,password and logout links?

-- 

--- 
You received this message because you are subscribed to the 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/groups/opt_out.


Re: [web2py] Re: Help with SQLite, a way to groupby values not a field?

2013-08-28 Thread Michele Comitini
You can do in SQL by using UNION and subselect, something similar to this
(not tested):

select a1, count(a1) from (SELECT c1 FROM t1 UNION SELECT c2 FROM t1 UNION
SELECT c2 FROM t1) as a1 GROUP BY a1;



2013/8/28 davedigerati hypr...@gmail.com

 humbly bumping...

 On Sunday, August 25, 2013 1:32:35 PM UTC-4, davedigerati wrote:

 Is there a way to SELECT from my (SQLite) db with example structure/data
 that looks like this:

 sue | dog | cat | dog
 joe | cat | rat | dog
 joe | dog | dog | rat
 joe | cat | cat | cat
 tom | rat | dog | dog

 a counted, grouped-by set for JOE only that looks like:
 cat - 4
 dog - 3
 rat - 2

 I've been playing with selecting Joe's records, then looping over them
 building subtotals in a dict, but this seems a huge waste of effort and my
 data is actually much larger so I am worried about performance as I try to
 scale this.  From what I read the groupby is for by fields only, not by
 counted values?  Can anyone point me in the right direction? thanks!

  --

 ---
 You received this message because you are subscribed to the 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/groups/opt_out.


-- 

--- 
You received this message because you are subscribed to the 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/groups/opt_out.


[web2py] new web2py.js changes the sequence of execution

2013-08-28 Thread simon
I have some very simple jquery scripts for creating dialog boxes. This was 
all working fine until the replacement of web2py.js in release 5113. 
However now it no longer works.

The pre-5113 version had a web2py_ajax_page complete function that first 
filled my dialog box and then executed response.js in that order.

The new version does these two things asynchronously.  Response.js is 
executed within event_handler and generally this happens before the 
ajax_page complete function.

Is there some reason why this was changed or could it be changed back so 
things happen in the same sequence? This does break backward compatibility.


-- 

--- 
You received this message because you are subscribed to the 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/groups/opt_out.


[web2py] Current status of CouchDB and MongoDB support?

2013-08-28 Thread Jim Allman
Hi all,

I'm currently working in web2py v2.4.5, and it looks like our project would 
benefit from adding a second, NoSQL database. I've searched the archives of 
this forum and the history of DAL code in the web2py repo, but it's still 
not clear to me whether either CouchDB or MongoDB is really done. Is 
anyone using this in a production site? Are there major bugs or missing 
features?

I see that the DAL 
codehttp://code.google.com/p/web2py/source/browse/gluon/dal.py?spec=svn3264658eb49228c2bde096156fb4294bb9ed06cename=3264658eb492r=3264658eb49228c2bde096156fb4294bb9ed06ceis
 pretty compact, so I might be able to help if it needs attention. But 
I'm still learning about web2py and NoSQL databases so I'm not ready yet. 

Thanks for any guidance,

  =jimA=

-- 

--- 
You received this message because you are subscribed to the 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/groups/opt_out.


Re: [web2py] Simple BASE in routes.py gives me invalid request

2013-08-28 Thread Wei Wang
Just got a chance to try this: I copied the 
midash/views/default/user.html tomiops/views/default/user.html, 
reloaded the page at /midash/user/login?_next=/midash/default/index, my 
user login page shows up.

So I guess there is a bug somewhere in the routing code.

-- 

--- 
You received this message because you are subscribed to the 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/groups/opt_out.


[web2py] Re: Current status of CouchDB and MongoDB support?

2013-08-28 Thread Alan Etkin
 

 I'm currently working in web2py v2.4.5, and it looks like our project 
 would benefit from adding a second, NoSQL database. I've searched the 
 archives of this forum and the history of DAL code in the web2py repo, but 
 it's still not clear to me whether either CouchDB or MongoDB is really 
 done. Is anyone using this in a production site? Are there major bugs or 
 missing features?

 
I have made some enhancements to the original mongodb adapter (see the 
project issues list). I suppose it has any of the non-experimental sql 
adapter features. Currently, there's a minor issue with trunk about 
matching None values in queries and it could be a GAE issue too: (there's a 
thread about it at web2py-developers)

-- 

--- 
You received this message because you are subscribed to the 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/groups/opt_out.


Re: [web2py] Simple BASE in routes.py gives me invalid request

2013-08-28 Thread Jonathan Lundell
On 28 Aug 2013, at 2:28 PM, Wei Wang ww9riv...@gmail.com wrote:
 Just got a chance to try this: I copied the midash/views/default/user.html 
 tomiops/views/default/user.html, reloaded the page at 
 /midash/user/login?_next=/midash/default/index, my user login page shows up.
 
 So I guess there is a bug somewhere in the routing code.

Interesting. 

Three requests: would you please re-post your route dictionary, and summarize 
the behavior you're seeing (including the latest, and the specific error 
messages)? This thread has gotten a little strung out...

Second, what happens if you leave off the query string ('?' and all after it)? 
I'm guessing nothing, but I'd like to check.

There appears to be a minor problem (recent, I'm guessing) with the error 
reporting as well. You're seeing the bad function properly reported, but no 
details on what appears to be a bad view (or bad view routing).

Third, look at both your controllers/ directories and make sure there aren't 
any files there that you don't expect. This is because, by default, the router 
uses the files in controllers/ in its logic.

-- 

--- 
You received this message because you are subscribed to the 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/groups/opt_out.


[web2py] Any way of removing the text from Grid buttons?

2013-08-28 Thread greenpoise
is there a way to remove the text from grid buttons? I mean the stock ones 
(View, Edit, Delete)

-- 

--- 
You received this message because you are subscribed to the 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/groups/opt_out.


[web2py] Re: new web2py.js changes the sequence of execution

2013-08-28 Thread Niphlod


On Wednesday, August 28, 2013 10:20:53 PM UTC+2, simon wrote:

 I have some very simple jquery scripts for creating dialog boxes. This was 
 all working fine until the replacement of web2py.js in release 5113. 
 However now it no longer works.


What commit identifies release 5113 ?
 


 The pre-5113 version had a web2py_ajax_page complete function that first 
 filled my dialog box and then executed response.js in that order.

 The new version does these two things asynchronously.  Response.js is 
 executed within event_handler and generally this happens before the 
 ajax_page complete function.

 
I'm a little bit baffled. trunk (and up until lots of time ago) 
executes the response.js command hooking up on the global ajaxSuccess 
event. 
Can you switch your web2py.js with the one in trunk and try ? if it has the 
same problem, would you move line 268 to after line 274 and see if it fixes 
the problem?
 

 Is there some reason why this was changed or could it be changed back so 
 things happen in the same sequence? This does break backward compatibility.


No, it doesn't. If you had a fully working app before, you have it also 
right now. If you want to leverage new features with - I assume - the 
newest web2py.js, then theoretically you should adapt accordingly your code.
 

-- 

--- 
You received this message because you are subscribed to the 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/groups/opt_out.


[web2py] Starting web2py fails silently with Cygwin python

2013-08-28 Thread Razvan Teslaru
Trying to run web2py under cygwin. Python 2.7.5 installed, plus all 
necessary dependencies. 

Downloaded and unzipped web2py_src.zip; when running ./web2py, it hangs for 
a few seconds and then exits, without any message. Initially I thought it 
might attempt (and fail) to spawn the GUI to get a password, but starting 
it with -a 'passwd' yields the same behavior. 

Tried uninstalling the cygwin python and using the regular Windows python 
under Cygwin -- now it works as expected, so it appears to be a Cygwin 
Python + web2py specific issue, but I'm not sure how to proceed from here, 
without any sort of error message.

-- 

--- 
You received this message because you are subscribed to the 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/groups/opt_out.


[web2py] Re: new web2py.js changes the sequence of execution

2013-08-28 Thread Anthony
Looks like this 
changehttps://code.google.com/p/web2py/source/browse/applications/admin/static/js/web2py.js?r=b995ca36cd33a28339d54f15bcf8eebb6d58f2e6was
 actually made in January in response to this 
issue https://code.google.com/p/web2py/issues/detail?id=1254. 
Technically, I suppose it does break backward compatibility because 
previously web2py-component-command (i.e., the content of response.js) was 
executed synchronously after the component content loaded, and now it is 
run asynchronously. Actually, this was probably not a good move, because 
you might need the JS to run after the component content has loaded, so we 
might want to revert this change. The web2py-component-command and 
web2py-component-flash headers were intended for use specifically with 
components. If we want to enable such functionality more generally, perhaps 
we should use alternative headers for that purpose. Please open an issue 
about this and link back to this thread.

Anthony

On Wednesday, August 28, 2013 1:20:53 PM UTC-7, simon wrote:

 I have some very simple jquery scripts for creating dialog boxes. This was 
 all working fine until the replacement of web2py.js in release 5113. 
 However now it no longer works.

 The pre-5113 version had a web2py_ajax_page complete function that first 
 filled my dialog box and then executed response.js in that order.

 The new version does these two things asynchronously.  Response.js is 
 executed within event_handler and generally this happens before the 
 ajax_page complete function.

 Is there some reason why this was changed or could it be changed back so 
 things happen in the same sequence? This does break backward compatibility.




-- 

--- 
You received this message because you are subscribed to the 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/groups/opt_out.


[web2py] Re: Why is the plugins list empty in the wizard?

2013-08-28 Thread Alan Etkin


 The problem is that the plugin app has been deprecated and plugins are 
 being moved to github and web2pyslices. It was a nice automatism we did not 
 have enough manpower to keep the plugins updated. It was not very useful.


It is possible to feed the admin app with a query to a web2pyslices 
packages api (i.e. with json) for searching plugins.

-- 

--- 
You received this message because you are subscribed to the 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/groups/opt_out.


[web2py] Re: Modifying auth.signature

2013-08-28 Thread Scott Hunter
I can, and have.  It just seems brittle; presumably there is code is Auth 
that relies on this structure, and should it change, my clone might no 
longer be consistent with it.  

Hence, my desire for a way to modify the existing Fields instead of making 
my own Fields which happen to match their current implementation.  But 
given your answer, it sounds like that isn't possible.  Oh, well.

- Scott

On Tuesday, August 27, 2013 7:36:44 AM UTC-4, Massimo Di Pierro wrote:

 A signature is just a db.Table. You can make your own.

 mysignature = db.Table(Field(...),Field(...), )

 On Monday, 26 August 2013 20:06:41 UTC-5, Scott Hunter wrote:

 Is there a way to use a modified version of auth.signature (in my 
 particular case, adding a custom_qualifier to each field) that doesn't 
 involve making a Table out of a clone of the set of fields with the desired 
 modification, but would still be useable as the original is?

 Thanks in advance,
 Scott



-- 

--- 
You received this message because you are subscribed to the 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/groups/opt_out.


[web2py] DAL , pymysql

2013-08-28 Thread Orrù

Hi,
I have two applications running: the application A is an instance of 
web2py and application B is based on the DAL standalone, aplications A 
and B, both  with  to migrate=False , to connecting to the same DB 
(mysql server).
*Sometimes the two fail* and return the following error:

Application A (web2py):
type 'exceptions.RuntimeError' Failure to connect, tried 5 times: 
Traceback (most recent call last): File 
/home/nabladel/web2py/web2py/gluon/dal.py, line 7276, in __init__ 
self._adapter = ADAPTERS[self._dbname](**kwargs) File 
/home/nabladel/web2py/web2py/gluon/dal.py, line 2483, in __init__ if 
do_connect: self.reconnect() File 
/home/nabladel/web2py/web2py/gluon/dal.py, line 596, in reconnect 
self.connection = f() File /home/nabladel/web2py/web2py/gluon/dal.py, 
line 2481, in connector return self.driver.connect(**driver_args) File 
/home/nabladel/web2py/web2py/gluon/contrib/pymysql/__init__.py, line 93, 
in Connect return Connection(*args, **kwargs) File 
/home/nabladel/web2py/web2py/gluon/contrib/pymysql/connections.py, line 
575, in __init__ self._connect() File 
/home/nabladel/web2py/web2py/gluon/contrib/pymysql/connections.py, line 
740, in _connect self._get_server_information() File 
/home/nabladel/web2py/web2py/gluon/contrib/pymysql/connections.py, line 
907, in _get_server_information self.server_charset = 
charset_by_id(self.server_language).name File 
/home/nabladel/web2py/web2py/gluon/contrib/pymysql/charset.py, line 173, 
in charset_by_id return _charsets.by_id(id) File 
/home/nabladel/web2py/web2py/gluon/contrib/pymysql/charset.py, line 21, 
in by_id return self._by_id[id] KeyError: 110 

Application B (DAL standalone):
DEBUG: connect attempt 0, connection error:
Traceback (most recent call last):
  File /home/nabladel/aplication/gluon/dal.py, line 7351, in __init__
self._adapter = ADAPTERS[self._dbname](**kwargs)
  File /home/nabladel/aplication/gluon/dal.py, line 2499, in __init__
if do_connect: self.reconnect()
  File /home/nabladel/aplication/gluon/dal.py, line 592, in reconnect
self.connection = f()
  File 
/home/nabladel/aplication/MinimalModbus-0.4/icontrol4/gluon/dal.py, line 
2497, in connector
return self.driver.connect(**driver_args)
  File /home/nabladel/aplication/gluon/contrib/pymysql/__init__.py, line 
93, in Connect
return Connection(*args, **kwargs)
  File /home/nabladel/aplication/gluon/contrib/pymysql/connections.py, 
line 575, in __init__
self._connect()
  File /home/nabladel/aplication/gluon/contrib/pymysql/connections.py, 
line 740, in _connect
self._get_server_information()
  File /home/nabladel/aplication/gluon/contrib/pymysql/connections.py, 
line 907, in _get_server_information
self.server_charset = charset_by_id(self.server_language).name
  File /home/nabladel/aplication/gluon/contrib/pymysql/charset.py, line 
173, in charset_by_id
return _charsets.by_id(id)
  File /home/nabladel/aplication/gluon/contrib/pymysql/charset.py, line 
21, in by_id
return self._by_id[id]
KeyError: 110

application B I start through the python IDLE, web2py out error only 
when I close IDLE.
web2py: Version 2.4.2 stable
can someone help me?


-- 

--- 
You received this message because you are subscribed to the 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/groups/opt_out.