I realise that this is an old topic, but I hope this is useful to other 
people looking to use RequireJS with Django.

You should take a look at django-require, which takes care of integrating 
the r.js optimizer with Django. I've just pushed up the 1.0.0 release.

https://github.com/etianen/django-require

It optimises your project using r.js in a post_process step. There's two 
built-in storage classes, and a mixin that can integrate with any other 
django storage backend (for example, S3BotoStorage from django-storages).

It also supports compiling standalone modules using almond.js.

It's a new package, so all feedback gratefully received!

On Tuesday, 28 February 2012 07:11:32 UTC, jpk wrote:
>
> Hi django-users,
>
> I'm working on a django project with a quickly growing javascript
> front-end using backbone.  The backbone application has grown to the
> point where it needs to be split into modules across multiple files.
> I'm looking into RequireJS to do that.
>
> I've done some research on how to best use require in django, but
> haven't found much.  My first stab at this is probably going to be
> more or less: Take the single javascript file I have now, break it
> into AMD modules in a sub-directory of the static directory the single
> file is in, set up require's minification stuff to put the minified
> javascript there in another sub-directory the same static directory,
> then set up templates to conditionally include the source/minified
> javascript for development/production.  Then I'll figure out some
> mechanism to run the minification stuff on the server during
> deployment.
>
> So, what I'm looking for is wisdom related to carrying out that
> process and maintaining it.  Has anyone set up require in a django
> project before, and have any tips to share?  I'd love to hear them!
>
> Thanks
> john
>
> --
> john p. kiffmeyer
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/YShx_WBt3sYJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to