WebFaction
Community site: login faq

Hello,

I'm at my wit's end here. I'm very new to web development. Everything is working fine on the development side, but I can not figure out why I'm getting the 500 error while in production. I've read all the docs, and my settings appear to be fine. I had this in production at one point, and I wanted to change one of my html docs. After I transferred it, the 500 error returned. I decided to just start all over with my production app and change the html doc back to the way it was. Still can't get the site live. Here are my settings:

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os
BASE_DIR = os.path.dirname(os.path.dirname(__file__))

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '#########################'

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

TEMPLATE_DEBUG = False

ALLOWED_HOSTS = ['.vintagebasketball.com']

TEMPLATE_LOADERS=(
    'django.template.loaders.filesystem.Loader',
    'django.template.loaders.app_directories.Loader',
)

# Application definition
LOCAL_APPS = (
    'home',
    'blog',
)
THIRD_PARTY_APPS = (
)
DEFAULT_APPS = (
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.comments',
    'django.contrib.staticfiles',
    'django.contrib.sites',
)

INSTALLED_APPS = LOCAL_APPS + THIRD_PARTY_APPS + DEFAULT_APPS

MIDDLEWARE_CLASSES = (
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
)

ROOT_URLCONF = 'vintageBB.urls'
WSGI_APPLICATION = 'vintageBB.wsgi.application'

DATABASES = {
    'default': {
        'ENGINE':   'django.db.backends.mysql',
        'NAME':     'vintagebb_db',
        'USER':     '#######',
        'PASSWORD': '#######',
    }

}

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True

STATIC_URL = '/static/'

I'm not worried about the static files yet, although when I did have this working I used collectstatic and I was able to add CSS to my project. I'm using Python2.7 and django 1.6.2 I just want the site back up. Any help would be MUCH APPRECIATED. I am so very frustrated :). Thanks in advance.

asked 19 Mar '14, 20:11

Rin
11113
accept rate: 0%

Enable DEBUG=True to see if you get further information on what is causing the 500 error. Be sure to restart your apache instance after the change as well.

(19 Mar '14, 20:33) bmeyer71 ♦♦

Thanks, bmeyer71. I've tried that as well and received no additional info. The log app files don't have any info either. Man, this is tough to debug lol. Oh, one additional comment. At one point, when I first went live, I could get to vintagebasketball.com/admin. However, when I went to the vintagebasketball.com there was the 500 error. Maybe there's some hint there? Neither of them work now, but I do remember either adding or removing the TEMPLATE_LOADERS tuple before and bam, it worked. The entire site was there. Now, I've tried removing this setting, using the TEMPLATE_CONTEXT setting, removing that, etc...still the error.

(19 Mar '14, 21:49) Rin

Please open a support ticket for us to look at this closer with you.

(19 Mar '14, 21:56) bmeyer71 ♦♦

Thanks again. Do I need to add TEMPLATE_DIRS perhaps?

(19 Mar '14, 21:58) Rin

It's possible, but it's hard to say without any further details on what is throwing the 500.

(19 Mar '14, 22:04) bmeyer71 ♦♦

Since I use pagination in one of my views, the problem with the above settings file is the lack of a django.core.context_processors.request in the TEMPLATE_CONTEXT_PROCESSORS attribute. My settings now includes:

TEMPLATE_CONTEXT_PROCESSORS = (
    "django.contrib.auth.context_processors.auth",
    "django.core.context_processors.request",
    "django.core.context_processors.debug",
    "django.core.context_processors.i18n",
    "django.core.context_processors.media",
    "django.core.context_processors.static",
    "django.core.context_processors.tz",
    "django.contrib.messages.context_processors.messages",
)

This solved my problem Thanks bmeyer for the support. Now, on to tackling static files...

permanent link

answered 20 Mar '14, 15:54

Rin
11113
accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×909
×113

question asked: 19 Mar '14, 20:11

question was seen: 21,733 times

last updated: 20 Mar '14, 15:54

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM