<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Folks,<div class=""><br class=""></div><div class="">I’m mostly done with a web server / web gallery application using Twisted Web.  </div><div class=""><br class=""></div><div class="">Now I’ve used a variety of different technologies, including:</div><div class=""><br class=""></div><div class=""><ul class="MailOutline"><li class="">pybonjour</li><li class="">scandir</li><li class="">Bootstrap</li><li class="">Jquery</li></ul><div class=""><br class=""></div></div><div class="">But I’m having a little bit of a problem cleaning this up for uploading to github.  </div><div class=""><br class=""></div><div class="">Can anyone give me some better suggestions for resources being shared between different web resource classes?</div><div class="">For example, I am using jinja2 and I have to make it a global to be available to all three web resources classes.</div><div class=""><br class=""></div><div class=""><ul class="MailOutline"><li class=""><li class="">    root.putChild("index", IndexPage(ctx))</li><li class="">    root.putChild("login", LoginPage(connection))</li><li class="">    root.putChild("logout", LogoutPage())</li><li class="">    root.putChild("javascript", static.File("javascript", "application/javascript”))</li></li></ul><br class=""></div><div class="">I haven’t been able to come up with a better solution?</div><div class=""><br class=""></div><div class="">A working code example is available from <a href="https://github.com/sheffler/login_logic_jinja2" class="">https://github.com/sheffler/login_logic_jinja2</a>.  It’s not my code, but the basic code layout is nigh identical.  I used it as a working model for the user authentication and built my gallery code as an additional child resource.</div><div class=""><br class=""></div><div class="">Worded another way, what’s the best practice for sharing data, code, and logic between children in a twisted web application, without making them global?</div><div class=""><br class=""></div><div class="">If global is the best answer, then I’ll continue with that.  But it just seems like there should be another way?</div><div class=""><br class=""></div><div class=""><span class="Apple-tab-span" style="white-space:pre">               </span>- Benjamin</div><div class=""><br class=""></div></body></html>