Q:

Django can't find static files and template files

After I edit my settings.py  to  3 files (base.py prod.py dev.py) in directory called settings
It can't find the Django template or static files  (404 error) 
What should I do ?  
base.py:
DEBUG = FALSE 
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
STATIC_URL = '/static/'
STATICFILES_DIRS = (
    ("js", os.path.join(STATIC_ROOT,'js')),
    ("css", os.path.join(STATIC_ROOT,'css')),
    ("images", os.path.join(STATIC_ROOT,'images')),
)
TEMPLATE_DIRS=( os.path.join(BASE_DIR,'templates'),)

prod.py:
from .base import *
DATABASES = {   
    'default': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2',
        'NAME': " ",
        'USER': " ",
        'PASSWORD': " ",
        'HOST': "" ,
        'PORT': "5432",
    }
}

wsgi.py: 
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mysite.settings.prod")

from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()

urls.py:
    urlpatterns += patterns('',
            url(r'^static/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.STATIC_ROOT}),)

A:

If you are doing this in production, make sure you runpython manage.py collectstatic which will store all static files into the directory defined by STATIC_ROOT in you settings.py file. Then to serve these using a web server (like nginx or apache), you just add alias to the directory defined in STATIC_ROOT. 

