pyramid

Pyramid fails to start when webtest and sqlalchemy are used together

我的梦境 提交于 2019-12-08 04:24:20
问题 I am trying to setup a pyramid app to use both webtest and sqlalchemy. If I comment out the SQLAlchemy code, the webtests run without a problem. [Test log ] https://travis-ci.org/caffeinated-expert/frisbee/builds/91622436 Error Traceback (most recent call last): File "frisbee/frisbee/tests/test_cities_page.py", line 18, in setUp app = main({}) File "frisbee/frisbee/__init__.py", line 15, in main engine = engine_from_config(settings, 'sqlalchemy.') File "build/bdist.macosx-10.10-x86_64/egg

Logging not working when running pyramid app under uWSGI in emperor mode

送分小仙女□ 提交于 2019-12-08 04:11:48
问题 First, a little background. I'm running an app under uWSGI in emperor mode. The uWSGI command line: uwsgi --master --emperor /etc/uwsgi --die-on-term --uid uwsgi --gid uwsgi The INI file for my app is in /etc/uwsgi and it is successfully found when uWSGI starts. My app's uwsgi and logging configuration sections: [uwsgi] socket = /tmp/uwsgi.sock master = true processes = 8 threads = 4 harakiri = 60 harakiri-verbose = true limit-post = 52428800 post-buffering = 8192 listen = 256 max-requests =

Trouble repeating elements using TAL, Chameleon and Pyramid

流过昼夜 提交于 2019-12-08 03:27:50
问题 I'm really struggling to get TAL and Chameleon/Pyramid to play nice. . . I have a view in Pyramid that returns, for example, the following: def view(request): return {'results' : [ {'name':'alice', 'value':22}, {'name':'bob', 'value':11}, {'name':'charlie', 'value':33} ] } I have a template that contains the following bit of HTML: <!DOCTYPE html> <html> <head></head> <body> <table> <thead> <tr> <td>Keyword</td> <td class="center">Mean Position</td> </tr> </thead> <tbody> <tr tal:repeat"row

template not found, deploying Pyramid on Webfaction

安稳与你 提交于 2019-12-08 01:06:24
问题 I'm trying to deploy my webapp to Webfaction, the basic example is working correctly, I got a TemplateNotFound in a template that extends a basic template using Jinja2. Here is my project tree: /webapps /myapp development.ini production.ini /bin /theapp /Project setup.py /project __init__.py views.py /templates base.jinja2 home.jinja2 /static _ init _.py config.include('pyramid_jinja2') config.add_jinja2_search_path("templates") home.jinja2 {% extends "templates/base.jinja2" %} To be more

Trouble repeating elements using TAL, Chameleon and Pyramid

时光毁灭记忆、已成空白 提交于 2019-12-07 22:42:25
I'm really struggling to get TAL and Chameleon/Pyramid to play nice. . . I have a view in Pyramid that returns, for example, the following: def view(request): return {'results' : [ {'name':'alice', 'value':22}, {'name':'bob', 'value':11}, {'name':'charlie', 'value':33} ] } I have a template that contains the following bit of HTML: <!DOCTYPE html> <html> <head></head> <body> <table> <thead> <tr> <td>Keyword</td> <td class="center">Mean Position</td> </tr> </thead> <tbody> <tr tal:repeat"row results"> <td>${row.name}</td> <td>${row.value}</td> </tr> </tbody> </table> </body> </html> I'm hoping

using Mysql and SqlAlchemy in Pyramid Framework

戏子无情 提交于 2019-12-07 19:01:52
问题 Pyramid Framework comes with a sample tutorial of sql alchemy that uses sqlite. The problem is that i want to use mysql so i change this sqlalchemy.url = sqlite:///%(here)s/tutorial.db Into this sqlalchemy.url = mysql://root:22password@localhost/alchemy when i try to run ../bin/pserve development.ini --reload It gives me the following error File "build/bdist.linux-i686/egg/sqlalchemy/connectors/mysqldb.py", line 52, in dbapi ImportError: No module named MySQLdb I understand that i should

Is there a way to share common configuration using Paste Deploy?

吃可爱长大的小学妹 提交于 2019-12-07 16:48:16
问题 This is a pretty simple idea conceptually. In terms of specifics, I'm working with a pretty generic Kotti installation, where I'm customizing some pages / templates. Much of my configuration is shared between a production and development server. Currently, these settings are included in two separate ini files. It would be nice to DRY this configuration, with common settings in one place. I'm quite open to this happening in python or an an ini file / section (or perhaps a third, yet-to-be

How does Pyramid's add_static_view work?

牧云@^-^@ 提交于 2019-12-07 08:56:47
问题 How does add_static_view(name, path) in Pyramid work? From the docstring: "The name argument is a string representing an application-relative local URL prefix. It may alternately be a full URL. The path argument is the path on disk where the static files reside. This can be an absolute path, a package-relative path, or an asset specification." Somehow I have got the impression that this description is not very accurate. If I add some code along the lines of config.add_static_view("static", "

Changing database per view & accessing multiple databases per view

雨燕双飞 提交于 2019-12-07 07:07:11
问题 I'm having some problems using SQLAlchemy in Pyramid. Although I can find examples of what I need, they're normally very short and lacking. So I've ended up with patchy code that barely makes any sense. So I'm hoping someone could give a fuller example of what I need to do. I have 4 databases all with the same schema. I want to be able to work on them from one Pyramid app, sometimes listing all "orders" from all 4 databases, sometimes just listing all "orders" from "site1". As the schemas are

Turbomail Integration with Pyramid

邮差的信 提交于 2019-12-07 06:43:08
问题 I am in need of a method to send an email from a Pyramid application. I know of pyramid_mailer, but it seems to have a fairly limited message class. I don't understand if it's possible to write the messages from pyramid_mailer using templates to generate the body of the email. Further, I haven't seen anything regarding whether rich-text is supported, or if it's just simple plain-text. Previously, I was using Turbomail with the Pylons framework. Unfortunately there doesn't appear to be any