[web2py] Scaling + performance tips to prepare for launch

2013-05-21 Thread smogzer
Hi folks,

I'm about to launch my site (http://nizen.net) and before launching i would
like some scaling tips.

Right now i've done the following:
- using cloudflare for CDN.
- compiled web2py .py - .pyc
- in 0.py session.forget(response)
- settings.migrate = False

I'm using openshift also. If i try to reach the big sites (engadget,
reddit, etc) i fear it may get the site broken.

Any (other) tips ?

-- 

--- 
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] Hey Massimo, how do you market and watch for web2py news, and other metrics and tricks.

2013-05-20 Thread smogzer
Hi Massimo,

I'm launching a business and i need some launching + metrics lessons. I've
followed you in reddit and Hacker news and i found you're are everywhere,
monitoring and defending web2py. The ptional questions about that
omnipresence are:

1) how do you market
2) and watch for web2py news, event everywhere
3) and other metrics and tricks.

-- 

--- 
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] In openshift: Need help on why my web2py website is being constantly accessed by openshift itself

2013-05-08 Thread smogzer
Hi folks,

So in openshift in a python 2.6 cartridge + haproxy i'm having lots of
accesses from openshift ip itself, like one every 3 seconds. I do not have
any cron jobs. Is there a way to figure where these access are coming from
: wsgi, web2py, openshift ?

-- 

--- 
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] Can somebody hack a user tracker and download counter for us ?

2013-04-16 Thread smogzer
I was wondering if somebody could hack a web2py slice that wraps the
A(_href) and adds the clicks to a db, also for downloads, for each session
it could track the user actions and create a behavior/path from it.

It would be great for everybody.

This slice could be a nice base
http://www.web2pyslices.com/slice/show/1358/a-simple-page-statistics-model

-- 

--- 
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 submit SQLFORM :/

2013-03-26 Thread smogzer
Hi Folks,

So I cannot submit SQLFORM, even the simpler ones like the following. I
always get the else: that says please fill the form
I checked and it seems the code is alright and i can submit forms and add
content using the badmin plugin, so i'm kind of lost here.

And another question, how can we pre-populate the upload field with
request.vars ?

in models.py

