简体   繁体   English

git push后的heroku server 500错误,尽管在本地工作

[英]heroku server 500 error after a git push it works locally though

I did a git push and then all of a sudden my app responds with a server error. 我进行了git push,然后突然我的应用程序响应服务器错误。 I have been trying to get my my scheduler to work it works fine locally. 我一直在尝试让我的调度程序在本地正常运行。 It gave me a problem but I fixed it using a git pull request. 它给了我一个问题,但是我使用git pull请求修复了它。 it was working fine locally and then all of sudden server error 500. I did heroku logs and got this response 它在本地工作正常,然后突然出现服务器错误500。我做了heroku日志并得到了此响应

my procfile 我的procfile

web: gunicorn gettingstarted.wsgi --log-file -
worker: celery -A blog worker -B -l info

my requirements.txt 我的requirements.txt

    amqp==1.4.9
    anyjson==0.3.3
    attrs==16.2.0
    beautifulsoup4==4.4.1
    billiard==3.3.0.23
    celery==3.1.23
    cffi==1.8.3
    click==6.6
    cryptography==1.5
    cssselect==0.9.2
    decorator==4.0.10
    dj-database-url==0.4.0
    Django==1.10.1
    django-bootstrap-pagination==1.6.2
    django-celery==3.1.17
    django-crispy-forms==1.6.0
    django-dynamic-scraper==0.11.2
    django-haystack==2.4.1
    django-markdown-deux==1.0.5
    django-pagedown==0.1.1
    django-redis-cache==1.6.5
    django-taggit==0.18.1
    feedparser==5.2.1
    future==0.15.2
    gunicorn==19.4.5
    html5lib==0.9999999
    httplib2==0.9.2
    idna==2.1
    jsonpath-rw==1.4.0
    kombu==3.0.35
    lxml==3.6.4
    markdown2==2.3.1
    oauth2client==2.2.0
    oauthlib==1.1.2
    parsel==1.0.3
    Pillow==3.2.0
    ply==3.8
    psycopg2==2.6.1
    pyasn1==0.1.9
    pyasn1-modules==0.0.8
    pycparser==2.14
    PyDispatcher==2.0.5
    pyOpenSSL==16.1.0
    pytz==2016.6.1
    queuelib==1.4.2
    redis==2.10.5
    requests==2.9.1
    requests-oauthlib==0.6.1
    rsa==3.4.2
    Scrapy==1.1.2
    scrapy-djangoitem==1.1.1
    scrapyd==1.1.0
    service-identity==16.0.0
    simplejson==3.8.2
    six==1.10.0
    tweepy==3.5.0
    Twisted==16.4.1
    uritemplate==0.6
    w3lib==1.15.0
    whitenoise==3.0
    Whoosh==2.7.4
    zope.interface==4.3.2

this all works locally though 这一切都在本地工作

I have scaled my web and worker to zero and started them back up still nothin. 我已经将我的网络和工作人员的比例缩放为零,然后又重新启动它们。 I have not seen any L,H,R error codes 我没有看到任何L,H,R错误代码

EDIT 编辑

this part of my output 我输出的这部分

 2016-09-24T02:23:53.832216+00:00 app[worker.1]: 

its red, this color just started happening. 它的红色,这种颜色才刚刚开始出现。 Earlier in the day I had using django celery beat locally I get error 'PeriodicTask' object has no attribute '_default_manager' and I fixed it following a pul request 当天早些时候,我在本地使用django celery beat时,出现错误“ PeriodicTask”对象没有属性“ _default_manager”,并且在请求pul后将其修复

obj = self.model._default_manager.get(pk=self.model.pk)

turned to 转向

98  Model = type(self.model)
99  obj = Model._default_manager.get(pk=self.model.pk)

EDIT 编辑

set my production DEBUG to True so I could see if I could see something. 将我的生产DEBUG设置为True,这样我就可以看清东西了。 And it said 它说

ImportError: No module named 'django.core.context_processors'

this was not in my heroku logs and as i mentioned before this works locally. 这不在我的heroku日志中,正如我之前提到的那样,它在本地有效。 I believe this is called failing silently. 我相信这被称为无声失败。 gonna see if I can figure this out. 要看看我能不能解决这个问题。 If someone has any idea what's going on and how to fix this, let me know. 如果有人知道发生了什么事以及如何解决此问题,请告诉我。 Right now google is my friend. 现在,谷歌是我的朋友。

Maybe your local Django version is earlier then in requirements.txt, because in Django 1.8 built-in template context processors have been moved to django.template.context_processors . 也许您本地的Django版本早于Requirements.txt,因为在Django 1.8中, 内置模板上下文处理器已移至django.template.context_processors

Try this example settings: 尝试以下示例设置:

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': ['templates'],
        'APP_DIRS': True,
        'OPTIONS': {
            'context_processors': [
                'django.template.context_processors.debug',
                'django.template.context_processors.request',
                'django.template.context_processors.media',
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
            ],
        },
    },
]

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

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