0

my django app working fine with debug = True but after setting debug false static files are not found error(brokenpipe error) static files are not loaded please any one help me. i tryed it but i cant resolved

my settings file is

"""
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/'
rani
  • 1
  • 2
  • i tryed all but not working so once again asked – rani Jun 17 '15 at 11:10
  • It will *not* work. That is on purpose, because you should be using an actual webserver for that. – spectras Jun 17 '15 at 12:40
  • actual webserver means. sorry i am new to django webapplication. please explain it clearly – rani Jun 17 '15 at 12:47
  • There are lots of possible setups. Basic idea is you don't expose Django to the outside world, you place some webserver in front of it, such as Apache or nginx. You configure it to do caching, security and serving static contents, and talk to your Django app through WSGI. See https://docs.djangoproject.com/en/1.8/howto/static-files/deployment/ – spectras Jun 17 '15 at 13:00
  • yea i already configured with apache web server but static files not loaded when debug = false – rani Jun 17 '15 at 13:03
  • You should then collect your static files (using `./manage.py collectstatic`) and set up your apache to serve the static files itself, instead of forwarding to Django. – spectras Jun 17 '15 at 14:45

0 Answers0