WebFaction
Community site: login faq

Hi,

I followed the instructions given here to serve static file using django.contrib.staticfiles. Now I want to serve user-uploaded files, and I'm not sure how to do it.

I can't upload the file directly in the static folder in which django.contrib.staticfiles copies all the static files, because they are going to be deleted when python manage.py collectstatic is run, so how can I do that? How can I have a folder in which I can upload files, which then are served independently from Django?

asked 05 Jul '12, 07:54

jul
111610
accept rate: 0%


Hi,

Please check Django's documentation on static files.

User-uploaded files should be stored in the directory specified by MEDIA_ROOT in your settings file.

permanent link

answered 05 Jul '12, 10:22

todork
1.2k5
accept rate: 34%

edited 05 Jul '12, 10:23

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×909

question asked: 05 Jul '12, 07:54

question was seen: 4,625 times

last updated: 05 Jul '12, 10:23

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM