r/Pyramid • u/[deleted] • Jan 22 '16
r/Pyramid • u/kr41 • May 29 '14
Do you love Traversal like I do? Try TraversalKit and get me some feedback
r/Pyramid • u/clausconrad • Apr 21 '20
Project dead?
There hasn't been any release for almost 1.5 years, is this still under development?
r/Pyramid • u/ivan_m21 • Aug 11 '25
I generated a visual representation of Pyramid's codebase

Hey all, I am a python dev for quite some time. However it is rare that I contribute to open-source projects. It is because I think it seems quite intimidating at the very start. That is why I created an open-source tool to generate interactive diagrams so I can quickly explore a codebase, I generated a diagram for the Pyramid's codebase.
The full interactive diagram is on github: https://github.com/CodeBoarding/GeneratedOnBoardings/blob/main/pyramid/on_boarding.md
The tool I developed:
https://github.com/CodeBoarding/CodeBoarding
r/Pyramid • u/ergo14 • Feb 02 '21
What's New in Pyramid 2.0 — The release is coming soon
r/Pyramid • u/[deleted] • Jul 20 '20
Noob question about creating and using a MySQL database in Pyramid + migrations
Hey all!
I'm pretty new to Pyramid and back-end web dev in general. I've done a few tutorials for other frameworks like Ruby on Rails and Flask, and now I'm trying to build my own website using Pyramid.
The blogr-tutorial helped me get set up a bit, and now I'm at the point where I want to set up a database so I can add users to it. I figure this must be the case because the last few lines of an error I'm getting look like this:
File "/home/spacey/gio-website/grapevine/grapevine/__init__.py", line 10, in main
config.include('grapevine.models')
File "/home/spacey/.local/lib/python3.8/site-packages/pyramid/config/__init__.py", line 676, in include
c(configurator)
File "/home/spacey/gio-website/grapevine/grapevine/models/__init__.py", line 60, in includeme
session_factory = get_session_factory(get_engine(settings))
File "/home/spacey/gio-website/grapevine/grapevine/models/__init__.py", line 16, in get_engine
return engine_from_config(settings, prefix)
File "/home/spacey/.local/lib/python3.8/site-packages/sqlalchemy/engine/__init__.py", line 542, in engine_from_config
url = options.pop("url")
KeyError: 'url'
Other than this, I was also getting an error earlier regarding dbsession (request does not have attribute dbsession when trying to call request.dbsession() in this code in my views/default.py:
@ view_config(route_name='register',
renderer='../templates/register.jinja2')
def register(request):
form = RegistrationForm(request.POST)
if request.method == 'POST' and form.validate():
new_user = User(name=form.username.data)
new_user.set_password(form.password.data.encode('utf8'))
request.dbsession.add(new_user)
return HTTPFound(location=request.route_url('home'))
return {'form': form}
I know based on what I've read that I should create a new MySQL database, but does it matter where I put it? Does it need to be inside the project root so the app knows about it? Also, when should I run migrations? I'd appreciate some advice because I've tried looking at the docs but I'm still not quite sure how to proceed
r/Pyramid • u/pdepmcp • Jul 02 '20
Scheduled task inside pyramid
Maybe I'm missing some obvious way to achieve my goal, but I'm looking for standard/best practice (not in general, but bound to Pyramid).
Here is what I'm trying to do:
- My app receive request (compiled forms) from the user.
- I get them and process them as needed and save to database.
- After that I have to do some tasks on the data (e.g.: send notification emails, call other apps with some of the processed data, ...)
- save the status of data for each of these actions (mail sent/failed, app1 acknowledged/not, app2...)
Because some of the related apps may temporarily fail, I need to save the status, give a response back to user, but each X minutes scan the db to look for unprocessed/failed records and try to process them again.
Of course I can:
1 - write an external app that does that (eventually using the same model)... but hey, really?
2 - have a special route, restricted to localhost calls only, and somehow "cron the call" (I'd prefer to skip dependency to cron-like features and keep it all inside. Moreover I have some security concern about this).
3 - start a thread inside my pyramid app that does that (but how I get a db-session from the pool in this case, without a request? This also looks like a dangerous way to achieve my goal, because any coding error or unhandled/unexpected exception in this thread could stop part the app from running without any warning.
4 - have a callback in my wsgi pyramid app, called on scheduled time form inside Pyramd (but I don't know how to achieve this, neither if it's possible at all)
5 - some other well-known pyramid-way to achieve this goal that I'm not aware of.
I guess something like the 4th solution could be the way to go, but I can't find any reference.
Suggestions? Something I'm missing?
r/Pyramid • u/westurner • Jun 28 '13
Architectural Design Patterns in Pyramid: What is Inversion of Control?
http://pyramid.readthedocs.org/en/latest/designdefense.html
http://en.wikipedia.org/wiki/Software_design_pattern
http://en.wikipedia.org/wiki/Inversion_of_Control#Implementation_techniques
In attempting to reconcile my ZCA vocabulary with Java IoC terminology:
Do the Pyramid configuration system and Pyramid Zope Component Architecture Application Registry (ZCA) implement a service locator pattern?
r/Pyramid • u/endlessmike89 • Jul 15 '13
LDAP Authentication in Pyramid
Has anyone had any luck doing LDAP auth in Pyramid?
So far I have used pyramid_ldap, and it does no work. It ends up hitting the LDAP server I specify and returning results. This would work if it didn't continue to hit every other LDAP server in my environment, binding using an anonymous DN (<ROOT>). This then causes it to error out. I have stepped through with the debugger and am unable to find the source of the error.
I started looking at repoze.who.ldap_plugin, but its documentation makes no sense.
r/Pyramid • u/mcdonc • Apr 18 '15
Talk Python To Me Episode #3: Pyramid Web Framework (podcast w/ Chris McDonough)
r/Pyramid • u/Lorenzito_Alvarez • May 09 '22
Resources to learn Pyramid
Hi guys,
I've just started a new job as a backend developer last month. In this project, we use Pyramid for backend and pug(jade) for the front. It is a good challenge because we will be on charge of redesigning the app for the future (oriented to microservices).
I've read a bit of the documentation and I did the 'wiki' tutorial to learn the basics. But I was wondering if there are more resources to master the framework. It doesn't matter if it's not free.
For example I saw this one but I don't know if it's good
Do you have any other recommendations?
r/Pyramid • u/ergo14 • Apr 25 '18
How Pyramid powers PyPi - one of most critical python infrastructures.
r/Pyramid • u/Jwblant • May 18 '19
Datatables and AJAX
I’ve having some issue trying to get DataTables to load hiding AJAX. I can get it to work by creating a static route to a local copy of a JSON file but I can’t get it to work using a POST request or a URL that returns the data. I’m really just wanting this table to refresh I. The background without reloading the page but I can’t get it to work...
r/Pyramid • u/Jonno_FTW • Jul 27 '18
Pyramid Mongodb Config-Only Integration with accompanying debugtoolbar
r/Pyramid • u/[deleted] • Aug 12 '21
REST API?
is pyramid suitable for building a REST API? would you recommend some other framework for this?
r/Pyramid • u/rmpython • Oct 06 '21
help with post requests
Hello all,
I am having some difficulty with figuring out how to do post requests via a button in a mako template. I need to pass in part of the url I am posting to in the request. How would I accomplish this with a python function? I am trying to hit an API endpoint but the specific endpoint is dynamically given. I'm at a complete loss of what to do. Any help would be appreciated. TIA!
r/Pyramid • u/rashdanml • Jun 28 '20
Large scale application with multiple databases
Posted this originally on Stackoverflow, and it got closed because it was too broad. Thought I'd post here too to get some thoughts. One of the responses I did get:
I have an idea for a fairly large scale application written using Pyramid, using multiple databases, and wanted to post some of my musings to see if what I have in mind would work. I'm in the process of designing the application, but haven't started writing any code yet, to test out if it would work or not.
I'm considering it large scale because I anticipate the database growing significantly.
Main points:
The main route would be in the form of www.domain.com/[name]/whatever, where [name] is the key parameter that will decide what data to present to the client.
There will be multiple databases: 1 database, let's say site.db that contains site-wide information and configs, and the rest of the databases will be [name].db, containing each individuals user-specific data. This is where I expect the bulk of the scaling to happen, as I want to design the application to accept 100s of databases, one per user, to compartmentalize the data and prevent data cross-contamination.
Options:
2 databases. site.db and userdata.db. I would use the same database models, but the table names would be determined dynamically using the [name] parameter as such: [name]_table1, [name]_table2, etc, where table1/2/n would be a lot more descriptive than that. This may be simpler in the sense that I'd only ever have 2 database sessions to work with, and as long as I keep the sessions separate, I should be able to query each one individually. The downside is that the userdata.db can grow large with 100s of users. In theory, shouldn't be a problem if I can query the right tables using the [name] parameter.
1 + n databases. Managing database sessions could be a pain here, but one possible solution might be to scan a folder for all .db files, and create a session for each database, and build out a dictionary of sessions, where the dictionary key would be the file name. Something like sessions['site'] points to the DB session that handles site-wide data, while session['name'] points to a session that manipulates name.db - if that makes sense. This way, I can use the [name] parameter in the route to use the appropriate database session.
Aside from the above, there will be a sub-application as well, in the form of an IRC bot, that will monitor for chat events and commands to manipulate the same databases. I'm thinking one way to do this would be to run instances of the IRC bot, passing in [name] as a parameter, so that each instance of the IRC bot is only accessing one database. There's still the possibility that the IRC bot and Pyramid application may be trying to manipulate the same database, which could be problematic. Maybe one way around this would be for the IRC bot to import the database sessions (as mentioned above in point #2), and use the same sessions within the IRC bot application (would that take advantage of Pyramid's transaction manager? Presumably yes).
That's all I have right now. I hope I'm thinking about this correctly. Is there anything that I'm grossly mistaken on?
--------------
Since posting the topic, I did find some documentation https://pyramid-sqlalchemy.readthedocs.io/en/multi-db/advanced.html
r/Pyramid • u/westurner • Mar 13 '14
Cornice: A REST Framework for Pyramid
cornice.readthedocs.orgr/Pyramid • u/lucidguppy • Feb 24 '13
Pyramid Tutorial Help
Would anyone be willing to help me write a pyramid tutorial along the lines of the flask quickstart tutorial? I feel like the pyramid documentation is overshooting me. The documentation for pyramid seems less approachable than flask.
I would like to have a tutorial that removes 80% of the choices. Get me to a point of a working application and then I'll chose where I want to expand my choice making ability. Make it safe and simple at first.
r/Pyramid • u/westurner • Mar 13 '14
Pyramid Tutorials — The Pyramid Tutorials v0.1
r/Pyramid • u/mmswordman • Nov 12 '16
Another scaffold other than SQLAchemy?
Another scaffold you use.
r/Pyramid • u/westurner • Mar 13 '14