使用gunicorn部署Django没有名为ImportError的模块:没有名为validation的模块

使用gunicorn部署Django没有名为ImportError的模块:没有名为validation的模块,第1张

概述我试图使用nginx,gunicorn和virtualenv来部署我的Django项目.但是在运行此评论时我遇到了以下错误 sudo gunicorn_django --bind test.com:8001 记录: Traceback (most recent call last): File "/opt/postjust/lib/python2.7/site-packages/gunicor 我试图使用Nginx,gunicorn和virtualenv来部署我的Django项目.但是在运行此评论时我遇到了以下错误

sudo gunicorn_django --bind test.com:8001

记录:

Traceback (most recent call last):  file "/opt/postjust/lib/python2.7/site-packages/gunicorn/arbiter.py",line 503,in spawn_worker    worker.init_process()  file "/opt/postjust/lib/python2.7/site-packages/gunicorn/workers/base.py",line 116,in init_process    self.wsgi = self.app.wsgi()  file "/opt/postjust/lib/python2.7/site-packages/gunicorn/app/base.py",line 67,in wsgi    self.callable = self.load()  file "/opt/postjust/lib/python2.7/site-packages/gunicorn/app/djangoapp.py",line 105,in load    mod = util.import_module("gunicorn.app.django_wsgi")  file "/usr/local/Cellar/python/2.7.8_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py",line 37,in import_module    __import__(name)  file "/opt/postjust/lib/python2.7/site-packages/gunicorn/app/django_wsgi.py",line 21,in <module>    from django.core.management.valIDation import get_valIDation_errorsimportError: No module named valIDation[2015-02-23 00:58:17 +0200] [10584] [INFO] Worker exiting (pID: 10584)[2015-02-23 00:58:17 +0200] [10581] [INFO] Shutting down: Master[2015-02-23 00:58:17 +0200] [10581] [INFO] Reason: Worker Failed to boot.

该项目在当地运行良好.

这是我的settings.py文件:

"""Django settings for postjust project.For more information on this file,seehttps://docs.djangoproject.com/en/1.7/topics/settings/For the full List of settings and their values,seehttps://docs.djangoproject.com/en/1.7/ref/settings/"""# Build paths insIDe the project like this: os.path.join(BASE_DIR,...)import osBASE_DIR = os.path.dirname(os.path.dirname(__file__))# 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 = 'jb-@(98(ew4kkociwv+2y(3799r*vug7-$g)e=6wsxigrk30=!'# Security WARNING: don't run with deBUG turned on in production!DEBUG = FalseTEMPLATE_DEBUG = FalseALLOWED_HOSTS = []# Application deFinitionINSTALLED_APPS = (    'django.contrib.admin','django.contrib.auth','django.contrib.ContentTypes','django.contrib.sessions','django.contrib.messages','django.contrib.staticfiles','blog')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',)ROOT_URLconf = 'postjust.urls'Wsgi_APPliCATION = 'postjust.wsgi.application'# Database# https://docs.djangoproject.com/en/1.7/ref/settings/#databasesDATABASES = {    'default': {        'ENGINE': 'django.db.backends.sqlite3','name': os.path.join(BASE_DIR,'db.sqlite3'),}}# Internationalization# https://docs.djangoproject.com/en/1.7/topics/i18n/LANGUAGE_CODE = 'en-us'TIME_ZONE = 'UTC'USE_I18N = TrueUSE_L10N = TrueUSE_TZ = True# Static files (CSS,JavaScript,Images)# https://docs.djangoproject.com/en/1.7/howto/static-files/STATIC_URL = '/static/'

我在virtualenv的点子列表:

Django(1.7.4)

gunicorn(19.2.1)

点子(6.0.8)

setuptools(12.0.5)

–Python 2.7.8

解决方法 将gunicorn_django更改为gunicorn newApp.wsgi:应用程序应修复此问题.

不再推荐使用gunicorn_django.这是因为它调用了不推荐使用的django_wsgi.py并抛出了导入错误.

更多信息:
http://www.rkblog.rk.edu.pl/w/p/first-impressions-django-17-beta-upgrade-young-project/

总结

以上是内存溢出为你收集整理的使用gunicorn部署Django没有名为ImportError的模块:没有名为validation的模块全部内容,希望文章能够帮你解决使用gunicorn部署Django没有名为ImportError的模块:没有名为validation的模块所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/langs/1194950.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-03
下一篇 2022-06-03

发表评论

登录后才能评论

评论列表(0条)

保存