{"action":"created","comment":{"url":"https://api.github.com/repos/skoczen/django-seo-js/pulls/comments/24040007","id":24040007,"diff_hunk":"@@ -1,16 +1,24 @@\n+from django_seo_js import settings\n from django_seo_js.backends import SelectedBackend\n from django_seo_js.helpers import request_should_be_ignored\n-from django.conf import settings\n+\n+import logging\n+logger = logging.getLogger(__name__)\n \n \n class HashBangMiddleware(SelectedBackend):\n     def process_request(self, request):\n-        if not request_should_be_ignored(request) and\\\n-           getattr(settings, \"SEO_JS_ENABLED\", not settings.DEBUG) and\\\n-           \"_escaped_fragment_\" in request.GET:\n+        if not settings.ENABLED:\n+            return\n+\n+        if request_should_be_ignored(request):\n+            return\n+\n+        if \"_escaped_fragment_\" not in request.GET:\n+            return\n \n-            url = request.build_absolute_uri()\n-            try:\n-                return self.backend.get_response_for_url(url)\n-            except:\n-                pass\n+        url = request.build_absolute_uri()\n+        try:\n+            return self.backend.get_response_for_url(url)\n+        except Exception as e:\n+            logger.exception(e)","path":"django_seo_js/middleware/hashbang.py","position":33,"original_position":33,"commit_id":"2746dc31f9cfe84b5857ba7f151d447a46f67ce9","original_commit_id":"2746dc31f9cfe84b5857ba7f151d447a46f67ce9","user":{"login":"mattrobenolt","id":375744,"avatar_url":"https://avatars.githubusercontent.com/u/375744?v=3","gravatar_id":"","url":"https://api.github.com/users/mattrobenolt","html_url":"https://github.com/mattrobenolt","followers_url":"https://api.github.com/users/mattrobenolt/followers","following_url":"https://api.github.com/users/mattrobenolt/following{/other_user}","gists_url":"https://api.github.com/users/mattrobenolt/gists{/gist_id}","starred_url":"https://api.github.com/users/mattrobenolt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattrobenolt/subscriptions","organizations_url":"https://api.github.com/users/mattrobenolt/orgs","repos_url":"https://api.github.com/users/mattrobenolt/repos","events_url":"https://api.github.com/users/mattrobenolt/events{/privacy}","received_events_url":"https://api.github.com/users/mattrobenolt/received_events","type":"User","site_admin":false},"body":"We should be logging these exceptions. :)","created_at":"2015-02-03T21:09:50Z","updated_at":"2015-02-03T21:09:50Z","html_url":"https://github.com/skoczen/django-seo-js/pull/10#discussion_r24040007","pull_request_url":"https://api.github.com/repos/skoczen/django-seo-js/pulls/10","_links":{"self":{"href":"https://api.github.com/repos/skoczen/django-seo-js/pulls/comments/24040007"},"html":{"href":"https://github.com/skoczen/django-seo-js/pull/10#discussion_r24040007"},"pull_request":{"href":"https://api.github.com/repos/skoczen/django-seo-js/pulls/10"}}},"pull_request":{"url":"https://api.github.com/repos/skoczen/django-seo-js/pulls/10","id":28589003,"html_url":"https://github.com/skoczen/django-seo-js/pull/10","diff_url":"https://github.com/skoczen/django-seo-js/pull/10.diff","patch_url":"https://github.com/skoczen/django-seo-js/pull/10.patch","issue_url":"https://api.github.com/repos/skoczen/django-seo-js/issues/10","number":10,"state":"open","locked":false,"title":"Minor refactor to take advantage of pre-calculated settings","user":{"login":"mattrobenolt","id":375744,"avatar_url":"https://avatars.githubusercontent.com/u/375744?v=3","gravatar_id":"","url":"https://api.github.com/users/mattrobenolt","html_url":"https://github.com/mattrobenolt","followers_url":"https://api.github.com/users/mattrobenolt/followers","following_url":"https://api.github.com/users/mattrobenolt/following{/other_user}","gists_url":"https://api.github.com/users/mattrobenolt/gists{/gist_id}","starred_url":"https://api.github.com/users/mattrobenolt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattrobenolt/subscriptions","organizations_url":"https://api.github.com/users/mattrobenolt/orgs","repos_url":"https://api.github.com/users/mattrobenolt/repos","events_url":"https://api.github.com/users/mattrobenolt/events{/privacy}","received_events_url":"https://api.github.com/users/mattrobenolt/received_events","type":"User","site_admin":false},"body":"Also optimize some lookups to be O(1) vs O(n)","created_at":"2015-02-03T21:07:46Z","updated_at":"2015-02-03T21:09:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"aa9ff698d001b74a172491b01d4084e5994877c7","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/skoczen/django-seo-js/pulls/10/commits","review_comments_url":"https://api.github.com/repos/skoczen/django-seo-js/pulls/10/comments","review_comment_url":"https://api.github.com/repos/skoczen/django-seo-js/pulls/comments/{number}","comments_url":"https://api.github.com/repos/skoczen/django-seo-js/issues/10/comments","statuses_url":"https://api.github.com/repos/skoczen/django-seo-js/statuses/2746dc31f9cfe84b5857ba7f151d447a46f67ce9","head":{"label":"mattrobenolt:refactor","ref":"refactor","sha":"2746dc31f9cfe84b5857ba7f151d447a46f67ce9","user":{"login":"mattrobenolt","id":375744,"avatar_url":"https://avatars.githubusercontent.com/u/375744?v=3","gravatar_id":"","url":"https://api.github.com/users/mattrobenolt","html_url":"https://github.com/mattrobenolt","followers_url":"https://api.github.com/users/mattrobenolt/followers","following_url":"https://api.github.com/users/mattrobenolt/following{/other_user}","gists_url":"https://api.github.com/users/mattrobenolt/gists{/gist_id}","starred_url":"https://api.github.com/users/mattrobenolt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattrobenolt/subscriptions","organizations_url":"https://api.github.com/users/mattrobenolt/orgs","repos_url":"https://api.github.com/users/mattrobenolt/repos","events_url":"https://api.github.com/users/mattrobenolt/events{/privacy}","received_events_url":"https://api.github.com/users/mattrobenolt/received_events","type":"User","site_admin":false},"repo":{"id":30261856,"name":"django-seo-js","full_name":"mattrobenolt/django-seo-js","owner":{"login":"mattrobenolt","id":375744,"avatar_url":"https://avatars.githubusercontent.com/u/375744?v=3","gravatar_id":"","url":"https://api.github.com/users/mattrobenolt","html_url":"https://github.com/mattrobenolt","followers_url":"https://api.github.com/users/mattrobenolt/followers","following_url":"https://api.github.com/users/mattrobenolt/following{/other_user}","gists_url":"https://api.github.com/users/mattrobenolt/gists{/gist_id}","starred_url":"https://api.github.com/users/mattrobenolt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattrobenolt/subscriptions","organizations_url":"https://api.github.com/users/mattrobenolt/orgs","repos_url":"https://api.github.com/users/mattrobenolt/repos","events_url":"https://api.github.com/users/mattrobenolt/events{/privacy}","received_events_url":"https://api.github.com/users/mattrobenolt/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mattrobenolt/django-seo-js","description":"SEO support for angular, backbone, ember, famo.us, and other SPA apps built with django.","fork":true,"url":"https://api.github.com/repos/mattrobenolt/django-seo-js","forks_url":"https://api.github.com/repos/mattrobenolt/django-seo-js/forks","keys_url":"https://api.github.com/repos/mattrobenolt/django-seo-js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mattrobenolt/django-seo-js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mattrobenolt/django-seo-js/teams","hooks_url":"https://api.github.com/repos/mattrobenolt/django-seo-js/hooks","issue_events_url":"https://api.github.com/repos/mattrobenolt/django-seo-js/issues/events{/number}","events_url":"https://api.github.com/repos/mattrobenolt/django-seo-js/events","assignees_url":"https://api.github.com/repos/mattrobenolt/django-seo-js/assignees{/user}","branches_url":"https://api.github.com/repos/mattrobenolt/django-seo-js/branches{/branch}","tags_url":"https://api.github.com/repos/mattrobenolt/django-seo-js/tags","blobs_url":"https://api.github.com/repos/mattrobenolt/django-seo-js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mattrobenolt/django-seo-js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mattrobenolt/django-seo-js/git/refs{/sha}","trees_url":"https://api.github.com/repos/mattrobenolt/django-seo-js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mattrobenolt/django-seo-js/statuses/{sha}","languages_url":"https://api.github.com/repos/mattrobenolt/django-seo-js/languages","stargazers_url":"https://api.github.com/repos/mattrobenolt/django-seo-js/stargazers","contributors_url":"https://api.github.com/repos/mattrobenolt/django-seo-js/contributors","subscribers_url":"https://api.github.com/repos/mattrobenolt/django-seo-js/subscribers","subscription_url":"https://api.github.com/repos/mattrobenolt/django-seo-js/subscription","commits_url":"https://api.github.com/repos/mattrobenolt/django-seo-js/commits{/sha}","git_commits_url":"https://api.github.com/repos/mattrobenolt/django-seo-js/git/commits{/sha}","comments_url":"https://api.github.com/repos/mattrobenolt/django-seo-js/comments{/number}","issue_comment_url":"https://api.github.com/repos/mattrobenolt/django-seo-js/issues/comments/{number}","contents_url":"https://api.github.com/repos/mattrobenolt/django-seo-js/contents/{+path}","compare_url":"https://api.github.com/repos/mattrobenolt/django-seo-js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mattrobenolt/django-seo-js/merges","archive_url":"https://api.github.com/repos/mattrobenolt/django-seo-js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mattrobenolt/django-seo-js/downloads","issues_url":"https://api.github.com/repos/mattrobenolt/django-seo-js/issues{/number}","pulls_url":"https://api.github.com/repos/mattrobenolt/django-seo-js/pulls{/number}","milestones_url":"https://api.github.com/repos/mattrobenolt/django-seo-js/milestones{/number}","notifications_url":"https://api.github.com/repos/mattrobenolt/django-seo-js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mattrobenolt/django-seo-js/labels{/name}","releases_url":"https://api.github.com/repos/mattrobenolt/django-seo-js/releases{/id}","created_at":"2015-02-03T20:03:35Z","updated_at":"2015-02-03T20:03:35Z","pushed_at":"2015-02-03T21:07:31Z","git_url":"git://github.com/mattrobenolt/django-seo-js.git","ssh_url":"git@github.com:mattrobenolt/django-seo-js.git","clone_url":"https://github.com/mattrobenolt/django-seo-js.git","svn_url":"https://github.com/mattrobenolt/django-seo-js","homepage":"","size":498,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"skoczen:master","ref":"master","sha":"0b36f8699b293c3bcdf2c8d220476cd0598b9e3e","user":{"login":"skoczen","id":200635,"avatar_url":"https://avatars.githubusercontent.com/u/200635?v=3","gravatar_id":"","url":"https://api.github.com/users/skoczen","html_url":"https://github.com/skoczen","followers_url":"https://api.github.com/users/skoczen/followers","following_url":"https://api.github.com/users/skoczen/following{/other_user}","gists_url":"https://api.github.com/users/skoczen/gists{/gist_id}","starred_url":"https://api.github.com/users/skoczen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skoczen/subscriptions","organizations_url":"https://api.github.com/users/skoczen/orgs","repos_url":"https://api.github.com/users/skoczen/repos","events_url":"https://api.github.com/users/skoczen/events{/privacy}","received_events_url":"https://api.github.com/users/skoczen/received_events","type":"User","site_admin":false},"repo":{"id":19581639,"name":"django-seo-js","full_name":"skoczen/django-seo-js","owner":{"login":"skoczen","id":200635,"avatar_url":"https://avatars.githubusercontent.com/u/200635?v=3","gravatar_id":"","url":"https://api.github.com/users/skoczen","html_url":"https://github.com/skoczen","followers_url":"https://api.github.com/users/skoczen/followers","following_url":"https://api.github.com/users/skoczen/following{/other_user}","gists_url":"https://api.github.com/users/skoczen/gists{/gist_id}","starred_url":"https://api.github.com/users/skoczen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skoczen/subscriptions","organizations_url":"https://api.github.com/users/skoczen/orgs","repos_url":"https://api.github.com/users/skoczen/repos","events_url":"https://api.github.com/users/skoczen/events{/privacy}","received_events_url":"https://api.github.com/users/skoczen/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/skoczen/django-seo-js","description":"SEO support for angular, backbone, ember, famo.us, and other SPA apps built with django.","fork":false,"url":"https://api.github.com/repos/skoczen/django-seo-js","forks_url":"https://api.github.com/repos/skoczen/django-seo-js/forks","keys_url":"https://api.github.com/repos/skoczen/django-seo-js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/skoczen/django-seo-js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/skoczen/django-seo-js/teams","hooks_url":"https://api.github.com/repos/skoczen/django-seo-js/hooks","issue_events_url":"https://api.github.com/repos/skoczen/django-seo-js/issues/events{/number}","events_url":"https://api.github.com/repos/skoczen/django-seo-js/events","assignees_url":"https://api.github.com/repos/skoczen/django-seo-js/assignees{/user}","branches_url":"https://api.github.com/repos/skoczen/django-seo-js/branches{/branch}","tags_url":"https://api.github.com/repos/skoczen/django-seo-js/tags","blobs_url":"https://api.github.com/repos/skoczen/django-seo-js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/skoczen/django-seo-js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/skoczen/django-seo-js/git/refs{/sha}","trees_url":"https://api.github.com/repos/skoczen/django-seo-js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/skoczen/django-seo-js/statuses/{sha}","languages_url":"https://api.github.com/repos/skoczen/django-seo-js/languages","stargazers_url":"https://api.github.com/repos/skoczen/django-seo-js/stargazers","contributors_url":"https://api.github.com/repos/skoczen/django-seo-js/contributors","subscribers_url":"https://api.github.com/repos/skoczen/django-seo-js/subscribers","subscription_url":"https://api.github.com/repos/skoczen/django-seo-js/subscription","commits_url":"https://api.github.com/repos/skoczen/django-seo-js/commits{/sha}","git_commits_url":"https://api.github.com/repos/skoczen/django-seo-js/git/commits{/sha}","comments_url":"https://api.github.com/repos/skoczen/django-seo-js/comments{/number}","issue_comment_url":"https://api.github.com/repos/skoczen/django-seo-js/issues/comments/{number}","contents_url":"https://api.github.com/repos/skoczen/django-seo-js/contents/{+path}","compare_url":"https://api.github.com/repos/skoczen/django-seo-js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/skoczen/django-seo-js/merges","archive_url":"https://api.github.com/repos/skoczen/django-seo-js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/skoczen/django-seo-js/downloads","issues_url":"https://api.github.com/repos/skoczen/django-seo-js/issues{/number}","pulls_url":"https://api.github.com/repos/skoczen/django-seo-js/pulls{/number}","milestones_url":"https://api.github.com/repos/skoczen/django-seo-js/milestones{/number}","notifications_url":"https://api.github.com/repos/skoczen/django-seo-js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/skoczen/django-seo-js/labels{/name}","releases_url":"https://api.github.com/repos/skoczen/django-seo-js/releases{/id}","created_at":"2014-05-08T17:04:17Z","updated_at":"2015-01-30T22:13:24Z","pushed_at":"2014-08-12T17:51:30Z","git_url":"git://github.com/skoczen/django-seo-js.git","ssh_url":"git@github.com:skoczen/django-seo-js.git","clone_url":"https://github.com/skoczen/django-seo-js.git","svn_url":"https://github.com/skoczen/django-seo-js","homepage":"","size":498,"stargazers_count":31,"watchers_count":31,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":3,"forks":6,"open_issues":3,"watchers":31,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/skoczen/django-seo-js/pulls/10"},"html":{"href":"https://github.com/skoczen/django-seo-js/pull/10"},"issue":{"href":"https://api.github.com/repos/skoczen/django-seo-js/issues/10"},"comments":{"href":"https://api.github.com/repos/skoczen/django-seo-js/issues/10/comments"},"review_comments":{"href":"https://api.github.com/repos/skoczen/django-seo-js/pulls/10/comments"},"review_comment":{"href":"https://api.github.com/repos/skoczen/django-seo-js/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/skoczen/django-seo-js/pulls/10/commits"},"statuses":{"href":"https://api.github.com/repos/skoczen/django-seo-js/statuses/2746dc31f9cfe84b5857ba7f151d447a46f67ce9"}}}}