Skip to content
Myr

Always register URL rules. This fixes #81

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Armin Ronacher · committed by Armin Ronacher · parent 6e52355 · Browse files · 3 files+13 added−8 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+13 added−8 removed

  • other:+13 added−8 removed

3 files+13 added−8 removed

modified:flask/app.py+8 added-5 removed
269 unmodified lines
270 #: app = Flask(__name__)271 #: app.url_map.converters['list'] = ListConverter272 self.url_map = Map()273274 # register the static folder for the application. Do that even275 # if the folder does not exist. First of all it might be created276 # while the server is running (usually happens during development)274 # if there is a static folder, register it for the application.275 if self.has_static_folder:276 self.add_url_rule(self.static_path + '/<path:filename>',277 endpoint='static',278 view_func=self.send_static_file)277 # but also because google appengine stores static files somewhere278 # else when mapped with the .yml file.279 self.add_url_rule(self.static_path + '/<path:filename>',280 endpoint='static',281 view_func=self.send_static_file)282283 #: The Jinja2 environment. It is created from the284 #: :attr:`jinja_options`.285 self.jinja_env = self.create_jinja_environment()
562 unmodified lines
modified:flask/helpers.py+1 added-3 removed
364 unmodified lines
365 """The Jinja loader for this package bound object.366367 .. versionadded:: 0.5368 """369 template_folder = os.path.join(self.root_path, 'templates')370 if os.path.isdir(template_folder):371 return FileSystemLoader(template_folder)369 return FileSystemLoader(os.path.join(self.root_path, 'templates'))370371 def send_static_file(self, filename):372 """Function used internally to send static files from the static373 folder to the browser.
29 unmodified lines
modified:CHANGES+4 added
11 unmodified lines
12 registration.13- OPTIONS is now automatically implemented by Flask unless the14 application explictly adds 'OPTIONS' as method to the URL rule.15 In this case no automatic OPTIONS handling kicks in.16- static rules are now even in place if there is no static folder17 for the module. This was implemented to aid GAE which will18 remove the static folder if it's part of a mapping in the .yml19 file.2021Version 0.5.122-------------23
98 unmodified lines