Questions tagged [pylons]

Pylons is a lightweight web framework emphasizing flexibility and rapid development.

Pylons

Pylons is an cross-platform and an open source web application written in . It makes extensive use of the Web Server Gateway Interface standard to promote reusability and to separate functionality into distinct modules. It is strongly influenced by Ruby on Rails: two of its main components, Routes and WebHelpers, are Python reimplementations of Rails features.

It was created by James Gardner and Ben Bangert and launched in september 2005.

At the current stable release (1.0 / May 28, 2010) it has more separation of the influence by Ruby on Rails and it can be seen in the routes module.

Resources

  • Gardner, James (2009) The Definitive Guide to Pylons. (APRESS)
  • Wikipedia (2011) Pylons (web framework). Last taken from: http://en.wikipedia.org/wiki/Pylons in february 26 2011
834 questions
20
votes
4 answers

Is there a better way to switch between HTML and JSON output in Pyramid?

# /test{.format} no longer seems to work... config.add_route('test', '/test.{ext}', view='ms.views.test') views.py: from pyramid.response import Response from pyramid.renderers import render import json def test(request): extension =…
dave
  • 7,157
  • 15
  • 61
  • 99
20
votes
8 answers

A simple Python deployment problem - a whole world of pain

We have several Python 2.6 applications running on Linux. Some of them are Pylons web applications, others are simply long-running processes that we run from the command line using nohup. We're also using virtualenv, both in development and in…
EMP
  • 51,372
  • 47
  • 157
  • 214
19
votes
6 answers

How can I redirect after POST in Pyramid?

I'm trying to have my form submit to a route which will validate the data then redirect back to the original route. For example: User loads the page website.com/post Form POSTs the data to website.com/post-save User gets redirected back to…
dave
  • 7,157
  • 15
  • 61
  • 99
18
votes
1 answer

Logout fails in Turbogears 2.2.2

I have app written in TG 2.2.2 with default authentication. Last days, I have problem with logging in and out. In safari, two authtkt cookies are created, one as "beta.domain.com", other ".beta.domain.com". After calling /logout_handler, cookie for…
tomis
  • 1,626
  • 1
  • 14
  • 26
18
votes
4 answers

Django vs. Pylons

I've recently become a little frustrated with Django as a whole. It seems like I can't get full control over anything. I love Python to death, but I want to be able (and free) to do something as simple as adding a css class to an auto-generated…
Kenneth Reitz
  • 7,581
  • 4
  • 27
  • 34
17
votes
4 answers

Ruby LESS gem equivalent in Python

The Ruby LESS gem looks awesome - and I am working on a Python/Pylons web project where it would be highly useful. CSS is, as someone we're all familiar with recently wrote about, clunky in some important ways. So I'd like to make it easier on…
Brighid McDonnell
  • 4,109
  • 3
  • 34
  • 59
17
votes
4 answers

Proper way to set object instance variables

I'm writing a class to insert users into a database, and before I get too far in, I just want to make sure that my OO approach is clean: class User(object): def setName(self,name): #Do sanity checks on name self._name = name …
ensnare
  • 34,050
  • 49
  • 140
  • 211
15
votes
2 answers

Pylons error - 'MySQL server has gone away'

I'm using Pylons (a python framework) to serve a simple web application, but it seems to die from time to time, with this in the error log: (2006, 'MySQL server has gone away') I did a bit of checking, and saw that this was because the connections…
swilliams
  • 44,959
  • 24
  • 94
  • 129
14
votes
2 answers

SQLAlchemy "event.listen" for all models

I have fields created_by and updated_by in each models. These fields are automatically filled with sqlalchemy.event.listen (formerly MapperExtension). For each model, I write: event.listen(Equipment, 'before_insert',…
uralbash
  • 2,267
  • 3
  • 21
  • 45
14
votes
1 answer

Help improve my file upload method (Pyramid framework)

Currently, I am using the following method for uploading files (via HTML form) in Pyramid. if request.params.get('form.submitted'): upload_directory = os.getcwd() + '/myapp/static/uploads/' my_file = request.POST.get('thumbnail') …
sidewinder
  • 2,253
  • 6
  • 21
  • 33
14
votes
7 answers

Is Pylons enterprise-ready?

I am a developer who is looking for an Enterprise-ready web application framework for Python. My main concern is long-term support, extensive feature set and reliability. I have been experimenting with Pylons and after my horrendous experience with…
cygnus atratus
  • 347
  • 4
  • 14
13
votes
6 answers

Equivalent of template context in Pyramid (pylons user)

What is the equivalent of template context in Pyramid? Does the IBeforeRender event in pyramid have anything to with this? I've gone through the official documentation but diffcult to understand what the IBeforeRender event is exactly.
sidewinder
  • 2,253
  • 6
  • 21
  • 33
13
votes
1 answer

Filtering by relation count in SQLAlchemy

I'm using the SQLAlchemy Python ORM in a Pylons project. I have a class "Project" which has a one to many relationship with another class "Entry". I want to do a query in SQLAlchemy that gives me all of the projects which have one or more entries…
wxs
  • 4,927
  • 5
  • 31
  • 46
13
votes
3 answers

SQLAlchemy - ObjectDeletedError: Instance '' 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] …
dave
  • 7,157
  • 15
  • 61
  • 99
13
votes
3 answers

Python nosetests skip certain Tests

I am working on tests for a web application written in python. Suppose I have 5 tests in my test_login.py module. Every single test is a Class. There is often one, base test that extends TestFlow class, which is our predefined test class. And then…
koleS
  • 1,598
  • 5
  • 25
  • 40
1
2
3
55 56