We can now manage.py runserver --settings=setting_no_askbot
This commit is contained in:
@@ -9,17 +9,17 @@ class ProfileMiddleware:
|
||||
print "Process request"
|
||||
|
||||
def process_response (self, request, response):
|
||||
totalTime = time.time() - self.t
|
||||
tmpfile = tempfile.NamedTemporaryFile(prefix='sqlprof-t=' + str(totalTime) + "-", delete=False)
|
||||
# totalTime = time.time() - self.t
|
||||
# tmpfile = tempfile.NamedTemporaryFile(prefix='sqlprof-t=' + str(totalTime) + "-", delete=False)
|
||||
|
||||
output = ""
|
||||
for query in connection.queries:
|
||||
output += "Time: " + str(query['time']) + "\nQuery: " + query['sql'] + "\n\n"
|
||||
# output = ""
|
||||
# for query in connection.queries:
|
||||
# output += "Time: " + str(query['time']) + "\nQuery: " + query['sql'] + "\n\n"
|
||||
|
||||
tmpfile.write(output)
|
||||
# tmpfile.write(output)
|
||||
|
||||
print "SQL Log file: " , tmpfile.name
|
||||
tmpfile.close()
|
||||
# print "SQL Log file: " , tmpfile.name
|
||||
# tmpfile.close()
|
||||
|
||||
print "Process response"
|
||||
# print "Process response"
|
||||
return response
|
||||
|
||||
2
setting_no_askbot.py
Normal file
2
setting_no_askbot.py
Normal file
@@ -0,0 +1,2 @@
|
||||
ASKBOT_ENABLED = False
|
||||
execfile("settings.py")
|
||||
@@ -1,5 +1,7 @@
|
||||
COURSEWARE_ENABLED = True
|
||||
ASKBOT_ENABLED = True
|
||||
|
||||
if 'ASKBOT_ENABLED' not in locals():
|
||||
ASKBOT_ENABLED = True
|
||||
if not COURSEWARE_ENABLED:
|
||||
ASKBOT_ENABLED = False
|
||||
|
||||
|
||||
Reference in New Issue
Block a user