commit | author | age
|
051143
|
1 |
Pyramid TODOs |
CM |
2 |
============= |
69364d
|
3 |
|
8ac9e6
|
4 |
Nice-to-Have |
CM |
5 |
------------ |
0db4a1
|
6 |
|
bc5272
|
7 |
- config.set_registry_attr with conflict detection... make sure the attr is |
CM |
8 |
added before a commit, but register an action so a conflict can be detected. |
|
9 |
|
2861f1
|
10 |
- Provide the presumed renderer name to the called view as an attribute of |
CM |
11 |
the request. |
|
12 |
|
d806f9
|
13 |
- Have action methods return their discriminators. |
CM |
14 |
|
4786ca
|
15 |
- Fix renderers chapter to better document system values passed to template |
CM |
16 |
renderers. |
|
17 |
|
37f3ba
|
18 |
- Modify view mapper narrative docs to not use pyramid_handlers. |
8ac9e6
|
19 |
|
cd422c
|
20 |
- Modify the urldispatch chapter examples to assume a scan rather than |
CM |
21 |
``add_view``. |
|
22 |
|
8ac9e6
|
23 |
- Introspection: |
57a0d7
|
24 |
|
63c969
|
25 |
* ``default root factory`` category (prevent folks from needing to searh |
CM |
26 |
"root factories" category)? |
58c01f
|
27 |
|
63c969
|
28 |
* ``default view mapper`` category (prevent folks from needing to search |
CM |
29 |
"view mappers" category)? |
58c01f
|
30 |
|
4a4ef4
|
31 |
* get rid of "tweens" category (can't sort properly?) |
CM |
32 |
|
bfc01f
|
33 |
- Fix deployment recipes in cookbook (discourage proxying without changing |
CM |
34 |
server). |
|
35 |
|
773024
|
36 |
- Try "with transaction.manager" in an exception view with SQLA (preempt |
CM |
37 |
homina homina response about how to write "to the database" from within in |
63c969
|
38 |
an exception view). Note: tried this and couldn't formulate the right |
CM |
39 |
situation where the database could not be written to within an exception |
|
40 |
view (but didn't try exhaustively). |
e307fc
|
41 |
|
95eab9
|
42 |
- Add narrative docs for wsgiapp and wsgiapp2. |
CM |
43 |
|
|
44 |
- Flesh out "Paste" narrative docs chapter. |
|
45 |
|
|
46 |
- Basic WSGI documentation (pipeline / app / server). |
|
47 |
|
63c969
|
48 |
- Change docs about creating a venusian decorator to not use ZCA (use |
CM |
49 |
configurator methods instead). |
95eab9
|
50 |
|
CM |
51 |
- Try to better explain the relationship between a renderer and a template in |
|
52 |
the templates chapter and elsewhere. Scan the documentation for reference |
|
53 |
to a renderer as *only* view configuration (it's a larger concept now). |
3d338e
|
54 |
|
a7d50d
|
55 |
- Add better docs about what-to-do-when-behind-a-proxy: paste.urlmap ("/foo = |
CM |
56 |
app1" and "domain app1.localhost = app1"), ProxyPreserveHost and the nginx |
|
57 |
equivalent, preserving HTTPS URLs. |
|
58 |
|
51add8
|
59 |
- Make "localizer" a property of request (instead of requiring |
CM |
60 |
"get_localizer(request)"? |
|
61 |
|
b5ffe3
|
62 |
- Alias the stupid long default session factory name. |
371a67
|
63 |
|
6aafc5
|
64 |
- Debug option to print view matching decision (e.g. debug_viewlookup or so). |
94a527
|
65 |
|
f765a6
|
66 |
- Non-bwcompat use of threadlocals that need to be documented or ameliorated: |
CM |
67 |
|
|
68 |
security.principals_allowed_by_permission |
|
69 |
|
|
70 |
resource.OverrideProvider._get_overrides: can't credibly be removed, |
|
71 |
because it stores an overrideprovider as a module-scope global. |
|
72 |
|
|
73 |
traversal.traverse: this API is a stepchild, and needs to be changed. |
|
74 |
|
|
75 |
Configurator.add_translation_dirs: not passed any context but a message, |
|
76 |
can't credibly be removed. |
|
77 |
|
95eab9
|
78 |
- Deprecate pyramid.security.view_execution_permitted (it only works for |
CM |
79 |
traversal). |
f07765
|
80 |
|
7c1549
|
81 |
- Provide a ``has_view`` function. |
CM |
82 |
|
485ef6
|
83 |
- Update App engine chapter with less creaky directions. |
d8d14a
|
84 |
|
9ff3b2
|
85 |
- Idea from Zart: |
CM |
86 |
|
|
87 |
diff --git a/pyramid/paster.py b/pyramid/paster.py |
|
88 |
index b0e4d79..b3bd82a 100644 |
|
89 |
--- a/pyramid/paster.py |
|
90 |
+++ b/pyramid/paster.py |
|
91 |
@@ -8,6 +8,7 @@ from paste.deploy import ( |
|
92 |
from pyramid.compat import configparser |
|
93 |
from logging.config import fileConfig |
|
94 |
from pyramid.scripting import prepare |
|
95 |
+from pyramid.config import Configurator |
|
96 |
|
|
97 |
def get_app(config_uri, name=None, loadapp=loadapp): |
|
98 |
""" Return the WSGI application named ``name`` in the PasteDeploy |
|
99 |
@@ -111,3 +112,10 @@ def bootstrap(config_uri, request=None): |
|
100 |
env['app'] = app |
|
101 |
return env |
|
102 |
|
|
103 |
+def make_pyramid_app(global_conf, app=None, **settings): |
|
104 |
+ """Return pyramid application configured with provided settings""" |
|
105 |
+ config = Configurator(package='pyramid', settings=settings) |
|
106 |
+ if app: |
|
107 |
+ config.include(app) |
|
108 |
+ app = config.make_wsgi_app() |
|
109 |
+ return app |
|
110 |
diff --git a/setup.py b/setup.py |
|
111 |
index 03ebb42..91e0e21 100644 |
|
112 |
--- a/setup.py |
|
113 |
+++ b/setup.py |
|
114 |
@@ -118,6 +118,8 @@ setup(name='pyramid', |
|
115 |
[paste.server_runner] |
|
116 |
wsgiref = pyramid.scripts.pserve:wsgiref_server_runner |
|
117 |
cherrypy = pyramid.scripts.pserve:cherrypy_server_runner |
|
118 |
+ [paster.app_factory] |
|
119 |
+ main = pyramid.paster:make_pyramid_app |
|
120 |
""" |
|
121 |
) |
|
122 |
|
|
123 |
|
cccc91
|
124 |
Future |
CM |
125 |
------ |
|
126 |
|
b6a102
|
127 |
- 1.5: remove ``pyramid.view.static`` and ``pyramid.view.is_response``. |
641301
|
128 |
|
2a9682
|
129 |
- 1.5: turn ``pyramid.settings.Settings`` into a function that returns the |
CM |
130 |
original dict (after ``__getattr__`` deprecation period, it was deprecated |
|
131 |
in 1.2). |
|
132 |
|
07cb8f
|
133 |
- 1.5: Remove ``pyramid.requests.DeprecatedRequestMethodsMixin`` and code in |
CM |
134 |
renderers module that looks for _response_content_type, et. al. |
2a9682
|
135 |
|
023c88
|
136 |
- 1.5: Maybe? deprecate set_request_property in favor of pointing people at |
CM |
137 |
add_request_method, schedule removal for 1.8? |
004882
|
138 |
|
f272f2
|
139 |
- 1.5: Remove pyramid.config.rendering set_renderer_globals_factory maybe. |
CM |
140 |
|
|
141 |
- 1.5: remove pyramid.config.route _add_view_from_route function. |
|
142 |
|
63c969
|
143 |
- 1.6: Remove IContextURL and TraversalContextURL. |
CM |
144 |
|
ca3df8
|
145 |
- 1.7: Change ``pyramid.authentication.AuthTktAuthenticationPolicy`` default |
MM |
146 |
``hashalg`` to ``sha512``. |
|
147 |
|
d8d14a
|
148 |
Probably Bad Ideas |
CM |
149 |
------------------ |
d89aee
|
150 |
|
485ef6
|
151 |
- Add functionality that mocks the behavior of ``repoze.browserid``. |
c8e78c
|
152 |
|
5f3fc0
|
153 |
- Consider implementing the API outlined in |
CM |
154 |
http://plope.com/pyramid_auth_design_api_postmortem, phasing out the |
|
155 |
current auth-n-auth abstractions in a backwards compatible way. |
9d3bd8
|
156 |
|
d8d14a
|
157 |
- Maybe add ``add_renderer_globals`` method to Configurator. |
CM |
158 |
|
95eab9
|
159 |
- Supply ``X-Vhm-Host`` support (probably better to do what paste#prefix |
CM |
160 |
middleware does). |
|
161 |
|
c5724c
|
162 |
- Have ``remember`` and ``forget`` actually set headers on the response using |
CM |
163 |
a response callback (and return the empty list)? |
f8636c
|
164 |
|
CM |
165 |
- http://pythonguy.wordpress.com/2011/06/22/dynamic-variables-revisited/ |
|
166 |
instead of thread locals |
a0547e
|
167 |
|
CM |
168 |
- Context manager for creating a new configurator (replacing |
|
169 |
``with_package``). E.g.:: |
|
170 |
|
|
171 |
with config.partial(package='bar') as c: |
|
172 |
c.add_view(...) |
|
173 |
|
|
174 |
or:: |
|
175 |
|
|
176 |
with config.partial(introspection=False) as c: |
|
177 |
c.add_view(..) |
|
178 |
|
44d73a
|
179 |
- _fix_registry should dictify the registry being fixed. |
20b1a1
|
180 |
|