[web2py] Earn $1000-$2500 per month
Earn $1000-$2500 per month If you Register your name You Get Sign-up bonus $5 AND Get $.20 cent for each referral. Further details http://www.earnbyforex.com/index.php?id=35678365
[web2py] Re: vps - memory problems
The problem of memory usage that you experience has nothing to do with the fact that code is executed at every request.Other users here do not experience the problem. In any case... Python is a language that does not provide garbage collection. It provides reference counting. This is a major limitation of the language. It fails to detect certain types of circular references. web2py has code to catch them by calling the garbage collection explicitly every 100 requests. Note every request because it would cause a slow down. Anyway, let's try to get to the bottom of this and isolate the problem. What OS? What Python version? what web2py version? what code? Massimo On Jun 3, 10:53 pm, Carlos carlosgali...@gmail.com wrote: Thanks for all the recommendations. But it still worries me that web2py (or uwsgi) does not automatically (a) cache/reuse unmodified code and (b) release memory after requests are served (or while idle), after each web request, and regardless of how small or big models actually are. Carlos
[web2py] webfaction: Internal Server Error after upgrade to 1.96.2
Hi, my site have an internal server error after upgrade to 1.96.2 Webfaction support say: Your app is trying to wrote to /dev/urandom which it will never be able to do: [pepearaya@web136 apache2]$ tail /home/pepearaya/logs/user/error_crewcatalyst.log [Sat Jun 04 01:34:25 2011] [error] [client 127.0.0.1] from globals import current [Sat Jun 04 01:34:25 2011] [error] [client 127.0.0.1] File /home/pepearaya/webapps/crewcatalyst/web2py/gluon/globals.py, line 21, in module [Sat Jun 04 01:34:25 2011] [error] [client 127.0.0.1] from html import xmlescape, TABLE, TR, PRE [Sat Jun 04 01:34:25 2011] [error] [client 127.0.0.1] File /home/pepearaya/webapps/crewcatalyst/web2py/gluon/html.py, line 29, in module [Sat Jun 04 01:34:25 2011] [error] [client 127.0.0.1] from utils import web2py_uuid, hmac_hash [Sat Jun 04 01:34:25 2011] [error] [client 127.0.0.1] File /home/pepearaya/webapps/crewcatalyst/web2py/gluon/utils.py, line 98, in module [Sat Jun 04 01:34:25 2011] [error] [client 127.0.0.1] ctokens = initialize_urandom() [Sat Jun 04 01:34:25 2011] [error] [client 127.0.0.1] File /home/pepearaya/webapps/crewcatalyst/web2py/gluon/utils.py, line 90, in initialize_urandom [Sat Jun 04 01:34:25 2011] [error] [client 127.0.0.1] open('/dev/urandom','wb').write(''.join(chr(t) for t in ctokens)) [Sat Jun 04 01:34:25 2011] [error] [client 127.0.0.1] IOError: [Errno 13] Permission denied: '/dev/urandom' *So, you need to change that line to: open('/dev/urandom','r').write(''.join(chr(t) for t in ctokens))* * * after that change I get this error: open('/dev/urandom','r').write(''.join(chr(t) for t in ctokens)) [Sat Jun 04 02:12:33 2011] [error] [client 127.0.0.1] IOError: [Errno 9] Bad file descriptor any idea of what i can to do? thanks!
[web2py] Re: webfaction: Internal Server Error after upgrade to 1.96.2
Reply 2: open('/dev/urandom','r').write(''.join(chr(t) for t in ctokens)) In this line, you are attempting to open /dev/urandom for reading, and then are attempting to write to it. Instead, you need to read the data from /dev/urandom, and then open a new file for writing to write your output. Hope that helps! __ what can i do?
[web2py] Re: vps - memory problems
On Jun 4, 5:18 am, Bruno Rocha rochacbr...@gmail.com wrote: - Do not stay with sqlite in production f.y.i. I have a site running with sqlite in production, but I get away with it by caching every single (select) query on a 60s span. I wouldn't recommend it for all scenarios, but this site is read-heavy and low in traffic, and sqlite is working well for us so far here.
[web2py] Re: webfaction: Internal Server Error after upgrade to 1.96.2
I am releasing 1.96.3 in a minute to fix this. Massimo On Jun 4, 3:09 am, Pepe Araya pepea...@gmail.com wrote: Reply 2: open('/dev/urandom','r').write(''.join(chr(t) for t in ctokens)) In this line, you are attempting to open /dev/urandom for reading, and then are attempting to write to it. Instead, you need to read the data from /dev/urandom, and then open a new file for writing to write your output. Hope that helps! __ what can i do?
[web2py] 1.96.3 is OUT
Just one minor change to deal with an error for system where users do not have permission to write to /dev/urandom (typically on shared hosts).
[web2py] Re: webfaction: Internal Server Error after upgrade to 1.96.2
On my Ubuntu 10.04 system /dev/urandom has mode 666 which means read and write for everyone. If it is not writeable on Webfaction for others then it is either a policy for a different Linux distribution or a policy of Webfaction. The idea behind writing to /dev/urandom is to seed the random number generator so the output read from the generator is less likely to be guessed which increases security.
Re: Re : Re: Re : Re: Re : Re: [web2py] Re: Email invitation
Can somebody please help me ? I would really want this to work. I customized db.auth_user, as described in the book, to add a 'token' field. I just added : Field('token', writable=False, readable=False, default=''). Then, in the controllers, I modified default.py : def user(): db.auth_user.insert(token=request.args(1)) return dict(form=auth()) Then in the models, I modified db.py : def my_auth_processing(form): if db(db.auth_user.token!='') (db.invitation.token==db.auth_user.token): return True else : return False auth.settings.register_onvalidation.append(lambda form: my_auth_processing(form)) But unfortunately no one is prevented from registering... So this does not work. Dwayne On 2 juin, 02:31, pbreit pbreitenb...@gmail.com wrote: Oops. For registration, you use this:http://web2py.com/book/default/chapter/08?search=register_onvalidation
[web2py] Re: webfaction: Internal Server Error after upgrade to 1.96.2
To add some more, on Ubuntu and according to man urandom all major Linux distributions since 2000 the file /etc/init.d/urandom saves the random number pool into a seed file and restores it on startup by writing it back to /dev/urandom.
Re: [web2py] Re: vps - memory problems
Do not stay with sqlite in production I don't agree http://www.sqlite.org/whentouse.html SQLite usually will work great as the database engine for low to medium traffic websites (which is to say, *99.9% of all websites*). The amount of web traffic that SQLite can handle depends, of course, on how heavily the website uses its database. Generally speaking, any site that gets fewer than 100K hits/day should work fine with SQLite. The 100K hits/day figure is a conservative estimate, not a hard upper bound. SQLite has been demonstrated to work with 10 times that amount of traffic first comment from http://stackoverflow.com/questions/54998/how-scalable-is-sqlite : As I mentioned in my first edit, database indexes dramatically reduce query time, but this is more of a general observation about databases than it is about SQLite. However, there is another trick you can use to speed up SQLite:transactionshttp://www.sqlite.org/lang_transaction.html . And we know that web2py puts every request in a transaction And great advices from another comment from the same page: If you want to speed things up with SQLite, do the following: - upgrade to SQLite 3.7.x - Enable write-ahead logginghttp://www.sqlite.org/draft/releaselog/3_7_0.html - Run the following pragma: PRAGMA cache_size = Number-of-pages; The default size (Number-of-pages) is 2000 pages, but if you raise that number, then you will raise the amount of data that is running straight out of memory.
Re: [web2py] 1.96.3 is OUT
On Jun 4, 2011, at 7:02 AM, Massimo Di Pierro wrote: Just one minor change to deal with an error for system where users do not have permission to write to /dev/urandom (typically on shared hosts). The change treats read-only urandom the same as non-existent urandom, for warning purposes. Is that the intent? Also, I wonder if it wouldn't be a good policy to unconditionally use local randomness (the seeded random) and mix in urandom randomness if available. That would help to guard against a bad urandom implementation that behaved (wrt read/write) normally.
[web2py] Re: Subdomain Duplicates Content
Are this changes in the new version? On May 28, 3:50 pm, Jonathan Lundell jlund...@pobox.com wrote: There's support for exclusive domain mapping enforcement in the trunk now. It'd be good if someone could try it out, because the unit tests I was able to come up with aren't all that close to a real-world environment. Just set exclusive_domain=True in the BASE router (for all domains) or an app router (for that apps's domain). You'll get a SyntaxError exception if you call URL() to generate a URL for a different app unless you explicitly provide a host= argument to URL. Or at least that's the intention. BTW, WRT the issue of search engines being confused by multiple URLs pointing to the same pages, you might want to investigate Google's canonical-host logic. It may not be helpful, in that it might deal only with complete domain duplication (egwww.domain.comand domain.com) rather than overlapping subsets of domains; I'm not sure.
Re: [web2py] Re: Subdomain Duplicates Content
On Jun 4, 2011, at 9:21 AM, Francisco Costa wrote: Are this changes in the new version? Yes. On May 28, 3:50 pm, Jonathan Lundell jlund...@pobox.com wrote: There's support for exclusive domain mapping enforcement in the trunk now. It'd be good if someone could try it out, because the unit tests I was able to come up with aren't all that close to a real-world environment. Just set exclusive_domain=True in the BASE router (for all domains) or an app router (for that apps's domain). You'll get a SyntaxError exception if you call URL() to generate a URL for a different app unless you explicitly provide a host= argument to URL. Or at least that's the intention. BTW, WRT the issue of search engines being confused by multiple URLs pointing to the same pages, you might want to investigate Google's canonical-host logic. It may not be helpful, in that it might deal only with complete domain duplication (egwww.domain.comand domain.com) rather than overlapping subsets of domains; I'm not sure.
Re: [web2py] Re: Subdomain Duplicates Content
for the record: to solve the problem with google robots you can set robot.txt to allow/deny other apps.
Re: [web2py] 1.96.3 is OUT
2011/6/4 Jonathan Lundell jlund...@pobox.com The change treats read-only urandom the same as non-existent urandom, for warning purposes. Is that the intent? Also, I wonder if it wouldn't be a good policy to unconditionally use local randomness (the seeded random) and mix in urandom randomness if available. That would help to guard against a bad urandom implementation that behaved (wrt read/write) normally. that seems to be a very good idea. with that, all who doesn't have access to /dev/urandom on host could use local urandom at least.
[web2py] Re: SQLite3 database and plugin wiki jqGrid
Also, the shell does not display the individual database rows. In previous versions of web2py I could use the shell command: db.auto_matrix[1] and the contents of the first database row would be displayed. Now nothing is displayed.. no response in the shell window.. Any ideas about what I am doing wrong? Thanks, Joe On Fri, Jun 3, 2011 at 11:58 PM, joseph simpson jjs0...@gmail.com wrote: I am running the latest version of web2py and starting to work with the plugin wiki. I have a simple data base with text, integers, boolean, and double values. Using plugin wiki and jqGrid the integers and double formatted items are displayed as None. See the attached screen shot. I also used SQLTABLE to display the data and received identical output. The data for the database is prepared using a python script and the DAL. The database contents are then exported to a csv file and imported into the current Web2py App. Any pointers on what may help to get the integers and doubles to display correctly. Thanks, Joe -- Joe Simpson Sent From My DROID!! -- Joe Simpson Sent From My DROID!!
[web2py] Re: webfaction: Internal Server Error after upgrade to 1.96.2
Thanks Massimo! I'll give a try
Re: [web2py] Re: GAE taskqueue with Web2py 1.95.1
ahh, yes i've been playing that game with my URL calls as well. i'll keep an eye out for places in my code that do the same. thanks! cfh
[web2py] App-generating wizard crashes
On 1.96.3 I tried the new app wizard for kicks. I let everything default except for the app name, foobar. Wizard crashed. Traceback (most recent call last): File N:\web2py\gluon\restricted.py, line 188, in restricted exec ccode in environment File N:/web2py/applications/admin/controllers/wizard.py, line 572, in module File N:\web2py\gluon\globals.py, line 96, in lambda self._caller = lambda f: f() File N:/web2py/applications/admin/controllers/wizard.py, line 200, in step6 create(form.vars) File N:/web2py/applications/admin/controllers/wizard.py, line 489, in create file=open(meta,'wb') IOError: [Errno 2] No such file or directory: 'N:\\web2py\\applications \\admin/..\\foobar\\wizard.metadata' Personally, I think this kind of wizard should not be packaged in with web2py at this early stage in web2py's career. I would question how many people would actually use it and whether it would be worth the effort to maintain. I'm not saying it isn't useful for newbies. I am saying that web2py newbies are probably early adopters and less likely to need or use such a wizard. Just my 2 cents.
Re: [web2py] Re: web2py 1.96.1 is OUT
2011/6/3 Alessandro Iob alessandro@gmail.com I have tried the new modules import feature (from mymodule import *, looks for mymodule in applications/thisapp/ modules first and then in sys.path. No more need for local_import) and it works wonderfully on OS/X but not at all on Windows. Below you can find the traceback. web2py™Version 1.96.2 (2011-06-03 16:11:39)PythonPython 2.5.4: C:\web2py\web2py.exe Traceback (most recent call last): File gluon/restricted.py, line 184, in restricted File C:/web2py/applications/castalia/controllers/default.py http://127.0.0.1:8000/admin/default/edit/castalia/controllers/default.py, line 2, in module File gluon/custom_import.py, line 280, in __call__ File gluon/custom_import.py, line 125, in __call__ ImportError: No module named selfgroup.castalia Any suggestion? Thank you Hello Alessandro, I wrote this code but I don't have Windows to do testing. I suspect it is a problem related to os.stat. Can you run this code on your machine and gave me the result? import os print os.stat(*path to the module you want to import*).st_mtime -- A+ - Pierre My blog and profile (http://pierrethibault.posterous.com)http://pierrethibault.posterous.com YouTube page (http://www.youtube.com/user/tubetib)http://www.youtube.com/user/tubetib Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2
Re: [web2py] 1.96.3 is OUT
I installed 1.96.3 on webfaction and doesn't run (zip downloaded directly from web 1 minute ago): [danto@web184 ~]$ python2.7 web2py/web2py.py Traceback (most recent call last): File web2py/web2py.py, line 16, in module import gluon.widget File /home/danto/web2py/gluon/__init__.py, line 15, in module from globals import current File /home/danto/web2py/gluon/globals.py, line 21, in module from html import xmlescape, TABLE, TR, PRE File /home/danto/web2py/gluon/html.py, line 29, in module from utils import web2py_uuid, hmac_hash File /home/danto/web2py/gluon/utils.py, line 98, in module ctokens = initialize_urandom() File /home/danto/web2py/gluon/utils.py, line 93, in initialize_urandom logging.warn( NameError: global name 'logging' is not defined 2011/6/4 danto web2py.n...@gmail.com 2011/6/4 Jonathan Lundell jlund...@pobox.com The change treats read-only urandom the same as non-existent urandom, for warning purposes. Is that the intent? Also, I wonder if it wouldn't be a good policy to unconditionally use local randomness (the seeded random) and mix in urandom randomness if available. That would help to guard against a bad urandom implementation that behaved (wrt read/write) normally. that seems to be a very good idea. with that, all who doesn't have access to /dev/urandom on host could use local urandom at least.
[web2py] Re: webfaction: Internal Server Error after upgrade to 1.96.2
Massimo, bad news :( it not work this is the log: [Sat Jun 04 17:41:31 2011] [error] [client 127.0.0.1] File /home/pepearaya/webapps/crewcatalyst/web2py/gluon/html.py, line 29, in module [Sat Jun 04 17:41:31 2011] [error] [client 127.0.0.1] from utils import web2py_uuid, hmac_hash [Sat Jun 04 17:41:31 2011] [error] [client 127.0.0.1] File /home/pepearaya/webapps/crewcatalyst/web2py/gluon/utils.py, line 98, in module [Sat Jun 04 17:41:31 2011] [error] [client 127.0.0.1] ctokens = initialize_urandom() [Sat Jun 04 17:41:31 2011] [error] [client 127.0.0.1] File /home/pepearaya/webapps/crewcatalyst/web2py/gluon/utils.py, line 90, in initialize_urandom [Sat Jun 04 17:41:31 2011] [error] [client 127.0.0.1] open('/dev/urandom','wb').write(''.join(chr(t) for t in ctokens)) [Sat Jun 04 17:41:31 2011] [error] [client 127.0.0.1] IOError: [Errno 13] Permission denied: '/dev/urandom'
[web2py] Field reference type and notnull parameter
Hello, I ran into small problem. When I define model: db.define_table('child', Field('parent', 'reference parent', notnull=False), ) The problem is that validation serves me an error eventhough no validators are attachted to parent and I explicitly provided notnull=False. It shouldnt check in database unless I express so in the validator this way it cannot realize the scenario to have parent or null ;] Regards, Marek
Re: [web2py] 1.96.3 is OUT
I have the same problem as i mentioned here: https://groups.google.com/d/topic/web2py/e2KcQDYcPD0/discussion
Re: Re : Re: Re : Re: Re : Re: [web2py] Re: Email invitation
I should be able to take a look later today. Been out of town.
[web2py] Re: vps - memory problems
Hi, I can finally point the specific part of my code where memory leaks: from gluon.tools import * w2p_recaptcha_xml = Recaptcha.xml def x_recaptcha_xml(self): return 'my own recaptcha xml' Recaptcha.xml = x_recaptcha_xml The above replaces Recaptcha's xml method wih my own. I know that in this specific case I can subclass Recaptcha and extend/override the xml method, but let's not discuss this for now. By doing it this way (direct replacement, instead of extend/override via subclass), everything works ok, except when I enable the yellow line (w2p_recaptcha_xml = Recaptcha.xml above). As soon as I enable this specific line (in yellow above) and restart uwsgi, memory just leaks after every single web request (much more noticeable when the models are very large in code), until the server stops responding due to very large memory consumption (after relatively few web requests). My question is why?, is it because w2p_recaptcha_xml retains the 'context' of everything and it just keeps adding and adding?, or how/why exactly does the above cause the memory leak?. I just want to understand the reasons. Thanks!, Carlos
Re: [web2py] 1.96.3 is OUT
2011/6/4 Pepe Araya pepea...@gmail.com I have the same problem as i mentioned here: https://groups.google.com/d/topic/web2py/e2KcQDYcPD0/discussion (still in webfaction) I installed a fresh copy (no upgrade) and at least I can access again to the scalfolding app but not to admin, now showing: admin disabled because unable to access password file
Re: [web2py] 1.96.3 is OUT
did you installed it with the webfaction's script?
Re: [web2py] 1.96.3 is OUT
2011/6/4 Pepe Araya pepea...@gmail.com did you installed it with the webfaction's script? they (webfaction) already installed web2py for me when I first sign on with their service. probably using their script. later I was upgrading from the web interface and then restarting apache from ssh without problem until I upgraded to 1.96.1 fom 1.95.1 recently I just tried logging in through ssh and doing same things I do local: wget web2py, python2.* web2py.py and so on. I tryied moving the web2py folder inside webapps to web2py-bkp and replacing it with a fresh web2py wgeted from web2py.com and as I said, cannot access the password file (the old install also said the same).
Re: [web2py] 1.96.3 is OUT
Do you have a parameters_###.py file in your web2py folder?
Re: [web2py] 1.96.3 is OUT
2011/6/4 pbreit pbreitenb...@gmail.com Do you have a parameters_###.py file in your web2py folder? the was not any parameter_.py file. still, I copied from the old folder and now I can see the login form to appadmin but my password doesn't work
Re: [web2py] 1.96.3 is OUT
If you have a new HMAC key, the old password file won't work. YOu could either copy over the old HMAC key into the new install or try generating a new password with python web2py.py -a 'your password' -i 127.0.0.1 -p 8000
Re: [web2py] 1.96.3 is OUT
In webfaction, I did a fresh install using their install script but i get this error: Traceback (most recent call last): File web2py.py, line 16, in module import gluon.widget File /home/pepearaya/webapps/crewcatalyst2/web2py/gluon/__init__.py, line 15, in module from globals import current File /home/pepearaya/webapps/crewcatalyst2/web2py/gluon/globals.py, line 21, in module from html import xmlescape, TABLE, TR, PRE File /home/pepearaya/webapps/crewcatalyst2/web2py/gluon/html.py, line 29, in module from utils import web2py_uuid, hmac_hash File /home/pepearaya/webapps/crewcatalyst2/web2py/gluon/utils.py, line 98, in module ctokens = initialize_urandom() File /home/pepearaya/webapps/crewcatalyst2/web2py/gluon/utils.py, line 93, in initialize_urandom logging.warn( NameError: global name 'logging' is not defined any idea of what I can to do?? thanks a lot!
Re: [web2py] 1.96.3 is OUT
On Jun 4, 2011, at 7:35 PM, Pepe Araya wrote: In webfaction, I did a fresh install using their install script but i get this error: Traceback (most recent call last): File web2py.py, line 16, in module import gluon.widget File /home/pepearaya/webapps/crewcatalyst2/web2py/gluon/__init__.py, line 15, in module from globals import current File /home/pepearaya/webapps/crewcatalyst2/web2py/gluon/globals.py, line 21, in module from html import xmlescape, TABLE, TR, PRE File /home/pepearaya/webapps/crewcatalyst2/web2py/gluon/html.py, line 29, in module from utils import web2py_uuid, hmac_hash File /home/pepearaya/webapps/crewcatalyst2/web2py/gluon/utils.py, line 98, in module ctokens = initialize_urandom() File /home/pepearaya/webapps/crewcatalyst2/web2py/gluon/utils.py, line 93, in initialize_urandom logging.warn( NameError: global name 'logging' is not defined any idea of what I can to do?? For now, import logging. This should be changed to use logging the way the rest of web2py does, though. See compileapp.py for a generic example using the 'web2py' logger. thanks a lot!
Re: [web2py] 1.96.3 is OUT
now it works ok! thanks!!