pylons

Mark string as safe in Mako

I'm using Pylons with Mako templates and I want to avoid typing this all the time: ${ h.some_function_that_outputs_html() | n } I want to somehow mark the function, or a variable as safe (you can do that in Django) so I don't have to pipe-en all the time. Any ideas? ...

How to use OpenID in RESTful API?

I'm building Pylons-based web application with RESTful API, which currently lacks any authentication. So I'm going to implement that and in order to avoid all the trouble and caution with storing user passwords, I'd like to use OpenID for authentication. What would be the best way to do this? Are these two things compatible? Are there ex...

Python after Ruby on Rails

I have been working with Ruby on Rails for over a year now and have been offered some development work with Python. I would like know if development with Python is as enjoyable as Ruby in terms of the clarity and ease of use. And how well is Python suited for Web development. I've heard of Pylons being a direct port of the Rails framewor...

With sqlalchemy how to dynamically bind to database engine on a per-request basis

I have a Pylons-based web application which connects via Sqlalchemy (v0.5) to a Postgres database. For security, rather than follow the typical pattern of simple web apps (as seen in just about all tutorials), I'm not using a generic Postgres user (e.g. "webapp") but am requiring that users enter their own Postgres userid and password, ...

Should Pylons' development.ini be checked in?

I'm learning about Pylons and I've read a few tutorials, but none of them have addressed collaboration practices. Starting on a practice project. I'd like to keep my code in a revision-control system (Git, specifically) as if it were an open-source project with multiple developers, in order to practice that aspect of Pylons development ...

Python stack for data centric scalable REST application

What Python frameworks/libraries you would use to create a data centric REST application. The application will have the following traits: read-biased in terms of number of individual ad-hoc requests write-biased in number of records added in batch feeds scalable (think virtual appliance, cloud) variety of data formats such as csv files...

TinyMCE Spellchecker in Pylons

I've been trying to get the TinyMCE spellchecker working with my Pylons app. My first problem is actually capturing the post data in the first place. Firebug tells me that the following is being sent: {"id":"c0","method":"checkWords","params":["en",["Lorem","ipsum","dolor","sit","amet","consectetur","adipisicing","elit","sed","do","eius...

What do I use, CherryPy or Pylons?

Hi I'm planning on building a site with social networking features. Which Python framework do you think is more appropriate or you would suggest over the other, CherryPy or Pylons? ...

Pylons "global name 'c' is not defined"

hiyas. i had setup Pylons v0.9.7, and create project. and using genshi. and i coding to easy test code , but that code dont working. code: member.py coding: utf-8 import logging import foo.model from foo.lib.base import * log = logging.getLogger(__name__) class MemberController(BaseController): def index(self): c.tit...

Pylons FormEncode @validate decorator pass parameters into re-render action

I am attempting to use the validate decorator in Pylons with FormEncode and I have encountered an issue. I am attempting to validate a form on a controller action that requires parameters, and if the validation fails, the parameters aren't passed back in when the form is re-rendered. Here's an example. def question_set(self, id): ...

SVG in pylons or turbogears?

Are there documented pylons or turbogears2 widgets for generating SVG markup as components and are there example applications that use them returning an SVG primary document? ...

Pylons Custom Middleware return 404

Hey all I have the following code as a middleware in an pylons application: import testing.model as model import re from pylons.controllers.util import abort class SubdomainCheckMiddleware(object): def __init__(self, app): self.app = app def __call__(self, environ, start_response): if 'subdomaincheck' in envir...

Pylons and AuthKit OpenID problem

Hi all! I have troubles setting up the support for openID authentication, using authkit and pylons. I set up everything as described in the cookbook, but still get the following error: File "/usr/lib/python2.6/dist-packages/authkit/authenticate/open_id.py", line 480, in __call__ return self.app(environ, start_response) File "/u...

Pylons and multiple forms per page

Hi all, I've got a web page I'm generating with Pylons and the evoque templating tool. I'm trying to generate a page with multiple forms per page (one form is part of a base template that becomes part of every page). I'm having a problem as I seemingly can only get the form element values for one form; whenever I try to get the value fr...

Pylons Uploading Distorted Images on Windows

I'm creating an web app in Pylons, and am working on an image upload action. This is currently running using egg:paste#http on my windows machine, in the basic development configuration described in the pylons documentation quickstart. When I POST an image to my application, then move the image to the web root directory, then pull the ...

How can I keep on-the-fly application-level statistics in an application running under Apache?

I have an application running under apache that I want to keep "in the moment" statistics on. I want to have the application tell me things like: requests per second, broken down by types of request latency to make requests to various backend services via thrift (broken down by service and server) number of errors being served per sec...

What is the method of doing nl2br in Genshi?

hiyas. I using Genshi+Pylons. please teach me, how use \n to <br/>tag in Genshi? I hope to obtain the same result as "nl2br" in php to change line. Or, does not the solution exist? i'm assign template to some text. (genshi template) <p>${c.message}</p> Im tried. case 1: (python code) c.message = """ foo bar """ NG. display res...

SQLAlchemy printing raw SQL from create()

Hi all I am giving Pylons a try with SQLAlchemy, and I love it, there is just one thing, is it possible to print out the raw SQL CREATE TABLE data generated from Table().create() before it's executed? ...

Pylons: free module-level variables?

Not even sure if module-level is correct here, but... I have a Pylons project and within the model component I have a global variable, doc, in __init__.py that I want to use from different Query objects. (doc is a Document handle on an XML file that I am using as a fake DB.) My question is, when does __init__.py's scope end? Currently I...

Mysql + SQLAlchemy + Pylons Issue

I'm trying to setup my models in Pylons using a MySQL backend and I keep getting the following: Traceback (most recent call last): File "/usr/local/bin/paster", line 8, in <module> load_entry_point('PasteScript==1.7.3', 'console_scripts', 'paster')() File "/usr/local/lib/python2.6/dist-packages/PasteScript-1.7.3-py2.6.egg/pa...