{"action":"created","comment":{"url":"https://api.github.com/repos/resulto/django-static-url/pulls/comments/88252678","pull_request_review_id":8829475,"id":88252678,"diff_hunk":"@@ -0,0 +1,127 @@\n+django-static-url - Generates dynamic static URL\n+================================================\n+\n+:Authors:\n+  Resulto Developpement Web Inc.\n+:Version: 0.1.0\n+\n+By default, the URI of static resources does not change between deployment and\n+it is up to each project to come with a solution to invalidate the browser's\n+cache. django-static-url adds helper functions that can be used in\n+Django settings file, in views and templates. The idea is to generate a new\n+/static/ URL each time the dev server is reloaded and a new URL each time the\n+code is deployed in production.\n+\n+How does it work?\n+-----------------\n+\n+In its simplest form, django-static-url will compute a hash based on the\n+current time and insert this hash between the static url prefix (e.g.,\n+/static/) and the static file path. The URL will be recomputed every time the\n+devserver is reloaded so any changes to static files should be picked up by the\n+browser without having to empty of bypass the cache.\n+\n+In production, you probably do not want the URL to change every time a process\n+is reloaded so you can provide the path of a file whose access time will be\n+used to compute the hash. For example, we give the path of our uwsgi config\n+file because it is accessed only once per deployment.\n+\n+More strategies will be provided in the future to accommodate various scenarios\n+(e.g., load balanced app servers that do not share files).\n+\n+django-static-url assumes that you know how to configure your production web\n+server. Presumably, you are using nginx and have added a location block to\n+bypass the python web server to serve your static files. We provide an example\n+location block for nginx in the installation instructions below.\n+\n+Requirements\n+------------\n+\n+django-static-url works with Python 3.4+. It requires Django 1.8+\n+\n+Installation\n+------------\n+\n+Install the library\n+~~~~~~~~~~~~~~~~~~~\n+\n+::\n+\n+    pip install django-static-url\n+\n+\n+Add this snippet in your Django Settings (development)\n+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n+\n+::\n+\n+    # The prefix of the static URL.\n+    STATIC_ROOT_URL = \"/static/\"\n+\n+    # Will change the URL everytime the settings/server is reloaded.\n+    from django_static_url_helper import url_helper\n+    STATIC_URL = url_helper.get_static_url_now(\n+        STATIC_ROOT_URL, True, SECRET_KEY)\n+\n+\n+Alternative 2: Add this snippet in your Django Settings (production)\n+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n+\n+\n+::\n+\n+    # The prefix of the static URL.\n+    STATIC_ROOT_URL = \"/static/\"\n+\n+    # Will change the URL everything the SOME_IMPORTANT_FILE_PATH is touched\n+    # (url generated based on access time).\n+    from django_static_url_helper import url_helper\n+    STATIC_URL = url_helper.get_static_url_file(\n+        STATIC_ROOT_URL,\n+        SOME_IMPORTANT_FILE_PATH, True,\n+        SECRET_KEY)\n+\n+\n+Add this to your urls file (development)\n+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n+\n+::\n+\n+    from django.conf import settings\n+    from django_static_url_helper.django_url_helper import staticfiles_dynamicurlpatterns\n+\n+    # Define your urlpatterns here\n+    urlpatterns = ...\n+\n+    if settings.DEBUG:\n+        urlpatterns += staticfiles_dynamicurlpatterns(settings.STATIC_ROOT_URL)\n+\n+\n+Add this to your nginx config file (production)\n+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n+\n+::\n+\n+    # regex that capture all requests made to","path":"README.rst","position":105,"original_position":105,"commit_id":"08430bc03a29362d8d34d35e580aba2e77b06cb3","original_commit_id":"08430bc03a29362d8d34d35e580aba2e77b06cb3","user":{"login":"ginmrt","id":3000613,"avatar_url":"https://avatars.githubusercontent.com/u/3000613?v=3","gravatar_id":"","url":"https://api.github.com/users/ginmrt","html_url":"https://github.com/ginmrt","followers_url":"https://api.github.com/users/ginmrt/followers","following_url":"https://api.github.com/users/ginmrt/following{/other_user}","gists_url":"https://api.github.com/users/ginmrt/gists{/gist_id}","starred_url":"https://api.github.com/users/ginmrt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ginmrt/subscriptions","organizations_url":"https://api.github.com/users/ginmrt/orgs","repos_url":"https://api.github.com/users/ginmrt/repos","events_url":"https://api.github.com/users/ginmrt/events{/privacy}","received_events_url":"https://api.github.com/users/ginmrt/received_events","type":"User","site_admin":false},"body":"captures","created_at":"2016-11-16T15:04:13Z","updated_at":"2016-11-16T15:20:54Z","html_url":"https://github.com/resulto/django-static-url/pull/1#discussion_r88252678","pull_request_url":"https://api.github.com/repos/resulto/django-static-url/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/resulto/django-static-url/pulls/comments/88252678"},"html":{"href":"https://github.com/resulto/django-static-url/pull/1#discussion_r88252678"},"pull_request":{"href":"https://api.github.com/repos/resulto/django-static-url/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/resulto/django-static-url/pulls/1","id":93401136,"html_url":"https://github.com/resulto/django-static-url/pull/1","diff_url":"https://github.com/resulto/django-static-url/pull/1.diff","patch_url":"https://github.com/resulto/django-static-url/pull/1.patch","issue_url":"https://api.github.com/repos/resulto/django-static-url/issues/1","number":1,"state":"open","locked":false,"title":"Initial import","user":{"login":"bartdag","id":464322,"avatar_url":"https://avatars.githubusercontent.com/u/464322?v=3","gravatar_id":"","url":"https://api.github.com/users/bartdag","html_url":"https://github.com/bartdag","followers_url":"https://api.github.com/users/bartdag/followers","following_url":"https://api.github.com/users/bartdag/following{/other_user}","gists_url":"https://api.github.com/users/bartdag/gists{/gist_id}","starred_url":"https://api.github.com/users/bartdag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bartdag/subscriptions","organizations_url":"https://api.github.com/users/bartdag/orgs","repos_url":"https://api.github.com/users/bartdag/repos","events_url":"https://api.github.com/users/bartdag/events{/privacy}","received_events_url":"https://api.github.com/users/bartdag/received_events","type":"User","site_admin":false},"body":"Porting staticfiles_helper to its very own project.","created_at":"2016-11-11T21:28:11Z","updated_at":"2016-11-16T15:20:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"89a11db234901ed240ed90777b659b07c6cdc234","assignee":{"login":"ginmrt","id":3000613,"avatar_url":"https://avatars.githubusercontent.com/u/3000613?v=3","gravatar_id":"","url":"https://api.github.com/users/ginmrt","html_url":"https://github.com/ginmrt","followers_url":"https://api.github.com/users/ginmrt/followers","following_url":"https://api.github.com/users/ginmrt/following{/other_user}","gists_url":"https://api.github.com/users/ginmrt/gists{/gist_id}","starred_url":"https://api.github.com/users/ginmrt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ginmrt/subscriptions","organizations_url":"https://api.github.com/users/ginmrt/orgs","repos_url":"https://api.github.com/users/ginmrt/repos","events_url":"https://api.github.com/users/ginmrt/events{/privacy}","received_events_url":"https://api.github.com/users/ginmrt/received_events","type":"User","site_admin":false},"assignees":[{"login":"ginmrt","id":3000613,"avatar_url":"https://avatars.githubusercontent.com/u/3000613?v=3","gravatar_id":"","url":"https://api.github.com/users/ginmrt","html_url":"https://github.com/ginmrt","followers_url":"https://api.github.com/users/ginmrt/followers","following_url":"https://api.github.com/users/ginmrt/following{/other_user}","gists_url":"https://api.github.com/users/ginmrt/gists{/gist_id}","starred_url":"https://api.github.com/users/ginmrt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ginmrt/subscriptions","organizations_url":"https://api.github.com/users/ginmrt/orgs","repos_url":"https://api.github.com/users/ginmrt/repos","events_url":"https://api.github.com/users/ginmrt/events{/privacy}","received_events_url":"https://api.github.com/users/ginmrt/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/resulto/django-static-url/pulls/1/commits","review_comments_url":"https://api.github.com/repos/resulto/django-static-url/pulls/1/comments","review_comment_url":"https://api.github.com/repos/resulto/django-static-url/pulls/comments{/number}","comments_url":"https://api.github.com/repos/resulto/django-static-url/issues/1/comments","statuses_url":"https://api.github.com/repos/resulto/django-static-url/statuses/08430bc03a29362d8d34d35e580aba2e77b06cb3","head":{"label":"resulto:initial-import","ref":"initial-import","sha":"08430bc03a29362d8d34d35e580aba2e77b06cb3","user":{"login":"resulto","id":7450085,"avatar_url":"https://avatars.githubusercontent.com/u/7450085?v=3","gravatar_id":"","url":"https://api.github.com/users/resulto","html_url":"https://github.com/resulto","followers_url":"https://api.github.com/users/resulto/followers","following_url":"https://api.github.com/users/resulto/following{/other_user}","gists_url":"https://api.github.com/users/resulto/gists{/gist_id}","starred_url":"https://api.github.com/users/resulto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/resulto/subscriptions","organizations_url":"https://api.github.com/users/resulto/orgs","repos_url":"https://api.github.com/users/resulto/repos","events_url":"https://api.github.com/users/resulto/events{/privacy}","received_events_url":"https://api.github.com/users/resulto/received_events","type":"Organization","site_admin":false},"repo":{"id":70677840,"name":"django-static-url","full_name":"resulto/django-static-url","owner":{"login":"resulto","id":7450085,"avatar_url":"https://avatars.githubusercontent.com/u/7450085?v=3","gravatar_id":"","url":"https://api.github.com/users/resulto","html_url":"https://github.com/resulto","followers_url":"https://api.github.com/users/resulto/followers","following_url":"https://api.github.com/users/resulto/following{/other_user}","gists_url":"https://api.github.com/users/resulto/gists{/gist_id}","starred_url":"https://api.github.com/users/resulto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/resulto/subscriptions","organizations_url":"https://api.github.com/users/resulto/orgs","repos_url":"https://api.github.com/users/resulto/repos","events_url":"https://api.github.com/users/resulto/events{/privacy}","received_events_url":"https://api.github.com/users/resulto/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/resulto/django-static-url","description":"Dynamically and smartly changes the static URL to invalidate browser or CDN cache","fork":false,"url":"https://api.github.com/repos/resulto/django-static-url","forks_url":"https://api.github.com/repos/resulto/django-static-url/forks","keys_url":"https://api.github.com/repos/resulto/django-static-url/keys{/key_id}","collaborators_url":"https://api.github.com/repos/resulto/django-static-url/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/resulto/django-static-url/teams","hooks_url":"https://api.github.com/repos/resulto/django-static-url/hooks","issue_events_url":"https://api.github.com/repos/resulto/django-static-url/issues/events{/number}","events_url":"https://api.github.com/repos/resulto/django-static-url/events","assignees_url":"https://api.github.com/repos/resulto/django-static-url/assignees{/user}","branches_url":"https://api.github.com/repos/resulto/django-static-url/branches{/branch}","tags_url":"https://api.github.com/repos/resulto/django-static-url/tags","blobs_url":"https://api.github.com/repos/resulto/django-static-url/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/resulto/django-static-url/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/resulto/django-static-url/git/refs{/sha}","trees_url":"https://api.github.com/repos/resulto/django-static-url/git/trees{/sha}","statuses_url":"https://api.github.com/repos/resulto/django-static-url/statuses/{sha}","languages_url":"https://api.github.com/repos/resulto/django-static-url/languages","stargazers_url":"https://api.github.com/repos/resulto/django-static-url/stargazers","contributors_url":"https://api.github.com/repos/resulto/django-static-url/contributors","subscribers_url":"https://api.github.com/repos/resulto/django-static-url/subscribers","subscription_url":"https://api.github.com/repos/resulto/django-static-url/subscription","commits_url":"https://api.github.com/repos/resulto/django-static-url/commits{/sha}","git_commits_url":"https://api.github.com/repos/resulto/django-static-url/git/commits{/sha}","comments_url":"https://api.github.com/repos/resulto/django-static-url/comments{/number}","issue_comment_url":"https://api.github.com/repos/resulto/django-static-url/issues/comments{/number}","contents_url":"https://api.github.com/repos/resulto/django-static-url/contents/{+path}","compare_url":"https://api.github.com/repos/resulto/django-static-url/compare/{base}...{head}","merges_url":"https://api.github.com/repos/resulto/django-static-url/merges","archive_url":"https://api.github.com/repos/resulto/django-static-url/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/resulto/django-static-url/downloads","issues_url":"https://api.github.com/repos/resulto/django-static-url/issues{/number}","pulls_url":"https://api.github.com/repos/resulto/django-static-url/pulls{/number}","milestones_url":"https://api.github.com/repos/resulto/django-static-url/milestones{/number}","notifications_url":"https://api.github.com/repos/resulto/django-static-url/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/resulto/django-static-url/labels{/name}","releases_url":"https://api.github.com/repos/resulto/django-static-url/releases{/id}","deployments_url":"https://api.github.com/repos/resulto/django-static-url/deployments","created_at":"2016-10-12T08:10:29Z","updated_at":"2016-11-03T16:27:37Z","pushed_at":"2016-11-14T15:33:54Z","git_url":"git://github.com/resulto/django-static-url.git","ssh_url":"git@github.com:resulto/django-static-url.git","clone_url":"https://github.com/resulto/django-static-url.git","svn_url":"https://github.com/resulto/django-static-url","homepage":null,"size":14,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"resulto:master","ref":"master","sha":"1e36ee2bfc88dd7f3e1c894e2b0c4da19b306b46","user":{"login":"resulto","id":7450085,"avatar_url":"https://avatars.githubusercontent.com/u/7450085?v=3","gravatar_id":"","url":"https://api.github.com/users/resulto","html_url":"https://github.com/resulto","followers_url":"https://api.github.com/users/resulto/followers","following_url":"https://api.github.com/users/resulto/following{/other_user}","gists_url":"https://api.github.com/users/resulto/gists{/gist_id}","starred_url":"https://api.github.com/users/resulto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/resulto/subscriptions","organizations_url":"https://api.github.com/users/resulto/orgs","repos_url":"https://api.github.com/users/resulto/repos","events_url":"https://api.github.com/users/resulto/events{/privacy}","received_events_url":"https://api.github.com/users/resulto/received_events","type":"Organization","site_admin":false},"repo":{"id":70677840,"name":"django-static-url","full_name":"resulto/django-static-url","owner":{"login":"resulto","id":7450085,"avatar_url":"https://avatars.githubusercontent.com/u/7450085?v=3","gravatar_id":"","url":"https://api.github.com/users/resulto","html_url":"https://github.com/resulto","followers_url":"https://api.github.com/users/resulto/followers","following_url":"https://api.github.com/users/resulto/following{/other_user}","gists_url":"https://api.github.com/users/resulto/gists{/gist_id}","starred_url":"https://api.github.com/users/resulto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/resulto/subscriptions","organizations_url":"https://api.github.com/users/resulto/orgs","repos_url":"https://api.github.com/users/resulto/repos","events_url":"https://api.github.com/users/resulto/events{/privacy}","received_events_url":"https://api.github.com/users/resulto/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/resulto/django-static-url","description":"Dynamically and smartly changes the static URL to invalidate browser or CDN cache","fork":false,"url":"https://api.github.com/repos/resulto/django-static-url","forks_url":"https://api.github.com/repos/resulto/django-static-url/forks","keys_url":"https://api.github.com/repos/resulto/django-static-url/keys{/key_id}","collaborators_url":"https://api.github.com/repos/resulto/django-static-url/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/resulto/django-static-url/teams","hooks_url":"https://api.github.com/repos/resulto/django-static-url/hooks","issue_events_url":"https://api.github.com/repos/resulto/django-static-url/issues/events{/number}","events_url":"https://api.github.com/repos/resulto/django-static-url/events","assignees_url":"https://api.github.com/repos/resulto/django-static-url/assignees{/user}","branches_url":"https://api.github.com/repos/resulto/django-static-url/branches{/branch}","tags_url":"https://api.github.com/repos/resulto/django-static-url/tags","blobs_url":"https://api.github.com/repos/resulto/django-static-url/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/resulto/django-static-url/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/resulto/django-static-url/git/refs{/sha}","trees_url":"https://api.github.com/repos/resulto/django-static-url/git/trees{/sha}","statuses_url":"https://api.github.com/repos/resulto/django-static-url/statuses/{sha}","languages_url":"https://api.github.com/repos/resulto/django-static-url/languages","stargazers_url":"https://api.github.com/repos/resulto/django-static-url/stargazers","contributors_url":"https://api.github.com/repos/resulto/django-static-url/contributors","subscribers_url":"https://api.github.com/repos/resulto/django-static-url/subscribers","subscription_url":"https://api.github.com/repos/resulto/django-static-url/subscription","commits_url":"https://api.github.com/repos/resulto/django-static-url/commits{/sha}","git_commits_url":"https://api.github.com/repos/resulto/django-static-url/git/commits{/sha}","comments_url":"https://api.github.com/repos/resulto/django-static-url/comments{/number}","issue_comment_url":"https://api.github.com/repos/resulto/django-static-url/issues/comments{/number}","contents_url":"https://api.github.com/repos/resulto/django-static-url/contents/{+path}","compare_url":"https://api.github.com/repos/resulto/django-static-url/compare/{base}...{head}","merges_url":"https://api.github.com/repos/resulto/django-static-url/merges","archive_url":"https://api.github.com/repos/resulto/django-static-url/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/resulto/django-static-url/downloads","issues_url":"https://api.github.com/repos/resulto/django-static-url/issues{/number}","pulls_url":"https://api.github.com/repos/resulto/django-static-url/pulls{/number}","milestones_url":"https://api.github.com/repos/resulto/django-static-url/milestones{/number}","notifications_url":"https://api.github.com/repos/resulto/django-static-url/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/resulto/django-static-url/labels{/name}","releases_url":"https://api.github.com/repos/resulto/django-static-url/releases{/id}","deployments_url":"https://api.github.com/repos/resulto/django-static-url/deployments","created_at":"2016-10-12T08:10:29Z","updated_at":"2016-11-03T16:27:37Z","pushed_at":"2016-11-14T15:33:54Z","git_url":"git://github.com/resulto/django-static-url.git","ssh_url":"git@github.com:resulto/django-static-url.git","clone_url":"https://github.com/resulto/django-static-url.git","svn_url":"https://github.com/resulto/django-static-url","homepage":null,"size":14,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/resulto/django-static-url/pulls/1"},"html":{"href":"https://github.com/resulto/django-static-url/pull/1"},"issue":{"href":"https://api.github.com/repos/resulto/django-static-url/issues/1"},"comments":{"href":"https://api.github.com/repos/resulto/django-static-url/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/resulto/django-static-url/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/resulto/django-static-url/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/resulto/django-static-url/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/resulto/django-static-url/statuses/08430bc03a29362d8d34d35e580aba2e77b06cb3"}}}}
{"actor":{"display_login":"ginmrt"}}