{"action":"closed","issue":{"url":"https://api.github.com/repos/wichitacode/flask-cdn/issues/8","labels_url":"https://api.github.com/repos/wichitacode/flask-cdn/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/wichitacode/flask-cdn/issues/8/comments","events_url":"https://api.github.com/repos/wichitacode/flask-cdn/issues/8/events","html_url":"https://github.com/wichitacode/flask-cdn/issues/8","id":110273634,"number":8,"title":"flask_cdn.url_for raises AttributeError inside Blueprint with static_folder=None","user":{"login":"jdp","id":574,"avatar_url":"https://avatars.githubusercontent.com/u/574?v=3","gravatar_id":"","url":"https://api.github.com/users/jdp","html_url":"https://github.com/jdp","followers_url":"https://api.github.com/users/jdp/followers","following_url":"https://api.github.com/users/jdp/following{/other_user}","gists_url":"https://api.github.com/users/jdp/gists{/gist_id}","starred_url":"https://api.github.com/users/jdp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdp/subscriptions","organizations_url":"https://api.github.com/users/jdp/orgs","repos_url":"https://api.github.com/users/jdp/repos","events_url":"https://api.github.com/users/jdp/events{/privacy}","received_events_url":"https://api.github.com/users/jdp/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-10-07T17:14:05Z","updated_at":"2015-10-08T13:56:13Z","closed_at":"2015-10-08T13:56:13Z","body":"If you render a template that calls `flask_cdn.url_for` inside a Blueprint that does not have a `static_folder` set, it raises an `AttributeError`:\r\n\r\n```\r\n# traceback trimmed\r\nFile \"/vagrant/templates/base.html\", line 11, in top-level template code\r\n    <link rel=\"shortcut icon\" href=\"{{ url_for('static', filename='img/favicon.ico') }}\">\r\n  File \"/home/vagrant/app-virtualenv/local/lib/python2.7/site-packages/flask_cdn.py\", line 39, in url_for\r\n    path = os.path.join(static_folder, values['filename'])\r\n  File \"/home/vagrant/app-virtualenv/lib/python2.7/posixpath.py\", line 77, in join\r\n    elif path == '' or path.endswith('/'):\r\nAttributeError: 'NoneType' object has no attribute 'endswith'\r\n```\r\n\r\nIt's because [`static_folder` defaults to `None` on `Blueprint` instances](http://flask.pocoo.org/docs/0.10/api/#blueprint-objects), it should probably use the app's static folder."}}