[web2py] Re: Not seeing logging.error messages in nginx error_log

2016-05-04 Thread Chris Guest
Hi DaveS,

So to clarify when I used mod_wsgi & apache I used to get logging.error 
messages saved into my apache error.log .
Now that I use uwsgi & nginx this doesn't happen.
I am not sure what your answer means as I am not familiar with what a 
logging.conf file is. I cannot find a logging.conf file in either 
/etc/uwsgi /etc/nginx or under my web2py instance.
I am not particularly trying to consolidate logs - I am not seeing these 
messages in any log. 

Thanks,
Chris

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


[web2py] Not seeing logging.error messages in nginx error_log

2016-05-04 Thread Chris Guest
Not seeing logging.error in nginx error_log


I have a mostly successful install of web2py application with uwsgi and 
nginx on centos using setup-web2py-nginx-uwsgi-centos70.sh .

But I can't figure out how to configure nginx, uwsgi and wsgihandler.py so 
that logging.error messages appear in the error_log file. 
I have been able to configure it so that nginx [notice] and [info] messages 
appear but these are generated by nginx itself and are not coming from 
logging.notice or logging.info calls in the web2py application. 
 
Can someone post a recipe as to how this is done?

Thanks,
Chris

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


[web2py] IP tables commands in setup-web2py-nginx-uwsgi-centos64.sh

2015-12-28 Thread Chris Guest
I've been looking at the script, setup-web2py-nginx-uwsgi-centos64.sh .
Towards the end of it, are these two commands:
/etc/init.d/iptables stop
chkconfig --del iptables

Why is it necessary to stop iptables and then remove all run level symlinks 
under /etc/rc[0-6].d ?




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

2015-12-02 Thread Chris Guest
I recently needed to modify the stock Bootstrap CSS so that the Navbar had 
a light colour,  #fafafb .

I added the following to  static/css/web2py-bootstrap3.css . I just thought 
that I would share it here in case is useful for others.


.navbar-default{
background-color:#fafafb;
border-color:#fafafb;
}

.navbar-inner {
background-color:#fafafb; 
border-color:#fafafb;
background-repeat: no-repeat;
filter: none;
}

.navbar .nav > li > a {
color: #3e3f3a;
}
.navbar .nav > li > a:active, .navbar .nav > li > a:hover {
color: #808285; 
}

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

2015-12-02 Thread Chris Guest
I didn't remove any classes from  static/css/bootstrap.min.css 
or static/css/bootstrap-theme.min.css .
I only added code to static/css/web2py-bootstrap3.css .
If there's a simpler way to do this, please let me know.


On Thursday, December 3, 2015 at 11:33:11 AM UTC+11, Leonel Câmara wrote:
>
> Did you remove the navbar-inverse class? That's what makes it black.
>

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

2015-07-12 Thread Chris Guest
Hi Mirek,

