__init__.py 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. # -*- coding: utf-8 -*-
  2. """
  3. flask
  4. ~~~~~
  5. A microframework based on Werkzeug. It's extensively documented
  6. and follows best practice patterns.
  7. :copyright: (c) 2011 by Armin Ronacher.
  8. :license: BSD, see LICENSE for more details.
  9. """
  10. __version__ = '0.10.1'
  11. # utilities we import from Werkzeug and Jinja2 that are unused
  12. # in the module but are exported as public interface.
  13. from werkzeug.exceptions import abort
  14. from werkzeug.utils import redirect
  15. from jinja2 import Markup, escape
  16. from .app import Flask, Request, Response
  17. from .config import Config
  18. from .helpers import url_for, flash, send_file, send_from_directory, \
  19. get_flashed_messages, get_template_attribute, make_response, safe_join, \
  20. stream_with_context
  21. from .globals import current_app, g, request, session, _request_ctx_stack, \
  22. _app_ctx_stack
  23. from .ctx import has_request_context, has_app_context, \
  24. after_this_request, copy_current_request_context
  25. from .module import Module
  26. from .blueprints import Blueprint
  27. from .templating import render_template, render_template_string
  28. # the signals
  29. from .signals import signals_available, template_rendered, request_started, \
  30. request_finished, got_request_exception, request_tearing_down, \
  31. appcontext_tearing_down, appcontext_pushed, \
  32. appcontext_popped, message_flashed
  33. # We're not exposing the actual json module but a convenient wrapper around
  34. # it.
  35. from . import json
  36. # This was the only thing that flask used to export at one point and it had
  37. # a more generic name.
  38. jsonify = json.jsonify
  39. # backwards compat, goes away in 1.0
  40. from .sessions import SecureCookieSession as Session
  41. json_available = True