Re: [web2py] Re: web2py broken

2018-08-12 Thread BlueShadow
well in windows (home pc) I got full access for myself, system, admin and 
authenticated users.
on my linux server I got  the following: -rw-r--r--  1 www-data www-data
but never the less it doesn't work on either system.
Any other idea?

On Sunday, August 12, 2018 at 12:44:10 PM UTC+2, Junior Phanter wrote:
>
> check the database permissions...
>
> Em 12/08/2018 06:14, "BlueShadow" > 
> escreveu:
>
> Do you guys have any tips what I can try next in order to fix it?
> Do you need to see other files?
> thanks for your help kind regards
> BlueShadow
>
> -- 
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> --- 
> You received this message because you are subscribed to the Google Groups 
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to web2py+un...@googlegroups.com .
> For more options, visit https://groups.google.com/d/optout.
>
>
>

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

2018-08-12 Thread BlueShadow
Do you guys have any tips what I can try next in order to fix it?
Do you need to see other files?
thanks for your help kind regards
BlueShadow

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

2018-08-11 Thread BlueShadow
So I tried to connect on python. and it seems to work.
I wrote this tiny program:
import sqlite3
conn = sqlite3.connect('storage.sqlite')
print(conn)
c = conn.cursor()
c.close()
this is the output:

So I guess it has nothing to do with a corrupted database.

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

2018-08-10 Thread BlueShadow
here is my menu.py:
# -*- coding: utf-8 -*-
# this file is released under public domain and you can use without 
limitations

#
## Customize your APP title, subtitle and menus here
#

response.title = ' '.join(word.capitalize() for word in request.application.
split('_'))
response.subtitle = T('customize me!')

## read more at http://dev.w3.org/html5/markup/meta.name.html
response.meta.author = 'xxx'
response.meta.description = 'xxx'
response.meta.keywords = 'xxx'
response.meta.generator = 'Web2py Web Framework'
#response.meta.copyright = 'Copyright 
2012-'+str(datetime.datetime.now().year)


## your http://google.com/analytics id
response.google_analytics_id = "xxx"

#
## this is the main application menu add/remove items as required
#

response.menu = [
('', 
False,A('START',_href=URL('default','index'),_title="Zurück 
zur Startseite"), []),
('', False,A('ARTIKEL', _href=URL('default','Articles'),
_title="Liste aller Artikel"), []),
('', False,A('FILME', 
_href=URL('default','Movies'),_title="Liste 
aller Filme"), []),
('', False,A('KRITIKEN', _href=URL('default','Reviews'),
_title="Liste aller Kritiken"), [])
]

#
## provide shortcuts for development. remove in production
#

def _():
# shortcuts
app = request.application
ctr = request.controller
# useful links to internal and external resources

response.menu+=[
(SPAN('INFOS',_style='color:white'),False, None, [
('',False,A('Impressum', _href=URL(r=request,c='default'
,f='Impressum'), _title="Informationen zu Movie-Alarm, Haftungsausschluss"
)),
('',False,A('Partnerschaft', _href=URL(r=request,c=
'default',f='Partner'), _title="Unsere Partnerseiten /Partner werden")),
('',False,A('Unterstütze MovieAlarm', _href=URL(r=
request,c='default',f='SupportMovieAlarm'), _title="Informationen wie du 
dafür sorgen kannst das wir weiterhin gute inhalte für dich erstellen."))
]
 )
 ] 
#--Require 
Authorization-
if auth.has_membership('Author'):
   response.menu+=[
(SPAN('AUTOREN',_style='color:yellow'),False, None, [
(T('Unfinished'),False,URL(r=request,c='author',f=
'unfinished')),
(T('Neuen Artikel Anlegen'),False,URL(r=request,c=
'author',f='newArticle')),
(T('Neues Review Schreiben'),False,URL(r=request,c=
'author',f='newReview')),
(T('Neuen Film Anlegen'),False,URL(r=request,c='author',
f='newMovie')),
(T('Neues Bild'),False,URL(r=request,c='author',f=
'newImage')),
(T('Hilfe für Autoren'),False,URL(r=request,c='manage',f
='Manuals')),
(T('Anleitung Schreiben'),False,URL(r=request,c='manage'
,f='WriteManual')),
(T('§ Infos zu Medien §'),False,URL(r=request,c='author'
,f='RInfos'))
]
 )
 ] 
_()


@anthony: I will look up how to connect to sqlite in python dbs and try it
@stifan: I am not sure what the problem is. I will keep your solution in 
mind and try it tomorrow.

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


[web2py] Re: web2py broken

2018-08-09 Thread BlueShadow
No one? Did I give insufficient information? I really need some help with 
this Problem thanks guys.

On Thursday, August 9, 2018 at 1:27:42 PM UTC+2, BlueShadow wrote:
>
>
> I just downloaded my entire app. (with FTP since I can't access the 
> webinterface) Now when I try to run it locally on a web2py compiled server 
> (newest one directly from the site). I get the following error: 
>
> 127.0.0.1.2018-08-09.13-16-30.9c125719-b261-4285-8a88-3012470558cc
>  file is encrypted or is not a database
>
> What do I need to do to get my database back?
> It should be an sqlite database if I remember correctly.
>

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


[web2py] Re: web2py broken

2018-08-09 Thread BlueShadow

I just downloaded my entire app. (with FTP since I can't access the 
webinterface) Now when I try to run it locally on a web2py compiled server 
(newest one directly from the site). I get the following error: 

127.0.0.1.2018-08-09.13-16-30.9c125719-b261-4285-8a88-3012470558cc
 file is encrypted or is not a database

What do I need to do to get my database back?
It should be an sqlite database if I remember correctly.

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


[web2py] web2py broken

2018-08-09 Thread BlueShadow
Hi I got a pretty big problem. My web2py seems to be completly broken. even 
my last backup won't work. when I go to my site I get: 
Internal errorTicket issued: unknown
and I can't access the appadmin.

I tried to use the console to backup the database:
python web2py.py -S appname -M
web2py Web Framework
Created by Massimo Di Pierro, Copyright 2007-2018
Version 2.14.6-stable+timestamp.2016.05.10.00.21.47
Database drivers available: sqlite3, imaplib, pyodbc, pymysql, pg8000
Traceback (most recent call last):
  File "/home/www-data/web2py/gluon/restricted.py", line 227, in restricted
exec ccode in environment
  File "applications/appname/models/menu.py", line 79, in 
_()
  File "applications/appname/models/menu.py", line 52, in _
if auth.has_membership('Author'):
  File "/home/www-data/web2py/gluon/tools.py", line 4360, in has_membership
group_id = self.id_group(group_id)  # interpret group_id as a role
  File "/home/www-data/web2py/gluon/tools.py", line 4331, in id_group
rows = self.db(self.table_group().role == role).select()
  File "/home/www-data/web2py/gluon/packages/dal/pydal/objects.py", line 
2020, i  n select
return adapter.select(self.query, fields, attributes)
  File "/home/www-data/web2py/gluon/packages/dal/pydal/adapters/sqlite.py", 
line   123, in select
return super(SQLiteAdapter, self).select(query, fields, attributes)
  File "/home/www-data/web2py/gluon/packages/dal/pydal/adapters/base.py", 
line 1  296, in select
return self._select_aux(sql,fields,attributes)
  File "/home/www-data/web2py/gluon/packages/dal/pydal/adapters/base.py", 
line 1  253, in _select_aux
self.execute(sql)
  File "/home/www-data/web2py/gluon/packages/dal/pydal/adapters/base.py", 
line 1  388, in execute
return self.log_execute(*a, **b)
  File "/home/www-data/web2py/gluon/packages/dal/pydal/adapters/base.py", 
line 1  382, in log_execute
ret = self.get_cursor().execute(command, *a[1:], **b)
OperationalError: unable to open database file


how would you guys try to fix it? I know I neglected my site for quite a 
while but I have no idea why it stopped working. (when I noticed it the 
oldest backup was overwritten with a non working version.
I am expecting some damage from it but I want the least amount of damage 
(obviously)
Thanks for your help.

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


[web2py] European General data protection act and web2py

2018-05-18 Thread BlueShadow
Hi,
I am using a fairly old version of web2py since the page is running since 
2012 I haven't done many updates. (since I ran into a world of trouble last 
time I tried to upgrade it I stayed at version 2.14.6)

Can you tell me if the web2py is using cookies?
Has anyone a cookie warning implemented or any other thing.
what would be the least anoying way to implement it?

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


[web2py] ValueError: invalid literal for long() with base 10:

2017-07-05 Thread BlueShadow
Hi,
I get incresing numbers of errors because there are external sites linking 
to an address like:
www.mydomain.com/Controlerfunction?id=123Brandon
So the link is correct up to the id value but for some reason they add some 
string to the end of the link.
Is there a way to catch these errors and move them to the right site (no 
string at the end)
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] Re: routes.py problems

2016-05-23 Thread BlueShadow

It seems to work now my routes.py had no default application. I still need 
to figure out how to route the other sites but new day new luck. thanks Jim

-- 
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: routes.py problems

2016-05-23 Thread BlueShadow
#!/usr/bin/python
# -*- coding: utf-8 -*-


routers = dict(
  BASE  = dict(
  domains = {
  'domain.com' : 'App',
  'www.domain.com' : 'App',
  '111.111.111.111/test' : 'test',

  }
  ),
  App = dict(
  root_static=['BingSiteAuth.xml','googlea0df30fe6baf4df4.html',
'f8d6b8.html','favicon.ico','Favicon.ico', 'robots.txt','humans.txt']
  )
)


routes_onerror = [
('App/*', '/App/default/error_site')
]

logging = 'warning'




On Monday, May 23, 2016 at 6:20:41 PM UTC+2, BlueShadow wrote:
>
> I reinstalled pretty much everything on my Server new OS newest web2py ... 
> and got my application back and running :-) but web2py uses still the 
> default routes.py.
> when I copied my old routes.py to the web2py root I got an internal server 
> error. I thought well lets use the example file copied it to root and 
> renamed it to routes.py same thing. when I remove the routes.py it woks 
> (welcome app at domain and app at domain/app)
>
> any suggestions or help is very welcome :) 
>

-- 
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] routes.py problems

2016-05-23 Thread BlueShadow
I reinstalled pretty much everything on my Server new OS newest web2py ... 
and got my application back and running :-) but web2py uses still the 
default routes.py.
when I copied my old routes.py to the web2py root I got an internal server 
error. I thought well lets use the example file copied it to root and 
renamed it to routes.py same thing. when I remove the routes.py it woks 
(welcome app at domain and app at domain/app)

any suggestions or help is very welcome :) 

-- 
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: No module named appname.modules.funtions

2016-05-23 Thread BlueShadow
there were a couple files assigned to root^^ chown to www-data and it 
worked^^

