Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit 346e5fb

Browse files
committed
Added support for FirePython logging when logged in as administrator.
1 parent 5d683ff commit 346e5fb

File tree

4 files changed

+19
-8
lines changed

4 files changed

+19
-8
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "utils/external/firepython"]
2+
path = utils/external/firepython
3+
url = git://github.com/woid/firepython.git

app.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,7 @@ skip_files: |
3939
(dev/.*)|
4040
(tests/.*)|
4141
(docs/.*)|
42+
(.*\.markdown)|
43+
(license\.txt)|
44+
(setup.py)
4245
)$

main.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,20 @@
2323

2424
__author__ = 'William T. Katz'
2525

26-
from google.appengine.ext import webapp
27-
28-
import logging
26+
import config
2927
import os
3028
import sys
31-
import wsgiref.handlers
32-
33-
from handlers.bloog import blog, contact, cache_stats, timings
34-
import config
3529

3630
# Force sys.path to have our own directory first, so we can import from it.
3731
sys.path.insert(0, config.APP_ROOT_DIR)
32+
sys.path.insert(1, os.path.join(config.APP_ROOT_DIR, 'utils/external'))
33+
34+
import logging
35+
import wsgiref.handlers
36+
from firepython.middleware import FirePythonWSGI
37+
from google.appengine.ext import webapp
38+
from google.appengine.api import users
39+
from handlers.bloog import blog, contact, cache_stats, timings
3840

3941
# Import custom django libraries
4042
webapp.template.register_template_library('utils.django_libs.gravatar')
@@ -64,8 +66,10 @@
6466
def main():
6567
path = timings.start_run()
6668
application = webapp.WSGIApplication(ROUTES, debug=config.DEBUG)
69+
if users.is_current_user_admin():
70+
application = FirePythonWSGI(application)
6771
wsgiref.handlers.CGIHandler().run(application)
6872
timings.stop_run(path)
6973

7074
if __name__ == "__main__":
71-
main()
75+
main()

utils/external/firepython

Submodule firepython added at aad76ff

0 commit comments

Comments
 (0)