Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename the media directory to static #108

Closed
wants to merge 1 commit into from

Conversation

thibault
Copy link
Contributor

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.

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

fixes django-extensions#107
@vladimiroff
Copy link
Contributor

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/

@beholderrk
Copy link

Please add this pull request to main.

@trbs
Copy link
Member

trbs commented Oct 14, 2012

Please test 276fd3b

@trbs trbs closed this Oct 14, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Moving media to static files
4 participants