__init__.py 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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: © 2010 by the Pallets team.
  8. :license: BSD, see LICENSE for more details.
  9. """
  10. __version__ = '1.0.2'
  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 .blueprints import Blueprint
  26. from .templating import render_template, render_template_string
  27. # the signals
  28. from .signals import signals_available, template_rendered, request_started, \
  29. request_finished, got_request_exception, request_tearing_down, \
  30. appcontext_tearing_down, appcontext_pushed, \
  31. appcontext_popped, message_flashed, before_render_template
  32. # We're not exposing the actual json module but a convenient wrapper around
  33. # it.
  34. from . import json
  35. # This was the only thing that Flask used to export at one point and it had
  36. # a more generic name.
  37. jsonify = json.jsonify
  38. # backwards compat, goes away in 1.0
  39. from .sessions import SecureCookieSession as Session
  40. json_available = True