[web2py] Re: web2py deployment: Apache, Nginx and Plesk Panel

2014-11-13 Thread LightDot
We've been running Plesk on our servers for more than a decade now but I'm afraid I don't have a ready-made & tested solution for Plesk and web2py. We're phasing Plesk out and a large part of our hosting infrastructure has been moved to a custom solution that's better suited for web2py too, amon

[web2py] crud edit

2014-11-13 Thread Alex Glaros
Crud edit form appears with correct args, but I don't see the original text that user is supposed to edit. If I type text into the form, it doesn't update the record. Anyone see anything wrong? HTML that calls the controller {{if auth.user_id == objectComment.created_by:}} {{=A("Edit me", _h

Re: [web2py] Re: upload a file with just a post request

2014-11-13 Thread António Ramos
Thank you I´ll do that! 2014-11-13 23:23 GMT+00:00 Niphlod : > BTW: take care to protect that function with some kind of restriction > (usually ip-based). If an attacker knows the endpoint it'll flood your app > with "fake" attachments as soon as he can :-P > > On Thursday, November 13, 2014 6:30

[web2py] Re: Sending email from server

2014-11-13 Thread Niphlod
well, to be nerdy. import telnetlib tn = telnetlib.Telnet(hostname, 25, 10) or (even better ?!) import socket s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.settimeout(2) try: s.connect((host, 25)) print 'i can reach it' except: print "can't reach it" On Wednesday

Re: [web2py] Re: upload a file with just a post request

2014-11-13 Thread Niphlod
BTW: take care to protect that function with some kind of restriction (usually ip-based). If an attacker knows the endpoint it'll flood your app with "fake" attachments as soon as he can :-P On Thursday, November 13, 2014 6:30:55 PM UTC+1, Ramos wrote: > > Very informative. > I´m more than satis

[web2py] Re: import app from one web2py server to another

2014-11-13 Thread Cliff Kachinske
Is there a modules/__init__.py ? On Monday, November 10, 2014 2:44:44 PM UTC-5, John Davis wrote: > > Hello > > I have an app written by someone which runs on our server. I have tried > to copy this app from one server to a new one which also runs web2py. I > use the admin site GUI for web2py

Re: [web2py] Re: Controller to do SOAP to an action-less service, how to generate the (xml) nodes

2014-11-13 Thread Dave S
On Thursday, November 13, 2014 9:49:41 AM UTC-8, Mariano Reingart wrote: > > On Wed, Nov 12, 2014 at 11:02 PM, Dave S > > wrote: > >> >> >> On Wednesday, November 12, 2014 4:58:53 PM UTC-8, Dave S wrote: >>> >>> >>> >>> On Friday, September 26, 2014 3:43:29 PM UTC-7, Dave S wrote:

[web2py] Re: Would appreciate a clarification on using redirect() from a component

2014-11-13 Thread Spokes
Got it. Thanks! On Thursday, November 13, 2014 2:07:08 PM UTC-5, Leonel Câmara wrote: > > Because when you don't specify, the URL function uses the extension of the > current request. More specifically URL does this: > > if extension is None and r.extension != 'html': > extension = r.

[web2py] Re: Would appreciate a clarification on using redirect() from a component

2014-11-13 Thread Leonel Câmara
Because when you don't specify, the URL function uses the extension of the current request. More specifically URL does this: if extension is None and r.extension != 'html': extension = r.extension Extension is None by default if you don't specify. However later URL also does this:

[web2py] Would appreciate a clarification on using redirect() from a component

2014-11-13 Thread Spokes
I have a view which contains a form that's within a LOAD component. The basic code for the component is something like this: def function1(): try: ... form = SQLFORM(db.my_table, row.id) ... if form.process().accepted: ... redirect(URL('contro

[web2py] Re: How to automatically send emails to users if they perform an action like sign up...

2014-11-13 Thread Leonel Câmara
Alex either set up your own smtp server or use a service like mailgun. -- 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 y

Re: [web2py] How to automatically send emails to users if they perform an action like sign up...

2014-11-13 Thread Alex Glaros
@Bruno, regarding "try to not use gmail for more than 500 recipients.", what other companies or ways are there to get past 500 recipients? thanks Alex Glaros -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://cod

Re: [web2py] Re: Controller to do SOAP to an action-less service, how to generate the (xml) nodes

2014-11-13 Thread Mariano Reingart
On Wed, Nov 12, 2014 at 11:02 PM, Dave S wrote: > > > On Wednesday, November 12, 2014 4:58:53 PM UTC-8, Dave S wrote: >> >> >> >> On Friday, September 26, 2014 3:43:29 PM UTC-7, Dave S wrote: >>> >>> >>> >>> On Friday, September 26, 2014 1:49:18 PM UTC-7, Mariano Reingart wrote: "Raw" c

Re: [web2py] Re: upload a file with just a post request

2014-11-13 Thread António Ramos
Very informative. I´m more than satisfied. Thank u António 2014-11-13 17:23 GMT+00:00 Leonel Câmara : > The cloud service is calling the controller putting the same vars in get > and post variables (no idea why they do that), so request.vars makes a list > of the values it gets for the same n

[web2py] Re: upload a file with just a post request

2014-11-13 Thread Leonel Câmara
The cloud service is calling the controller putting the same vars in get and post variables (no idea why they do that), so request.vars makes a list of the values it gets for the same name as request.vars has both get and post vars. -- Resources: - http://web2py.com - http://web2py.com/book (D

Re: [web2py] Re: upload a file with just a post request

2014-11-13 Thread António Ramos
no, with request.post_vars ido not get duplicates. is there a reason why ? Thank you António 2014-11-13 16:48 GMT+00:00 Leonel Câmara : > Instead of request.vars use request.post_vars, do you still have > duplication? > > -- > Resources: > - http://web2py.com > - http://web2py.com/book (Documen

[web2py] Re: upload a file with just a post request

2014-11-13 Thread Leonel Câmara
Instead of request.vars use request.post_vars, do you still have duplication? -- 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 b

Re: [web2py] Re: upload a file with just a post request

2014-11-13 Thread António Ramos
For the record i´m using web2py 2.9.5 Another problem i have is that the params that i send from the cloud service are received in duplicate inside an array. They told me that the issue must be an web2py issue. See below my request vars output nr and flag are an array of duplicate values. In m

Re: [web2py] Upload path broken since 2.9.11 update

2014-11-13 Thread Louis Amon
I really don’t have any time to setup my environment for proper testing & git contributions. I still consider myself to be a novice and I’m the only dev in my startup right now… But I do intend to contribute to the framework in a few weeks’ time, when my startup will have raised funds :) Le 1

[web2py] Re: Grid links in component do not open in new window properly

2014-11-13 Thread Leonel Câmara
Actually, Anthony's suggestion is better, I clearly shouldn't be here without my dosage of coffee, 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) --

[web2py] Re: Upload path broken since 2.9.11 update

2014-11-13 Thread Leonel Câmara
Why don't you make a pull request so you don't have to remember this in your next update? -- 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 t

[web2py] Re: Another import problem

2014-11-13 Thread Leonel Câmara
Create an empty file called __init__.py in your modules folder and restart web2py. -- 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 mess

Re: [web2py] Upload path broken since 2.9.11 update

2014-11-13 Thread Louis Amon
Hi Anthony, I was using 2.9.5 before the upgrade. In the end, I found that it may be that the part of the code than handles uploads through a filesystem never did work with the « uploadfolder » attribute (i.e. it might have been a patch I made a few months ago and lost in the process of the up

[web2py] Re: Grid links in component do not open in new window properly

2014-11-13 Thread Anthony
A simpler option might be to check whether the request is being made via Ajax, and conditionally change the view: def inner(): response.view = 'default/inner.load' if request.ajax else 'default/inner.html' grid = SQLFORM.grid(db.item) return locals() In that case, the .html view

[web2py] Re: Upload path broken since 2.9.11 update

2014-11-13 Thread Anthony
Which version of web2py were you using prior to the upgrade? On Thursday, November 13, 2014 4:04:19 AM UTC-5, Louis Amon wrote: > > Hi, > > My website has been using web2py for a few months now, and we handle > pictures using Amazon S3 and Cloudfront for storage and distribution. > > The correspo

[web2py] Another import problem

2014-11-13 Thread Johann Spies
146.232.116.99.2014-11-13.15-21-45.36862f70-ab08-4cd3-a245-001025b8e4ac No module named sakb.modules.pretty Version web2py™ Version 2.9.11-stable+timestamp.2014.09.15.23.35.11 Python Python 2.7.3: /usr/bin/python (prefix: /usr) Traceback 1. 2. 3. 4. 5. 6. 7. 8. 9. Traceback (most recent call l

[web2py] Ubuntu, Nginx, Web2py - how to deploy Awstats on server?

2014-11-13 Thread lyn2py
Hi guys, I just looked up how to do it, but because web2py uses special Nginx configurations, I'd like to ask if anyone installed Awstats on the Ubuntu, Nginx, WSGI configuration, and how did you do it? This is the closest I can find regarding installing Awstats but I'm stumped at the access.lo

[web2py] Re: send mail error

2014-11-13 Thread Leonel Câmara
Well yes, that was just an example you have to adapt it to your model. BTW, now you no longer need to have any if 'register' in request.args block in your user function. No problem, glad to help. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web

[web2py] Re: upload a file with just a post request

2014-11-13 Thread Leonel Câmara
You did get it in request.vars it's just not called 'upload' like in my example, you call it 'filename'. So: models: db.define_table('myfile', Field('name'), Field('cloudfile', 'upload'), ) controller: def post_file(): """ Controller to post files """ if 'filename' in request.v

[web2py] Re: Grid links in component do not open in new window properly

2014-11-13 Thread Leonel Câmara
The problem is that URL, when an extension is not specified, inherits it from the current URL which is .load in the case where they are loaded in components with extension='load'. The thing is, this need to be load, otherwise inner will use the generic HTML view extending layout.html and you do

Re: [web2py] Re: upload a file with just a post request

2014-11-13 Thread António Ramos
Oops seem like that i dont receive the upload in request.vars here is my request.vars : > Done! > Thank u > > 2014-11-12 17:54 GMT+00:00 Leonel Câmara : > >> Yes, yes it is. That's what forms do anyway. In fact you can use SQLFORM >> to do this if you want. >> >> Here's an example solution not

Re: [web2py] Re: send mail error

2014-11-13 Thread Vid Ogris
Found all my bugs and problems. It was in def add_organization(form):, where I had to change all column names so they match my db. Thanks for the help. 2014-11-13 12:17 GMT+01:00 Vid Ogris : > Ok. > > I inserted your code into db.py > > Now I get an error > 'Table' object has no attribute 'na

Re: [web2py] Re: send mail error

2014-11-13 Thread Vid Ogris
Ok. I inserted your code into db.py Now I get an error 'Table' object has no attribute 'name' it is in my controler default.py under funcition user() if 'register' in request.args: form = auth.register() return dict(form=form) Since my app spec changed I don need autocomplete. SO user just ins

[web2py] Re: send mail error

2014-11-13 Thread Leonel Câmara
No, all the code in this demo goes into the welcome app (just ask admin to make you a new app), into db.py, before auth.define_tables. All the controllers are the default supplied by welcome.py -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web

[web2py] Upload path broken since 2.9.11 update

2014-11-13 Thread Louis Amon
Hi, My website has been using web2py for a few months now, and we handle pictures using Amazon S3 and Cloudfront for storage and distribution. The corresponding code in web2py looks like this : Field('picture_1', type='upload', requires=IS_EMPTY_OR(IS_IMAGE(extensions=('jpeg', 'png'