I am following 2 different tutorials on creating a Django App. In one video (on lynda) it states that my static (javascript/css/image) files should live here:
project_name/project_name/static/
I have a js and css file in there and it links up to my templates just fine. In the second tutorial on youtube (1:38 mark), I am learning how to store uploaded files. After using the collectstatic
command, ALL of my files are now going to
project_name/static/
my settings.py:
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
STATIC_URL = '/static/'
STATICFILES_DIRS = [
os.path.join(BASE_DIR, "static"),
]
STATIC_ROOT = os.path.join(os.path.dirname(BASE_DIR), "/the_office/the_office/static")
I looked here for a better understanding of static_root vs static files_dir and I'd rather it stay where it originally was. I've tried all combinations of file paths I could think of messing around with Static_Root
and StaticFiles_Dirs
but no luck. How can I change the path back to the original? Any further clarification of the os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
is appreciated as well.