Permalink
Browse files

modernize

  • Loading branch information...
1 parent a0d29e3 commit ea0da8319cd110962b139a4872c81e9bb84f926e @mcdonc mcdonc committed Feb 15, 2012
Showing with 37 additions and 51 deletions.
  1. +1 −1 .gitignore
  2. +4 −12 development.ini
  3. +26 −34 production.ini
  4. +6 −4 setup.py
View
2 .gitignore
@@ -17,4 +17,4 @@ pypyenv/
build/
dist/
ideadb
-
+exception.log
View
16 development.ini
@@ -1,4 +1,4 @@
-[app:shootout]
+[app:main]
use = egg:shootout
reload_templates = true
debug_authorization = false
@@ -7,19 +7,11 @@ debug_routematch = false
debug_templates = true
default_locale_name = en
sqlalchemy.url = sqlite:///%(here)s/shootout.db
-
-[pipeline:main]
-pipeline =
- egg:WebError#evalerror
- tm
- shootout
-
-[filter:tm]
-use = egg:repoze.tm2#tm
-commit_veto = repoze.tm:default_commit_veto
+pyramid.includes = pyramid_debugtoolbar
+ pyramid_tm
[server:main]
-use = egg:Paste#http
+use = egg:waitress#main
host = 0.0.0.0
port = 6543
View
60 production.ini
@@ -1,77 +1,69 @@
-[app:shootout]
+[app:main]
use = egg:shootout
-reload_templates = false
+reload_templates = true
debug_authorization = false
debug_notfound = false
debug_routematch = false
-debug_templates = false
+debug_templates = true
default_locale_name = en
sqlalchemy.url = sqlite:///%(here)s/shootout.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
- shootout
+pyramid.includes = pyramid_exclog
+ pyramid_tm
[server:main]
-use = egg:Paste#http
+use = egg:waitress#main
host = 0.0.0.0
port = 6543
# Begin logging configuration
[loggers]
-keys = root, shootout, sqlalchemy
+keys = root, shootout, sqlalchemy, exc_logger
[handlers]
-keys = console
+keys = console, exc_handler
[formatters]
-keys = generic
+keys = generic, exc_formatter
[logger_root]
-level = WARN
+level = INFO
handlers = console
[logger_shootout]
-level = WARN
+level = DEBUG
handlers =
qualname = shootout
[logger_sqlalchemy]
-level = WARN
+level = INFO
handlers =
qualname = sqlalchemy.engine
# "level = INFO" logs SQL queries.
# "level = DEBUG" logs SQL queries and results.
# "level = WARN" logs neither. (Recommended for production systems.)
+[logger_exc_logger]
+level = ERROR
+handlers = exc_handler
+qualname = exc_logger
+
[handler_console]
class = StreamHandler
args = (sys.stderr,)
level = NOTSET
formatter = generic
+[handler_exc_handler]
+class = FileHandler
+args = ('%(here)s/exception.log',)
+level = ERROR
+formatter = exc_formatter
+
[formatter_generic]
format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s
+[formatter_exc_formatter]
+format = %(asctime)s %(message)s
+
# End logging configuration
View
10 setup.py
@@ -9,18 +9,20 @@
requires = [
'setuptools',
- 'pyramid',
+ 'pyramid>=1.2',
'SQLAlchemy',
'transaction',
- 'repoze.tm2>=1.0b1', # default_commit_veto
+ 'pyramid_tm',
+ 'pyramid_debugtoolbar',
+ 'pyramid_exclog',
'zope.sqlalchemy',
- 'WebError',
'pyramid_simpleform',
'cryptacular',
+ 'waitress',
]
if sys.version_info[:3] < (2,5,0):
- requires.append('pysqlite')
+ raise RuntimeError('This application requires Python 2.6+')
setup(name='shootout',
version='0.2',

0 comments on commit ea0da83

Please sign in to comment.