Skip to main content

Handling django app media

Project description

the intention of this application is to enable static app files (css, js, pics) in the app folder itself.

<application1>/media/<application1>/js/script.js <application2>/media/<application2>/js/script.js

<project>/media/logo.jpg

To use this view in development you should add something like the following to urls.py: if settings.DEBUG: urlpatterns += (r’^media/(?P<path>.*)$’, ‘site.media.serve_apps’, {‘document_root’ : settings.MEDIA_ROOT})

For deployment there is a managament command called symlinkmedia that will create symlinks to each applications media directory in MEDIA_ROOT.

Now all apps in INSTALLED_APPS that have a “media” directory in them will be reachable as ‘/media/<application_name>/’.

You can then have the admin media files served by setting ADMIN_MEDIA_PREFIX = ‘/media/admin/’

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-appmedia-1.0.1.tar.gz (25.3 kB view details)

Uploaded Source

File details

Details for the file django-appmedia-1.0.1.tar.gz.

File metadata

File hashes

Hashes for django-appmedia-1.0.1.tar.gz
Algorithm Hash digest
SHA256 c41cb355f10436a9c811ede7495b4088f785ea88a779fd6fb669ee2eb7cb4697
MD5 8b9927fe44490cd8ad947afcd3fdc2c9
BLAKE2b-256 f963f5d9d04e0eea193bada59f2500b45053f500bd546d9094d5e68bc78f86b2

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page