Static Media Manager v0.4 documentation
Install the package.
From Source Checkout:
git clone http://opensource.washingtontimes.com/git/public/django-staticmediamgr.git/
cd django-staticmediamgr
python setup.py install
From PyPI:
**Comming soon**
Add to INSTALLED_APPS. In your projects settings.py file, add staticmediamgr to INSTALLED_APPS.
Configure Settings. In settings.py or local_settings.py configure at least STATIC_MEDIA_COPY_PATHS and possibly STATIC_MEDIA_COMPRESS_CSS and STATIC_MEDIA_COMPRESS_JS.
For local development, assuming you are using a local_settings.py file, set your STATIC_MEDIA_COPY_PATHS to a path that is not versioned with version control. Then configure django to serve media from that directory.
In local_settings.py:
STATIC_MEDIA_COPY_PATHS = (
{'from': 'media', 'to': 'media2'},
)
Then in urls.py:
urlpatterns += patterns('',
(r'^media/(?P<path>.*)$', 'django.views.static.serve',
{'document_root': os.path.join(os.path.basedir(__file__), 'media2')}),
)
Static Media Manager creates a management command copy_static_media. To copy all your static media simply:
./manage.py copy_static_media