pylons

uwsgi / mod_wsgi handling pylons redirect_to & error pages

My stack is nginx > uwsgi > pylons. If I use redirect_to on a controller, the app throws a 302 error. Also I don't see any 404 or 500 error pages anymore that worked fine in paste. Any pointers would be greatly appreciated. Thanks. ...

TurboMail 3 with Pylons 1.0 - MailNotEnabledException

I am trying to setup TurboMail 3 with Pylons 1.0 Followed the docs here I have added this to the development.ini [DEFAULT] ... mail.on = true mail.manager = immediate mail.transport = smtp mail.smtp.server = localhost and my app_globals.py looks like: """The application's Globals object""" from beaker.cache import CacheManager f...

How do I cache a list/dictionary in Pylons?

On a website I'm making, there's a section that hits the database pretty hard. Harder than I want. The data that's being retrieved is all very static. It will rarely change. So I want to cache it. I came across http://wiki.pylonshq.com/display/pylonsdocs/Caching+in+Templates+and+Controllers and had a good read have been making use of te...

How do I dynamically add pylons apps to a uwsgi process on nginx with UWSGI_SCRIPT?

I have successfully deployed a single pylons app on nginx + uwsgi using: uwsgi --paste config:/var/www/sites/helloworld/development.ini --socket :3031 -H /var/www/virtualenv However I am using nginx to virtual host 3 sites. Based on this tutorial and the uwsgi/wiki/DynamicApps page from main uwsgi site on unbit, I can add apps dynami...

Python framework for building ad serving application (like AdSense)?

What Python web framework (Django?, Pylons?, ...) suitable for building ad serving application (like AdSense)? ...

SQLAlchemy - ObjectDeletedError: Instance '<Class at...>' has been deleted. Help.

I'm having some issues with deleting rows from a database and then adding new ones. Here's the code: for positionid in form_result['responsibilities']: inputdata = form_result['responsibilities'][positionid] self.__deleterow(dbmyaccount.Responsibilities, session['authed']['userid']) for resp in (i.strip() for i in inputdata...

Monitor Multiple Pylons Application

Are there any tools that I can run on my server to monitor multiple Pylons applications? I need to monitor the number of requests each application receives, how much memory each application is using, how much of the cpu is being used and other stats similar to those. I need to see the stats for each individual Pylons application. All i...

Using Microsoft SQL through python on a webserver

I'm trying to run some queries to a database from a pylons (paster-based) webserver and every time I try to import the pymssql Library I'm using (its this one by the way) I keep getting this error: tds_init_winsock: WSAEnumProtocols failed with 10055(WSAENOBUFS: No buffer space available.) on the import. I also tried using sqlalchemy ...

Pylons - catching errors before redirect to document/error for logging

I want to log 404 and 500 errors in a pylons app before they redirect to my custom error message (/error/document). My problem is that since Pylons does the redirect, I am unable to determine the page on which the error occurred inside the error controller. So without building a parser for the paster.log I don't know a good way to sele...

A very simple question about integrated jinja2 to pylons

I'm integrating jinja2 to pylons, I see in the document page there is: from jinja2 import Environment, PackageLoader config['pylons.app_globals'].jinja_env = Environment( loader=PackageLoader('yourapplication', 'templates') ) My question is: what should I use for yourapplication? Suppose my application is 'test', what should I wri...

Updating to Pylons 0.10

In the instruction (http://pylonshq.com/docs/en/1.0/upgrading/) I find : To upgrade to 1.0, first upgrade your project to 0.10. This is a Pylons release that is fully backwards-compatible with 0.9.7. However under 0.10 a variety of warnings will be issued about the various things that need to be changed before upgrading...

Using Pylons authenticate_form without a decorator

There's a good question at Using Pylons validate and authenticate_form decorator that brings to light the fact that if you're using @validate and @authenticate_form to decorate a Pylons controller action, @authenticate_form must come second. If not, after correcting and re-submitting the form following a failed validation, it detects a C...

Look for an example application of "pylons + sqlalchemy"

I'm new to python, and starting to learn website development with pylons and sqlalchemy. I've read the document of sqlalchemy and pylons, but still have a lot of problems. I've tried 2 days, but a simple website with basic CRUD operations can't work yet. I met some big problems(for me), that the circular imports problem, and relationsh...

How to declared one-to-many if there are 2 fields for a same foreign key

I'm new to python(sqlalchemy), and I'm learning to build web site with pylons and sqlalchemy. I have a problem when I declare the relationship between models. I've tried it several hours, but failed. But I think it should be a basic question. I have two classes: User and Article, user can create articles, and modified the other people...

python setup.py bdist_egg Not Setting Up Requirements for Package

I have a Pylons app that I am ready to deploy for the first time to production. It has a simple set of requirements listed in setup.py: install_requires=[ "Pylons>=1.0", "Jinja2", "couchdb", "python-openid", ], When I run "python setup.py bdist_egg" it seems to create the egg file properly. When I copy the egg file to ...

Long delays and messed up AJAX responses when running Pylons app via Apache

I have a Pylons app that I'm trying to set up using Apache and FCGI. The Pylons INI file has this in it: [server:main] use = egg:Flup#fcgi_thread host = 0.0.0.0 port = 40100 This used to work on an old CentOS server with Pylons 0.9.7, but now I'm trying to set it up on a new one, running Ubuntu 10.04 and Pylons 1.0. I can connect to t...

How to match all .sass request to a particular controller in pylons?

I'm using pylons, and want to use clever css. I created a controller SassController to handle .sass requests, but in the config/routing.py, I don't know how to write the mapping. What I want is: client request: http://localhost:5000/stylesheets/questions/index.sass all such requests will be handled by SassController#index I tried: ...

How to reload the modified files without restarting in pylons?

I'm using pylons, and using this command to start the server: paster serve --reload development.ini I found when I modify something, the paster will reload the application. In the console, it shows: -------------------- Restarting -------------------- Starting server in PID 7476. serving on http://127.0.0.1:5000 This is convenient ...

Pylons/Routes Named Routes vs. Keyword Routes and Subdomains

Subdomain behavior is not working as I expect in my Pylons project. Can someone provide some insight? I was using a named route and received back a URL that did not contain my current subdomain: I have the following rule defined on my mapper: map.sub_domains = True ... map.connect('openid_verify', '/verify', controller='oid...

Pylons redirect me on domain instead of subdomain

When I go to http:// sub.domain.com where is my Pylons project, application should redirect me on http:// sub.domain.com/login?redirect=/, but it's redirecting me on http:// domain.com/login?redirect=/ All redirections are to http:// domain.com/[rest of url]/ instead of http:// sub.domain.com/[rest of url]/ but project is under http:// ...