金字塔项目:“ValueError:变量赋值......”在尝试保存时

时间:2012-07-17 02:30:29

标签: python pyramid

尝试运行Pyramid项目时出现以下错误。据我所知,这是一夜之间出现的,我不知道如何开始调试:

C:\mas\mas>..\Scripts\pserve.exe serve development.ini --reload
Starting subprocess with file monitor
Traceback (most recent call last):
  File "C:\mas\Scripts\pserve-script.py", line 8, in <module>
    load_entry_point('pyramid==1.3.2', 'console_scripts', 'pserve')()
  File "C:\mas\lib\site-packages\pyramid-1.3.2-py2.7.egg\pyramid\scripts\pserve.
py", line 47, in main
    return command.run()
  File "C:\mas\lib\site-packages\pyramid-1.3.2-py2.7.egg\pyramid\scripts\pserve.
py", line 221, in run
    vars = self.parse_vars(restvars)
  File "C:\mas\lib\site-packages\pyramid-1.3.2-py2.7.egg\pyramid\scripts\pserve.
py", line 330, in parse_vars
    % arg)
ValueError: Variable assignment 'development.ini' invalid (no "=")

问题是什么,或者我应该如何确定它?对不起,我的问题很模糊,但如果我对我的要求有了更多了解,我可能会在Google上找到答案:)。

第328 - 330行:

        raise ValueError(
            'Variable assignment %r invalid (no "=")'
            % arg)

development.ini

[app:main]
use = egg:mas

pyramid.reload_templates = true
pyramid.debug_authorization = false
pyramid.debug_notfound = false
pyramid.debug_routematch = false
pyramid.default_locale_name = en
pyramid.includes = pyramid_debugtoolbar
    pyramid_tm
    pyramid_beaker

sqlalchemy.url = sqlite:///%(here)s/mas.db

# Cache settings
cache.regions = default_term, second, short_term, long_term
cache.type = memory
cache.second.expire = 1
cache.short_term.expire = 60
cache.default_term.expire = 300
cache.long_term.expire = 3600

# Beaker sessions
#session.type = file
#session.data_dir = %(here)s/data/sessions/data
#session.lock_dir = %(here)s/data/sessions/lock
session.type = memory
session.key = akhet_demo
session.secret = 0cb243f53ad865a0f70099c0414ffe9cfcfe03ac

[server:main]
use = egg:waitress#main
host = 0.0.0.0
port = 6543

# Begin logging configuration

[loggers]
keys = root, mas, sqlalchemy

[handlers]
keys = console

[formatters]
keys = generic

[logger_root]
level = INFO
handlers = console

[logger_mas]
level = DEBUG
handlers =
qualname = mas

[logger_sqlalchemy]
level = INFO
handlers =
qualname = sqlalchemy.engine
# "level = INFO" logs SQL queries.
# "level = DEBUG" logs SQL queries and results.
# "level = WARN" logs neither.  (Recommended for production systems.)

[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

# End logging configuration

2 个答案:

答案 0 :(得分:3)

Ich,我已经解决了,我在错误的地方寻找问题。问题是这个命令:

..\Scripts\pserve.exe serve development.ini --reload

应该是这个命令:

..\Scripts\pserve.exe development.ini --reload

我不知道我的批处理文件是如何或何时被更改的,但是如果某人有类似的问题,希望这会有所帮助。

答案 1 :(得分:2)

看来您的参数顺序是向后的 - 它应该是:

..\Scripts\pserve.exe development.ini --reload