|
Installation
Installing dbsprockets and common problems
Featured InstallationWith Setuptoolseasy_install dbsprockets If you dont have setuptools, install from here. From the RepositoryDownloading from the trunk is not advisable and should never be done by anyone. Here is how to do it: svn checkout http://dbsprockets.googlecode.com/svn/trunk/ dbsprockets Then cd to the dbsprockets directory and: python setup.py install if you would like to modify the dbsprockets code for your purposes: python setup.py develop Note: You must have setuptools installed to use python setup.py, see above. Common ProblemsAll FrameworksNo local packages or download links found for RuleDispatch>=0.5a0.dev-r2306 error: Could not find suitable distribution for Requirement.parse('RuleDispatch>=0.5a0.dev-r2306') ~or~ DistributionNotFound: RuleDispatch>=0.5a0.dev-r2247 This is because RuleDispatch has not released a new version, despite having made patches necessary for toscawidgets to work. Try this: easy_install http://dbsprockets.googlecode.com/files/RuleDispatch-0.5a0.dev-r2306.tar.gz Usually this is followed by the PyProtocols error: No local packages or download links found for PyProtocols==1.0a0dev-r2302 error: Could not find suitable distribution for Requirement.parse('PyProtocols==1.0a0dev-r2302') ~or~ DistributionNotFound: PyProtocols>=1.0a0dev-r2302 Try this: easy_install http://dbsprockets.googlecode.com/files/PyProtocols-1.0a0dev-r2302.zip TG1.0 SpecificallyTypeError: No object (name: ToscaWidgets per-request storage) has been registered for this thread easy_install -U toscawidgets After, make sure ToscaWidgets is turned ON by adding / changing this line in the dev.cfg/prod.cfg or app.cfg: toscawidgets.on = True ValueError: need more than 2 values to unpack Try this: Just to make sure you have the latest version of Genshi, do this: easy_install -U genshi After, make sure Genshi is set as the default view by adding / changing this line in the dev.cfg/prod.cfg or app.cfg: tg.defaultview = 'genshi' Compatibility IssuesGrokIf you are going to use dbsprockets in a Grok application, you can as long as your Grok app is a WSGI app. Grok has a way of doing this here. Then, you need to modify your grok.ini to include the toscawidgets middleware: add: [filter:tosca] use=egg:toscawidgets#middleware default_view=genshi modify: [pipeline:main]
pipeline = egg:Paste#cgitb
egg:Paste#httpexceptions
suppressZopeErrorHandling
tosca
bbbElixirIf you want to use dbsprockets with the Elixir declarative layer in Turbogears 1 you have to set the session and metadata vars of the Elixir class on the model (or the beginning of the controller file). Assuming you created your Turbogears instance with Elixir set by default (-e flag on the quickstart) just make sure you add this to your "model.py" file: # there are the necessary imports for what we want from elixir import session as elixir_session, metadata as elixir_metadata from turbogears.database import session,metadata # the magic is here... elixir_session = session elixir_metadata = metadata |