On Sunday, May 22, 2016 at 2:28:38 PM UTC+2, BlueShadow wrote:
>
> Hi,
> Something is very wrong with my web2py. I finally got the newest verion 
> (2.14.6  nginx/1.4.6, Python 2.7.6 Ubuntu 16.04) on my production server. 
> and the welcome app is running fine. when I want to use my application it 
> creates a ticket for basically every inport:
> Movie_Alarm.modules.plugin_multiselect_widget
> I uncommented the multiselect plugin and I got the next:
> No module named appname.modules.func
> ...
> and so on the files are in web2py/applications/appname/modules or plugins 
> respectively. I can open them with the webinterface. So I got no clue whats 
> going on.
> thanks for your help and suggestions
>

-- 
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] No module named appname.modules.funtions

2016-05-22 Thread BlueShadow
Hi,
Something is very wrong with my web2py. I finally got the newest verion 
(2.14.6  nginx/1.4.6, Python 2.7.6 Ubuntu 16.04) on my production server. 
and the welcome app is running fine. when I want to use my application it 
creates a ticket for basically every inport:
Movie_Alarm.modules.plugin_multiselect_widget
I uncommented the multiselect plugin and I got the next:
No module named appname.modules.func
...
and so on the files are in web2py/applications/appname/modules or plugins 
respectively. I can open them with the webinterface. So I got no clue whats 
going on.
thanks for your help and suggestions

-- 
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] finding the error for unknown ticket

2016-05-16 Thread BlueShadow
Hi,
my production site displays for every site an unknown ticket. is there a 
way to find out why this happens. is there a log or something where there 
are more informations?
I am running ubuntu nginx uswgi and the newest web2py on a freshly 
installed ubuntu server 14.04.
thanks for your help.

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


[web2py] Re: unknown ticket on server for all sites

2016-05-15 Thread BlueShadow
I am running windows 7 on my home pc and ubuntu 14.04 on my server. On my 
server I get unknown ticket as an error. on my home pc I updated web2py and 
I get the database locked error.
I don't know what bitlocker is so I guess I don't have it. I uploaded 
everything with filezilla.
Sry that I don't have more informations but I just have no clue how to get 
more if I get an unknown ticket.

On Sunday, May 15, 2016 at 6:03:34 AM UTC+2, Alfonso Serra wrote:
>
> Still, what operating system are you running? Does it have bitlocker or 
> similar enabled? I dont know how bitlocker works but you could be uploading 
> an encrypted file to your server. Easy to check If you try any other text 
> file and it works.
>
>

-- 
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: unknown ticket on server for all sites

2016-05-14 Thread BlueShadow
I tried accessing my database from my backup on my local pc. it opens just 
fine with the firefox extension no password or anything.
I checked a couple tables and they look fine.

On Saturday, May 14, 2016 at 8:28:14 PM UTC+2, Alfonso Serra wrote:
>
> Hmm looks bad, ransomware on 
> your server? Do you have a copy of your database?, It would also happen if 
> you are editing on windows and have the bitlocker service enabled. You will 
> be uploading an encrypted database.
> Try to open your database directly, Firefox has a plugin for it.
>

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


[web2py] unknown ticket on server for all sites

2016-05-14 Thread BlueShadow
Hi all my sites show an unknown ticket on my production site.
So I got my backup and it worked for 2-3days.
than it started again
... repeat about 3 times.
So I reinstalled my entire server new ubuntu 14.04
ngninx uswgi web2py
my coppied app (I use sqlite as db so it should work)
and now I get the welcome app.
the appadmin but my app still shows an unknown ticket for all sites.
when I copied my app to a localhost web2py I get the following ticket
 file is encrypted or is not a database
Version
  
web2py™ Version 2.10.3-stable+timestamp.2015.04.02.21.42.07
Python Python 2.6.4: C:\Python26\pythonw.exe (prefix: C:\Python26)

Traceback

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.

Traceback (most recent call last):
  File "F:\Dateien\Programmieren\testweb2py\web2py\gluon\restricted.py", line 
227, in restricted
exec ccode in environment
  File 
"F:/Dateien/Programmieren/testweb2py/web2py/applications/MA/models/menu.py" 
, line 79, 
in 
_()
  File 
"F:/Dateien/Programmieren/testweb2py/web2py/applications/MA/models/menu.py" 
, line 52, 
in _
if auth.has_membership('Author'):
  File "F:\Dateien\Programmieren\testweb2py\web2py\gluon\tools.py", line 3542, 
in has_membership
group_id = self.id_group(group_id)  # interpret group_id as a role
  File "F:\Dateien\Programmieren\testweb2py\web2py\gluon\tools.py", line 3512, 
in id_group
rows = self.db(self.table_group().role == role).select()
  File 
"F:\Dateien\Programmieren\testweb2py\web2py\gluon\packages\dal\pydal\objects.py",
 line 2093, in select
return adapter.select(self.query,fields,attributes)
  File 
"F:\Dateien\Programmieren\testweb2py\web2py\gluon\packages\dal\pydal\adapters\sqlite.py",
 line 125, in select
return super(SQLiteAdapter, self).select(query, fields, attributes)
  File 
"F:\Dateien\Programmieren\testweb2py\web2py\gluon\packages\dal\pydal\adapters\base.py",
 line 1239, in select
return self._select_aux(sql,fields,attributes)
  File 
"F:\Dateien\Programmieren\testweb2py\web2py\gluon\packages\dal\pydal\adapters\base.py",
 line 1204, in _select_aux
self.execute(sql)
  File 
"F:\Dateien\Programmieren\testweb2py\web2py\gluon\packages\dal\pydal\adapters\base.py",
 line 1326, in execute
return self.log_execute(*a, **b)
  File 
"F:\Dateien\Programmieren\testweb2py\web2py\gluon\packages\dal\pydal\adapters\base.py",
 line 1320, in log_execute
ret = self.cursor.execute(command, *a[1:], **b)
DatabaseError: file is encrypted or is not a database





Error snapshot
  
[image: help]

  




  
  
(file is encrypted or is not a database



I know it is an old version of web2py I got on my local system but the only 
thing I have right now.

-- 
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] subdomain for testing

2015-07-29 Thread BlueShadow
I looked at the deployment script in detail. But I can't figure out how you 
could do it.
I tried adding server blocks in the sites enabled folder in nginx like this:

server {
listen  80;
server_name www.myexamplew2papp.com 
http://www.google.com/url?q=http%3A%2F%2Fwww.myexamplew2papp.comsa=Dsntz=1usg=AFQjCNGJfTu-OEbGD9pJTlkO7cQdwBNtNA
;
###to enable correct use of response.static_version
location ~* ^/(\w+)/static(?:/_[\d]+\.[\d]+\.[\d]+)?/(.*)$ {
alias /home/www-data/web2py/applications/$1/static/$2;
expires max;
### if you want to use pre-gzipped static files (recommended)
### check scripts/zip_static_files.py and remove the comments
# include /etc/nginx/conf.d/web2py/gzip_static.conf;
}
###


###if you use something like myapp = dict(languages=[en, it, jp], 
default_language=en) in your routes.py
#location ~* ^/(\w+)/(en|it|jp)/static/(.*)$ {
#alias /home/www-data/web2py/applications/$1/;
#try_files static/$2/$3 static/$3 =404;
#}
###


location / {
#uwsgi_pass  127.0.0.1:9001;
uwsgi_pass  unix:///tmp/web2py.socket;
include uwsgi_params;
uwsgi_param UWSGI_SCHEME $scheme;
uwsgi_param SERVER_SOFTWAREnginx/$nginx_version;


###remove the comments to turn on if you want gzip compression 
of your pages
# include /etc/nginx/conf.d/web2py/gzip.conf;
### end gzip section


### remove the comments if you use uploads (max 10 MB)
#client_max_body_size 10m;
###
}
}




server {
listen  80;
server_namewww.myexamplew2papp.com/wpblog;
index index.htm;
root /home/www-data/subdomain/html;
index index.php index.html index.htm;
location / {
# try_files $uri $uri/ =404;
try_files $uri $uri/ /index.php?q=$uri$args;
}


error_page 404 /404.html;


error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}


location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;

}
}

but I just get the web2py 404 page not found site fromm my app.


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


[web2py] subdomain for testing

2015-07-28 Thread BlueShadow
hi,
I have a web2py app on www.myexamplew2papp.com which runs perfectly. Now I 
want to create a subpage for testing which is not web2py but wordpress. 
this wordpressblog should be located here: www.myexamplew2papp.com/wpblog.
Does onyone know how I do that?
thanks

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


Re: [web2py] subdomain for testing

2015-07-28 Thread BlueShadow
I'm using nginx

On Tuesday, July 28, 2015 at 7:50:41 PM UTC+2, Richard wrote:

 Which server do you use? Apache, nginx? Basically you need to exclude 
 wpblog from the route to your web2py app this is done in the config of your 
 webserver... You can have a look at this web2py deployment script contrib : 
 https://github.com/web2py/web2py/blob/master/scripts/setup-ubuntu-12-04-redmine-unicorn-web2py-uwsgi-nginx.sh
  
 https://www.google.com/url?q=https%3A%2F%2Fgithub.com%2Fweb2py%2Fweb2py%2Fblob%2Fmaster%2Fscripts%2Fsetup-ubuntu-12-04-redmine-unicorn-web2py-uwsgi-nginx.shsa=Dsntz=1usg=AFQjCNGsF8K3PQzXtfgUtk07H49dvH9xrQ
  
 line 333

 Direct link :

 https://github.com/web2py/web2py/blob/master/scripts/setup-ubuntu-12-04-redmine-unicorn-web2py-uwsgi-nginx.sh#L333

 It regular expression, it should be similar with apache...

 Richard




 On Tue, Jul 28, 2015 at 1:09 PM, BlueShadow kevin@gmail.com 
 javascript: wrote:

 hi,
 I have a web2py app on www.myexamplew2papp.com which runs perfectly. Now 
 I want to create a subpage for testing which is not web2py but wordpress. 
 this wordpressblog should be located here: www.myexamplew2papp.com/wpblog
 .
 Does onyone know how I do that?
 thanks

 -- 
 Resources:
 - http://web2py.com
 - http://web2py.com/book (Documentation)
 - http://github.com/web2py/web2py (Source code)
 - https://code.google.com/p/web2py/issues/list (Report Issues)
 --- 
 You received this message because you are subscribed to the Google Groups 
 web2py-users group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to web2py+un...@googlegroups.com javascript:.
 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] web2py update app admin doesn't work anymore

