Skip to content
This repository

Rename the media directory to static #108

Closed
wants to merge 1 commit into from

4 participants

Thibault J. Kiril Vladimiroff Shergin Rodion trbs
Thibault J.

Makes the autocomplete media files be served by the test server, and managed
by the 'collectstatic' command.

fixes #107

I'm kinda new to django, so feel free to tell me if I did something silly here.

Thibault J. Move media to static directory.
Makes the autocomplete files be served by the test server, and managed
by the 'collectstatic' command.

fixes #107
6b60b4a
Kiril Vladimiroff

Actually it's quite important MEDIA_ROOT to be different from STATIC_ROOT and MEDIA_URL from STATIC_URL.

From Django Documentation:

In previous versions of Django, it was common to place static assets in MEDIA_ROOT along with user-uploaded files, and serve them both at MEDIA_URL. Part of the purpose of introducing the staticfiles app is to make it easier to keep static files separate from user-uploaded files.

For this reason, you need to make your MEDIA_ROOT and MEDIA_URL different from your STATIC_ROOT and STATIC_URL. You will need to arrange for serving of files in MEDIA_ROOT yourself; staticfiles does not deal with user-uploaded files at all. You can, however, use django.views.static.serve() view for serving MEDIA_ROOT in development; see Serving other directories.

https://docs.djangoproject.com/en/dev/howto/static-files/

Shergin Rodion

Please add this pull request to main.

trbs
Owner

Please test 276fd3b

trbs trbs closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Jun 13, 2011
Thibault J. Move media to static directory.
Makes the autocomplete files be served by the test server, and managed
by the 'collectstatic' command.

fixes #107
6b60b4a
This page is out of date. Refresh to see the latest.
0  ...dia/django_extensions/css/jquery.autocomplete.css → ...tic/django_extensions/css/jquery.autocomplete.css
File renamed without changes
0  ...ensions/media/django_extensions/img/indicator.gif → ...nsions/static/django_extensions/img/indicator.gif
File renamed without changes
0  ...ns/media/django_extensions/js/jquery.ajaxQueue.js → ...s/static/django_extensions/js/jquery.ajaxQueue.js
File renamed without changes
0  ...media/django_extensions/js/jquery.autocomplete.js → ...tatic/django_extensions/js/jquery.autocomplete.js
File renamed without changes
0  ...media/django_extensions/js/jquery.bgiframe.min.js → ...tatic/django_extensions/js/jquery.bgiframe.min.js
File renamed without changes
0  ...o_extensions/media/django_extensions/js/jquery.js → ..._extensions/static/django_extensions/js/jquery.js
File renamed without changes
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.