Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd Alembic support from alchemy cookiecutter #3307
Conversation
This was referenced Jun 23, 2018
stevepiercy
requested a review
from
mmerickel
Jun 23, 2018
stevepiercy
assigned
stevepiercy and
mmerickel
Jun 23, 2018
stevepiercy
added
docs
do-not-merge
labels
Jun 23, 2018
stevepiercy
added some commits
Jun 23, 2018
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
stevepiercy
Jun 28, 2018
Member
@mmerickel I took a stab at merging the cookiecutter's default script with the tutorial's script from the models step. When I run it, I get an import error. See stack trace below.
I'm not sure whether the script is correct and I should wait until I fix the views in the next step to get it to run, or the script is wrong. Will pyramid.bootstrap only work when the app is in a runnable state?
$ env/bin/initialize_tutorial_db development.ini
Traceback (most recent call last):
File "env/bin/initialize_tutorial_db", line 11, in <module>
load_entry_point('tutorial', 'console_scripts', 'initialize_tutorial_db')()
File "/Users/stevepiercy/projects/hack-on-pyramid/tutorial/tutorial/scripts/initialize_db.py", line 40, in main
env = bootstrap(config_uri)
File "/Users/stevepiercy/projects/hack-on-pyramid/tutorial/env/lib/python3.5/site-packages/pyramid/paster.py", line 107, in bootstrap
app = get_app(config_uri, options=options)
File "/Users/stevepiercy/projects/hack-on-pyramid/tutorial/env/lib/python3.5/site-packages/pyramid/paster.py", line 28, in get_app
return loader.get_wsgi_app(name, options)
File "/Users/stevepiercy/projects/hack-on-pyramid/tutorial/env/lib/python3.5/site-packages/plaster_pastedeploy/__init__.py", line 131, in get_wsgi_app
global_conf=defaults)
File "/Users/stevepiercy/projects/hack-on-pyramid/tutorial/env/lib/python3.5/site-packages/paste/deploy/loadwsgi.py", line 247, in loadapp
return loadobj(APP, uri, name=name, **kw)
File "/Users/stevepiercy/projects/hack-on-pyramid/tutorial/env/lib/python3.5/site-packages/paste/deploy/loadwsgi.py", line 272, in loadobj
return context.create()
File "/Users/stevepiercy/projects/hack-on-pyramid/tutorial/env/lib/python3.5/site-packages/paste/deploy/loadwsgi.py", line 710, in create
return self.object_type.invoke(self)
File "/Users/stevepiercy/projects/hack-on-pyramid/tutorial/env/lib/python3.5/site-packages/paste/deploy/loadwsgi.py", line 146, in invoke
return fix_call(context.object, context.global_conf, **context.local_conf)
File "/Users/stevepiercy/projects/hack-on-pyramid/tutorial/env/lib/python3.5/site-packages/paste/deploy/util.py", line 55, in fix_call
val = callable(*args, **kw)
File "/Users/stevepiercy/projects/hack-on-pyramid/tutorial/tutorial/__init__.py", line 11, in main
config.scan()
File "/Users/stevepiercy/projects/hack-on-pyramid/tutorial/env/lib/python3.5/site-packages/pyramid/config/__init__.py", line 1043, in scan
ignore=ignore)
File "/Users/stevepiercy/projects/hack-on-pyramid/tutorial/env/lib/python3.5/site-packages/venusian/__init__.py", line 230, in scan
__import__(modname)
File "/Users/stevepiercy/projects/hack-on-pyramid/tutorial/tutorial/views/default.py", line 6, in <module>
from ..models import MyModel
ImportError: cannot import name 'MyModel'|
@mmerickel I took a stab at merging the cookiecutter's default script with the tutorial's script from the I'm not sure whether the script is correct and I should wait until I fix the views in the next step to get it to run, or the script is wrong. Will $ env/bin/initialize_tutorial_db development.ini
Traceback (most recent call last):
File "env/bin/initialize_tutorial_db", line 11, in <module>
load_entry_point('tutorial', 'console_scripts', 'initialize_tutorial_db')()
File "/Users/stevepiercy/projects/hack-on-pyramid/tutorial/tutorial/scripts/initialize_db.py", line 40, in main
env = bootstrap(config_uri)
File "/Users/stevepiercy/projects/hack-on-pyramid/tutorial/env/lib/python3.5/site-packages/pyramid/paster.py", line 107, in bootstrap
app = get_app(config_uri, options=options)
File "/Users/stevepiercy/projects/hack-on-pyramid/tutorial/env/lib/python3.5/site-packages/pyramid/paster.py", line 28, in get_app
return loader.get_wsgi_app(name, options)
File "/Users/stevepiercy/projects/hack-on-pyramid/tutorial/env/lib/python3.5/site-packages/plaster_pastedeploy/__init__.py", line 131, in get_wsgi_app
global_conf=defaults)
File "/Users/stevepiercy/projects/hack-on-pyramid/tutorial/env/lib/python3.5/site-packages/paste/deploy/loadwsgi.py", line 247, in loadapp
return loadobj(APP, uri, name=name, **kw)
File "/Users/stevepiercy/projects/hack-on-pyramid/tutorial/env/lib/python3.5/site-packages/paste/deploy/loadwsgi.py", line 272, in loadobj
return context.create()
File "/Users/stevepiercy/projects/hack-on-pyramid/tutorial/env/lib/python3.5/site-packages/paste/deploy/loadwsgi.py", line 710, in create
return self.object_type.invoke(self)
File "/Users/stevepiercy/projects/hack-on-pyramid/tutorial/env/lib/python3.5/site-packages/paste/deploy/loadwsgi.py", line 146, in invoke
return fix_call(context.object, context.global_conf, **context.local_conf)
File "/Users/stevepiercy/projects/hack-on-pyramid/tutorial/env/lib/python3.5/site-packages/paste/deploy/util.py", line 55, in fix_call
val = callable(*args, **kw)
File "/Users/stevepiercy/projects/hack-on-pyramid/tutorial/tutorial/__init__.py", line 11, in main
config.scan()
File "/Users/stevepiercy/projects/hack-on-pyramid/tutorial/env/lib/python3.5/site-packages/pyramid/config/__init__.py", line 1043, in scan
ignore=ignore)
File "/Users/stevepiercy/projects/hack-on-pyramid/tutorial/env/lib/python3.5/site-packages/venusian/__init__.py", line 230, in scan
__import__(modname)
File "/Users/stevepiercy/projects/hack-on-pyramid/tutorial/tutorial/views/default.py", line 6, in <module>
from ..models import MyModel
ImportError: cannot import name 'MyModel' |
stevepiercy
added some commits
Jun 28, 2018
stevepiercy
added some commits
Jun 30, 2018
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
@mmerickel ready for final review. |
stevepiercy commentedJun 23, 2018
•
edited
WIP. Should be backported to
1.9-branchonly upon completion.See #1597 and Pylons/pyramid-cookiecutter-alchemy#7