2015-04-25 Thread BlueShadow
Hi I'm running web2py on ubuntu with nginx after updating to the current 
version my appadmin doesn't work anymore.
this is the error I got directly from the appadmin error folder:
S'output'
p2
Stype 'exceptions.ImportError' No module named pydal.objects
p3
sS'layer'
p4
S'/home/www-data/web2py/applications/admin/controllers/default.py'
p5
sS'code'
p6

thanks for your help

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


[web2py] button to start function which dynamicly chynges page

2015-04-06 Thread BlueShadow
Hi,
I have a function in my web2py app which takes quite a while. I like to 
have a button on a page which starts the funktion but does not reload the 
page for 10 minutes. The function should also dynamicly display its 
progress on the page. Is there a way to do that?

-- 
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] temp table

2015-03-19 Thread BlueShadow
Hi,
I get some information from constantly updating files. (this part works 
already) Some of these information I want to save in a temp db table. 
So once the user opens the temp table site he should get an overview 
about all information in the temp table and decide for each entry if its 
taken over to the main db table or if it should be deleted.
How would you guys tackle this problem?
thanks for the help.

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


[web2py] Search for Similar database entries

2015-01-24 Thread BlueShadow
Hi I got a filled db table with articles each article has a title which 
looks like this: Movie the article is about - Topic discussed what I want 
to list all articles which have the same first half of the title: Movie 
the article is about
Thanks for your help.

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


[web2py] Re: Search for Similar database entries

2015-01-24 Thread BlueShadow

Thanks.
how do you make an index?

-- 
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] nginx one ip two web2py applications two non web2py websites

2014-12-01 Thread BlueShadow
Hi,
I got one server with one ip.
And I have a total of 4 websites. two web2py apps and two non web2py apps.
I had that configured and working a year ago. and can't remember how I did 
it.
I updatet web2py and now all web2py urls are redirected to one of the non 
web2py websites.
Can anyone tell me wat went wrong.
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] Re: nginx one ip two web2py applications two non web2py websites

2014-12-01 Thread BlueShadow
I'm stupid. I had the $hostname still in the conf file in sites-available
thanks Niphlod.

On Monday, December 1, 2014 9:44:36 PM UTC+1, BlueShadow wrote:

 Hi,
 I got one server with one ip.
 And I have a total of 4 websites. two web2py apps and two non web2py apps.
 I had that configured and working a year ago. and can't remember how I did 
 it.
 I updatet web2py and now all web2py urls are redirected to one of the non 
 web2py websites.
 Can anyone tell me wat went wrong and how to set it up correctly?
 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] list all users with membership of a group

2014-06-18 Thread BlueShadow
Hi folks,
I want to display all members of auth_group.id 3
but for some reason I got a blokade and can't get it to work.
thanks for your help.

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


[web2py] module has no attribute...

2014-05-28 Thread BlueShadow
I just added a function to my module sitemap called stats which basicly 
counts the sites which are in my sitemap. My problem is the function I just 
created (stats(db)) can't be called I always get a ticket:
...

  sitemapstat=sitemap.stats(db)
AttributeError: 'module' object has no attribute 'stats'
...

 import sitemap
sitemapstat=sitemap.stats(db)


but I can see this d... function the module is saved and everything seems 
to be OK.
any ideas?

-- 
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] list:reference field number of entries

2014-04-23 Thread BlueShadow
Hi,
I got a list:reference field where there are very many entries to choose 
from and the default field shows only 5 entries is there a way to increase 
that number or get a better field to select multiple entries?
thanks for your help

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


Re: [web2py] list:reference field number of entries

2014-04-23 Thread BlueShadow
Thanks Niphlod yours works.
Richard can you tell me how one can implement the jquery multiple select 
plugin.
I tried a fancy one some time ago which had two windows one showing the 
selected and one showing the unselected. but I could never get it to work.

-- 
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] Tuning app performance for good response times on slow servers

2014-02-25 Thread BlueShadow
Hi,
I'm using web2py with nginx and sqlite. And my response times are pretty 
bad. last time I measured it I god results around 2000ms.
When I use google pagespeed it tells me three things I should improve: use 
browser caching for images, put javascript and css below the fold and check 
the content management system for known bottlenecks ...
The first two I got no clue how to do them or what it means putting 
something below the fold.
Are there any known bottlenecks and fixes for them?
regards

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


[web2py] Making a complete backup of an app

2014-02-17 Thread BlueShadow
Hi,
I got several problems with my current web2py version: I can't disable 
apps, I can't use the package all command, or the update command and a few 
other minor things.
So I wanted to delete web2py completly and reinstall it. But I'm not sure 
how I get all things from my app (database (sqlite)). The main App has 
become pretty big over the time (about 400mb in pictures alone)
Anyone who can tell me how I can back up my App completly without the 
package system of w2p?

-- 
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/groups/opt_out.


[web2py] Reaching pages by a descriptive pagename

2014-02-10 Thread BlueShadow
Hi I would love if I could reach my Articles not only by this type of URL: 
www.mydomain.com/Article?id=112 but also by this type of URL: 
www.mydomain.com/Article:Title-of-the-Article (or something similar I just 
want to have the Title of that Article in the URL). Is there an easy way to 
do this? The old URLs still have to work! I would love to have a redirect 
to my new type of URL.
Thanks for your Help

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


[web2py] Re: Important New Year News: Edison Award

2014-01-04 Thread BlueShadow


 good luck you and web2py deserve it.


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


[web2py] converted url %3F and %3D

2014-01-04 Thread BlueShadow
Hi,
for some reason some external links converted the ?id=10 in one of my urls 
to %3Fid%3D10 my question is how can I convert that request back to the 
existing url. Preferably for all sites if it should happen again.
Do I have to do some nginx magic to do that or can it be done within web2py?
thanks

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


[web2py] Re: list:reference painfull to fill

2013-12-12 Thread BlueShadow
thanks for your offer I'm working my way through the example code but my 
biggest problem is that php site. I don't know php. But from what I get 
from the php code is that all the sample cities need to be in an unordered 
list environment ulli/li.../ul
but this form part of the bsmselect example really confuses me.

h1Example 1: Typical Usage/h1
form action=./example_results.php method=post

label for=cities1What are your favorite cities?/label
select id=cities1 multiple=multiple name=cities[] title=Click to 
Select a City class=sminit
  optionAmsterdam/option
/select
pinput type=submit name=submit value=submit //p
  /form


especially the php file in form action=
?php

if(!empty($_POST['submit'])) {

  echo html\nbody style='width: 400px; margin: 2em auto; font-family: 
Arial;';

  if(!empty($_POST['cities'])) {

echo \npstrongYou selected the following 
cities:/strong/p\nul;

foreach($_POST['cities'] as $city) {

  // exclude any items with chars we don't want, just in case someone 
is playing
  if(!preg_match('/^[-A-Z0-9\., ]+$/iD', $city)) continue;

  // print the city
  echo \n\tli . htmlspecialchars($city) . /li;
}

echo \n/ul;

  } else {
echo \npNo items selected/p;
  }

  echo \npa href='index.html'Try Again?/a/p;

  echo \n/body\n/html;

} else {
  // if someone arrived here not having started at example.html
  // then show example.html instead
  require(index.html);

}


It seems to me that there is an entire html document in this php file. 

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


[web2py] list:reference painfull to fill

2013-12-09 Thread BlueShadow
Hi,
If I had two tables one called ingredience and the other soup. It is quite 
painfull to put 20 ingredience in one soup. Is there any more convenient 
way? It is sopposed to work with a form for users to create more entries. 
So punching in the ids is not an option.

-- 
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/groups/opt_out.


[web2py] multiple select plugin and list reference

2013-11-27 Thread BlueShadow
I found this wonderfull plugin: 
http://dev.s-cubism.com/plugin_multiselect_widget
which looks awesome for the things I wonna do.
But I don't get ist to work with a field which has a list reference table
I want the field to be either empty of filled with an unlimeted amount of 
entries. So I had no required field at all:
Field('Fruit','list:reference Fruits'),
so I tried the following:
from plugin_multiselect_widget import (
hmultiselect_widget, vmultiselect_widget,
rhmultiselect_widget, rvmultiselect_widget,
)
...
db.Cocktail.Fruit.requires=IS_EMPTY_OR(IS_IN_DB(db,'Fruits.id','Fruits.Name'
,multiple=True))
db.Cocktail.Fruit.widget = hmultiselect_widget
which gave me the multiselect widget but When I mark a fruit and click on 
the register button nothing happens.


-- 
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/groups/opt_out.


[web2py] Re: DAL db.table.field.contains

2013-11-21 Thread BlueShadow
def Authors():
AL=db().select(db.Author.ALL, orderby=db.Author.Name)
TheList=[]
for Author in AL:
l=db(db.Book.Author.contains(Author.id)).select(db.Book.ALL, orderby
=db.Book.Name)
if len(l)0:
TheList.append([l[0]])
else:
TheList.append([])
return dict(AL=AL,BookList=TheList)
here is my controller funktion
and my view:
table
{{i=0}}
{{for Author in AL:}}
tr
td{{=Author.Name}}/tdtd/td
/tr
{{for b in BookList[i]:}}
tr
td/tdtd{{=b.Name}}/td
/tr
{{pass}}
{{i+=1}}
{{pass}}
/table
its supposed to give an alphabetical list of all authors which it does.
and list all their books (only one is displayed)


-- 
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/groups/opt_out.


[web2py] DAL db.table.field.contains

2013-11-21 Thread BlueShadow
Hi
I got two tables Books and Authors
Book(Name,List:Author,...)
each book has at least one author
now I want to have a list of all the books one Author has written.
So I came up with this line of code:
l=db(db.Books.Author.contains(Author.id)).select(db.Books.ALL, orderby=db:
Books.Name)
which works but it only gives me one Book per Author.
I got no clue why this happens I know that I have several Authors which 
have more than one book.

-- 
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/groups/opt_out.


[web2py] avoid out of range error from googlebot

2013-11-20 Thread BlueShadow
Hi,
to increase my speed I have a fast downloadfunction for my images:
def fast_download():
   session.forget(response)
   cache.action(time_expire=604800)(lambda: 0)()
   # very basic security (only allow fast_download on 
your_table.upload_field):
   if not request.args(0).startswith(Images.):
   return download()
   
   #-check which picture we are allowed to display
   #get the db entry and determine whether it is a small or big pic
   rows=db(db.Images.thumb == request.args(0)).select()
   try:
   rows[0]
   except:
   small=0
   rows=db(db.Images.Image == request.args(0)).select()
   else:
   small=1

   #print rows[0],small
   row=rows[0]
   if ...#some stuff to determine which image is shown (not relevant)


   from PIL import Image
   img=row.thumb
   filename = os.path.join(request.folder,'uploads',img)

   return response.stream(open(filename,'rb'))

which works quite good.
My Problem is that the google image bot tries quite frequently to access 
the function directly. which gives an out of range error. (268 in the last 
3 weeks)
part of one error ticket:

