{"id":16858963,"url":"https://github.com/ross/webassets-dynamic","last_synced_at":"2025-06-25T05:39:12.706Z","repository":{"id":1482625,"uuid":"1729241","full_name":"ross/webassets-dynamic","owner":"ross","description":"helper module to allow you to use webassets with django.views.static.serve","archived":false,"fork":false,"pushed_at":"2012-03-30T20:25:02.000Z","size":101,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-21T19:42:12.261Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ross.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-05-10T17:51:24.000Z","updated_at":"2015-05-18T14:56:21.000Z","dependencies_parsed_at":"2022-08-16T13:25:05.648Z","dependency_job_id":null,"html_url":"https://github.com/ross/webassets-dynamic","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ross/webassets-dynamic","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ross%2Fwebassets-dynamic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ross%2Fwebassets-dynamic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ross%2Fwebassets-dynamic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ross%2Fwebassets-dynamic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ross","download_url":"https://codeload.github.com/ross/webassets-dynamic/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ross%2Fwebassets-dynamic/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261814649,"owners_count":23213803,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-13T14:15:45.310Z","updated_at":"2025-06-25T05:39:12.667Z","avatar_url":"https://github.com/ross.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"webassets-dynamic is a library to allow you to use webassets with django\nprojects where django.views.static.serve is in use. This is common when static\nfiles live in and are served out of shared \"apps.\"\n\nIf your django app or its dependencies (django apps in those deps) have url\nrules like the following, this is what you need.\n\n    url(r'^static/(?P\u003cpath\u003e.*)$', 'django.views.static.serve',\n        {'document_root': join(dirname(__file__), 'static')}, name='static')\n\n\nThe module provides a single extral function dynamic_assets. It accepts two\nparameters. The first is the static view's name ('static' in the above rule.)\nThe second parameter is the location of the file within the static-directory,\nthe same as you'd use when creating a url.\n\nGenerally this module is set up to manually create and check-in the bundled\nfiles. To do that you'll just run the normal ./manage.py assets rebuild and then\ncheck in the results.\n\nYou will need to configure the following values in your settings.py:\n\n    # where you want to place the resulting output\n    ASSETS_ROOT = os.path.join(ROOT_DIR, 'skin/static/')\n    # the uri at which ^^ is served (can't dynamically get this b/c there may be\n    # multiple statics)\n    STATIC_URL = '/static/'\n    # do not automatically update the packaged assets at runtime (they'll only\n    # be creatd when you run ./manage.py assets rebuild) generating them on the\n    # fly might work, but it's currently untested/not supported.\n    ASSETS_UPDATER = False\n    # by default set ASSETS_DEBUG to DEBUG, meaning that when we're in debug\n    # mode we'll get the expanded list of individual js/css files with their\n    # dynamic paths.\n    ASSETS_DEBUG = DEBUG\n\nAn example assets.py using this module follows:\n\n    from django_assets import Bundle, register\n    from webassets_dynamic import dynamic_assets\n    from os.path import join\n\n    register('js_all', Bundle(\n        dynamic_assets('sharedappjs', 'js/jquery.min.js'),\n        dynamic_assets('sharedappjs', 'js/log.js'),\n        dynamic_assets('static', 'js/app.js'),\n        filters=['jsmin'], output=join('js', 'js_all.js')))\n\n    register('css_all', Bundle(\n        dynamic_assets('static', 'css/screen.css'),\n        filters=['cssrewrite', 'cssmin'],\n        output=join('css', 'css_all.css')))\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fross%2Fwebassets-dynamic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fross%2Fwebassets-dynamic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fross%2Fwebassets-dynamic/lists"}