[Twisted-web] Bootstrapping for Nevow
Manuel Holtgrewe
purestorm at ggnore.net
Tue May 17 14:09:15 MDT 2005
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi
dialtone requested a more verbose example on IRC, so here it is.
My basic idea is that having a common application structure would
allow for reuseable components (I mean "embeddable applications")
like forums, weblogs, younameit.
When developing in such a "best practice" you would create self-
contained packages for each "logically seperated" part like such
applications as stated above. The applications would be reuseable,
then, and one could imagine that there could be a central repository
of such applications.
IMO there would also be a need for a central authentication and
permission handling package so a forum application can access the
same data as a CMS application. All this looks a bit like the concept
"Zope" and "Zope Products" have. I don't really like Zope because of
its ZODB integration into everything, the templating system etc. but
I think it is very successful because you have myriads of components
you can base your web sites on.
If there was a "common auth infrastructure" and a definition of how
components have to look for the outside and how you can embed them
into your code, I think Nevow would become much more effective to
work with since code becomes reuseable.
Maybe these are ideas are not new to the Nevow project and its
community and they had their reasons not to create such structures,
but I just wanted to raise the issue to see what happens ;)
Manuel
PS: Here is an example of the code layout:
# The project root contains the tac file to run the server and the "site
# specific" modules.
$PROJECT/
server.tac
[projectname]/
__init__.py
# This package contains files that are "glue" for the other
modules like
# the "main layout" template containing <html>...</html>.
site/
# This module defines rend.Page chidren like a RootPage etc.
__init__.py
# another module with site specific things
somemodule.py
html/
sometemplate.html
sometemplate.html
sql/ (if desired)
mysql.sql
othersql.sql
resources/
style1.css
style2.css
image1.png
image2.jpg
moo.js
# These are other self-contained, but site specific modules.
This could
# be a custom user management, a forum etc. with all the
necessary Python
# code, CSS, JS, images etc.
sitespecific1/
__init__.py
datahandler.py
something.py
html/
...
sql/
...
resources/
...
sitespecific2/
__init__.py
html/
...
sql/
...
resources/
...
# The "module repository" contains reuseable, "embeddable"
applications. These
# could be a user management system that brings login forms etc, a
forum etc.
$COMPONENTS
# The packages here have the same structure as the packages above
in the
# project's directory.
someforum/
__init__.py
data.py
usermanagement.py
forumposts.py
html/
...
resources/
...
weblog/
...
tictactoe/
...
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (Darwin)
iD8DBQFCik9s+Z0vV1m84RkRAr6wAJ4rMVR+Iatt8nW2KvR4l2r33wxiKACgj0FE
SBeY43mTR/IczdPX8IGktWY=
=h2UM
-----END PGP SIGNATURE-----
More information about the Twisted-web
mailing list