When we first defined our current media structure for Review Board, there
wasn't a very solid recommendation, so we made our own. The recommendation
outlined there isn't too bad, but most apps that use Django are generally
single websites that have very specific needs for their media. In those
cases, having a static/ directory with css/, images/, and js/ directories is
probably fine.

In our case, we're a webapp that has slightly more complex needs. We need a
well-structured static media directory that can have new app media
directories plugged into it. With pluggable extensions coming down the road
for Review Board, it's very important that we don't mix and match
directories, but instead give each extension a top-level directory that can
be organized however the extension writer sees fit.

In a lot of ways, our model is closer to the standard Django way of handling
templates. One top-level directory, then subdirectories per-app, then
whatever internal structure may be needed, if any.

The directory layout highlighted on that page indicates that all images will
go in /static/images, all css in /static/css, and all JavaScript in
/static/js. This simply will not work for us, will cause clutter, make
installation messier, and make it really hard to upgrade and downgrade.

I assume your concern is from the standpoint of a Djblets user, rather than
Review Board. in your case, you can use either Aliases in your
Apache/lighttpd configuration or symlinks on the filesystem to achieve your
needs. For example, this sort of setup should work:

$SITE/static/js/djblets -> $DJBLETS/media/js/
$SITE/static/images/djblets -> $DJBLETS/media/images/
$SITE/static/css/djblets -> $DJBLETS/media/css/

There's a couple small templates that reference {{MEDIA_URL}}djblets/js/...
and so on, but you can always provide your own or simply inherit from those.

In the case of jQuery, simply use your main jQuery file you care about. The
Djblets-provided ones won't take up much space anyway, and you don't have to
reference them. You just need to inherit from a template and substitute your
own, or provide a new template from scratch, if you even use the features
that need those templates.

Christian

-- 
Christian Hammond - chip...@chipx86.com
Review Board - http://www.review-board.org
VMware, Inc. - http://www.vmware.com


On Sat, Mar 28, 2009 at 2:39 AM, Kless <jonas....@googlemail.com> wrote:

>
> I mean, that the general (and recommended) structure for projects
> Django is to put the static files in './static', and for js in './
> static/js'
>
> http://ericholscher.com/projects/django-conventions/project/
>
> So, if we use too the JQuery JS for our project, we have several files
> with the same script; one on './static/djblets/js/jquery-min*.js' and
> another one in './static/js/jquery-min*.js'.
>
>
> On 28 mar, 08:31, Christian Hammond <chip...@chipx86.com> wrote:
> > I'm not sure what you mean. Extensions won't bundle jQuery, they'll use
> > Djblets's version. Or are you talking about something else?
> >
> > Christian
> >
> > --
> > Christian Hammond - chip...@chipx86.com
> > Review Board -http://www.review-board.org
> > VMware, Inc. -http://www.vmware.com
> >
> > On Sat, Mar 28, 2009 at 1:24 AM, Kless <jonas....@googlemail.com> wrote:
> >
> > > not even for JS? Because many users use JQuery so that we'll the same
> > > JS scripts in './static/js/' and './static/djblets/js/'.
> >
> > > On 27 mar, 20:20, Christian Hammond <chip...@chipx86.com> wrote:
> > > > There are no plans to change this structure. We're keeping it as
> > > > appname/filetype. This will be important for extensions down the
> road,
> > > since
> > > > they'll be installing into and uninstalling from their own
> directories,
> > > and
> > > > we don't want them to be at all touching anything in Review Board,
> > > Djblets,
> > > > etc.-owned directories.
> >
> > > > Christian
> >
> > > > --
> > > > Christian Hammond - chip...@chipx86.com
> > > > Review Board -http://www.review-board.org
> > > > VMware, Inc. -http://www.vmware.com
> >
> > > > On Fri, Mar 27, 2009 at 6:52 AM, Kless <jonas....@googlemail.com>
> wrote:
> >
> > > > > Could be changed your structure of static files?
> >
> > > > >http://svn.navi.cx/misc/trunk/djblets/djblets/media/
> >
> > > > > If were as:
> >
> > > > > css/djblets/
> > > > > img/djblets/
> > > > > js/
> >
> > > > > would be more easy that were integrated in another projects.
> >
> > > > > In addition, if all apps. were to use a structure as /static/app/
> > > > > {css,js,img} would be a chaos.
> >
> > > > > It would be better if the apps. would create a structure as
> '/static/
> > > > > css/app/', '/static/img/app/', '/static/js/'. Just as it's used in
> > > > > 'templates'.
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"reviewboard" group.
To post to this group, send email to reviewboard@googlegroups.com
To unsubscribe from this group, send email to 
reviewboard+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/reviewboard?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to