File /home/www-data/web2py/applications/Movie_Alarm/controllers/default.py 
https://www.movie-alarm.de/admin/edit/Movie_Alarm/controllers/default.py, 
line 327, in fast_download
row=rows[0]


HTTP_FROM:
googlebot(at)googlebot.com


HTTP_USER_AGENT:
Googlebot-Image/1.0
REQUEST_URI:
/fast_download/Images.thumb.a791255ac1014c88.7466d626e61696c2e6a7067.jpg


I tried to put fast_download in the disallowed part of the robots.txt
but it seems to have no effect.
and I hate having so many errors in my error database :)
have you guys any ideas how I can prevent this from happening 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/groups/opt_out.


[web2py] tactic for avoiding errors

2013-10-26 Thread BlueShadow
Hi,
I got a slightly modified download function:
def fast_download():
   session.forget(response)
   cache.action(time_expire=604800)(lambda: 0)()
   # very basic security (only allow fast_download on 
your_table.upload_field):
   if not request.args(0).startswith(Images.):
   return download()
...
   filename = os.path.join(request.folder,'uploads',request.args(0))
   #response.headers['Last-Modified'] = time.strftime(%a, %d %b %Y 
%H:%M:%S +, time.localtime(os.path.getmtime(filename)))
   return response.stream(open(filename,'rb'))

my problem is that I get quite a few attempts to get to the images directly 
like: /default/fast_download/Images.thumb.bb2649jpg etc.
39 since yesterday. which raises an error. The User Agent claims to be the 
GoogleImageBot at least most of the times.
I did put this line in the robots.txt: 

Disallow: /default/fast_download/
but it seems to have no effect at all.
Any ideas on the strategies I should use when the function is called directly?

-- 
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/groups/opt_out.


[web2py] Request: Error Traceback Page: Requested URL with Arguments

2013-10-25 Thread BlueShadow
Hi,
I would love to see a little addition to the error page:
A line where it displays the entire URL with all the arguments.
I know its already under the request button. but its spread and I have to 
search for it every time. it would really speed up my process of looking 
for an error. And I guess quite a few people would love to have that extra 
line.
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/groups/opt_out.


[web2py] updating web2py app code

2013-10-16 Thread BlueShadow
Since my original app was build with web2py 1.8.something. without any 
version control or anything like that I was wondering if there is a good 
tutorial how to set an app up with all the current features. Or if you 
think it's not worth it and never change a running system.
One thing I would love to change is to add a version control to my system. 
Is there a tutorial for that?

-- 
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/groups/opt_out.


[web2py] web2py update nothing is working anymore

2013-10-01 Thread BlueShadow
Hi
i tried to upgrade the framework after using the experimental upgrading 
button in the admin panel. I couldn't access the admin panel anymore. I got 
an error page which I could not open.
So I copied my application to some place on the server (cp -R ) deleted 
web2py (rm -R) used the nginx install script. Now the admin panel is 
working again. But once I copied my page to the web2py applications folder 
the app isn't working anymore. (unknown error)
I tried to put my app on a locale web2py (windows compiled) copy and it 
doesn't work either. and gives me an error no auth_groups
So I'm pretty much stuck I just used a backup to restore the part where at 
least my page was running but I still don't have any access to the admin 
panel.

-- 
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/groups/opt_out.


[web2py] Re: web2py update nothing is working anymore

2013-10-01 Thread BlueShadow
For some reason I don't know after the backup finished (the backup was with 
a non working admin panel) everything works again. I got no explanation 
because its the second time I used this backup. and last time it didn't 
work.

Am Dienstag, 1. Oktober 2013 14:33:07 UTC+2 schrieb BlueShadow:

 Hi
 i tried to upgrade the framework after using the experimental upgrading 
 button in the admin panel. I couldn't access the admin panel anymore. I got 
 an error page which I could not open.
 So I copied my application to some place on the server (cp -R ) deleted 
 web2py (rm -R) used the nginx install script. Now the admin panel is 
 working again. But once I copied my page to the web2py applications folder 
 the app isn't working anymore. (unknown error)
 I tried to put my app on a locale web2py (windows compiled) copy and it 
 doesn't work either. and gives me an error no auth_groups
 So I'm pretty much stuck I just used a backup to restore the part where at 
 least my page was running but I still don't have any access to the admin 
 panel.



-- 
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/groups/opt_out.


[web2py] optimizing for mobile devices

2013-07-25 Thread BlueShadow
Hi,
since my Mobile menu links to non existing stuff %20CA% or something like 
that I want to use the normal menu which I find way nicer.
I guess I need to change this line:
{{=MENU(response.menu, _class='mobile-menu' if is_mobile else 
'sf-menu',mobile=is_mobile)}}

the second thing I would love to do is use smaler images for mobile 
devices. Can I do this just by:
is_mobile=request.user_agent().is_mobile
if s_mobile:
...small img...
else:
...large img...

-- 

--- 
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] clear error database

2013-07-23 Thread BlueShadow
I got a bit of a problem:
I get a timeout when I go to errors in the admin section. I guess there are 
so many errors that it just takes to long for the page to load (haven't 
looked at them for quite some time.)
Is there a way to clear those errors so that I can at least see the new 
one's?
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: clear error database

2013-07-23 Thread BlueShadow
I'm Using nginx.
conf file:
user www-data;
worker_processes 4;
pid /var/run/nginx.pid;

events {
worker_connections 768;
# multi_accept on;
}

http {

##
# Basic Settings
##

sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 120;
types_hash_max_size 2048;
client_max_body_size 45m;
# server_tokens off;
   include /etc/nginx/mime.types;
default_type application/octet-stream;

##
# Gzip Settings
##

gzip on;
gzip_disable msie6;

# gzip_vary on;
# gzip_proxied any;
# gzip_comp_level 6;
# gzip_buffers 16 8k;
# gzip_http_version 1.1;
 gzip_types text/plain text/css application/json application/x-javascript 
text/xml application/xml application/xml+rss text/javascript;

##
# nginx-naxsi config
##
# Uncomment it if you installed nginx-naxsi
##

#include /etc/nginx/naxsi_core.rules;

...
   

   

-- 

--- 
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: list:reference requires is not empty

2013-06-09 Thread BlueShadow
I tried the IS_LIST_OF validator and I can't get ist to work. when I have 
no validator I got all names in my refrenced table. And I can select as 
much as I like, but when I use any validators the list disappears and I get 
an input for a string. I tried IS_LENGTH(minsize=1) as well as 
IS_LIST_OF(IS_IN_DB(db,reference.id,reference.name),1,10), any suggestions?

-- 

--- 
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: app about page

2013-06-02 Thread BlueShadow


https://lh6.googleusercontent.com/-oDE7O7Yvqgk/UasTv8GH5TI/AAk/lB1eTk0eIcw/s1600/project+progress.gif
I stumbled apon the about page and this graph so I searched the forums and 
found this post. seeing the number of lines written is pretty interesting 
but I can't figure this graph out. why are there negative numbers and 
spikes in the graph?
I my opinion it should progress more or less linear with flat lines for the 
breaks I took.
 

On Friday, January 4, 2013 11:36:28 AM UTC+1, Ramos wrote:

 hello.
 what does it mean the graph in the about page under Project progress?


 Thank you
 António


-- 

--- 
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] web2py Safety discussion

2013-06-02 Thread BlueShadow
I wrote just a simple few lines to display the contents of that file to my 
personal Admin report^^

h2Failed logins to Adminpanel:/h2
{{deny=os.path.join('applications', 'admin', 'private', 'hosts.deny')}}
{{file=open(deny,'r')}}
{{lines=file.readlines()}}
{{file.close()}}
{{for l in lines:}}
{{=l}}
{{pass}}

Since I had something to eat before I wrote that over an hour passed from 
the time of my deliberate failed login.
And the file is empty.

In my opinion this should be stored somewhere. Because only with the 
knowlege is power :)
And based apon data one can decide if it is necessary to increase security.

-- 

--- 
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] list:reference requires is not empty

2013-06-02 Thread BlueShadow
when one has a database field with a list:reference type it can be empty. 
For quite a few scenarios this is undesirable. but if you use requires 
is_not_empty() it first of all doesn't show the reference table entries. 
And it still allows you to leave the field empty.

-- 

--- 
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] db field requires is empty

2013-06-02 Thread BlueShadow
I got a database field which needs to be filled when a bolean is true and 
when its not true it should be empty.
Thats what I did:
Field('Booleancheck','boolean'),
Field('Type','reference Type_table', requires=IS_IN_DB (db,'type_table.id',
'type_table.Name') if request.vars.Booleancheck else None),

This requires the field to be filled if booleancheck is true but when its 
falls it can be filled. is there a IS_EMPTY() validator?

-- 

--- 
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] web2py Safety discussion

2013-06-01 Thread BlueShadow
Hi,
Overall web2py is pretty save as far as I know. https://scanmyserver.com/ 
shows for my web2py app 6 low priority risks. As far as I'm concerned 
they are very low priority but since I startet to record all errors (code 
400 404 500) in an database table I get a little concerned since my very 
small site gets on some days 20 attacks. They are pretty premitive as far 
as I can tell. Trying to call admin page or /wp-login ... trying to add 
code after the url...
So my concern is not the site itself but the appadmin. It is only protected 
by a password and as far as I can tell there is no brute force protection 
like a timeout after 3 or five misspelled passwords.
I don't know if I'm just paranoid but I can't record if there are attemps 
to access appadmin and there is no timeout for the password.
I would welcome your thoughts on this issue.

-- 

--- 
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: 2.4.7 problems

2013-05-29 Thread BlueShadow
I just rechecked it the standard www-data user is the owner of the folder 
and its content.

On Tuesday, May 28, 2013 10:03:15 PM UTC+2, Niphlod wrote:

 I tried with cache.disk and no error occurred. 
 Are you positive that there are no permission issues on the cache folder ?


-- 

--- 
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] 2.4.7 problems

2013-05-28 Thread BlueShadow
Hi,
I updated to the newest version of web2py and I got at least to problems:
there is no client cache funktion anymore.
the second one:
I get an error when I create a cached version of a page:
@auth.requires_membership('VIP')
@cache(Ertrag, time_expire=86400, cache_model=cache.disk)
def Ertrag():
Liste=getvaluesfromDB(db)
Liste=Sortvalues(Liste)
return response.render(Liste=Liste)

returns this error
type 'exceptions.RuntimeError' unable to create/re-create cache file 
F:\Website\web2py\applications\Prolog\cache\cache.shelve Version  web2py™ 
Version 
2.4.7-stable+timestamp.2013.05.24.17.48.47  Python Python 2.7.4: 
C:\Python27\python.exe (prefix: C:\Python27)  Traceback 

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.

