<commit_before>#!/usr/bin/env python

import os

from flask_script import Manager, Server
from flask_script.commands import ShowUrls, Clean
from mothership import create_app
from mothership.models import db

# default to dev config because no one should use this in
# production anyway
env = os.environ.get('MOTHERSHIP_ENV', 'dev')
app = create_app('mothership.settings.%sConfig' % env.capitalize())

manager = Manager(app)
manager.add_command("server", Server())
manager.add_command("show-urls", ShowUrls())
manager.add_command("clean", Clean())


@manager.shell
def make_shell_context():
	""" Creates a python REPL with several default imports
		in the context of the app
	"""

	return dict(app=app, db=db)
	# return dict(app=app, db=db, User=User)


@manager.command
def createdb():
	""" Creates a database with all of the tables defined in
		your SQLAlchemy models
	"""

	db.create_all()

if __name__ == "__main__":
	manager.run()


# ./venv/bin/uwsgi --http 0.0.0.0:8000 --home venv --wsgi-file manage.py --callable app --master --catch-exceptions
<commit_msg>Remove comment for running under uwsgi<commit_after>#!/usr/bin/env python

import os

from flask_script import Manager, Server
from flask_script.commands import ShowUrls, Clean
from mothership import create_app
from mothership.models import db

# default to dev config because no one should use this in
# production anyway
env = os.environ.get('MOTHERSHIP_ENV', 'dev')
app = create_app('mothership.settings.%sConfig' % env.capitalize())

manager = Manager(app)
manager.add_command("server", Server())
manager.add_command("show-urls", ShowUrls())
manager.add_command("clean", Clean())


@manager.shell
def make_shell_context():
	""" Creates a python REPL with several default imports
		in the context of the app
	"""

	return dict(app=app, db=db)
	# return dict(app=app, db=db, User=User)


@manager.command
def createdb():
	""" Creates a database with all of the tables defined in
		your SQLAlchemy models
	"""

	db.create_all()

if __name__ == "__main__":
	manager.run()

{'fraction_non_alphanumeric': 0.11978399607265587, 'fraction_numerical': 0.0039273441335297005, 'mean_word_length': 5.065476190476191, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, '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': '1481043', 'n_tokens_mistral': 672, 'n_tokens_neox': 639, 'n_words': 204}