Michael Merickel
2018-10-04 1f307db52785634d6667fde8de0273d5e0612310
commit | author | age
17cf32 1 .. _configuration_module:
CM 2
66b20a 3 .. role:: methodcategory
CM 4    :class: methodcategory
5
d7f259 6 :mod:`pyramid.config`
CM 7 ---------------------
17cf32 8
d7f259 9 .. automodule:: pyramid.config
17cf32 10
66b20a 11 .. autoclass:: Configurator
17cf32 12
66b20a 13   :methodcategory:`Controlling Configuration State`
7534ba 14
66b20a 15     .. automethod:: commit
CM 16     .. automethod:: begin
17     .. automethod:: end
18     .. automethod:: include
19     .. automethod:: make_wsgi_app()
20     .. automethod:: scan
bdd2b1 21
66b20a 22   :methodcategory:`Adding Routes and Views`
388544 23
66b20a 24     .. automethod:: add_route
CM 25     .. automethod:: add_static_view(name, path, cache_max_age=3600, permission=NO_PERMISSION_REQUIRED)
26     .. automethod:: add_view
0db4a1 27     .. automethod:: add_notfound_view
a7fe30 28     .. automethod:: add_forbidden_view
af77a1 29     .. automethod:: add_exception_view
388544 30
66b20a 31   :methodcategory:`Adding an Event Subscriber`
388544 32
66b20a 33     .. automethod:: add_subscriber
388544 34
66b20a 35   :methodcategory:`Using Security`
388544 36
66b20a 37      .. automethod:: set_authentication_policy
CM 38      .. automethod:: set_authorization_policy
de3d0c 39      .. automethod:: set_default_csrf_options
7c0f09 40      .. automethod:: set_csrf_storage_policy
e25a70 41      .. automethod:: set_default_permission
6b180c 42      .. automethod:: add_permission
e25a70 43
2c2534 44    :methodcategory:`Extending the Request Object`
af7a1d 45
023c88 46      .. automethod:: add_request_method
10320e 47
66b20a 48    :methodcategory:`Using I18N`
da358e 49
66b20a 50      .. automethod:: add_translation_dirs
CM 51      .. automethod:: set_locale_negotiator
cae85d 52
66b20a 53    :methodcategory:`Overriding Assets`
1a42bd 54
66b20a 55      .. automethod:: override_asset(to_override, override_with)
af2323 56
66b20a 57    :methodcategory:`Getting and Adding Settings`
388544 58
66b20a 59      .. automethod:: add_settings
388544 60      .. automethod:: get_settings
CM 61
66b20a 62    :methodcategory:`Hooking Pyramid Behavior`
CM 63
64      .. automethod:: add_renderer
65      .. automethod:: add_resource_url_adapter
66      .. automethod:: add_response_adapter
67      .. automethod:: add_traverser
68      .. automethod:: add_tween
0196b2 69      .. automethod:: add_route_predicate
de3d0c 70      .. automethod:: add_subscriber_predicate
0196b2 71      .. automethod:: add_view_predicate
35e632 72      .. automethod:: add_view_deriver
0bee84 73      .. automethod:: set_execution_policy
66b20a 74      .. automethod:: set_request_factory
CM 75      .. automethod:: set_root_factory
76      .. automethod:: set_session_factory
77      .. automethod:: set_view_mapper
78
79    :methodcategory:`Extension Author APIs`
388544 80
CM 81      .. automethod:: action
82      .. automethod:: add_directive
83      .. automethod:: with_package
225a7b 84      .. automethod:: derive_view
388544 85
66b20a 86    :methodcategory:`Utility Methods`
388544 87
CM 88      .. automethod:: absolute_asset_spec
66b20a 89      .. automethod:: maybe_dotted
388544 90
66b20a 91    :methodcategory:`ZCA-Related APIs`
CM 92
93      .. automethod:: hook_zca
94      .. automethod:: unhook_zca
225a7b 95      .. automethod:: setup_registry
66b20a 96
CM 97    :methodcategory:`Testing Helper APIs`
98
99      .. automethod:: testing_add_renderer
100      .. automethod:: testing_add_subscriber
101      .. automethod:: testing_resources
102      .. automethod:: testing_securitypolicy
103
104    :methodcategory:`Attributes`
adfc23 105
ce5c42 106      .. attribute:: introspectable
CM 107
108         A shortcut attribute which points to the
109         :class:`pyramid.registry.Introspectable` class (used during
110         directives to provide introspection to actions).
111
0b23b3 112         .. versionadded:: 1.3
57a0d7 113
CM 114      .. attribute:: introspector
115
116         The :term:`introspector` related to this configuration.  It is an
117         instance implementing the :class:`pyramid.interfaces.IIntrospector`
65d4a6 118         interface.
57a0d7 119
0b23b3 120         .. versionadded:: 1.3
388544 121
CM 122      .. attribute:: registry
123
124         The :term:`application registry` which holds the configuration
125         associated with this configurator.
adfc23 126
66b20a 127 .. attribute:: global_registries
37e3be 128
66b20a 129    The set of registries that have been created for :app:`Pyramid`
fa1ac6 130    applications, one for each call to
66b20a 131    :meth:`pyramid.config.Configurator.make_wsgi_app` in the current
CM 132    process. The object itself supports iteration and has a ``last`` property
133    containing the last registry loaded.
37e3be 134
66b20a 135    The registries contained in this object are stored as weakrefs, thus they
CM 136    will only exist for the lifetime of the actual applications for which they
137    are being used.
37e3be 138
32333e 139 .. autoclass:: not_
568a02 140
MM 141 .. attribute:: PHASE0_CONFIG
142 .. attribute:: PHASE1_CONFIG
143 .. attribute:: PHASE2_CONFIG
144 .. attribute:: PHASE3_CONFIG