<commit_before>"""Web Application"""

from pyramid.config import Configurator
from sqlalchemy import engine_from_config

from ..model import (
    Session,
    Base,
)


def main(global_config, **settings):
    """This functions returns a Pyramid WSGI application"""

    engine = engine_from_config(settings, 'sqlalchemy.')
    Session.configure(bind=engine)
    Base.metadata.bind = engine

    config = Configurator(settings=settings)
    config.include('.mandrill', route_prefix="/mandrill")
    return config.make_wsgi_app()<commit_msg>Get Database URL from env if it's there<commit_after>"""Web Application"""

from pyramid.config import Configurator
from sqlalchemy import engine_from_config

from ..model import (
    Session,
    Base,
)


def main(global_config, **settings):
    """This functions returns a Pyramid WSGI application"""

    if os.environ.get('DATABASE_URL') is not None:
        settings['sqlalchemy.url'] = os.environ.get('DATABASE_URL')

    engine = engine_from_config(settings, 'sqlalchemy.')
    Session.configure(bind=engine)
    Base.metadata.bind = engine

    config = Configurator(settings=settings)
    config.include('.mandrill', route_prefix="/mandrill")
    return config.make_wsgi_app()
{'fraction_non_alphanumeric': 0.11400651465798045, 'fraction_numerical': 0.0, 'mean_word_length': 4.536036036036036, 'pattern_counts': {'":': 0, '<': 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': '4304245', 'n_tokens_mistral': 382, 'n_tokens_neox': 358, 'n_words': 87}