Hey Martijn,<br><br>On Mon, Jan 18, 2010 at 4:21 PM, Martijn Faassen &lt;<a href="mailto:faassen@startifact.com">faassen@startifact.com</a>&gt; wrote:<br>&gt;&gt; [Django + Grok = Grongo]<br>&gt;<br>&gt; Alternatively just a buildout with a Django-Grok would be interesting to<br>

&gt; see - we could put it up in <a href="http://grok.zope.org/grokapps">grok.zope.org/grokapps</a> or something. We must<br>&gt; record this for anyone coming along in the future who wants to mess<br>&gt; around with this.<br>

<br>I&#39;d really like to get a working buildout for this.  It&#39;ll definitely make it easier for me to experiment further.  After trying out a few things, I think I just need to extend the buildout that grokproject generates, in three ways:<br>

<br>1) Add Django and megrok.traject dependencies<br><br>2) Generate an additional script, bin/djangoctl, which delegates to Django&#39;s django-admin.py<br>
<br>3) Add the line `os.environ[&#39;DJANGO_SETTINGS_MODULE&#39;] = ${something_from_buildout}` to bin/myproject-ctl, bin/paster, etc.  I think this is the most straightforward and correct place to put that line, if it&#39;s not too difficult to modify buildout&#39;s script templates.<br>

<br>Task #3 is the one I&#39;m least confident about.  I haven&#39;t found any
obvious way to do this.  I&#39;d be very grateful if somebody with more
buildout knowledge could point me in the right direction, or tell me
I&#39;m approaching this wrong and give me a different direction.  :)<br>
<br>With a buildout in hand I&#39;ll be better able to translate things into useful
documentation -- which I&#39;ll happily send along to be posted.  Then I&#39;ll also start playing around with paste.script templates for the various bits &amp; pieces (e.g. Django settings, models, admin, forms, traject views)<br>

<br>&gt; I am wondering how this deals with transactions. With zope.sqlalchemy we<br>&gt; integrate Zope&#39;s transaction machinery into SQLAlchemy. I would expect<br>&gt; something similar would need to happen here to ensure that data is<br>

&gt; properly committed.<br><br>Good question .. I have no idea.  I know Django has its own middleware-style transaction manager that&#39;s on by default when you&#39;re using Django&#39;s views system and HTTP layer[1].  Grongo would be going underneath that layer so I think things are different.  When I get a chance I&#39;ll try to take a look at Django&#39;s transaction-middleware and the zope.sqlalchemy code, it sounds like between the two of them it shouldn&#39;t be hard to get this working properly.<br>

<br>Cheers,<br>Ethan<br><br>P.S. I love the name Grongo.  Definitely a friendly dinosaur -- works with Grok to hunt down large mammals and forage berries from the tall trees? :)<br><br>[1] <a href="http://docs.djangoproject.com/en/dev/topics/db/transactions/">http://docs.djangoproject.com/en/dev/topics/db/transactions/</a><br>