db.define_table('t_asd',
Field('id','id'),
Field('f_app',type='string', default='abc',label=T('Parent
App'),comment=T('The application or addon that will load this.'))
)

in controller.py

@auth.requires_login()
def register_addon3():
form = SQLFORM(db.t_asd)
if form.process().accepted:
print(Addon added, waiting for moderator approval to show on the
addon store.)
response.flash = 'Addon added, waiting for moderator approval to
show on the addon store.'
elif form.errors:
print(form has errors.)
response.flash = 'form has errors'
else:
print(please fill the form.)
response.flash = 'please fill the form'
return dict(form=form)

-- 

--- 
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] Just knew about Server-Sent Events and want to share it with you

2012-09-09 Thread smogzer
Stream Updates with Server-Sent Events:

Are like websockets but unidirectional, from the server to the client.
Most modern browsers support it.

It can be combined with XmlHttpRequest / ajax if the client needs to
send events to the server, i.e. emulate websockets.

From https://github.com/rwldrn/jquery.eventsource:
Q. why use EventSource rather than Websockets?
A. EventSource is easier to setup on server (uses http), lighter and
most of the times - that's what you acually need. (via temp01)

Other resources:

Discussions:
http://www.html5rocks.com/en/tutorials/eventsource/basics/
http://www.prodigyproductionsllc.com/articles/programming/javascript/avoid-using-eventsource-server-sent-events/

A JS library: https://github.com/Yaffle/EventSource
Implemetation on python2/3: https://github.com/niwibe/sse.git
DJango implementation: https://github.com/niwibe/django-sse.git

-- 





[web2py] Dotcloud now with support for websockets is += 1 service ?

2012-03-27 Thread smogzer
Hi folks,

I recently read about websockets and saw a video by Bruno Rocha showing the
use of comet and web2py and it seems like a technology with lots
of potential.
What i would like to know is that if it is possible to replace comet with
some server side service provided by dotcloud, so that web2py +
postgres/mongo + websockets == 2 services instead of 3, and therefore keep
prototyping apps right there on the free dotcloud account.

http://techcrunch.com/2012/03/27/open-paas-dotcloud-adds-support-for-websockets-vertical-scaling-and-more/

http://blog.dotcloud.com

Thanks in advance.


[web2py] accessing to static folder via .load is broken

2012-03-07 Thread smogzer
Hello all,

So i was trying my local site and i saw some broken images that are loaded
via the following code
img src={{=URL(r=request,c='static',f='images/product.png')}} alt=bb
width=296 height=400 /
This is inside a .load file that loads inside a DIV.

and produces the following URL which does not exist:
http://192.168.0.106/init/static/images.load/product.png

The .load suffix should not be there, unless the /static directory is
no longer an exception controller.

This used to work fine like one month ago, some patch must have broken it.

Could anybody fix that error or explain what if there is a new convention
for static files.

Thanks in advance.


[web2py] 20 beautiful resources that complement twitter bootstrap

2012-03-02 Thread smogzer
Hey dewds forging web2py 2.0 have a look at these gorgeous:

http://www.webresourcesdepot.com/20-beautiful-resources-that-complement-twitter-bootstrap/


[web2py] Re: In plugin_wiki meta-code tables i cannot upload data :(

2012-02-29 Thread smogzer
Guys,
could any of you at least try uploading stuff to a plugin-wiki meta-code
created database.
Just to tell me that it's just my configuration that's broken ( i tried
firefox and chromium linux ) or it's the plugin.

On Mon, Feb 27, 2012 at 12:20 AM, smogzer smog...@gmail.com wrote:

 I'm trying to create a meta-database that can be defined via meta-code and
 i've come to a bug : i can't upload data to fields in that database.
 Could anybody fix the problem ? here is a sample code for testing.

 http://127.0.0.1/apagar/plugin_wiki/page_edit/meta-code
 code:
 db.define_table('imagex',
 Field('id','id',represent=lambda id:SPAN(id,'
 ',A('edit',_href=URL('page',args='edit',vars=dict(table='imagex',rec=id),
 Field('name'),
 Field('type'),
 Field('picture', 'upload',requires=IS_IMAGE()),
 format = '%(name)s')

 for testing
 http://127.0.0.1/apagar/plugin_wiki/page/edit?table=imagexrec=1
 code:
 ``
 {{=plugin_wiki.widget('create',table='imagex')}}
 ``:template

 ``

 {{=plugin_wiki.widget('read',table=str(request.vars.table),record_id=str(request.vars.rec))}}
 ``:template

 ``

 {{=plugin_wiki.widget('update',table=str(request.vars.table),record_id=str(request.vars.rec))}}
 ``:template



[web2py] In plugin_wiki meta-code tables i cannot upload data :(

2012-02-26 Thread smogzer
I'm trying to create a meta-database that can be defined via meta-code and
i've come to a bug : i can't upload data to fields in that database.
Could anybody fix the problem ? here is a sample code for testing.

http://127.0.0.1/apagar/plugin_wiki/page_edit/meta-code
code:
db.define_table('imagex',
Field('id','id',represent=lambda id:SPAN(id,'
',A('edit',_href=URL('page',args='edit',vars=dict(table='imagex',rec=id),
Field('name'),
Field('type'),
Field('picture', 'upload',requires=IS_IMAGE()),
format = '%(name)s')

for testing
http://127.0.0.1/apagar/plugin_wiki/page/edit?table=imagexrec=1
code:
``
{{=plugin_wiki.widget('create',table='imagex')}}
``:template

``
{{=plugin_wiki.widget('read',table=str(request.vars.table),record_id=str(request.vars.rec))}}
``:template

``
{{=plugin_wiki.widget('update',table=str(request.vars.table),record_id=str(request.vars.rec))}}
``:template


[web2py] bare login using a sha1 or md5 signature instead of plain text pass

2012-02-14 Thread smogzer
I'm doing a C++ framework and i want to remotely login into web2py, for
simplification libcurl style.
Problem is that the bare login requires plain text or just base64 encoded
password transmission, in short it is vulnerable to a man in the middle
attack that may compromise the user passwords.

So what i want to achieve is to login into web2py in a method similar to
what pandora uses, that is something like:

l:  login
p: hash of (l+p)

What would be the patch required to allow this kind of login into web2py ?
I'm guessing adding an extra sha1 password Field in auth table, some
onPassword_creation onPassword_modification, and the registration events.


[web2py] how to download file from within a cid target

2012-01-17 Thread smogzer
I'm trying to generate a pdf with the bundled pdf generator (fypdf)
from withing a .load file that is loaded into a div.

Outside the cid div (i.e. extension .html)  the download works fine
but from within the .load, the contents get rendered into the cid
target, never downloading to the user.

How can i download a generated file from within a cid ?

print request.function+request.extension:,
request.function+.+request.extension

response.headers['Content-Type']='application/pdf'
#tmp_pdf = f.render('invoice.pdf', dest='S')
attachment = 'attachment;filename=invoice.pdf'
response.headers['Content-Disposition'] = attachment
response.extension ='pdf'
#response.cid =''
#response.ajax = False
content = f.render('invoice.pdf', dest='S')
return f.render('invoice.pdf', dest='S')#response.stream(content)

Another similar problem is blog headlines that are generated from a
feedburner javascript within a .load / cid and never render, while
they render perfectly outside (.html). Maybe these two problems are
linked.