简体   繁体   English

heroku django服务器错误

[英]heroku django server error

Trying to deploy django project on heroku: https://crmtestnewone.herokuapp.com/crm/ 尝试在heroku上部署django项目: https ://crmtestnewone.herokuapp.com/crm/

Do all as this instruction said but getting error (Server Error (500)) https://github.com/DjangoGirls/tutorial-extensions/blob/master/heroku/README.md 按照此指令的说明进行操作,但会出现错误(服务器错误(500)) https://github.com/DjangoGirls/tutorial-extensions/blob/master/heroku/README.md

2016-10-06T14:01:38.045036+00:00 heroku[router]: at=info method=GET path="/crm/" host=crmtestnewone.herokuapp.com request_id=4981504b-0314-48ee-8a1b-ef7c51062b8f fwd="95.108.174.232" dyno=web.1 connect=1ms service=53ms status=500 bytes=253

I only can enter /admin page 我只能进入/ admin页面

2016-10-06T14:03:37.432783+00:00 heroku[router]: at=info method=GET path="/admin/" host=crmtestnewone.herokuapp.com request_id=854e9324-a660-4a4e-ac19-8a9e693331c2 fwd="95.108.174.232" dyno=web.1 connect=0ms service=85ms status=200 bytes=4891
2016-10-06T14:03:37.596058+00:00 heroku[router]: at=info method=GET path="/static/admin/css/dashboard.css" host=crmtestnewone.herokuapp.com request_id=65fcb7df-bbe8-4731-aabc-24c1886c7300 fwd="95.108.174.232" dyno=web.1 connect=0ms service=2ms status=404 bytes=304
2016-10-06T14:03:37.597996+00:00 heroku[router]: at=info method=GET path="/static/admin/css/base.css" host=crmtestnewone.herokuapp.com request_id=2ed877bd-c9f7-4b3d-b613-c479d75d1ef1 fwd="95.108.174.232" dyno=web.1 connect=0ms service=3ms status=404 bytes=299

Can you give any advice to me? 你能给我什么建议吗? Why admin page working (i can create objects in my models), but look like pure html without any style and my other pages dont work at all? 为什么管理页面正常工作(我可以在模型中创建对象),但是看起来像纯HTML却没有任何样式,而我的其他页面根本不工作?

UPDATE: 更新:

settings.py settings.py

INSTALLED_APPS = (
'crm',
'bootstrapform',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',)

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

ROOT_URLCONF = 'dive_into.urls'

TEMPLATES = [
{
    'BACKEND': 'django.template.backends.django.DjangoTemplates',
    'DIRS': [os.path.join(BASE_DIR, 'templates')],
    'APP_DIRS': True,
    'OPTIONS': {
        'context_processors': [
            'django.template.context_processors.debug',
            'django.template.context_processors.request',
            'django.contrib.auth.context_processors.auth',
            'django.contrib.messages.context_processors.messages',
            ],
        },
    },
]

WSGI_APPLICATION = 'dive_into.wsgi.application'

import os
BASE_DIR = os.path.dirname(os.path.dirname(__file__))

DATABASES = {
'default': {
    'ENGINE': 'django.db.backends.sqlite3',
    'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
    }
}
LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True
STATIC_URL = '/static/'
LOGIN_REDIRECT_URL = '/crm/'
PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__))
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
import dj_database_url

DATABASES['default'] = dj_database_url.config()

SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')

ALLOWED_HOSTS = ['*']

DEBUG = False

try:
    from .local_settings import *
except ImportError:
    pass

requirements.txt requirements.txt

Django==1.10.1
django-bootstrap-form==3.2.1
gunicorn==19.4.5
psycopg2==2.6.1
whitenoise==2.0.6
dj-database-url==0.4.0

change to debug=true, got error: Could not parse the remainder: '=' from '=' in 更改为debug = true,得到错误:无法解析剩余部分:'='from'='in
problem was in: {% if search_clients = 'no auth'%} it should be == It works fine localy throught. 问题出在:{%如果search_clients ='no auth'%}应该是==整个区域都可以正常工作。

Newtt thanks for your help! Newtt感谢您的帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM