docs/narr/MyProject/development.ini
@@ -20,7 +20,7 @@ # Begin logging configuration [loggers] keys = root keys = root, myproject [handlers] keys = console @@ -32,6 +32,11 @@ level = INFO handlers = console [logger_myproject] level = DEBUG handlers = qualname = myproject [handler_console] class = StreamHandler args = (sys.stderr,) docs/narr/MyProject/production.ini
New file @@ -0,0 +1,63 @@ [app:MyProject] use = egg:MyProject reload_templates = false debug_authorization = false debug_notfound = false debug_routematch = false debug_templates = false default_locale_name = en [filter:weberror] use = egg:WebError#error_catcher debug = false ;error_log = ;show_exceptions_in_wsgi_errors = true ;smtp_server = localhost ;error_email = janitor@example.com ;smtp_username = janitor ;smtp_password = "janitor's password" ;from_address = paste@localhost ;error_subject_prefix = "Pyramid Error" ;smtp_use_tls = ;error_message = [pipeline:main] pipeline = weberror MyProject [server:main] use = egg:Paste#http host = 0.0.0.0 port = 6543 # Begin logging configuration [loggers] keys = root, myproject [handlers] keys = console [formatters] keys = generic [logger_root] level = INFO handlers = console [logger_myproject] level = INFO handlers = qualname = myproject [handler_console] class = StreamHandler args = (sys.stderr,) level = NOTSET formatter = generic [formatter_generic] format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s # End logging configuration docs/narr/project.rst
@@ -136,10 +136,18 @@ directory. The ``setup.py`` file in that directory can be used to distribute your application, or install your application for deployment or development. A :term:`PasteDeploy` ``.ini`` file named ``development.ini`` will also be created in the project directory. You will use this ``.ini`` file to configure a server, to run your application, and to and debug your application. A :term:`PasteDeploy` ``.ini`` file named ``development.ini`` will be created in the project directory. You will use this ``.ini`` file to configure a server, to run your application, and to and debug your application. It sports configuration that enables an interactive debugger and settings optimized for development. Another :term:`PasteDeploy` ``.ini`` file named ``production.ini`` will also be created in the project directory. It sports configuration that disables any interactive debugger (to prevent inappropriate access and disclosure), and turns off a number of debugging settings. You can use this file to put your application into production, and you can modify it to do things like send email when an exception occurs. The ``MyProject`` project directory contains an additional subdirectory named ``myproject`` (note the case difference) representing a Python @@ -456,6 +464,7 @@ | | `-- mytemplate.pt | |-- tests.py | `-- views.py |-- production.ini |-- README.txt |-- setup.cfg `-- setup.py @@ -475,7 +484,10 @@ written in :term:`ReStructuredText` format. #. ``development.ini`` is a :term:`PasteDeploy` configuration file that can be used to execute your application. be used to execute your application during development. #. ``production.ini`` is a :term:`PasteDeploy` configuration file that can be used to execute your application in a production configuration. #. ``setup.cfg`` is a :term:`setuptools` configuration file used by ``setup.py``. @@ -604,6 +616,17 @@ configuration file. The values in a ``[DEFAULT]`` section will be passed to your application's ``main`` function as ``global_values``. ``production.ini`` ~~~~~~~~~~~~~~~~~~~ The ``development.ini`` file is a :term:`PasteDeploy` configuration file with a purpose much like that of ``development.ini``. However, it disables the WebError interactive debugger, replacing it with a logger which outputs exception messages to ``stderr`` by default. It also turns off template development options such that templates are not automatically reloaded when changed, and turns off all debugging options. You can use this file instead of ``development.ini`` when you put your application into production. .. index:: single: setup.py docs/tutorials/modwsgi/index.rst
@@ -75,13 +75,15 @@ from pyramid.paster import get_app application = get_app( '/Users/chrism/modwsgi/env/myapp/myapp.ini', 'main') '/Users/chrism/modwsgi/env/myapp/production.ini', 'main') The first argument to ``get_app`` is the project Paste configuration file name. The second is the name of the section within the .ini file that should be loaded by ``mod_wsgi``. The assignment to the name ``application`` is important: mod_wsgi requires finding such an assignment when it opens the file. The first argument to ``get_app`` is the project Paste configuration file name. It's best to use the ``production.ini`` file provided by your Pyramid paster template, as it contains settings appropriate for production. The second is the name of the section within the .ini file that should be loaded by ``mod_wsgi``. The assignment to the name ``application`` is important: mod_wsgi requires finding such an assignment when it opens the file. #. Make the ``pyramid.wsgi`` script executable. docs/tutorials/wiki/src/authorization/production.ini
New file @@ -0,0 +1,70 @@ [app:tutorial] use = egg:tutorial reload_templates = false debug_authorization = false debug_notfound = false debug_routematch = false debug_templates = false default_locale_name = en zodb_uri = file://%(here)s/Data.fs?connection_cache_size=20000 [filter:weberror] use = egg:WebError#error_catcher debug = false ;error_log = ;show_exceptions_in_wsgi_errors = true ;smtp_server = localhost ;error_email = janitor@example.com ;smtp_username = janitor ;smtp_password = "janitor's password" ;from_address = paste@localhost ;error_subject_prefix = "Pyramid Error" ;smtp_use_tls = ;error_message = [filter:tm] use = egg:repoze.tm2#tm commit_veto = repoze.tm:default_commit_veto [pipeline:main] pipeline = weberror egg:repoze.zodbconn#closer tm tutorial [server:main] use = egg:Paste#http host = 0.0.0.0 port = 6543 # Begin logging configuration [loggers] keys = root, tutorial [handlers] keys = console [formatters] keys = generic [logger_root] level = INFO handlers = console [logger_tutorial] level = INFO handlers = qualname = tutorial [handler_console] class = StreamHandler args = (sys.stderr,) level = NOTSET formatter = generic [formatter_generic] format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s # End logging configuration docs/tutorials/wiki/src/basiclayout/production.ini
New file @@ -0,0 +1,70 @@ [app:tutorial] use = egg:tutorial reload_templates = false debug_authorization = false debug_notfound = false debug_routematch = false debug_templates = false default_locale_name = en zodb_uri = file://%(here)s/Data.fs?connection_cache_size=20000 [filter:weberror] use = egg:WebError#error_catcher debug = false ;error_log = ;show_exceptions_in_wsgi_errors = true ;smtp_server = localhost ;error_email = janitor@example.com ;smtp_username = janitor ;smtp_password = "janitor's password" ;from_address = paste@localhost ;error_subject_prefix = "Pyramid Error" ;smtp_use_tls = ;error_message = [filter:tm] use = egg:repoze.tm2#tm commit_veto = repoze.tm:default_commit_veto [pipeline:main] pipeline = weberror egg:repoze.zodbconn#closer tm tutorial [server:main] use = egg:Paste#http host = 0.0.0.0 port = 6543 # Begin logging configuration [loggers] keys = root, tutorial [handlers] keys = console [formatters] keys = generic [logger_root] level = INFO handlers = console [logger_tutorial] level = INFO handlers = qualname = tutorial [handler_console] class = StreamHandler args = (sys.stderr,) level = NOTSET formatter = generic [formatter_generic] format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s # End logging configuration docs/tutorials/wiki/src/models/production.ini
New file @@ -0,0 +1,70 @@ [app:tutorial] use = egg:tutorial reload_templates = false debug_authorization = false debug_notfound = false debug_routematch = false debug_templates = false default_locale_name = en zodb_uri = file://%(here)s/Data.fs?connection_cache_size=20000 [filter:weberror] use = egg:WebError#error_catcher debug = false ;error_log = ;show_exceptions_in_wsgi_errors = true ;smtp_server = localhost ;error_email = janitor@example.com ;smtp_username = janitor ;smtp_password = "janitor's password" ;from_address = paste@localhost ;error_subject_prefix = "Pyramid Error" ;smtp_use_tls = ;error_message = [filter:tm] use = egg:repoze.tm2#tm commit_veto = repoze.tm:default_commit_veto [pipeline:main] pipeline = weberror egg:repoze.zodbconn#closer tm tutorial [server:main] use = egg:Paste#http host = 0.0.0.0 port = 6543 # Begin logging configuration [loggers] keys = root, tutorial [handlers] keys = console [formatters] keys = generic [logger_root] level = INFO handlers = console [logger_tutorial] level = INFO handlers = qualname = tutorial [handler_console] class = StreamHandler args = (sys.stderr,) level = NOTSET formatter = generic [formatter_generic] format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s # End logging configuration docs/tutorials/wiki/src/views/production.ini
New file @@ -0,0 +1,70 @@ [app:tutorial] use = egg:tutorial reload_templates = false debug_authorization = false debug_notfound = false debug_routematch = false debug_templates = false default_locale_name = en zodb_uri = file://%(here)s/Data.fs?connection_cache_size=20000 [filter:weberror] use = egg:WebError#error_catcher debug = false ;error_log = ;show_exceptions_in_wsgi_errors = true ;smtp_server = localhost ;error_email = janitor@example.com ;smtp_username = janitor ;smtp_password = "janitor's password" ;from_address = paste@localhost ;error_subject_prefix = "Pyramid Error" ;smtp_use_tls = ;error_message = [filter:tm] use = egg:repoze.tm2#tm commit_veto = repoze.tm:default_commit_veto [pipeline:main] pipeline = weberror egg:repoze.zodbconn#closer tm tutorial [server:main] use = egg:Paste#http host = 0.0.0.0 port = 6543 # Begin logging configuration [loggers] keys = root, tutorial [handlers] keys = console [formatters] keys = generic [logger_root] level = INFO handlers = console [logger_tutorial] level = INFO handlers = qualname = tutorial [handler_console] class = StreamHandler args = (sys.stderr,) level = NOTSET formatter = generic [formatter_generic] format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s # End logging configuration docs/tutorials/wiki2/src/authorization/production.ini
New file @@ -0,0 +1,69 @@ [app:tutorial] use = egg:tutorial reload_templates = false debug_authorization = false debug_notfound = false debug_routematch = false debug_templates = false default_locale_name = en sqlalchemy.url = sqlite:///%(here)s/tutorial.db [filter:weberror] use = egg:WebError#error_catcher debug = false ;error_log = ;show_exceptions_in_wsgi_errors = true ;smtp_server = localhost ;error_email = janitor@example.com ;smtp_username = janitor ;smtp_password = "janitor's password" ;from_address = paste@localhost ;error_subject_prefix = "Pyramid Error" ;smtp_use_tls = ;error_message = [filter:tm] use = egg:repoze.tm2#tm commit_veto = repoze.tm:default_commit_veto [pipeline:main] pipeline = weberror tm tutorial [server:main] use = egg:Paste#http host = 0.0.0.0 port = 6543 # Begin logging configuration [loggers] keys = root, tutorial, sqlalchemy [handlers] keys = console [formatters] keys = generic [logger_root] level = INFO handlers = console [logger_tutorial] level = INFO handlers = qualname = tutorial [handler_console] class = StreamHandler args = (sys.stderr,) level = NOTSET formatter = generic [formatter_generic] format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s # End logging configuration docs/tutorials/wiki2/src/basiclayout/production.ini
New file @@ -0,0 +1,69 @@ [app:tutorial] use = egg:tutorial reload_templates = false debug_authorization = false debug_notfound = false debug_routematch = false debug_templates = false default_locale_name = en sqlalchemy.url = sqlite:///%(here)s/tutorial.db [filter:weberror] use = egg:WebError#error_catcher debug = false ;error_log = ;show_exceptions_in_wsgi_errors = true ;smtp_server = localhost ;error_email = janitor@example.com ;smtp_username = janitor ;smtp_password = "janitor's password" ;from_address = paste@localhost ;error_subject_prefix = "Pyramid Error" ;smtp_use_tls = ;error_message = [filter:tm] use = egg:repoze.tm2#tm commit_veto = repoze.tm:default_commit_veto [pipeline:main] pipeline = weberror tm tutorial [server:main] use = egg:Paste#http host = 0.0.0.0 port = 6543 # Begin logging configuration [loggers] keys = root, tutorial, sqlalchemy [handlers] keys = console [formatters] keys = generic [logger_root] level = INFO handlers = console [logger_tutorial] level = INFO handlers = qualname = tutorial [handler_console] class = StreamHandler args = (sys.stderr,) level = NOTSET formatter = generic [formatter_generic] format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s # End logging configuration docs/tutorials/wiki2/src/models/production.ini
New file @@ -0,0 +1,69 @@ [app:tutorial] use = egg:tutorial reload_templates = false debug_authorization = false debug_notfound = false debug_routematch = false debug_templates = false default_locale_name = en sqlalchemy.url = sqlite:///%(here)s/tutorial.db [filter:weberror] use = egg:WebError#error_catcher debug = false ;error_log = ;show_exceptions_in_wsgi_errors = true ;smtp_server = localhost ;error_email = janitor@example.com ;smtp_username = janitor ;smtp_password = "janitor's password" ;from_address = paste@localhost ;error_subject_prefix = "Pyramid Error" ;smtp_use_tls = ;error_message = [filter:tm] use = egg:repoze.tm2#tm commit_veto = repoze.tm:default_commit_veto [pipeline:main] pipeline = weberror tm tutorial [server:main] use = egg:Paste#http host = 0.0.0.0 port = 6543 # Begin logging configuration [loggers] keys = root, tutorial, sqlalchemy [handlers] keys = console [formatters] keys = generic [logger_root] level = INFO handlers = console [logger_tutorial] level = INFO handlers = qualname = tutorial [handler_console] class = StreamHandler args = (sys.stderr,) level = NOTSET formatter = generic [formatter_generic] format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s # End logging configuration docs/tutorials/wiki2/src/views/production.ini
New file @@ -0,0 +1,69 @@ [app:tutorial] use = egg:tutorial reload_templates = false debug_authorization = false debug_notfound = false debug_routematch = false debug_templates = false default_locale_name = en sqlalchemy.url = sqlite:///%(here)s/tutorial.db [filter:weberror] use = egg:WebError#error_catcher debug = false ;error_log = ;show_exceptions_in_wsgi_errors = true ;smtp_server = localhost ;error_email = janitor@example.com ;smtp_username = janitor ;smtp_password = "janitor's password" ;from_address = paste@localhost ;error_subject_prefix = "Pyramid Error" ;smtp_use_tls = ;error_message = [filter:tm] use = egg:repoze.tm2#tm commit_veto = repoze.tm:default_commit_veto [pipeline:main] pipeline = weberror tm tutorial [server:main] use = egg:Paste#http host = 0.0.0.0 port = 6543 # Begin logging configuration [loggers] keys = root, tutorial, sqlalchemy [handlers] keys = console [formatters] keys = generic [logger_root] level = INFO handlers = console [logger_tutorial] level = INFO handlers = qualname = tutorial [handler_console] class = StreamHandler args = (sys.stderr,) level = NOTSET formatter = generic [formatter_generic] format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s # End logging configuration