Traceback (most recent call last):
  File F:\Website\web2py\gluon\restricted.py, line 212, in restricted
exec ccode in environment
  File F:/Website/web2py/applications/Prolog/controllers/default.py 
http://127.0.0.1:8000/admin/default/edit/Prolog/controllers/default.py, line 
188, in module
  File F:\Website\web2py\gluon\globals.py, line 194, in lambda
self._caller = lambda f: f()
  File F:\Website\web2py\gluon\tools.py, line 3021, in f
return action(*a, **b)
  File F:\Website\web2py\gluon\cache.py, line 402, in __call__
self.time_expire)
  File F:\Website\web2py\gluon\cache.py, line 347, in __call__
storage = self._open_shelve_and_lock()
  File F:\Website\web2py\gluon\cache.py, line 299, in _open_shelve_and_lock
'unable to create/re-create cache file %s' % self.shelve_name)
RuntimeError: unable to create/re-create cache file 
F:\Website\web2py\applications\Prolog\cache\cache.shelve

Error snapshot [image: help] 
http://127.0.0.1:8000/admin/default/ticket/Prolog/127.0.0.1.2013-05-28.11-51-13.e9da1018-313c-4c70-b945-35a6194e7ecc#
 

type 'exceptions.RuntimeError'(unable to create/re-create cache file 
F:\Website\web2py\applications\Prolog\cache\cache.shelve) 

inspect attributes 
Atribute der Ausnahmeinstanz args (r'unable to create/re-create cache file 
F:\Website\web2py\applications\Prolog\cache\cache.shelve',)  __setattr__ 
method-wrapper 
'__setattr__' of exceptions.RuntimeError object  __reduce_ex__ built-in 
method __reduce_ex__ of exceptions.RuntimeError object  __getslice__ 
method-wrapper 
'__getslice__' of exceptions.RuntimeError object  __getitem__ method-wrapper 
'__getitem__' of exceptions.RuntimeError object  __setstate__ built-in 
method __setstate__ of exceptions.RuntimeError object  __getattribute__ 
method-wrapper 
'__getattribute__' of exceptions.RuntimeError object  __str__ method-wrapper 
'__str__' of exceptions.RuntimeError object  __format__ built-in method 
__format__ of exceptions.RuntimeError object  __reduce__ built-in method 
__reduce__ of exceptions.RuntimeError object  __class__ type 
'exceptions.RuntimeError'  __dict__ {}  __delattr__ method-wrapper 
'__delattr__' of exceptions.RuntimeError object  __subclasshook__ built-in 
method __subclasshook__ of type object  __repr__ method-wrapper 
'__repr__' of exceptions.RuntimeError object  __init__ method-wrapper 
'__init__' of exceptions.RuntimeError object  __hash__ method-wrapper 
'__hash__' of exceptions.RuntimeError object  __sizeof__ built-in method 
__sizeof__ of exceptions.RuntimeError object  __doc__ 'Unspecified 
run-time error.'  __unicode__ built-in method __unicode__ of 
exceptions.RuntimeError object  __new__ built-in method __new__ of type 
object

...default.py

http:///[app]/default/data/update/[table]/[id]
http:///[app]/default/data/delete/[table]/[id]
http:///[app]/default/data/select/[table]
http:///[app]/default/data/search/[table]
but URLs must be signed, i.e. linked with
  A('table',_href=URL('data/tables',user_signature=True))
or with the signed load operator
  LOAD('default','data.load',args='tables',ajax=True,user_signature=True)

return dict(form=crud(),nsb=1)


-- 

--- 
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: 2.4.7 problems

2013-05-28 Thread BlueShadow
deleting the cache directory has no effekt.
any other ideas?


On Tuesday, May 28, 2013 12:32:18 PM UTC+2, Niphlod wrote:

 cache.client was experimental. it was renamed to cache.action

 As for the second error, try to delete the cache/ directory

 Il giorno martedì 28 maggio 2013 11:58:35 UTC+2, BlueShadow ha scritto:

 Hi,
 I updated to the newest version of web2py and I got at least to problems:
 there is no client cache funktion anymore.
 the second one:
 I get an error when I create a cached version of a page:
 @auth.requires_membership('VIP')
 @cache(Ertrag, time_expire=86400, cache_model=cache.disk)
 def Ertrag():
 Liste=getvaluesfromDB(db)
 Liste=Sortvalues(Liste)
 return response.render(Liste=Liste)

 returns this error
 type 'exceptions.RuntimeError' unable to create/re-create cache file 
 F:\Website\web2py\applications\Prolog\cache\cache.shelve Version  web2py™ 
 Version 
 2.4.7-stable+timestamp.2013.05.24.17.48.47  Python Python 2.7.4: 
 C:\Python27\python.exe (prefix: C:\Python27)  Traceback 

 1.
 2.
 3.
 4.
 5.
 6.
 7.
 8.
 9.
 10.
 11.
 12.
 13.
 14.
 15.
 16.

 Traceback (most recent call last):
   File F:\Website\web2py\gluon\restricted.py, line 212, in restricted
 exec ccode in environment
   File F:/Website/web2py/applications/Prolog/controllers/default.py 
 http://127.0.0.1:8000/admin/default/edit/Prolog/controllers/default.py, 
 line 188, in module
   File F:\Website\web2py\gluon\globals.py, line 194, in lambda
 self._caller = lambda f: f()
   File F:\Website\web2py\gluon\tools.py, line 3021, in f
 return action(*a, **b)
   File F:\Website\web2py\gluon\cache.py, line 402, in __call__
 self.time_expire)
   File F:\Website\web2py\gluon\cache.py, line 347, in __call__
 storage = self._open_shelve_and_lock()
   File F:\Website\web2py\gluon\cache.py, line 299, in _open_shelve_and_lock
 'unable to create/re-create cache file %s' % self.shelve_name)
 RuntimeError: unable to create/re-create cache file 
 F:\Website\web2py\applications\Prolog\cache\cache.shelve

 Error snapshot [image: help] 
 http://127.0.0.1:8000/admin/default/ticket/Prolog/127.0.0.1.2013-05-28.11-51-13.e9da1018-313c-4c70-b945-35a6194e7ecc#
  

 type 'exceptions.RuntimeError'(unable to create/re-create cache file 
 F:\Website\web2py\applications\Prolog\cache\cache.shelve) 

 inspect attributes 
 Atribute der Ausnahmeinstanz args (r'unable to create/re-create cache 
 file F:\Website\web2py\applications\Prolog\cache\cache.shelve',)  
 __setattr__ method-wrapper '__setattr__' of exceptions.RuntimeError 
 object  __reduce_ex__ built-in method __reduce_ex__ of 
 exceptions.RuntimeError object  __getslice__ method-wrapper 
 '__getslice__' of exceptions.RuntimeError object  __getitem__ 
 method-wrapper 
 '__getitem__' of exceptions.RuntimeError object  __setstate__ built-in 
 method __setstate__ of exceptions.RuntimeError object  __getattribute__ 
 method-wrapper 
 '__getattribute__' of exceptions.RuntimeError object  __str__ 
 method-wrapper 
 '__str__' of exceptions.RuntimeError object  __format__ built-in 
 method __format__ of exceptions.RuntimeError object  __reduce__ built-in 
 method __reduce__ of exceptions.RuntimeError object  __class__ type 
 'exceptions.RuntimeError'  __dict__ {}  __delattr__ method-wrapper 
 '__delattr__' of exceptions.RuntimeError object  __subclasshook__ built-in 
 method __subclasshook__ of type object  __repr__ method-wrapper 
 '__repr__' of exceptions.RuntimeError object  __init__ method-wrapper 
 '__init__' of exceptions.RuntimeError object  __hash__ method-wrapper 
 '__hash__' of exceptions.RuntimeError object  __sizeof__ built-in 
 method __sizeof__ of exceptions.RuntimeError object  __doc__ 'Unspecified 
 run-time error.'  __unicode__ built-in method __unicode__ of 
 exceptions.RuntimeError object  __new__ built-in method __new__ of 
 type object

 ...default.py

 http:///[app]/default/data/update/[table]/[id]
 http:///[app]/default/data/delete/[table]/[id]
 http:///[app]/default/data/select/[table]
 http:///[app]/default/data/search/[table]
 but URLs must be signed, i.e. linked with
   A('table',_href=URL('data/tables',user_signature=True))
 or with the signed load operator
   LOAD('default','data.load',args='tables',ajax=True,user_signature=True)
 
 return dict(form=crud(),nsb=1)




-- 

--- 
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: 2.4.7 problems

2013-05-28 Thread BlueShadow




 I just changet it from cache.disk to cache.ram and it works but I would 
 prefer to put it on the disk and not to the ram.









































-- 

--- 
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: edit static content from web interface nginx

2013-05-22 Thread BlueShadow
I'm using uwsgi and all files are owned by the default www-data user 
created by the install file for web2py nginx

On Sunday, May 19, 2013 8:03:03 AM UTC+2, Calvin wrote:

 Check the file permissions for the static folder to see if it's own by 
 uwsgi (if you're using that... or whichever wsgi)?

-- 

--- 
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] edit static content from web interface nginx

2013-05-17 Thread BlueShadow
Hi,
since I'm using nginx as a server I can't edit my static files (css, js...) 
from the webinterface. I can view them but when I want to edit them I get a 
404 error. anyone with the same problem?

-- 

--- 
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] user comments

2013-05-15 Thread BlueShadow
I would love to see your badass coments plugin Niphlod. 

On Wednesday, May 15, 2013 9:39:21 AM UTC+2, Niphlod wrote:

 I was planning on writing a more updated plugin with some badass features 
 but as all the things is currently backlogged  

 On Wednesday, May 15, 2013 3:37:26 AM UTC+2, marco mansilla wrote:

 El Tue, 14 May 2013 12:33:51 -0700 (PDT) 
 BlueShadow kevin@gmail.com escribió: 

  Hi, 
  I like to add comments for users to my app. Is there a plugin which 
  does all the work for me or do I have to develop it myself? It would 
  be awesome if moderators could edit or delete comments. 
  

 there is [0], but i think it might be out of date, and the threaded 
 comments plugin is not available, still is not that hard to write the 
 code yourseft. In the book i think in the services section there's an 
 example of LOAD for ajax comments. 

 [0] http://www.web2py.com/plugins/default/simple_comments 



-- 

--- 
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] user comments

2013-05-14 Thread BlueShadow
Hi,
I like to add comments for users to my app. Is there a plugin which does 
all the work for me or do I have to develop it myself? It would be awesome 
if moderators could edit or delete comments.

-- 

--- 
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: mobile menu links won't work. %3Ca%20href=

2013-05-04 Thread BlueShadow
Hi, 
I got no clue what you mean by open a ticket.
There is no error ticket generated for this.


