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
830 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,717
  • 19
  • 68
  • 100
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
  • 59,148
  • 53
  • 164
  • 220
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,717
  • 19
  • 68
  • 100
19
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
  • 8,559
  • 4
  • 31
  • 34
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,884
  • 1
  • 15
  • 28
18
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
  • 40,069
  • 64
  • 158
  • 224
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,293
  • 4
  • 36
  • 61
16
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
  • 48,060
  • 27
  • 100
  • 130
15
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
  • 3,219
  • 5
  • 25
  • 45
15
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
  • 5,617
  • 5
  • 36
  • 51
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
  • 3,013
  • 6
  • 24
  • 33
14
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
  • 3,013
  • 6
  • 24
  • 33
14
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,717
  • 19
  • 68
  • 100
14
votes
4 answers

Is there a python implementation to .net automapper?

Automapper is a object-object mapper where we can use to project domain model to view model in asp.net mvc. http://automapper.codeplex.com/ Is there equivalent implementation in Python for use in Django(Template)/Pylons ? Or is there necessity for…
stoto
  • 364
  • 1
  • 4
  • 10
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
1
2
3
55 56