我试图在mod wsgi服务器上设置Pyramid启动器应用程序。我已经使用下面的代码了解了其他示例。但是我收到了错误:
LookupError: Entry point 'main' not found in egg 'Pyramid_starter'
关于我做错了什么建议?
我已经运行了以下设置,现在出现错误:
python setup.py develop
application.py(mod wsgi服务器的入口点)
import os
import sys
from pyramid.paster import get_app
from pyramid.paster import get_appsettings
here = os.path.dirname(os.path.abspath(__file__))
project_folder = os.path.basename(here).lower()
sys.path.insert(0, os.path.join(here, project_folder))
config = os.path.join(here, 'development.ini')
!!!这两行代码都会生成错误
application = get_app(config, 'main')
settings = get_appsettings(config, 'main')
我的development.ini文件:
###
# app configuration
# http://docs.pylonsproject.org/projects/pyramid/en/1.5-branch/narr/environment.html
###
[app:main]
pyramid.includes = pyramid_chameleon
use = egg:Pyramid_starter
pyramid.reload_templates = true
pyramid.debug_authorization = false
pyramid.debug_notfound = false
pyramid.debug_routematch = false
pyramid.default_locale_name = en
# By default, the toolbar only appears for clients from IP addresses
# '127.0.0.1' and '::1'.
# debugtoolbar.hosts = 127.0.0.1 ::1
###
# wsgi server configuration
###
[server:main]
use = egg:waitress#main
host = 0.0.0.0
port = 6543
###
# logging configuration
# http://docs.pylonsproject.org/projects/pyramid/en/1.5-branch/narr/logging.html
###
[loggers]
keys = root, pyramid_starter
[handlers]
keys = console
[formatters]
keys = generic
[logger_root]
level = INFO
handlers = console
[logger_pyramid_starter]
level = DEBUG
handlers =
qualname = pyramid_starter
[handler_console]
class = StreamHandler
args = (sys.stderr,)
level = NOTSET
formatter = generic
[formatter_generic]
format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s
答案 0 :(得分:1)
错误位于.ini文件中。更改以下
[app:main]
pyramid.includes = pyramid_chameleon
use = egg:Pyramid_starter
到
[app:main]
use = egg:Pyramid_starter
pyramid.includes = pyramid_chameleon
use = egg:Pyramid_starter首先出现