On Thursday, July 2, 2015 at 9:52:44 PM UTC+10, Mirek Zvolský wrote:

 I have not such error in your jsfiddle.
 What about to give console.log(column) after if (column) {


I have changed my web2py page to this:

 if (column) {

 console.log(

 i + ': ' + column.style + ': ' + 
 column.visible()

 );

 if (column.style===undefined)

 column.style = '';

 column.visible( ! column.visible() );

 console.log(

 i + ': ' + column.style + ': ' + 
 column.visible()

 );

 }


I am now seeing this in the console: 

 a.toggle-vis click event
 0: undefined: true
 0: : false
 1: undefined: true
 1: : false


Chris 


 Dne čtvrtek 2. července 2015 3:46:23 UTC+2 Chris Guest napsal(a):

 I have a very wide html table. I want to selectively hide groups of 
 columns at a time using a list of a.
 Someone suggested using Datatables.net. So I have developed a proof of 
 concept and all looks well.

 http://jsfiddle.net/ChrisGuest/orgj7oL9/

 Now when I drop this code into a web2py as below, I end up with wrong 
 behaviour and seeing this error in the JS Console:

 a.toggle-vis click event
 0: : false
 1: : false
 a.toggle-vis click event
 0: : false
 1: : false
 a.toggle-vis click event
 0: : false
 1: : false
 a.toggle-vis click event
 *Uncaught TypeError: Cannot read property 'style' of undefined*


 I suspected that this could be caused by a conflict between DataTables.js 
 and another JavaScript module so I went through  commented them all out 
 except for jquery.js .
 Unfortunately the problems still persists. 
 I have documented how I use DataTables.js with web2py. I am wondering if 
 I've missed something important here. I'd be curious if anyone else could 
 get this to go.

 Thanks,
 Chris


 I have modified layout.html to include:

 link rel=stylesheet href=
 https://cdn.datatables.net/1.10.7/css/jquery.dataTables.css; /
 script src='
 https://cdn.datatables.net/1.10.7/js/jquery.dataTables.min.js' 
  /script


 view/batch/demo.html ( see http://jsfiddle.net/ChrisGuest/orgj7oL9/ for 
 complete table code).

 {{extend 'layout.html'}}
 
 h1Results/h1
 
 ul.../ul
 table id=batch_table
 ...
 /table
 
 script
 
 $(document).ready(function() {
 var table = $('#batch_table').DataTable( {
 scrollY: 200px,
 paging: false
 } );
 
 $('a.toggle-vis').on('click', function (e) {
 e.preventDefault();
 
 console.log('a.toggle-vis click event');
 // Get the column API object
 var data_columns =  $(this).attr('data-column');
 if (data_columns.length) {
 var data_columns = data_columns.split(',');
 for (var i=0; idata_columns.length; i++) { 
 var column = table.column(data_columns[i]);   
  
 if (column) {
 if (column.style===undefined)
 column.style = '';
 column.visible( ! column.visible() );
 console.log(
 i + ': ' + column.style + ': ' + 
 column.visible()
 );
 }
 }
 }
  
 });
 
 });
 
 /script



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

2015-07-01 Thread Chris Guest
I have a very wide html table. I want to selectively hide groups of columns 
at a time using a list of a.
Someone suggested using Datatables.net. So I have developed a proof of 
concept and all looks well.

http://jsfiddle.net/ChrisGuest/orgj7oL9/

Now when I drop this code into a web2py as below, I end up with wrong 
behaviour and seeing this error in the JS Console:

a.toggle-vis click event
0: : false
1: : false
a.toggle-vis click event
0: : false
1: : false
a.toggle-vis click event
0: : false
1: : false
a.toggle-vis click event
*Uncaught TypeError: Cannot read property 'style' of undefined*


I suspected that this could be caused by a conflict between DataTables.js 
and another JavaScript module so I went through  commented them all out 
except for jquery.js .
Unfortunately the problems still persists. 
I have documented how I use DataTables.js with web2py. I am wondering if 
I've missed something important here. I'd be curious if anyone else could 
get this to go.

Thanks,
Chris


I have modified layout.html to include:

link rel=stylesheet 
href=https://cdn.datatables.net/1.10.7/css/jquery.dataTables.css; /
script src='https://cdn.datatables.net/1.10.7/js/jquery.dataTables.min.js' 
 /script


view/batch/demo.html ( see http://jsfiddle.net/ChrisGuest/orgj7oL9/ for 
complete table code).

{{extend 'layout.html'}}

h1Results/h1

ul.../ul
table id=batch_table
...
/table

script

$(document).ready(function() {
var table = $('#batch_table').DataTable( {
scrollY: 200px,
paging: false
} );

$('a.toggle-vis').on('click', function (e) {
e.preventDefault();

console.log('a.toggle-vis click event');
// Get the column API object
var data_columns =  $(this).attr('data-column');
if (data_columns.length) {
var data_columns = data_columns.split(',');
for (var i=0; idata_columns.length; i++) { 
var column = table.column(data_columns[i]);
if (column) {
if (column.style===undefined)
column.style = '';
column.visible( ! column.visible() );
console.log(
i + ': ' + column.style + ': ' + 
column.visible()
);
}
}
}
 
});

});

/script

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

2015-04-22 Thread Chris Guest
Here is a block of code that I added to the views/default/user.html 
template of my application in order to debug a permission issue.

I am posting it here the hope that it is useful to others.


{{  
if request.args(0)=='not_authorized':
groups = db(db.auth_membership.user_id == 
auth.user.id).select(db.auth_membership.group_id)
group_ids = [group.group_id for group in groups]
group_details = 
db(db.auth_group.id.belongs(group_ids)).select(db.auth_group.id, 
db.auth_group.role)

rows = db.executesql('SELECT group_id, name, table_name, record_id FROM 
auth_permission ORDER BY group_id', as_dict=True)

}}
h3User groups:/h3
ul
{{for group in group_details:}}
li{{=group['id']}}: {{=group['role']}}/li
ul
{{for row in rows:
if row['group_id']!= group['id']: continue}}
li{{=row['name']}} {{=row['table_name']}}/li
{{pass}}
/ul
{{pass}}
/ul
{{  
pass
}}

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