Re: Simple production question
Thanks to all for yours replies. If I understand correctly, your Pylons application is running on port 8080, and you want Apache to proxy port 5001 to it but not port 80 (i.e., port 80 will be used for a different website). Excuse me for my bad English. I dont' explain well the problem. The Pylons applications is running on port 5001. But there aren't problems to change the port to another (over 8000). I wrote a lot of CherryPy applications where I set the port, start its server and that's all. Using Pylons, seems to be better use a web server (like Apache) to serve the application instead using Paster directly. Now, I have an Apache web server that serve the main web site of our center and other virtual sites. So, I haven't a domain to bind to Pylon application but only a port. My question is: is there a way to configure Apache to proxy calls to the specific port where Paster is running? Enrico --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
External link for form action
Dear all, I'm going crazy but I'm unable to find how can I set an external link for a form action. In my Pylons application I created a form that have to be processed by a credit card security site. So in form action=... I had put the external link directly. But it doesn't work. When I click on the submit button, nothing happen. How can I do that? Thanks in advance Enrico --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: Python 3.1
On Oct 28, 2009, at 9:52 PM, Mike Orr wrote: On Wed, Oct 28, 2009 at 10:27 AM, Mario Ruggier ma...@ruggier.org wrote: On Tue, Oct 27, 2009 at 9:27 PM, Mike Orr sluggos...@gmail.com wrote: On Tue, Oct 27, 2009 at 4:07 AM, Mario Ruggier ma...@ruggier.org wrote: In the long term it would seem even more restraining, although presumably you could abandon the policy in a year or two. Well, yes, that's the price to pay for having a unique code base (and dist package). In any case, you would still gain on other py3 features, like performance, when running under py3. Has Python 3's performance caught up to Python 2's yet? For a while the I/O system was in Python though I think it's in C now, but the last stats I saw showed Python 3 running slower. Sorry, I meant to say performance in some areas, like systematic returning iterators instead of lists e.g for dict.keys, map(), filter(), etc. For the general performance profile I believe you are right, py3 is still slower... But, name me *one* py3 feature for which a legacy package *must* have ?!? You can say the same about Python 2.6 features, Python 2.5 features, etc. You don't *have* to use them and some people don't care, but other people do and would like to use the features. For instance, named tuples and defaultdict, which were added in 2.6. I had to reimplement defaultdict in WebHelpers so it would be compatible with 2.5. I still haven't used named tuples yet because we only switched to Python 2.6 at work a few months ago. But, the key point here is *legacy*... in general you want to make a legacy (working, deployed) package available to py3 world for the benefit of applications that wish to migrate to py3 and need to carry over the dependency, and *not* to selfishly take advantage of the benefits of the new language version. Presumably, if anything is working in 2.5, it can be made to work on both 2.5 and 3.0 from the same code base, without deprecating anything in the 2.5 version or without back-porting any features of the new lang version. Of course if you want to back-port some 3.0 feature into your 2.5 version, then special work as you describe is needed... but then the question does not anymore concern support for 3.0 but whether you still want to support 2.5 and for how long. For the defaultdict example, it would be another type defn that will be obtained differently when running under 2.5 as opposed to when running under 3.0. m. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: Python 3.1
On Oct 28, 2009, at 6:27 PM, Mario Ruggier wrote: On Tue, Oct 27, 2009 at 9:27 PM, Mike Orr sluggos...@gmail.com wrote: On Tue, Oct 27, 2009 at 4:07 AM, Mario Ruggier ma...@ruggier.org wrote: No-one seems to give any consideration to the very real possibility of adjusting the *same* code base to run on both py 2 *and* 3 -- the same tarball, the same setup.py. A recipe (and real world examples, one of which is a web fraemwork) for how this may be done is here: http://mail.mems-exchange.org/durusmail/qp/441/ That would work in the short term, but it would suck to be limited to a subset of Python's features, and to have 'if's all over the place. There need only be one if block, centrally placed... all modules can import specific items from there. In the long term it would seem even more restraining, although presumably you could abandon the policy in a year or two. Well, yes, that's the price to pay for having a unique code base (and dist package). In any case, you would still gain on other py3 features, like performance, when running under py3. But, name me *one* py3 feature for which a legacy package *must* have ?!? The mention of wsgi/py3/unicode issues in this thread reminded me of an similar earlier exchange on this same group (some 10 months ago in Jan)... where in one of the replies Micheal Bayer had said '''There are no unicode issues in WSGI''': http://groups.google.com/group/pylons-discuss/browse_thread/thread/7840c48a1b14c5aa/9bb0444c8dd4611b?#9bb0444c8dd4611b I guess it boils down to where does WSGI (should) end and where the rest of the stack (should) start... plenty room for opinion! MikeB is not a framework developer. He's a database guy who has also written a remarkable template engine, Hey, so did I ;-) And actually I do not say that lightly -- I still have to come across a templating task that can be done in Mako or any other python templating system and that cannot be done in Evoque -- on the contrary, in general it is done more simple and direct in Evoque. Even if you consider Evoque's limitation of handling only python expressions (i.e. no statements), in practice this is never a concern -- anything requiring a statement is in external pure-python (trusted) modules. The (big) gain... is that Evoque can be sandboxed (i.e. let your untrusted user modify the template source!), a feature that no other templating system had *designed-in* from the start. Anyhow, paying honour to Mako as the reference templating in python, here's a summary of differentiating features of Evoque: http://evoque.gizmojo.org/features/unique/ Plus, it is almost a year that it runs under python 3, as well as python 2.4+, from the same codebase. m. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: Python 3.1
On 11/2/09 15:28 , Mario Ruggier wrote: The (big) gain... is that Evoque can be sandboxed (i.e. let your untrusted user modify the template source!), a feature that no other templating system had *designed-in* from the start. You mean like Zope PageTemplates since its creation about 10 years ago? Wichert. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: Simple production question
On Nov 2, 4:44 am, morellik enrico.more...@gmail.com wrote: My question is: is there a way to configure Apache to proxy calls to the specific port where Paster is running? See mike's post above. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: Python 3.1
On Nov 2, 2009, at 3:41 PM, Wichert Akkerman wrote: On 11/2/09 15:28 , Mario Ruggier wrote: The (big) gain... is that Evoque can be sandboxed (i.e. let your untrusted user modify the template source!), a feature that no other templating system had *designed-in* from the start. You mean like Zope PageTemplates since its creation about 10 years ago? If you say so, I guess not ;-) Does ZPT allow embedding (most) python expressions? My impression is that ZPT was designed to primarily output X/HTML (altho I think it can be made to output arbitrary text- based formats) so I tend to think of it as a beast of a different kind, that is not comparable to mako/evoque class of text-based templating (performance would certainly not be comparable). m. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: External link for form action
I tried to create a static route in routing.py: map.connect('credit_card', 'https://www.credit_card.com', _static=True) and use it in the form: form action=${h.url_for('credit_card')} method=POST without results. After pressing submit I see the same page with all input fields values in the navigation toolbar of the browser, e.g. I see [http://localhost:5001/user/payment/] and after submit I see [http://localhost:5001/user/payment/? tr_id=0amount=00010email=...@ddd] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: redirect after download?
Gentlemen, Thanks again for your illuminating responses. As you have no doubt surmised, most of the problem is that I don't know what I'm doing! I'm not doing anything esoteric; I'm just a re-noob whose last serious foray into web apps was with cgi/perl over ten years ago. So I'm sure that the things I want to do are pretty standard...it is just that I'm woefully ignorant. Having said that, I've found Pylons a fairly comfortable ride, and put up most of the app without too many issues. I did note Matt's suggestion of the META tag in an earlier email, but a quick google search didn't yield anything that I was able to connect with downloading. But as you've indicated that this is a common solution, I will take a better look this time around. I don't mind reading documentation; sometimes the problem is not knowing enough to be able to ask the right question. Mike's suggestion about the redirect is also interesting, and immediately made sense. I appreciate the pointers! Best, Tim On Sun, 2009-11-01 at 12:08 -0500, Matt Feifarek wrote: On Fri, Oct 30, 2009 at 1:06 PM, Mike Orr sluggos...@gmail.com wrote: Somehow this issue doesn't come up on other sites. I'm not sure if you have unusual requirements or you're not considering all the UI possibilities. Maybe it's because when people download something, daysyn, don't forget the old-fashioned META that redirects/refreshes! I think that's commonly used, and isn't javascript. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Standard Deploy
I want to create a RPM package for my pylon app. Exists any document / proposal about put the pylons tree as a system-wide package, in a standard way. For example, my pylon app is a blog, the next tree can be deploy after install it: /etc/myblog/myblog.ini /etc/myblog/myblog.wsgi - link to apache2/site-enabled for (mod_wsgi) /usr/lib/python2.6/site-packages/myblog/... /var/lib/myblog/templates/ /var/lib/myblog/public/ /usr/share/doc/myblog/Documentation ... or create a pylons directory as standard, for example: /etc/pylons/myblog.ini /var/lib/pylons/myblog/... ... It's possible? Greetings --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: External link for form action
On Mon, Nov 2, 2009 at 7:04 AM, morellik enrico.more...@gmail.com wrote: I tried to create a static route in routing.py: map.connect('credit_card', 'https://www.credit_card.com', _static=True) and use it in the form: form action=${h.url_for('credit_card')} method=POST without results. After pressing submit I see the same page with all input fields values in the navigation toolbar of the browser, e.g. I see [http://localhost:5001/user/payment/] and after submit I see [http://localhost:5001/user/payment/? tr_id=0amount=00010email=...@ddd] What does View Source show in the browser? The behavior is consistent with form action= method=POST /, which could happen if url_for returned None. That in turn would indicate it couldn't match the route name, and then we'd have to investigate why. Also, what happens if you replace the h.url_for call with ``url('credit_card')``. url_for is gradually being replaced by pylons.url, which has a different implementation and thus may behave differently. Another possiblility is that a different route is matching, something earlier in the route definitions. As a workaround, you can use a 'c' variable for the URL. Routes does not provide much advantage for external URLs, other than the convenience of defining them in the route map. -- Mike Orr sluggos...@gmail.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: redirect after download?
On Mon, Nov 2, 2009 at 9:14 AM, Tim Bock jtb...@daylight.com wrote: I did note Matt's suggestion of the META tag in an earlier email, but a quick google search didn't yield anything that I was able to connect with downloading. But as you've indicated that this is a common If you look at the source of the page I mentioned: http://somafm.com/play/spacestation You can see an example. There may be script in there, too... I haven't parsed it thoroughly. Also, check out this: http://sourceforge.net/projects/freevo/files/kaa-metadata/0.7.7/kaa-metadata-0.7.7.tar.gz/download Sourceforge has been doing this for years. Though I can't see the meta tag in there anymore; they must be using a script. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: Standard Deploy
On Mon, Nov 2, 2009 at 8:05 AM, Antonio Beamud Montero antonio.bea...@gmail.com wrote: I want to create a RPM package for my pylon app. Exists any document / proposal about put the pylons tree as a system-wide package, in a standard way. For example, my pylon app is a blog, the next tree can be deploy after install it: /etc/myblog/myblog.ini /etc/myblog/myblog.wsgi - link to apache2/site-enabled for (mod_wsgi) /usr/lib/python2.6/site-packages/myblog/... /var/lib/myblog/templates/ /var/lib/myblog/public/ /usr/share/doc/myblog/Documentation ... or create a pylons directory as standard, for example: /etc/pylons/myblog.ini /var/lib/pylons/myblog/... ... It's possible? There are no official RPM instructions or directory layout for Pylons. In this case, I would avoid over-engineering and scattering files across multiple directories. If this app will be used only by a few sysadmins who know Pylons (or will get to know it during the time they administer the site), just put the entire app in one directory. The best choices are /usr/share/myblog or /usr/share/pylons/myblog following the precedents of: PHPMyAdmin: /usr/share/phpmyadmin Emacs: /usr/share/emacs/site-lisp Vim: /usr/share/vim/{addons,vim72} PHPMyAdmin puts its configuration files in /etc/phpmyadmin (the Apache config and the equivalent of production.ini). The main Apache configuration simply includes /etc/phpmyadmin/apache.conf. But Apache could simply set its DocumentRoot to /usr/share/phpmyadmin and that would work too. All documentation should go under /usr/share/doc/[pylons-apps/]myblog per the Filesystem Hierarchy Standard (http://www.pathname.com/fhs/). Samples of the configuration files can also go here. I set up my sites differently than this. I don't use RPM/DPKG. I put applications under /home/wwwadmin/apps (Subversion checkouts) and virtualenvs under /home/wwwadmin/venv . Data files go under /home/wwwadmin/data . The INI files stay with their applications (/home/wwwadmin/apps/myblog/production.ini). The apps all run under Supervisor using their appropriate virtualenv. Apache and Supervisor configurations are kept under /home/wwwadmin/apps/servers/all, and hand-copied to /etc. (My rule is that anything executed by root must be hand-copied from the apps directory to its proper location, while webapps running as www-data can be run directly from the apps directory.) -- Mike Orr sluggos...@gmail.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: External link for form action
why do you even need to handle the creditcard processing form as a variable ? the chances of that changing should be incredibly slim. i'd just hardcode the form. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Repeating elements and htmlfill
Hi, htmlfill.render() doesn't seem to handle repeating elements as I expect. I've boiled my code down to this example: import formencode.htmlfill as htmlfill template = 'input id=weightings-0.weight name=weightings-0.weight type=text value= /' print htmlfill.render(template, defaults={'weightings': [{'weight': 1.0}]}) print htmlfill.render(template, defaults={'weightings-0.weight': 1.0}) Output: input id=weightings-0.weight name=weightings-0.weight type=text value=/ input id=weightings-0.weight name=weightings-0.weight type=text value=1.0 / See how the first render fails to populate a value. Am I doing something wrong? I've using version 1.2.1. Are there any good examples out there? Chapter 6 of the 1.1 book covers some of this but it's not complete (it also has a bug unless I'm missing something - person and people are used inconsistently). Thanks, Mike m...@asplake.co.uk http://positiveincline.com http://twitter.com/asplake --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: Repeating elements and htmlfill
Yeah as far as I know it does not work like that for the first case. You need to preprocess your defaults with formencode.variabledecode.variable_encode() to change the first case into the second case. I'm still working on a good repetitions example, are you using javascript? You should look at formencode's NestedVariables, variable_encode and variable_decode to start. On Mon, Nov 2, 2009 at 11:21 AM, Mike Burrows (asplake) m...@asplake.co.uk wrote: Hi, htmlfill.render() doesn't seem to handle repeating elements as I expect. I've boiled my code down to this example: import formencode.htmlfill as htmlfill template = 'input id=weightings-0.weight name=weightings-0.weight type=text value= /' print htmlfill.render(template, defaults={'weightings': [{'weight': 1.0}]}) print htmlfill.render(template, defaults={'weightings-0.weight': 1.0}) Output: input id=weightings-0.weight name=weightings-0.weight type=text value=/ input id=weightings-0.weight name=weightings-0.weight type=text value=1.0 / See how the first render fails to populate a value. Am I doing something wrong? I've using version 1.2.1. Are there any good examples out there? Chapter 6 of the 1.1 book covers some of this but it's not complete (it also has a bug unless I'm missing something - person and people are used inconsistently). Thanks, Mike m...@asplake.co.uk http://positiveincline.com http://twitter.com/asplake --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: Repeating elements and htmlfill
On Nov 2, 8:32 pm, Ian Wilson vengfulsquir...@gmail.com wrote: Yeah as far as I know it does not work like that for the first case. You need to preprocess your defaults with formencode.variabledecode.variable_encode() to change the first case into the second case. Thanks Ian, I'll look into that tomorrow. I'm still working on a good repetitions example, are you using javascript? You should look at formencode's NestedVariables, variable_encode and variable_decode to start. I did plan to use Javascript, then I took a closer look at the 1.1 book and thought I'd see how I would get on with the approach outlined there. After struggling a little I decided to play it safe and not add rows dynamically (by either method) to start with. Either way, the need to populate the form with data remains. I have NestedVariables and ForEach in my parent form schema, but (in my code at least) they don't come into play until validation time. Anyway, I hope to understand this a bit better after following your first piece of advice. A really solid good example of this would brilliant. Forms in Pylons do take a bit of getting used to (which is about the worst I can say about what has been a positive experience for the most part)! Thanks regards, Mike --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: New Pylons on AppEngine article in wiki
On Sun, Nov 1, 2009 at 11:06 AM, Matt Feifarek matt.feifa...@gmail.comwrote: On Thu, Oct 29, 2009 at 3:19 PM, reco r...@nex9.com wrote: just tried the wiki page i got the following probs: File lib/setuptools-0.6c11-py2.5.egg/pkg_resources.py, line 24, in module from os import utime, rename, unlink, mkdir ImportError: cannot import name mkdir INFO 2009-10-29 19:56:30,793 dev_appser Yeah, I'm now getting this too. I think that the 1.2.7 release of GAE broke this. I'm going to look into it. Actually, it turns out I have a *different* error; I'm getting a problem with os.makedirs. I patched it thusly in my runpylons.py: # fix the setuptools bug introduced in GAE 1.2.7 def dummyfunc(*args, **kwargs): pass os.makedirs = dummyfunc That allows the app to be run under the dev_appserver. Reco, what version of the SDK are you running when you have this problem? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---