<commit_before>#!/usr/bin/env python
# tuned-resonator
# experiments with google physical-web mdns broadcast

import tornado.ioloop
import tornado.web
from handlers.BrowserHandler import BrowserHandler
from handlers.ApiHandler import ApiHandler
from handlers.SubmitHandler import SubmitHandler
import redis



db = redis.StrictRedis(host='localhost', port=6379, db=1)
auth = redis.StrictRedis(host='localhost', port=6379, db=2)
# settings = {'debug':True}
# settings = {'debug':True, 'auth':auth} # not sure this will work, strike this first if stuff doesn't work
settings = {'debug':True, 'auth':True}
# TODO: here populate the auth db with the credentials from keys.py or groups.py
# also consider an api-based way to add groups (poss involving master key), this might be rly easy to scale?
# no master keys w/o someone doing a security audit, maybe

application = tornado.web.Application([
    (r"/api", ApiHandler),
    (r"/submit", SubmitHandler),
    (r"/", BrowserHandler),
], db=db, **settings)

if __name__ == "__main__":<commit_msg>oh my, i am going back to mongo<commit_after>#!/usr/bin/env python
# tuned-resonator
# experiments with google physical-web mdns broadcast

import tornado.ioloop
import tornado.web
from handlers.BrowserHandler import BrowserHandler
from handlers.ApiHandler import ApiHandler
from handlers.SubmitHandler import SubmitHandler
import redis



# db = redis.StrictRedis(host='localhost', port=6379, db=1)
# auth = redis.StrictRedis(host='localhost', port=6379, db=2)
client = MongoClient(tz_aware=True)
db = client.curriculum
# settings = {'debug':True}
# settings = {'debug':True, 'auth':auth} # not sure this will work, strike this first if stuff doesn't work
settings = {'debug':True, 'auth':True}
# TODO: here populate the auth db with the credentials from keys.py or groups.py
# also consider an api-based way to add groups (poss involving master key), this might be rly easy to scale?
# no master keys w/o someone doing a security audit, maybe

application = tornado.web.Application([
    (r"/api", ApiHandler),
    (r"/submit", SubmitHandler),
    (r"/", BrowserHandler),
], db=db, **settings)

if __name__ == "__main__":
{'fraction_non_alphanumeric': 0.11593533487297922, 'fraction_numerical': 0.009237875288683603, 'mean_word_length': 5.278260869565218, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2175523', 'n_tokens_mistral': 676, 'n_tokens_neox': 637, 'n_words': 230}