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
154
votes
6 answers

How do I run a single test with Nose in Pylons

I have a Pylons 1.0 app with a bunch of tests in the test/functional directory. I'm getting weird test results and I want to just run a single test. The nose documentation says I should be able to pass in a test name at the command line but I get…
Ben
  • 9,591
  • 9
  • 32
  • 40
102
votes
9 answers

UnicodeEncodeError: 'latin-1' codec can't encode character

What could be causing this error when I try to insert a foreign character into the database? >>UnicodeEncodeError: 'latin-1' codec can't encode character u'\u201c' in position 0: ordinal not in range(256) And how do I resolve it? Thanks!
ensnare
  • 34,050
  • 49
  • 140
  • 211
56
votes
4 answers

How to efficiently manage frequent schema changes using sqlalchemy?

I'm programming a web application using sqlalchemy. Everything was smooth during the first phase of development when the site was not in production. I could easily change the database schema by simply deleting the old sqlite database and creating a…
ascobol
  • 7,026
  • 6
  • 45
  • 67
55
votes
3 answers

SQLAlchemy, clear database content but don't drop the schema

I'm developing a Pylons app which is based on exisitng database, so I'm using reflection. I have an SQL file with the schema that I used to create my test database. That's why I can't simply use drop_all and create_all. I would like to write some…
Juliusz Gonera
  • 4,009
  • 4
  • 25
  • 32
53
votes
6 answers

SQLAlchemy printing raw SQL from create()

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?
Mads Madsen
  • 695
  • 1
  • 5
  • 8
50
votes
7 answers

How to get column names from SQLAlchemy result (declarative syntax)

I am working in a pyramid project and I've the table in SQLAlchemy in declarative syntax """models.py""" class Projects(Base): __tablename__ = 'projects' __table_args__ = {'autoload': True} I get the results by using """"views.py""" session…
Sukumar
  • 3,164
  • 3
  • 24
  • 28
49
votes
3 answers

Should I use Pylons or Pyramid?

I was planning to move from Django to Pylons, but then I bumped into Pyramid. What are the differences between Pylons and Pyramid? I read some text in PylonsBook, which currently covers Pylons 0.9.7, and wonder if it is a to start for Pylons and…
AbdAllah
  • 753
  • 2
  • 7
  • 14
47
votes
2 answers

How can I select all rows with sqlalchemy?

I am trying to get all rows from a table. In controller I have: meta.Session.query(User).all() The result is [, ], but I have 2 rows in this table. I use this model for the table: import hashlib import sqlalchemy as sa from sqlalchemy import…
gummmibear
  • 691
  • 2
  • 7
  • 13
40
votes
10 answers

Which is faster, python webpages or php webpages?

Which is faster, python webpages or php webpages? Does anyone know how the speed of pylons(or any of the other frameworks) compares to a similar website made with php? I know that serving a python base webpage via cgi is slower than php because…
40
votes
1 answer

get path of python binary that's executing the script

I have a Pylons controller (irrelevant but explains why I have this need) say starter.py that starts another process using: retcode = subprocess.call(('python','/path/to/myScript.py')) now since the app runs in a virtual env python is not the right…
neurino
  • 9,962
  • 2
  • 37
  • 58
34
votes
5 answers

sqlalchemy existing database query

I am using SQLAlchemy as ORM for a python project. I have created few models/schema and it is working fine. Now I need to query a existing MySQL database, no insert/update just the select statement. How can I create a wrapper around the tables of…
DevC
  • 6,005
  • 8
  • 34
  • 56
31
votes
3 answers

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…
Pēteris Caune
  • 38,874
  • 6
  • 52
  • 76
24
votes
3 answers

Is Pyramid ready/recommended for prime time?

I was wandering around testing various options for my new personal project, ranging from PHP, to node.js, to Haskell. I feel most comfortable with Python, though, so I thought I'd go back to it in the end. I've taken a second look at frameworks like…
user234932
23
votes
7 answers

How come I can not activate my Virtual Python Environment with 'source env/bin/activate' command?

I am trying to activate my Virtual Python Environment to use with Pylons but I think I am executing the commands wrong. jem@jem-laptop:~$ source env/bin/activate bash: env/bin/activate: No such file or directory What am I doing wrong? How should I…
pylonicon
21
votes
1 answer

How to create and restore a backup from SqlAlchemy?

I'm writing a Pylons app, and am trying to create a simple backup system where every table is serialized and tarred up into a single file for an administrator to download, and use to restore the app should something bad happen. I can serialize my…
swilliams
  • 44,959
  • 24
  • 94
  • 129
1
2 3
55 56