I’m using Django 1.3 and I realize it has a collectstatic command to collect static files into STATIC_ROOT. Here I have some other global files that need to be served using STATICFILES_DIR.
Can I make them use the same dir ?
Thanks.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No. In fact, the file
django/contrib/staticfiles/finders.pyeven checks for this and raises anImproperlyConfiguredexception when you do so:The
STATICFILES_DIRScan contain other directories (not necessarily app directories) with static files and these static files will be collected into yourSTATIC_ROOTwhen you run collectstatic. These static files will then be served by your web server and they will be served from yourSTATIC_ROOT.If you have files currently in your
STATIC_ROOTthat you wish to serve then you need to move these to a different directory and put that other directory inSTATICFILES_DIRS. YourSTATIC_ROOTdirectory should be empty and all static files should be collected into that directory (i.e., it should not already contain static files).