Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added support for FirePython logging when logged in as administrator.

  • Loading branch information...
commit 346e5fb7c1fd87259dc79f2c4ae852badb6f2b79 1 parent 5d683ff
@Arachnid Arachnid authored
Showing with 19 additions and 8 deletions.
  1. +3 −0  .gitmodules
  2. +3 −0  app.yaml
  3. +12 −8 main.py
  4. +1 −0  utils/external/firepython
View
3  .gitmodules
@@ -0,0 +1,3 @@
+[submodule "utils/external/firepython"]
+ path = utils/external/firepython
+ url = git://github.com/woid/firepython.git
View
3  app.yaml
@@ -39,4 +39,7 @@ skip_files: |
(dev/.*)|
(tests/.*)|
(docs/.*)|
+ (.*\.markdown)|
+ (license\.txt)|
+ (setup.py)
)$
View
20 main.py
@@ -23,18 +23,20 @@
__author__ = 'William T. Katz'
-from google.appengine.ext import webapp
-
-import logging
+import config
import os
import sys
-import wsgiref.handlers
-
-from handlers.bloog import blog, contact, cache_stats, timings
-import config
# Force sys.path to have our own directory first, so we can import from it.
sys.path.insert(0, config.APP_ROOT_DIR)
+sys.path.insert(1, os.path.join(config.APP_ROOT_DIR, 'utils/external'))
+
+import logging
+import wsgiref.handlers
+from firepython.middleware import FirePythonWSGI
+from google.appengine.ext import webapp
+from google.appengine.api import users
+from handlers.bloog import blog, contact, cache_stats, timings
# Import custom django libraries
webapp.template.register_template_library('utils.django_libs.gravatar')
@@ -64,8 +66,10 @@
def main():
path = timings.start_run()
application = webapp.WSGIApplication(ROUTES, debug=config.DEBUG)
+ if users.is_current_user_admin():
+ application = FirePythonWSGI(application)
wsgiref.handlers.CGIHandler().run(application)
timings.stop_run(path)
if __name__ == "__main__":
- main()
+ main()
1  utils/external/firepython
@@ -0,0 +1 @@
+Subproject commit aad76ffad9500e787b249c8ab8f1bc8f3d48700b

1 comment on commit 346e5fb

@darwin

Sorry guys, I’ve changed my nick to darwin, so firepython repo url has changed.

Please sign in to comment.
Something went wrong with that request. Please try again.