{"action":"created","comment":{"url":"https://api.github.com/repos/edx/credentials/pulls/comments/53425900","id":53425900,"diff_hunk":"@@ -0,0 +1,18 @@\n+\"\"\"\n+Custom S3 storage backends to store files in sub folders.\n+\"\"\"\n+from functools import partial\n+\n+from django.conf import settings\n+from storages.backends.s3boto import S3BotoStorage\n+\n+\n+MediaS3BotoStorage = partial(\n+    S3BotoStorage,\n+    location=settings.MEDIA_ROOT.strip('/').split('/')[-1]\n+)\n+\n+StaticS3BotoStorage = partial(\n+    S3BotoStorage,\n+    location=settings.STATIC_ROOT.strip('/').split('/')[-1]","path":"credentials/apps/core/s3utils.py","position":null,"original_position":17,"commit_id":"867c30738fd8d041867fd789a8d772baca2a64cd","original_commit_id":"ec6fc876f6485ea571bde97ec059cfed1e9bc2cc","user":{"login":"zubair-arbi","id":5072991,"avatar_url":"https://avatars.githubusercontent.com/u/5072991?v=3","gravatar_id":"","url":"https://api.github.com/users/zubair-arbi","html_url":"https://github.com/zubair-arbi","followers_url":"https://api.github.com/users/zubair-arbi/followers","following_url":"https://api.github.com/users/zubair-arbi/following{/other_user}","gists_url":"https://api.github.com/users/zubair-arbi/gists{/gist_id}","starred_url":"https://api.github.com/users/zubair-arbi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zubair-arbi/subscriptions","organizations_url":"https://api.github.com/users/zubair-arbi/orgs","repos_url":"https://api.github.com/users/zubair-arbi/repos","events_url":"https://api.github.com/users/zubair-arbi/events{/privacy}","received_events_url":"https://api.github.com/users/zubair-arbi/received_events","type":"User","site_admin":false},"body":"@maxrothman I have updated the config settings so that we can use the media and static root values directly.","created_at":"2016-02-19T06:05:40Z","updated_at":"2016-02-19T06:05:40Z","html_url":"https://github.com/edx/credentials/pull/60#discussion_r53425900","pull_request_url":"https://api.github.com/repos/edx/credentials/pulls/60","_links":{"self":{"href":"https://api.github.com/repos/edx/credentials/pulls/comments/53425900"},"html":{"href":"https://github.com/edx/credentials/pull/60#discussion_r53425900"},"pull_request":{"href":"https://api.github.com/repos/edx/credentials/pulls/60"}}},"pull_request":{"url":"https://api.github.com/repos/edx/credentials/pulls/60","id":59480661,"html_url":"https://github.com/edx/credentials/pull/60","diff_url":"https://github.com/edx/credentials/pull/60.diff","patch_url":"https://github.com/edx/credentials/pull/60.patch","issue_url":"https://api.github.com/repos/edx/credentials/issues/60","number":60,"state":"open","locked":false,"title":"add S3BotoStorage for static and media files","user":{"login":"zubair-arbi","id":5072991,"avatar_url":"https://avatars.githubusercontent.com/u/5072991?v=3","gravatar_id":"","url":"https://api.github.com/users/zubair-arbi","html_url":"https://github.com/zubair-arbi","followers_url":"https://api.github.com/users/zubair-arbi/followers","following_url":"https://api.github.com/users/zubair-arbi/following{/other_user}","gists_url":"https://api.github.com/users/zubair-arbi/gists{/gist_id}","starred_url":"https://api.github.com/users/zubair-arbi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zubair-arbi/subscriptions","organizations_url":"https://api.github.com/users/zubair-arbi/orgs","repos_url":"https://api.github.com/users/zubair-arbi/repos","events_url":"https://api.github.com/users/zubair-arbi/events{/privacy}","received_events_url":"https://api.github.com/users/zubair-arbi/received_events","type":"User","site_admin":false},"body":"@awais786 @ahsan-ul-haq @tasawernawaz @waheedahmed \r\n\r\nUpdate S3BotoStorage to use 'media' folder for media files and 'staticfiles' for static files.\r\n\r\nRelated configuration changes: https://github.com/edx/configuration/pull/2781\r\n\r\nhttp://stackoverflow.com/questions/10390244/how-to-set-up-a-django-project-with-django-storages-and-amazon-s3-but-with-diff/10825691#10825691\r\nhttp://martinbrochhaus.com/s3.html","created_at":"2016-02-16T11:58:59Z","updated_at":"2016-02-19T06:05:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"078befeb6044c7ebbf66a1613b0195746e0e74d5","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/edx/credentials/pulls/60/commits","review_comments_url":"https://api.github.com/repos/edx/credentials/pulls/60/comments","review_comment_url":"https://api.github.com/repos/edx/credentials/pulls/comments{/number}","comments_url":"https://api.github.com/repos/edx/credentials/issues/60/comments","statuses_url":"https://api.github.com/repos/edx/credentials/statuses/867c30738fd8d041867fd789a8d772baca2a64cd","head":{"label":"edx:zub/update-static-media-location","ref":"zub/update-static-media-location","sha":"867c30738fd8d041867fd789a8d772baca2a64cd","user":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"repo":{"id":47830104,"name":"credentials","full_name":"edx/credentials","owner":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/edx/credentials","description":"Django application used as the backend to support Course or Program based credentials.","fork":false,"url":"https://api.github.com/repos/edx/credentials","forks_url":"https://api.github.com/repos/edx/credentials/forks","keys_url":"https://api.github.com/repos/edx/credentials/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edx/credentials/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edx/credentials/teams","hooks_url":"https://api.github.com/repos/edx/credentials/hooks","issue_events_url":"https://api.github.com/repos/edx/credentials/issues/events{/number}","events_url":"https://api.github.com/repos/edx/credentials/events","assignees_url":"https://api.github.com/repos/edx/credentials/assignees{/user}","branches_url":"https://api.github.com/repos/edx/credentials/branches{/branch}","tags_url":"https://api.github.com/repos/edx/credentials/tags","blobs_url":"https://api.github.com/repos/edx/credentials/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edx/credentials/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edx/credentials/git/refs{/sha}","trees_url":"https://api.github.com/repos/edx/credentials/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edx/credentials/statuses/{sha}","languages_url":"https://api.github.com/repos/edx/credentials/languages","stargazers_url":"https://api.github.com/repos/edx/credentials/stargazers","contributors_url":"https://api.github.com/repos/edx/credentials/contributors","subscribers_url":"https://api.github.com/repos/edx/credentials/subscribers","subscription_url":"https://api.github.com/repos/edx/credentials/subscription","commits_url":"https://api.github.com/repos/edx/credentials/commits{/sha}","git_commits_url":"https://api.github.com/repos/edx/credentials/git/commits{/sha}","comments_url":"https://api.github.com/repos/edx/credentials/comments{/number}","issue_comment_url":"https://api.github.com/repos/edx/credentials/issues/comments{/number}","contents_url":"https://api.github.com/repos/edx/credentials/contents/{+path}","compare_url":"https://api.github.com/repos/edx/credentials/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edx/credentials/merges","archive_url":"https://api.github.com/repos/edx/credentials/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edx/credentials/downloads","issues_url":"https://api.github.com/repos/edx/credentials/issues{/number}","pulls_url":"https://api.github.com/repos/edx/credentials/pulls{/number}","milestones_url":"https://api.github.com/repos/edx/credentials/milestones{/number}","notifications_url":"https://api.github.com/repos/edx/credentials/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edx/credentials/labels{/name}","releases_url":"https://api.github.com/repos/edx/credentials/releases{/id}","deployments_url":"https://api.github.com/repos/edx/credentials/deployments","created_at":"2015-12-11T14:09:03Z","updated_at":"2016-01-27T09:19:02Z","pushed_at":"2016-02-19T06:01:50Z","git_url":"git://github.com/edx/credentials.git","ssh_url":"git@github.com:edx/credentials.git","clone_url":"https://github.com/edx/credentials.git","svn_url":"https://github.com/edx/credentials","homepage":"http://open-edx-credentials-guide.readthedocs.org/en/latest/ ","size":2380,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":4,"forks":3,"open_issues":4,"watchers":1,"default_branch":"master"}},"base":{"label":"edx:master","ref":"master","sha":"3c0062d3ff696378fe81f64cc14d9293c26e21db","user":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"repo":{"id":47830104,"name":"credentials","full_name":"edx/credentials","owner":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/edx/credentials","description":"Django application used as the backend to support Course or Program based credentials.","fork":false,"url":"https://api.github.com/repos/edx/credentials","forks_url":"https://api.github.com/repos/edx/credentials/forks","keys_url":"https://api.github.com/repos/edx/credentials/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edx/credentials/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edx/credentials/teams","hooks_url":"https://api.github.com/repos/edx/credentials/hooks","issue_events_url":"https://api.github.com/repos/edx/credentials/issues/events{/number}","events_url":"https://api.github.com/repos/edx/credentials/events","assignees_url":"https://api.github.com/repos/edx/credentials/assignees{/user}","branches_url":"https://api.github.com/repos/edx/credentials/branches{/branch}","tags_url":"https://api.github.com/repos/edx/credentials/tags","blobs_url":"https://api.github.com/repos/edx/credentials/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edx/credentials/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edx/credentials/git/refs{/sha}","trees_url":"https://api.github.com/repos/edx/credentials/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edx/credentials/statuses/{sha}","languages_url":"https://api.github.com/repos/edx/credentials/languages","stargazers_url":"https://api.github.com/repos/edx/credentials/stargazers","contributors_url":"https://api.github.com/repos/edx/credentials/contributors","subscribers_url":"https://api.github.com/repos/edx/credentials/subscribers","subscription_url":"https://api.github.com/repos/edx/credentials/subscription","commits_url":"https://api.github.com/repos/edx/credentials/commits{/sha}","git_commits_url":"https://api.github.com/repos/edx/credentials/git/commits{/sha}","comments_url":"https://api.github.com/repos/edx/credentials/comments{/number}","issue_comment_url":"https://api.github.com/repos/edx/credentials/issues/comments{/number}","contents_url":"https://api.github.com/repos/edx/credentials/contents/{+path}","compare_url":"https://api.github.com/repos/edx/credentials/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edx/credentials/merges","archive_url":"https://api.github.com/repos/edx/credentials/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edx/credentials/downloads","issues_url":"https://api.github.com/repos/edx/credentials/issues{/number}","pulls_url":"https://api.github.com/repos/edx/credentials/pulls{/number}","milestones_url":"https://api.github.com/repos/edx/credentials/milestones{/number}","notifications_url":"https://api.github.com/repos/edx/credentials/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edx/credentials/labels{/name}","releases_url":"https://api.github.com/repos/edx/credentials/releases{/id}","deployments_url":"https://api.github.com/repos/edx/credentials/deployments","created_at":"2015-12-11T14:09:03Z","updated_at":"2016-01-27T09:19:02Z","pushed_at":"2016-02-19T06:01:50Z","git_url":"git://github.com/edx/credentials.git","ssh_url":"git@github.com:edx/credentials.git","clone_url":"https://github.com/edx/credentials.git","svn_url":"https://github.com/edx/credentials","homepage":"http://open-edx-credentials-guide.readthedocs.org/en/latest/ ","size":2380,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":4,"forks":3,"open_issues":4,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/edx/credentials/pulls/60"},"html":{"href":"https://github.com/edx/credentials/pull/60"},"issue":{"href":"https://api.github.com/repos/edx/credentials/issues/60"},"comments":{"href":"https://api.github.com/repos/edx/credentials/issues/60/comments"},"review_comments":{"href":"https://api.github.com/repos/edx/credentials/pulls/60/comments"},"review_comment":{"href":"https://api.github.com/repos/edx/credentials/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/edx/credentials/pulls/60/commits"},"statuses":{"href":"https://api.github.com/repos/edx/credentials/statuses/867c30738fd8d041867fd789a8d772baca2a64cd"}}}}