Questions tagged [pyramid]

Pyramid is a Python-based web framework provided by the Pylons Project. Do not use the "pyramid" tag for displaying items in a pyramid shape.

Pyramid is a small, fast, down-to-earth Python web application development framework that is un-opinionated and very flexible. This allows it to be used in a variety of different projects where Pyramid's flexibility allows for easier integration with already-existing code/modules. Because it is un-opinionated it gives the developer a lot of choice in how to handle various aspects - such as sessions, authentication, authorization and more - without sacrificing support for those aspects or out-of-box ease of use.

It is developed as part of The Pylons Project. It is licensed under a BSD-like license with extra clauses.

Official Logo

Official Pyramid Logo

Official Icon

Official Pyramid Icon

2212 questions
12
votes
3 answers

Pyramid stream response body

I'm trying to stream Server-Sent Events from my Pyramid application, but I can't figure out how to stream the response body from my view. Here's the test view I'm using (it totally doesn't implement SSE, it's just to work out the streaming…
spiffytech
  • 6,161
  • 7
  • 41
  • 57
12
votes
2 answers

What is the difference between a cornice.Service and cornice.resource in Cornice?

I have read through the documentation many times over and search all over for the answer to this question but have come up short. Specifically I've looked at Defining the service and the Cornice API for a service and at Defining resource for…
Dan P.
  • 1,433
  • 1
  • 16
  • 28
12
votes
1 answer

Why am I getting DistributionNotFound error when I try to run Pyramid project?

I installed in my new Windows 8 (x64): python-2.7 pywin32-218.win32-py2.7 setuptools-0.6c11.win32-py2.7 and pyramid (via easy_install) I tried to run my pyramid project: pserve I:\Projects\PyramidProject\development.ini and…
David Silva
  • 1,939
  • 7
  • 28
  • 60
12
votes
1 answer

SQLAlchemy won't update my database

I'm making a Pyramid app using SQLAlchemy-0.7.8. I'm using 64bit Python3.2. The question is, why does the following function not commit anything to the database? def create_card(sText,sCard): """ create a wildcard instance if all is well…
Sheena
  • 15,590
  • 14
  • 75
  • 113
12
votes
1 answer

Map different URLs to same view

It seems trivial enough but I can't find a valid answer to this problem. Suppose I have two different links '/' and '/home' and I want them to point to the same view. (This means whether user opens xyz.com or xyz.com/home, same page will be…
RedBaron
  • 4,717
  • 5
  • 41
  • 65
12
votes
2 answers

How do I split models.py into different files for different models in Pyramid?

I am new to pyramid and have been struggling to make some changes to my project. I am trying to split my models/Classes into individual files instead of a single models.py file. In order to do so I have removed the old models.py and created a models…
Karan
  • 334
  • 1
  • 3
  • 15
11
votes
3 answers

Pyramid: how to set cookie without renderer?

In configuration file: config.add_route('lang', '/lang-{code}') In views: @view_config(route_name='lang') def lang(request): code = request.matchdict['code'] response = Response() response.set_cookie('lang', value=code,…
Vitalii Ponomar
  • 10,686
  • 20
  • 60
  • 88
11
votes
2 answers

UPDATE statement on table xxx' expected to update 1 row(s); 0 were matched with Zope transactionmanager

I am running a Pyramid + Zope transaction manager + SQLAlchemy + PostgreSQL. On some occasions, I have seen StaleDataError error on a Pyramid web application which should very trivial view of updating one row in a database. As the error happens…
Mikko Ohtamaa
  • 82,057
  • 50
  • 264
  • 435
11
votes
3 answers

using list on postgresql JSON type with sqlalchemy

I am using pyramid with sqlalchemy, pyramid_tm and postgresql to test this. DBSession = scoped_session(sessionmaker(extension=ZopeTransactionExtension())) Base = declarative_base() class MyList(Base): id = Column(Integer, primary_key=True) …
idwaker
  • 406
  • 3
  • 10
11
votes
1 answer

How do I make `python setup.py test -q` quieter?

I've just started a Pyramid project, following the recommendations from the Pyramid docs. The command for testing looks like this: ../bin/python setup.py test -q ..which gives me this result: $ ../bin/python setup.py test -q running test running…
Daniel Baird
  • 2,239
  • 1
  • 18
  • 24
11
votes
1 answer

SelectField in wtforms and added

I'm currently work on some project in pyramid and have problem with wtforms SelectField. I have a 3 SelectField fields: car_make (e.g., "audi") car_model (e.g., "audi 80") car_version (e.g., "AUDI 80 B4"). The car_make choices I can load in the…
qwetty
  • 1,238
  • 2
  • 10
  • 24
11
votes
7 answers

Debug Pylons application through Eclipse

I have Eclipse setup with PyDev and love being able to debug my scripts/apps. I've just started playing around with Pylons and was wondering if there is a way to start up the paster server through Eclipse so I can debug my webapp?
Max Stewart
  • 3,573
  • 26
  • 28
11
votes
1 answer

Pyramid catch-all friendly exception handling

Is there a way that I can handle some sort of "catch-all" error handling in a Pyramid web app? I currently have implemented exception logging to a database (via the docs at…
Peter Tirrell
  • 2,962
  • 4
  • 29
  • 52
11
votes
3 answers

which python web framework(django or django-norel or pyramid) to use when MongoDB is used as a database

I am using MongoDB as my primary(and only till now) database and because of google and the links it provided me i am confused between Django or Pyramid. I am comfortable with python but never done web development in python(i have done in PHP). Now…
lovesh
  • 5,235
  • 9
  • 62
  • 93
11
votes
1 answer

How to use a common ini configuration (between development and production) in pyramid?

I want to have a common configuration with settings that do not change across different environments (development and production). I know I could set up a global settings.py file (e.g., sql limits), but as far as I know, pyramid requires certain…
BDuelz
  • 3,890
  • 7
  • 39
  • 62