Michael Merickel
2018-10-26 035f6cf8238211d097c991677fde6b5bc046a57b
TODO.txt
@@ -4,24 +4,18 @@
Nice-to-Have
------------
- Create a "mako_renderer_factory_factory" that provides searches in settings
  for "mako."-prefixed keys but allows other prefixes to be used to create
  different factories that don't use the global mako settings.  This would be
  useful for the debug toolbar, which can currently be sabotaged by someone
  using custom mako configuration settings.
- config.set_registry_attr with conflict detection... make sure the attr is
  added before a commit, but register an action so a conflict can be detected.
- Add docs about upgrading between Pyramid versions (e.g. how to see
  deprecation warnings).
- Provide the presumed renderer name to the called view as an attribute of
  the request.
- Fix renderers chapter to better document system values passed to template
  renderers.
- Have action methods return their discriminators.
- Modify view mapper narrative docs to not use pyramid_handlers.
- Modify the urldispatch chapter examples to assume a scan rather than
  ``add_view``.
- Decorator for append_slash_notfound_view_factory.
- Introspection:
@@ -32,9 +26,6 @@
    "view mappers" category)?
  * get rid of "tweens" category (can't sort properly?)
  * Introspection hiding for directives for purposes of omitting toolbar
    registrations.  Maybe toolbar can just use a null introspector?
- Fix deployment recipes in cookbook (discourage proxying without changing
  server).
@@ -47,8 +38,6 @@
- Add narrative docs for wsgiapp and wsgiapp2.
- Flesh out "Paste" narrative docs chapter.
- Basic WSGI documentation (pipeline / app / server).
- Change docs about creating a venusian decorator to not use ZCA (use
@@ -58,16 +47,9 @@
  the templates chapter and elsewhere.  Scan the documentation for reference
  to a renderer as *only* view configuration (it's a larger concept now).
- Add better docs about what-to-do-when-behind-a-proxy: paste.urlmap ("/foo =
- Add better docs about what-to-do-when-behind-a-proxy: rutter ("/foo =
  app1" and "domain app1.localhost = app1"), ProxyPreserveHost and the nginx
  equivalent, preserving HTTPS URLs.
- _fix_registry should dictify the registry being fixed.
- Make "localizer" a property of request (instead of requiring
  "get_localizer(request)"?
- Alias the stupid long default session factory name.
  proxy_params, preserving HTTPS URLs.
- Debug option to print view matching decision (e.g. debug_viewlookup or so).
@@ -86,42 +68,48 @@
- Deprecate pyramid.security.view_execution_permitted (it only works for
  traversal).
- Create a function which performs a recursive request.
- Create a ``render_view`` that works by using config.derive_view against an
  existing view callable instead of querying the registry (some sort of API
  for rendering a view callable object to a response from within another view
  callable). Possible idea: have config.add_view mark up the
  function/method/class like @view_config does, then use the attached info to
  derive a view callable whenever called via some API.
- Provide a ``has_view`` function.
- Update App engine chapter with less creaky directions.
Future
------
- Idea from Zart:
- 1.4: Kill off ``bfg.routes`` envvars in router.
- 1.4: Remove ``chameleon_text`` / ``chameleon_zpt`` deprecated functions
  (render_*)
- 1.4: Remove ``pyramid.configuration.ConfigurationError`` (deprecated).
- 1.4: Remove ``pyramid.paster.PyramidTemplate`` (deprecated).
- 1.4: Remove ``pyramid.settings.get_settings`` (deprecated).
- 1.5: Remove all deprecated ``pyramid.testing`` functions.
- 1.5: turn ``pyramid.settings.Settings`` into a function that returns the
  original dict (after ``__getattr__`` deprecation period, it was deprecated
  in 1.2).
- 1.5: Remove ``pyramid.requests.DeprecatedRequestMethodsMixin``.
- 1.6: Remove IContextURL and TraversalContextURL.
  diff --git a/pyramid/paster.py b/pyramid/paster.py
  index b0e4d79..b3bd82a 100644
  --- a/pyramid/paster.py
  +++ b/pyramid/paster.py
  @@ -8,6 +8,7 @@ from paste.deploy import (
   from pyramid.compat import configparser
   from logging.config import fileConfig
   from pyramid.scripting import prepare
  +from pyramid.config import Configurator
   def get_app(config_uri, name=None, loadapp=loadapp):
       """ Return the WSGI application named ``name`` in the PasteDeploy
  @@ -111,3 +112,10 @@ def bootstrap(config_uri, request=None):
       env['app'] = app
       return env
  +def make_pyramid_app(global_conf, app=None, **settings):
  +    """Return pyramid application configured with provided settings"""
  +    config = Configurator(package='pyramid', settings=settings)
  +    if app:
  +        config.include(app)
  +    app = config.make_wsgi_app()
  +    return app
  diff --git a/setup.py b/setup.py
  index 03ebb42..91e0e21 100644
  --- a/setup.py
  +++ b/setup.py
  @@ -118,6 +118,8 @@ setup(name='pyramid',
           [paste.server_runner]
           wsgiref = pyramid.scripts.pserve:wsgiref_server_runner
           cherrypy = pyramid.scripts.pserve:cherrypy_server_runner
  +        [paster.app_factory]
  +        main = pyramid.paster:make_pyramid_app
         """
         )
Probably Bad Ideas
------------------
@@ -139,3 +127,22 @@
- Have ``remember`` and ``forget`` actually set headers on the response using
  a response callback (and return the empty list)?
- http://pythonguy.wordpress.com/2011/06/22/dynamic-variables-revisited/
  instead of thread locals
- Context manager for creating a new configurator (replacing
  ``with_package``).  E.g.::
    with config.partial(package='bar') as c:
        c.add_view(...)
  or::
    with config.partial(introspection=False) as c:
        c.add_view(..)
- _fix_registry should dictify the registry being fixed.
- Apply a prefix to the userid principal to avoid poisoning the principal
  namespace. See https://github.com/Pylons/pyramid/issues/2060