Am Samstag, 4. Mai 2013 00:04:15 UTC+2 schrieb Massimo Di Pierro:

 Please open a ticket about this.

 On Friday, 3 May 2013 15:43:29 UTC-5, BlueShadow wrote:

 Hi,
 I just discovered the my menu links don't work when one uses a mobile 
 device. they work fine with firefox chrome (I haven't tested all the other 
 browsers but I guess they work perfectly as well). but once the user agent 
 is mobile and the menue changes to one big drop down menu all links direct 
 you to url/%3Ca%20href= which gives you a bad request as expected. Any 
 ideas why this could be the case.
 And the entries in the menu look funny too for example: Start 
 Here is one line of my menu.py file:
 response.menu = [
 ('', 
 False,A('Start',_href=URL('default','index'),_title=Back 
 to the main page), []),...




-- 

--- 
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] mobile menu links won't work. %3Ca%20href=

2013-05-03 Thread BlueShadow
Hi,
I just discovered the my menu links don't work when one uses a mobile 
device. they work fine with firefox chrome (I haven't tested all the other 
browsers but I guess they work perfectly as well). but once the user agent 
is mobile and the menue changes to one big drop down menu all links direct 
you to url/%3Ca%20href= which gives you a bad request as expected. Any 
ideas why this could be the case.
And the entries in the menu look funny too for example: Start 
Here is one line of my menu.py file:
response.menu = [
('', False,A('Start',_href=URL('default','index'),_title=Back 
to the main page), []),...


-- 

--- 
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: @cache decorator

2013-04-23 Thread BlueShadow
Just to wrap this up:

So here is what I did to solve my problem (data is added once a day, time 
to render the result page takes forever):
The function which gets the data got appended by: cache.disk.clear() and 
cache.ram.clear()
I used the unix crantab to call that function once a day via a curl command.
the display function is called 1-2 minutes later and cached for 24 hours.
I removed the datestring although it would make no diffrence, but its just 
unnessassary.
It works like a charm now I got load times down from 30sekonds to about 5 
(there are some graphics rendered from the data via matplotlib).

Thanks for all the help 

-- 

--- 
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: app behaves radically diffrent on home PC (Windows) than on server(linux)

2013-04-22 Thread BlueShadow
Sorry for that I meant 

import datetime 
print datetime.datetime.now()

I was typing faster than I could think. this throws the error. I edited it 
away in the original post. I tested that exact same code with thepython 
idle gui which works so if have typos they weren't there when I tested 
them. :)

-- 

--- 
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: app behaves radically diffrent on home PC (Windows) than on server(linux)

2013-04-22 Thread BlueShadow
so I found the error causing this error: type 
'exceptions.AttributeError' type object 'datetime.datetime' has no 
attribute 'datetime'
I had in my db.py from datetime import datetime and in one of my modules I 
had import datetime (and accordingly I used datetime.now() inside the app 
and datetime.datetime.now() in the module).
which worked great on my server but apperently not on windows.
So I changed that. Now I get the next error:
class 'sqlite3.DatabaseError' file is encrypted or is not a database

the database is not encrypted and works fine in production. I had this 
error before and I know how to work around it: delete the content of the 
databases folder, export and import db via a csv file.

which is kind of annoying is there a fix for this?

The shell inside web2py is still not working. I tried this line print 
test no reaction at all.

My app was first created with web2py 1.9.something and I upgraded always 
almost imidiately.

-- 

--- 
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: app behaves radically diffrent on home PC (Windows) than on server(linux)

2013-04-22 Thread BlueShadow
 windows pc:



import sqlite3 
In [2] : print sqlite3.version 
2.6.0 
In [3] : print sqlite3.sqlite_version 
3.6.21 

  

Linux 

import sqlite3 
In [5] : print sqlite3.version 
2.6.0 
In [6] : print sqlite3.sqlite_version 
3.7.9 


on neither maschine is pysqlite2 installed.

So I will try to update my sqlite3 on my windows machine and see if it 
fixes the problem.


I think this may be a problem with sqlite versions. 

 On both system, in a python shell do: 

 import sqlite3 
 print sqlite3.version 
 print sqlite3.sqlite_version 

 # Following is just two check if you have 
 # the pysqlite2 installed 
 import pysqlite2.dbapi2 
 pysqlite2.dbapi2.version 
 pysqlite2.dbapi2.sqlite_version 


 and send us the results 

 Ricardo 


-- 

--- 
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: app behaves radically diffrent on home PC (Windows) than on server(linux)

2013-04-22 Thread BlueShadow
now I got pysqlite (on my windows maschine) which has following versions
In [6] : import pysqlite2.dbapi2 
In [7] : print pysqlite2.dbapi2.version
2.6.3
In [8] : print pysqlite2.dbapi2.sqlite_version
3.7.6.2

but I don't know how to update sqlite3

-- 

--- 
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: app behaves radically diffrent on home PC (Windows) than on server(linux)

2013-04-22 Thread BlueShadow
I chose to disable WAL which seems to work. I had not a lot of time to test 
it I just commented my try: except Blog which enabled WAL in the test app.
I will do some further testing tomorrow. Thanks Ricardo

I got the newest version of python 2 so I guess I have to wait for python 
2.7.5 and hope that they upgrade sqlite.

-- 

--- 
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] db select with rows

2013-04-21 Thread BlueShadow

I can't get my head around this problem it's probably easy but I ask anyway:
I got rows(lets call them rowsA) from tableA and I want to select all items 
from another tableB which have one of the ids in tableA
I could do it with a for loop selecting one at a time like so:
for row in rowsA:
 temp=db(db.tableB.id==row.id).select()
but now I got only one element as a result.
how can I get all those into one variable:rowsB

-- 

--- 
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] app behaves radically diffrent on home PC (Windows) than on server(linux)

2013-04-21 Thread BlueShadow
Hi,
I was developping my app for the last couple weeks directly on my server. 
now for my new functions I wanted some easy tests like using the print 
command and see it directly^^
So I package the app and put it on my windows PC (web2py 2.4.6-stable same 
as on Server (not the compiled version: source version)) and I got errors 
for the most trivial things which should work. 

from datetime import datetime
print datetime.datetime.now()

I tested the code on my python idle gui which works. but in web2py it does 
not.
type 'exceptions.AttributeError' type object 'datetime.datetime' has no 
attribute 'datetime'

then I tried the shell in my app it does not work. But in the welcome app 
it works.

On the server (linux system) everything works. on my windows Home PC it 
does not work.

any ideas what is causing this behavior? And how I can fix it?



-- 

--- 
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] search db partial string match

2013-04-20 Thread BlueShadow
I got a table like this one:
db.define_table('Movie',
Field('Title',length=64),
Field('Content',length=512),
   )
Now I like to search this table Title with a string like Star Wars.
My problem is that there are 6 Star Wars Movies: Star Wars: Episode I...
I want to have all of those 6 as a result.
any idea how I can do that?
My first attempt failed miserable
Movies=db(db.Movie.Title[:len(Searchstr)]==Searchstr)
which gives me this: Set (SUBSTR(Movie.Title,1,(2 - 1)) = '2')

-- 

--- 
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: Cannot import module 'guppy', appadmin cache

2013-04-19 Thread BlueShadow
I did now and I can't import it in python:
ImportError: No module named gubby


On Friday, April 19, 2013 9:54:08 AM UTC+2, Niphlod wrote:

 did you try opening a python shell and seeing if you can still import 
 guppy (i.e. it wasn't removed after all) ?

 On Thursday, April 18, 2013 11:51:05 PM UTC+2, BlueShadow wrote:

 I did kill all processes remotly related to web2py an  uswgi and the 
 internet restarted all and the cache page still wont load without that 
 error.


 On Thursday, April 18, 2013 11:08:14 PM UTC+2, Niphlod wrote:

 guppy has not been updated in a while, there are some known bugs with 
 the stable release and there seems to be already a bug listed on 
 web2py's official issues.
 I tried to install it from sources, but didn't had luck with that either.
 Seems also that the debian package is somewhat oldie.. to sum up, I 
 never saw it working ^_^

 But if you uninstalled it and you restarted uwsgi (hard restart, better) 
 you should be able to get to your need to install guppy simple cache 
 page. Sure that you're restarting the uwsgi process (and not reloading it) ?



-- 

--- 
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] costum error log

2013-04-19 Thread BlueShadow
Hi I got a custum error page which saves some of the data to give me a 
quick overview of the why those errors happen. it stores the error code the 
request.url and the useragent. my problem is I get a bunch of 400 errors. 
and I want to know what the users/bots typed in exactly. request_uri gives 
theurl of the error page request.url the URL they typed but stops at the 
function.
so if I type www.exampe.com/controller/function# I get a 400 error but 
how can I get those 3 characters in my error log.

-- 

--- 
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: costum error log

2013-04-19 Thread BlueShadow
well that was my personal trial to get a 400 error. I just want to find out 
why there are about 5-10 400 errors on my webpage per day. and if they are 
caused by some bad bots or something. So I can lock them out with my 
firewall.
If its just typos I won't do a thing. Right now I'm saving the request_url 
and the error code. But this wont help me at all if someone gets a 400 
error on a working page.
Thats why I asked.
other things which cause 400 errors are .../function(testerror)
pretty much every non letter other than ? and /

