How to use dojo toolkit in django?

203 views
Skip to first unread message

Duke

unread,
Apr 14, 2008, 3:13:35 AM4/14/08
to Django users
How to use dojo toolkit in django project?
Where to store the dojo toolkit in the project and how to use them in
the html page?

Kenneth Gonsalves

unread,
Apr 14, 2008, 4:32:37 AM4/14/08
to django...@googlegroups.com

James Bennett

unread,
Apr 14, 2008, 4:42:04 AM4/14/08
to django...@googlegroups.com
On Mon, Apr 14, 2008 at 2:13 AM, Duke <p.sath...@gmail.com> wrote:
> Where to store the dojo toolkit in the project

The same place you put all other CSS stylesheets, JavaScript, images
and other static files. Similarly, they will be served the same way.
There is specific documentation on how to handle the serving of static
files, and you probably want to start by reading that.

> and how to use them in
> the html page?

The same way you use any other JavaScript in any other web page you
have ever built.

--
"Bureaucrat Conrad, you are technically correct -- the best kind of correct."

Kenneth Gonsalves

unread,
Apr 14, 2008, 4:46:12 AM4/14/08
to django...@googlegroups.com

On 14-Apr-08, at 2:02 PM, Kenneth Gonsalves wrote:

>> How to use dojo toolkit in django project?
>> Where to store the dojo toolkit in the project and how to use them in
>> the html page?
>
> http://www.djangoproject.com/documentation/serialization/

sorry - that is for ajax. Use dojo in django precisely as you use
javascript in a normal html page. Put a block in the head section of
your base.html where you can load the dojo libraries - either in
base.html itself or in the required page.

in base.html:

{% block javascripthere %}
{% endblock %}
</head>

and in the template:
{% block javascripthere %}

load dojo libraries here
{% endblock %}

Etienne Robillard

unread,
Apr 14, 2008, 7:29:24 AM4/14/08
to django...@googlegroups.com

http://code.djangoproject.com/wiki/AJAX/Dojo/RefactoredFormSubmit

Feel free to review/extend this example too, as it's for me a good
reference for building UIs specifically with Dojo, Ajax and Django.

Regards,

Etienne

bobhaugen

unread,
Apr 14, 2008, 8:24:18 AM4/14/08
to Django users
On Mon, 14 Apr 2008 00:13:35 -0700 (PDT)
Duke <p.sathish...@gmail.com> wrote:
> Where to store the dojo toolkit in the project

You can avoid all of the static files issues with dojo by serving it
from AOL, like so:
<script type="text/javascript" src="http://o.aolcdn.com/dojo/1.1.0/
dojo/dojo.xd.js"></script>

I'm doing it that way, both in development and production. So far, no
hiccups, it's faster than having Django serve it, and does not burden
my host.

john.g...@gmail.com

unread,
Apr 29, 2008, 4:40:18 PM4/29/08
to Django users
I've also been looking at Dojo lately. Of the javascript frameworks
I've looked over, it appears to have the best combination of
abstraction and features (feel free to offer alternatives). I've tried
to get the dojox.Grid thing working but have so far failed to do so.
Serializing a queryset into JSON doesn't appear to yield a data model
structure that works with the Dojo data stores. So either I'm missing
something or I'm not describing the structure correctly when I set up
the system in javascript.

Has anyone gotten the grid working? If so, would you mind sharing an
example of the javascript model structure and/or the view that
serializes JSON? I'd like to get this thing moving if possible, as its
lazy scrolling seems like it would beat the pants off old-fashioned
pagination.

Thanks,
John

On Apr 14, 5:24 am, bobhaugen <bob.hau...@gmail.com> wrote:
> On Mon, 14 Apr 2008 00:13:35 -0700 (PDT)
>
> Duke <p.sathish...@gmail.com> wrote:
> > Where to store thedojotoolkit in the project
>
> You can avoid all of the static files issues withdojoby serving it
> from AOL, like so:
> <script type="text/javascript" src="http://o.aolcdn.com/dojo/1.1.0/dojo/dojo.xd.js"></script>
>
> I'm doing it that way, both in development and production. So far, no
> hiccups, it's faster than havingDjangoserve it, and does not burden
> my host.

Wolfram Kriesing

unread,
Jul 25, 2008, 5:50:40 AM7/25/08
to django...@googlegroups.com
Hi,

I remembered seeing this topic mentioned here,
and now there is a solution to it. http://code.google.com/p/dojango/

A quick summary of the main features of dojango:

* a reusable django app that provides dojo
* easy dojo setup inside django
* build an optimized dojo
* some helper functions, i.e. JSON conversion
* switch easily between different dojo versions.

cu

Wolfram

Reply all
Reply to author
Forward
0 new messages