[Sa Apr 09 18: 27: 29.953008 2016] [: Fehler] [pid 3230: tid 140635784853248] [Client 103.14.196.22:53950] mod_wsgi (pid = 3230) : Ziel-WSGI-Skript '/var/www/FlaskApps/FlaskApps.wsgi' kann nicht als Python-Modul geladen werden.eve app Bereitstellungsfehler kann mir jemand helfen, es zu beheben
[Sa Apr 09 18: 27: 29.953045 2016] [: Fehler] [pid 3230: tid 140635784853248] [Client 103.14.196.22:53950] mod_wsgi (pid = 3230): Ausnahme beim Verarbeiten des WSGI-Skripts '/ var/www/FlaskApps/FlaskApps.wsgi '.
[Sa 9. April 18: 27: 29,953065 2016] [: error] [pid 3230: tid 140635784853248] [client 103.14.196.22:53950] Traceback (jüngste Aufforderung zuletzt):
[Sa 09 Apr 18: 27: 29.953079 2016] [: Fehler] [pid 3230: tid 140635784853248] [Client 103.14.196.22:53950] Datei "/var/www/FlaskApps/FlaskApps.wsgi", Zeile 8, in
[Sat Apr 09 18: 27: 29.953126 2016] [: Fehler] [pid 3230: tid 140635784853248] [Client 103.14.196.22:53950] von run Import App als Anwendung
[Sa Apr 09 18: 27: 29.953136 2016] [ : Fehler] [pid 3230: tid 140635784853248] [clie nt 103.14.196.22:53950] Datei "/var/www/FlaskApps/PlagiarismDefenderApp/run.py", Zeile 28, in
[Sa Apr 09 18: 27: 29.953165 2016] [: Fehler] [Pid 3230: tid 140635784853248] [client 103.14.196.22:53950] app = Eve()
[Sa Apr 09 18: 27: 29,953173 2016] [: error] [3230 pid: tid 140635784853248] [client 103.14.196.22:53950] Die Datei "/usr/local/lib/python2.7/dist-packages/eve/flaskapp.py", Zeile 139, in init
[Sa 9. April 18: 27: 29,953371 2016] [: error] [pid 3230: tid 140635784853248] [Client 103.14.196.22:53950] self.validate_domain_struct()
[Sa Apr 09 18: 27: 29.953382 2016] [: Fehler] [pid 3230: tid 140635784853248] [Client 103.14.196.22:53950] Datei "/usr/local/lib/python2.7/dist-packages/ Eve/flaskapp.py“, Leitung 252, in validate_domain_struct
[Sa 09 Apr 18: 27: 29,953395 2016] [: error] [3230 pid: tid 140635784853248] [client 103.14.196.22:53950] erhöhen ConfigException (‘ DOMAIN Wörterbuch fehlt oder falsch. ')
[Sa Apr 09 18: 27: 29.953408 2016] [: Fehler] [pid 3230: tid 140635784853248] [Client 103.14.196.22:53950] ConfigException: DOMAIN Wörterbuch fehlt oder falsch.
home.py Datei
# -*- coding: utf-8 -*-
import os
from eve import Eve
if 'PORT' in os.environ:
port = int(os.environ.get('PORT'))
host = '0.0.0.0'
else:
port = 5000
host = '127.0.0.1'
app = Eve()
if __name__ == '__main__':
app.run(host=host, port=port)
settins.py Datei
import os
MONGO_HOST = os.environ.get('MONGO_HOST', 'localhost')
MONGO_PORT = os.environ.get('MONGO_PORT', 27017)
MONGO_USERNAME = os.environ.get('MONGO_USERNAME', 'user')
MONGO_PASSWORD = os.environ.get('MONGO_PASSWORD', 'user')
MONGO_DBNAME = os.environ.get('MONGO_DBNAME', 'evedemo')
RESOURCE_METHODS = ['GET', 'POST', 'DELETE']
ITEM_METHODS = ['GET', 'PATCH', 'DELETE']
CACHE_CONTROL = 'max-age=20'
CACHE_EXPIRES = 20
people = {
# 'title' tag used in item links.
'item_title': 'person',
'additional_lookup': {
'url': 'regex("[\w]+")',
'field': 'lastname'
},
'schema': {
'firstname': {
'type': 'string',
'minlength': 1,
'maxlength': 10,
},
'lastname': {
'type': 'string',
'minlength': 1,
'maxlength': 15,
'required': True,
},
'role': {
'type': 'list',
'allowed': ["author", "contributor", "copy"],
},
# An embedded 'strongly-typed' dictionary.
'location': {
'type': 'dict',
'schema': {
'address': {'type': 'string'},
'city': {'type': 'string'}
},
},
'born': {
'type': 'datetime',
},
}
}
works = {
'cache_control': 'max-age=10,must-revalidate',
'cache_expires': 10,
'schema': {
'title': {
'type': 'string',
'required': True,
},
'description': {
'type': 'string',
},
'owner': {
'type': 'objectid',
'required': True,
'data_relation': {
'resource': 'people',
'embeddable': True
},
},
}
}
DOMAIN = {
'people': people,
'works': works,
}
/var/www/FlaskApps/FlaskApps.wsgi
#! /usr/bin/python
import sys
import logging
logging.basicConfig(stream=sys.stderr)
sys.path.insert(0,"/var/www/FlaskApps/PlagiarismDefenderApp/")
# home points to the home.py file
from home import app as application
application.secret_key = "somesecretsessionkey"
Es sagt Ihnen, dass etwas mit Ihrem DOMAINS Wörterbuch nicht stimmt. Konsultieren Sie die Dokumente, um herauszufinden, was Eve erwartet. – snakecharmerb
Ihr DOMAIN-Dict ist OK, ich habe es in meiner Umgebung mit dem gevent WSGI-Server getestet. Ich habe dieses Problem einmal gesehen, ich werde versuchen, mich daran zu erinnern, was es war. – gcw