On Friday, April 19, 2013 9:06:43 PM UTC+2, Niphlod wrote:

 given that you want a ready-to-use solution, can you give an example ?
 with /app/controller/function# you can't get what follows #, but the 
 first  is in requested_uri as it should be.



 On Friday, April 19, 2013 8:53:52 PM UTC+2, BlueShadow wrote:

 Thats no anchor thats the first random character i found. Try it it 
 fails. Code 400
 Am 19.04.2013 20:50 schrieb Niphlod nip...@gmail.com:

 uhm you can't (even in a normal request) have the value that is 
 assigned with an #anchor (call it anchor, fragment, whatever) ... that 
 doesn't get passed to the webserverso you can't have a page that fails 
 because of that #part

 On Friday, April 19, 2013 8:22:21 PM UTC+2, BlueShadow wrote:

 Hi I got a custum error page which saves some of the data to give me a 
 quick overview of the why those errors happen. it stores the error code 
 the 
 request.url and the useragent. my problem is I get a bunch of 400 errors. 
 and I want to know what the users/bots typed in exactly. request_uri gives 
 theurl of the error page request.url the URL they typed but stops at the 
 function.
 so if I type 
 www.exampe.com/controller/**functionhttp://www.exampe.com/controller/function#
  
 I get a 400 error but how can I get those 3 characters in my error log.

  -- 
  
 --- 
 You received this message because you are subscribed to a topic in the 
 Google Groups web2py-users group.
 To unsubscribe from this topic, visit 
 https://groups.google.com/d/topic/web2py/qfl8qCtZJe8/unsubscribe?hl=en.
 To unsubscribe from this group and all its topics, send an email to 
 web2py+un...@googlegroups.com.
 For more options, visit https://groups.google.com/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] @cache decorator

2013-04-18 Thread BlueShadow
Hi I got a site which calls some major calculating. So I thought lets use 
the cache decoator to speed up second time loads.
But it doesnt seem to have any effekt on pageloading times.
@cache(returnDatestring()+Somepage, time_expire=86000, cache_model=cache.
disk)
def Somepage():
#some time intensive calculations
return response.render(l=l)

So with and without the @cache decorator it takes about 25 seconds for the 
page to load. (yeah my server is slow I know) As far as I understand it the 
whole age should be stored on the disk and be served as a static page. 
which should load instantly.
Or is just the output of the function stored and the view has to be 
rendered afterwards? (the view has a big table with like 100 rows, there 
are calculated some sums too)
If so can I cache the entire view?

-- 

--- 
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: @cache decorator

2013-04-18 Thread BlueShadow
So you are basicly saying I did exactly what I wanted to do save the entire 
generated page on disk.
So how can I find out what is taking so long for the page to load?

@Derek: thats easy: I want the page cached from 00:05 to 23:59. because 
every day at midnight the data changes. if for some reason the page is 
cached later than 00:05 (I got a cronjob with a curl to visit that page) 
the new version will be calculated regardless of whether there is still a 
cached version or not. (because the date changes)

On Thursday, April 18, 2013 6:41:37 PM UTC+2, Paolo valleri wrote:

 Basically it stores the output of the function, in your case the output is 
 the rendered view.
 For more info about cache, have a look here: 
 http://web2py.com/books/default/chapter/29/04#cache

 Paolo



-- 

--- 
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] Cannot import module 'guppy', appadmin cache

2013-04-18 Thread BlueShadow
Hi,
I wanted to get some information on my cache usage. so I went to the cache 
page in appadmin which worked fine at that moment but told me I need guppy 
in order to get the size of the cache.
So I installed it. now I get an error page which tells me guppy cannot be 
imported.
I restarted nginx/uswgi and web2py which had no effekt.
I even tried to uninstall guppy but the error message stays the same.
Any ideas?

-- 

--- 
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: Cannot import module 'guppy', appadmin cache

2013-04-18 Thread BlueShadow
I did kill all processes remotly related to web2py an  uswgi and the 
internet restarted all and the cache page still wont load without that 
error.


On Thursday, April 18, 2013 11:08:14 PM UTC+2, Niphlod wrote:

 guppy has not been updated in a while, there are some known bugs with the 
 stable release and there seems to be already a bug listed on web2py's 
 official issues.
 I tried to install it from sources, but didn't had luck with that either.
 Seems also that the debian package is somewhat oldie.. to sum up, I 
 never saw it working ^_^

 But if you uninstalled it and you restarted uwsgi (hard restart, better) 
 you should be able to get to your need to install guppy simple cache 
 page. Sure that you're restarting the uwsgi process (and not reloading it) ?



-- 

--- 
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: response.menu links alt attribute and target=blank

2013-04-15 Thread BlueShadow
Anthony you are always have fast and perfect answers. thanks for that.

On Monday, April 15, 2013 3:50:29 AM UTC+2, Anthony wrote:

 A menu item can be specified like this:

 ('Label', False, dict(_href=URL(...), _target='blank'))

 or this:

 ('', False, A('Label', _href=URL(...), _target='blank'))

 Note, in the second case, the third element can be any HTML helper object 
 (including nested helpers).

 Anthony

 On Sunday, April 14, 2013 6:09:56 PM UTC-4, BlueShadow wrote:

 Hi,
 I like to be able to set some link attributes in my response menu:
 I want some links to open in a new tab: target=blank
 and I would love to set some alt atributes for the links in the response 
 menu.
 Is that even possible?
 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] @cache expire and load again at specific daytimes

2013-04-14 Thread BlueShadow
Hi, 
I'm loving the @cache decorator like this one.
@cache(key, time_expire=100, cache_model=cache.disk)
Now I have a very specific problem. I want to display some results of a 
testing machine which gives out huge amounts of data. 1MB CSV. which is 
after dropping the useless data still 200kB of data.
The Old data has to be used to. So right now I got 21MB of database which 
needs to be parsed.
Those test results come via email to my w2p app. which works great. The 
results come in every day at midnight.
So I thought it would be ideal to cache the output.
At Midnight there is no server load so it would be perfect to do all the 
work right after the data comes in cache it and store it until the next 
chunk of data comes in.
So is there a way to load the funktion from w2p lets say every day at 00:05 
cache the data for 24 hours.

-- 

--- 
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: Is there a way to cache images from download function?

2013-04-14 Thread BlueShadow
So I changed my function to this:

#7days
@cache.client(time_expire=604800, quick='SVL')
def fast_download():
   session.forget(response)
   # very basic security (only allow fast_download on 
your_table.upload_field):
   if not request.args(0).startswith(db.Images):
   return download()
   # remove/add headers that prevent/favors client-side caching
   #del response.headers['Cache-Control']
   #del response.headers['Pragma']
   #del response.headers['Expires']
   filename = os.path.join(request.folder,'uploads',request.args(0))
   #response.headers['Last-Modified'] = time.strftime(%a, %d %b %Y 
%H:%M:%S +, time.localtime(os.path.getmtime(filename)))
   return response.stream(open(filename,'rb'))


developers.google.com/speed/pagespeed/
still says I should enable caching for those pictures.
any idea why its not working?

-- 

--- 
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: @cache expire and load again at specific daytimes

2013-04-14 Thread BlueShadow
It is always 24 hours so 3600*24 is 86400s that was the easy part. 
@cache(request.env.path_info,time_expire=86400,cache_model=cache.disk) 
adding this decorator to the function isn't that difficult either.

The thing I wan't is to have something which loads the page at 00:05 every 
day. for all eternity.
So that the first user which opens the page gets the cached page. and 
doesn't have to wait that long.



On Sunday, April 14, 2013 2:07:48 PM UTC+2, Niphlod wrote:

 use a function to inspect request.now and calculate how many seconds you 
 want the data to be stored.then pass that value to the time_expire 
 parameter.

 On Sunday, April 14, 2013 12:35:59 PM UTC+2, BlueShadow wrote:

 Hi, 
 I'm loving the @cache decorator like this one.
 @cache(key, time_expire=100, cache_model=cache.disk)
 Now I have a very specific problem. I want to display some results of a 
 testing machine which gives out huge amounts of data. 1MB CSV. which is 
 after dropping the useless data still 200kB of data.
 The Old data has to be used to. So right now I got 21MB of database which 
 needs to be parsed.
 Those test results come via email to my w2p app. which works great. The 
 results come in every day at midnight.
 So I thought it would be ideal to cache the output.
 At Midnight there is no server load so it would be perfect to do all the 
 work right after the data comes in cache it and store it until the next 
 chunk of data comes in.
 So is there a way to load the funktion from w2p lets say every day at 
 00:05 cache the data for 24 hours.



-- 

--- 
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: @cache expire and load again at specific daytimes

2013-04-14 Thread BlueShadow
thats not what I wan't.
I don't want the user to load the page and wait for it at all. (because 
eventually it will take half an hour)

I want that web2py is the first user who loads it every day. So that when I 
access the site lets say at seven o klock the side is already cached.

On Sunday, April 14, 2013 2:49:21 PM UTC+2, Niphlod wrote:

 it's 24 hours every day. the point is that you need to cache it for 86400 
 seconds only if it's 00:05 in the morning.
 if it's 00:10, you have to substract 300 seconds from 86400, and so on.

 On Sunday, April 14, 2013 2:46:16 PM UTC+2, BlueShadow wrote:

 It is always 24 hours so 3600*24 is 86400s that was the easy part. 
 @cache(request.env.path_info,time_expire=86400,cache_model=cache.disk) 
 adding this decorator to the function isn't that difficult either.

 The thing I wan't is to have something which loads the page at 00:05 
 every day. for all eternity.
 So that the first user which opens the page gets the cached page. and 
 doesn't have to wait that long.



 On Sunday, April 14, 2013 2:07:48 PM UTC+2, Niphlod wrote:

 use a function to inspect request.now and calculate how many seconds you 
 want the data to be stored.then pass that value to the time_expire 
 parameter.

 On Sunday, April 14, 2013 12:35:59 PM UTC+2, BlueShadow wrote:

 Hi, 
 I'm loving the @cache decorator like this one.
 @cache(key, time_expire=100, cache_model=cache.disk)
 Now I have a very specific problem. I want to display some results of a 
 testing machine which gives out huge amounts of data. 1MB CSV. which is 
 after dropping the useless data still 200kB of data.
 The Old data has to be used to. So right now I got 21MB of database 
 which needs to be parsed.
 Those test results come via email to my w2p app. which works great. The 
 results come in every day at midnight.
 So I thought it would be ideal to cache the output.
 At Midnight there is no server load so it would be perfect to do all 
 the work right after the data comes in cache it and store it until the 
 next 
 chunk of data comes in.
 So is there a way to load the funktion from w2p lets say every day at 
 00:05 cache the data for 24 hours.



-- 

--- 
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: Is there a way to cache images from download function?

2013-04-14 Thread BlueShadow
It works like a charm. I used the stream function and that works too.
#7days
def fast_download():
   session.forget(response)
   cache.client(time_expire=604800)(lambda: 0)()
   # very basic security (only allow fast_download on 
your_table.upload_field):
   if not request.args(0).startswith(db.Images):
   return download()
   filename = os.path.join(request.folder,'uploads',request.args(0))
   return response.stream(open(filename,'rb'))

thanks Niphlod you are awesome.

On Sunday, April 14, 2013 3:21:18 PM UTC+2, Niphlod wrote:

 ok. So, basically the problem is that response.stream is a special kind 
 of function.
 It raises HTTP(200, content_of_the_file) instead of returning it, and 
 raising an HTTP(200) is a smart way to do it.
 Unfortunately, this means that
 def download():
   return response.stream()

 basically doesn't return from download, it raises an exception inside 
 response.stream and the execution is cutted of right in the response.stream 
 function.

 A decorator outside download() doesn't work, because it doesn't have the 
 chance to execute that function completely.
 Now, on the bright side, the download() function should be the only one 
 behaving in this way, so the cache.client implementation shouldn't change.

 I'll see if we can use a public function just to adjust headers 
 beforehand without requiring for the actual function.
 For the time being, this works ok.

  def download():
 cache.client(time_expire=604800, quick='SVL')(lambda: 0)()
 
 allows downloading of uploaded files
 http:///[app]/default/download/[filename]
 
 return response.download(request, db)

 basically because cache.client is coded to be a decorator, you have to 
 pass it a function.
 In this case, a dummy lambda:0 is passed. To fire the actual 
 calculations of the cache decorator, you have to call it (and that's why 
 there's an empty () at the end). The headers are then manipulated in the 
 current response, so response.download pick it up where headers are already 
 set, and when it returns the image, the headers are shipped with the 
 response.

 If you have any doubts, please ask.



-- 

--- 
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] response.menu links alt attribute and target=blank

2013-04-14 Thread BlueShadow
Hi,
I like to be able to set some link attributes in my response menu:
I want some links to open in a new tab: target=blank
and I would love to set some alt atributes for the links in the response 
menu.
Is that even possible?
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: performance issue time to first byte

2013-04-14 Thread BlueShadow


thanks to the awesome help of Ricardo Pedroso my performance increased by a 
factor of 100 (at least).

Well what were the problems:

first of all my vserver cpu is very slow. (600MHz 1 Core) Which is just 
rediculous in those times my mobile phone has a faster processor.

apache-modwsgi-web2py is pretty processor intensive especially if you ad a 
mod_pagespeed.

 

what did we do (decending order of performance increase):

we enabled a lot of caching, 

removed code from models to modules

splitted controlers (from over 20 funktions to less than 7 each)

compiled application

used html instead of python helper functions

 

The last thing we did was switching from apache to nginx: which is just 
awesome:

just to show the diffrence I list some of our test results:

after optimization in apache:

apache bench:

ab -n 100 -c 2 domain.com

This is ApacheBench, Version 2.3

...
Server Software: Apache/2.2.22

Document Path: /
Document Length: 27429 bytes

Concurrency Level: 2
Time taken for tests: 17.198 seconds
Complete requests: 100
...

Requests per second: 5.81 [#/sec] (mean)
Time per request: 343.961 [ms] (mean)
Time per request: 171.981 [ms] (mean, across all concurrent requests)
Transfer rate: 158.22 [Kbytes/sec] received

Connection Times (ms)
minmean[+/-sd] 
median 
max
Connect: 0 00.0  0 0
Processing:138 343 81.8   332639
Waiting:   138 341 82.3   328 638
Total:138 343 81.8   332 639

Percentage of the requests served within a certain time (ms)
50% 332
66% 358
75% 365
80% 396
90% 456
95% 493
98% 634
99% 639
100% 639 (longest request)

 

with nginx(and yes the size is smaller because I compressed the pngs)

 

ab -n 100 -c 2 domain.com

...

Server Software:nginx/1.1.19

...

Document Length:25420 bytes

 

Concurrency Level:  2

Time taken for tests:   10.821 seconds

Complete requests:  100

...

Requests per second:9.24 [#/sec] (mean)

Time per request:   216.427 [ms] (mean)

Time per request:   108.214 [ms] (mean, across all concurrent requests)

Transfer rate:  233.14 [Kbytes/sec] received

 

Connection Times (ms)

   minmean[+/-sd] 
median   max

Connect: 0 0 0.0  0
  0

Processing:25   215 42.9   207   387

Waiting:   25   214 42.6   207   387

Total:25   215 42.9   207   
387

 

Percentage of the requests served within a certain time (ms)

  50%207

  66%210

  75%217

  80%265

  90%272

  95%278

  98%286

  99%387

 100%387 (longest request)

 

webpagetest.org gives now results which are not that good but I suspect 
that it depends on their server cpu utilization a lot. and after I tried 
some other pages which I knew where good before I come to the conclusion 
that this site isn't reliable at all at the moment.

loadimpact.com tells me that the server can handle 100 users at the same 
time before the server starts to fail. So a pretty good improvement. 
unfurtuanatly I don't have results from before from loadimpact.

 

I hope it helps some people which are looking for more performance 
especially with slow cpus
















-- 

--- 
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: performance issue time to first byte

2013-04-10 Thread BlueShadow


https://lh4.googleusercontent.com/-I0kLdrEwQsY/UWVTmumUkSI/AAM/k5r4M6UFcwI/s1600/Waterfalldiagramm.png
I played a little with mod_pagespeed which decreases everything but the 
ttfb.
Here is my waterfall diagram:
it doesn't look like a waterfall at all more like a drippling creek :(
any suggestions how I can get rid of most of those green bars?

-- 

--- 
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] performance issue time to first byte

2013-04-10 Thread BlueShadow
Thanks Ricardo for that idea with curl. I did that 5 times the ttfb is 
almost the total time. the total time having 0 to 1 ms more than the ttfb. 
the average time is 201 ms which seems to me pretty big considering its a 
localhost request.
when I did that test application(welcome app) I got an average about 80 ms 
which seems pretty slow too (localhost no db requests...).
when I do the test with webpagetest I get around 300 ms for the TTFB, for 
each file the green bar(ttfb for that file is ~160 ms

-- 

--- 
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] performance issue time to first byte

2013-04-10 Thread BlueShadow
migrations are false and lazy tables are true.
I tried to do something with cache.ram (for another app) which had no 
effekt at all perfhaps I did it wrong.
consider moving code to (imported) modules #I started on it when I realised 
I was using request.folder in my sitemap funktion which I currently have in 
a module (which isn't that smart I know thats one of the first things I 
will change)

I don't know how to deal with those two points:
5. Add session.forget for methods which don't use the session object. #when 
I dont use session.something I can add the session.forget to the beginning 
of the controler?
6. Enable connection pooling depending on the database. #no idea what to do 
here


haven't tried any of those:
compile the app #haven't tried
controller-specific models #I only use two controlers
database indexes #don't know what it is



On Wednesday, April 10, 2013 5:30:10 PM UTC+2, BlueShadow wrote:

 Thanks Ricardo for that idea with curl. I did that 5 times the ttfb is 
 almost the total time. the total time having 0 to 1 ms more than the ttfb. 
 the average time is 201 ms which seems to me pretty big considering its a 
 localhost request.
 when I did that test application(welcome app) I got an average about 80 ms 
 which seems pretty slow too (localhost no db requests...).
 when I do the test with webpagetest I get around 300 ms for the TTFB, for 
 each file the green bar(ttfb for that file is ~160 ms


-- 

--- 
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] performance issue time to first byte

2013-04-10 Thread BlueShadow


  thanks for all the suggestions I'm trying to work at one after the other:
kompiling it made it a lot worse: 
http://www.webpagetest.org/result/130410_9P_14QQ/
the results now vary a lot from a total of 4 secs to over 11 secs.

-- 

--- 
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] performance issue time to first byte

2013-04-10 Thread BlueShadow
the images are cached with Expire header (access + 1 month) which works 
quite well.

On Wednesday, April 10, 2013 9:39:14 PM UTC+2, Jonathan Lundell wrote:

 On 10 Apr 2013, at 12:34 PM, Anthony abas...@gmail.com javascript: 
 wrote:

 In your homepage you are serving 10 images, at least, in fast_download 
 controller, here it's safe

 to put session.forget() if not already. It will allow concurrent request 
 from the same browser.


 Good point. If those images are being served dynamically from a controller 
 because they were uploaded (as opposed to being static assets), then the 
 session file locking will cause each request to be handled serially (only a 
 problem if using file based sessions -- no locking for db or cookie based 
 sessions). In that case, you can add session.forget(response) to the 
 download function (be sure to pass in response, otherwise, it won't 
 actually unlock the file and will be no help). This is not necessary with 
 static files, as they are served before the session is connected or the app 
 code is executed.


 Also (with dynamically served images), if the images are cacheable by the 
 browser, you probably need to set the appropriate cache headers on the 
 response.


-- 

--- 
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] performance issue time to first byte

2013-04-10 Thread BlueShadow
yeah I found it. right now pretty much everything is strange to me. but I 
continue to work on it.


On Wednesday, April 10, 2013 11:39:58 PM UTC+2, LightDot wrote:

 Well, this is completely unexpected. I really can't think of what would 
 cause the compiled code to run slower than the uncompiled one. Intriguing!!

 Anyway, you probably used the admin to compile the app? There is a menu 
 entry Remove Compiled there, same place as the Compile was.


 On Wednesday, April 10, 2013 9:39:55 PM UTC+2, BlueShadow wrote:

  thanks for all the suggestions I'm trying to work at one after the 
 other:
 kompiling it made it a lot worse: 
 http://www.webpagetest.org/result/130410_9P_14QQ/
 the results now vary a lot from a total of 4 secs to over 11 secs. how do 
 I undo the compile. or what did I do wrong?



-- 

--- 
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] performance issue time to first byte

2013-04-10 Thread BlueShadow
about that time is my aim.

On Wednesday, April 10, 2013 11:55:36 PM UTC+2, LightDot wrote:

 I tested a couple of my sites, to get some feel as to what to expect. TTFB 
 from the first run, tested across half of Europe:

 1st site: 57ms to 74ms
 2nd site: 57ms to 202ms

 First one is a corporate style web page, the second one has a lot of 
 content, thumbnails, etc. Both using apache + mod_wsgi in daemon mode, 
 postgresql, compiled, cache, etc. etc.

 On Wednesday, April 10, 2013 11:17:39 PM UTC+2, Niphlod wrote:

 let us know what you find : I just tested my production site and 
 (although it runs with uwsgi+nginx and is behind SSL) the max time of TTFB 
 don't go over 150ms.

 On Wednesday, April 10, 2013 11:14:24 PM UTC+2, Ricardo Pedroso wrote:

 On Wed, Apr 10, 2013 at 8:39 PM, BlueShadow kevin@gmail.com 
 wrote: 
  thanks for all the suggestions I'm trying to work at one after the 
 other: 
  kompiling it made it a lot worse: 
  http://www.webpagetest.org/result/130410_9P_14QQ/ 
  the results now vary a lot from a total of 4 secs to over 11 secs. 

 Very weird... I never saw this happened. 

 If you want I'm willing to try to give you a help on this, just send 
 me an email off-list. 
 Optimizations are a subject that I like. 


 Ricardo 



-- 

--- 
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] Add Expire headers ga.js

2013-04-09 Thread BlueShadow
Hi,
I was wondering if you can set Expire headers to external files like the 
google analytics javascript file (ga.js)


-- 

--- 
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] performance issue time to first byte

2013-04-09 Thread BlueShadow
Hi I'm trying to improve my pageloadtimes. And so far I'm doing pretty 
good. I decreased the number of quests by merging some css files and some 
javascript. I added expire headers to pretty much every file I serve. But 
the most time it takes to load a page is the time to first byte.
I checked my site with webpagetest.org it takes 0.747s for the first byte. 
and quite a few requests take 500 ms or more before the first byte flows. 
Is there any way to find out why its taking so long? And a way to improve 
tose numbers.
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.




  1   2   3   >