为什么django app在调试时没有加载静态文件?

时间:2015-06-17 10:52:59

标签: python mysql json django apache

我的django应用程序正常工作与debug = True但设置调试后错误静态文件未找到错误(brokenpipe错误)静态文件未加载请任何人帮助我。我尝试过但我无法解决

我的设置文件是

"""
Django settings for smartdeal_advt project.

For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
PROJECT_ROOT = os.path.realpath(os.path.dirname(__file__))
import djcelery
djcelery.setup_loader()
CELERYBEAT_SCHEDULER = "djcelery.schedulers.DatabaseScheduler"
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'zew*kl=+0cnt2zwd^%84vl(m5y7!^(n9&2%3_vkv6!mr==)s3d'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = False

TEMPLATE_DEBUG = True

ALLOWED_HOSTS = ['127.0.0.1','localhost']

CORS_ORIGIN_ALLOW_ALL = True

# Application definition


WSGI_APPLICATION = 'smartdeal_advt.wsgi.application'


# Database
# https://docs.djangoproject.com/en/1.7/ref/settings/#databases
rnationalization
# https://docs.djangoproject.com/en/1.7/topics/i18n/

LANGUAGE_CODE = 'en-us'
# TIME_ZONE = 'UTC'

TIME_ZONE = 'Asia/Kolkata'

MEDIA_ROOT = os.path.join(PROJECT_ROOT, 'media/images/')

CV_ROOT = os.path.join(PROJECT_ROOT, 'media/cv/')

CV_URL = '/media/cv/'

MEDIA_URL = '/media/images/'


STATICFILES_FINDERS = (
    'django.contrib.staticfiles.finders.FileSystemFinder',
    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
#    'django.contrib.staticfiles.finders.DefaultStorageFinder',
)
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.7/howto/static-files/

STATIC_ROOT = os.path.join(PROJECT_ROOT, 'static')
STATICFILE_DIRS = (
                   os.path.join(PROJECT_ROOT, '/static/css')
                 )

STATIC_URL = '/static/'

0 个答案:

没有答案