Port Django to Javascript

144 views
Skip to first unread message

DvD

unread,
Apr 5, 2012, 2:22:13 AM4/5/12
to django...@googlegroups.com
Hi folks,
I created a project not long ago and I'm currently maintaining it called Broke which wants to be a porting to Javascript of Django https://github.com/brokenseal/broke-client
You can find it featured inside the todomvc project from addy osmani https://github.com/addyosmani/todomvc ( https://github.com/brokenseal/todomvc for the latest updates from broke )

I think the project itself has a lot of potential but lacks two very important things: a real documentation and a community.
I'm writing to you all to see if anyone could be interested in taking part to this project.
Broke currently features a lot of cool stuff such as:
 - pythonic classes and models: write stuff like
models.Model.create({
        __name__: "todo.models.Task"
        ,title: models.CharField({ max_length: 200 })
        ,is_complete: models.BooleanField({ 'default': false })
        ,update: function(kwargs){
            if('is_complete' in kwargs && kwargs['is_complete']) {
                this.elements().addClass('done');
            } else if('is_complete' in kwargs && !kwargs['is_complete']) {
                this.elements().removeClass('done');
            }

            return this._super(kwargs);
        }
    });
 - django templating: you can basically reuse the same templates you are currently using server side, with some limitations ( the only supported tags are if-else, for cycles, ifequal, comment )
 - database routing: you can choose to save your object on any data source you want ( local storage, remote server, a local json object )

Have a look at the code base and let me know what you think.
Anyone? :)

Cheers,
Davide

Marcin Tustin

unread,
Apr 5, 2012, 2:36:03 AM4/5/12
to django...@googlegroups.com
What's the motivation for this project? Who (especially already being familiar with python and django) would want to use this, and for what?

--
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/-/nXspKySFAhQJ.
To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.



--
Marcin Tustin
Tel: 07773 787 105

kenneth gonsalves

unread,
Apr 5, 2012, 2:48:09 AM4/5/12
to django...@googlegroups.com
On Thu, 2012-04-05 at 07:36 +0100, Marcin Tustin wrote:
> What's the motivation for this project? Who (especially already being
> familiar with python and django) would want to use this, and for
> what?

frankly these are not questions to be asked of an open source project.
--
regards
Kenneth Gonsalves

Lars Ruoff

unread,
Apr 5, 2012, 3:00:56 AM4/5/12
to Django users
On Apr 5, 8:48 am, kenneth gonsalves <law...@thenilgiris.com> wrote:
> frankly these are not questions to be asked of an open source project.

On the contrary, many more open source projects should ask themselves
that question!

I'm very much interested in the answer, since i really don't get it.
Why would you re-invent a server-side application framework on client-
side??

regards,
Lars

kenneth gonsalves

unread,
Apr 5, 2012, 3:08:33 AM4/5/12
to django...@googlegroups.com
On Thu, 2012-04-05 at 00:00 -0700, Lars Ruoff wrote:
> On Apr 5, 8:48 am, kenneth gonsalves <law...@thenilgiris.com> wrote:
> > frankly these are not questions to be asked of an open source
> project.
>
> On the contrary, many more open source projects should ask themselves
> that question!

I remember a guy, his name has slipped my mind, who released a kernel
and mentioning that it most probably would not be useful as better ones
were around, but he did so because he felt that someone, somewhere *may*
find it of interest.
--
regards
Kenneth Gonsalves

DvD

unread,
Apr 5, 2012, 3:46:20 AM4/5/12
to django...@googlegroups.com
Thanks for asking, Marcin.

This project started back in 2009 because at that time there was not even a single js mvc framework around that I liked ( at that time the only ones around were JavascriptMVC, Jamal and another one, can't remember the name ).
That's the main reason behind this project but there are plenty more than that.

What I essentially ported to js is the philosophy that we all love and care for, from Django and a feeling that this is missing on the js communities. It's like when Django started: why didn't they use Rails? Same reasons here.

Cheers!
Davide

To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

sebastien piquemal

unread,
Apr 5, 2012, 4:42:48 AM4/5/12
to django...@googlegroups.com
I guess the people that don't get the point have probably never made a heavy Javascript application ... Ever used Backbone.js ?

client-side - one page - websites are much nicer to use than any website with a page load after every click.

So I totally understand why you would do such a project, and I actually think it is a lovely idea !!! On the other hand, I've started to think lately that Django is not the best backend solution for building such applicatons.
So, @davide, how do you plan on making sure that any weird API can be plugged-in to the system ... will you separate nicely the model layer from the "backend" (web API, or dummy data store, or whatever) ???

Cheers anyway, and I'll follow the project !

Sébastien

Davide Callegari

unread,
Apr 5, 2012, 5:08:38 AM4/5/12
to django...@googlegroups.com
Hi Sébastien,
thanks to the database routing system and the possibility add any backend database (or data source, however you wanna call it) directly into broke, or your project.
You can think of it as a sort of plugin system that anyone can use.

For instance, if you are using django-piston or django-tastypie to create a nice public API, you can create a db backend to match your public api, however you wanna create it.
Using the models you can do stuff like:

MyModel.objects.filter({ id__gte: 10 }).using('nodejs-remote-backend').all()

and you get all the data you want from that db backend or you can use a db router to make sure all the requests for that model are redirected to that specific db backend.

Thanks for the support :)

Davide

DvD

unread,
May 2, 2012, 3:15:45 AM5/2/12
to django...@googlegroups.com
Hey,
is no one is really interested in helping in this project?

Gerald Klein

unread,
May 2, 2012, 4:51:12 AM5/2/12
to django...@googlegroups.com
Maybe I missed an earlier post but I am always looking for new projects please explain your requirements.

--jerry

On Wed, May 2, 2012 at 2:15 AM, DvD <birraf...@gmail.com> wrote:
Hey,
is no one is really interested in helping in this project?

--
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/-/kQ_GesNzV7wJ.

To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/django-users?hl=en.



--

Gerald Klein DBA

Cont...@geraldklein.com

www.geraldklein.com

j...@zognet.com

708-599-0352


Linux registered user #548580 



N.Aleksandrenko

unread,
May 2, 2012, 5:32:37 AM5/2/12
to django...@googlegroups.com
Why do you want to port django to javascript, there are great js libs
and frameworks. It will be better to make a js bundle for django
making in ajax ready.
Js Tools working out of the box. Such as:
+ ajax upload
+ ajax registration with error handeling
+ ajax pages
+ binding django and a js framework (as backbone)
+ bind django with ad ui library (as jquery ui)

and much more basic stuff

Building the apps with django is still not DRY. If you are a frontend
developer you can make a bundle to make django better and many people
may find it helpfull and use it.
If you decide to start such project ... call :) me i can i will help
with ideas and code.

yati sagade

unread,
May 2, 2012, 10:11:45 AM5/2/12
to django...@googlegroups.com
I am a Django user, but I don't see anything wrong in a JS framework inspired by Django. Afterall, only great things can inspire. But I fail to understand why JavaScript has to be only client side - It is a perfectly valid choice as a server side language for not all, but certainly some use cases. Besides, the server-side portion and the client-side portions can share code. I recently wrapped up a project that involved using Node.js in the backend, and man how I missed Django there. The current sane choice for a web framework on top of Node is Express.js (Node is itself very low level) - which is inspired by Sinatra, a web development framework(they call it a DSL) for Ruby. My point is when something inspired by a Ruby server-side framework can become the de-facto standard choice for the Node.js community, why not let them taste Django? I personally find the idea compelling, but *only* if the server-side capabilities of the language are respected. If we look solely at the client side, no-one would want to ditch jQuery/Prototype ;)

Now for the motivation, I would always love to hack together a quick app using the same language(and importantly, the same mindset) both on the server and client sides ;) And yes, with the WebWorkers API ported to work with Node.js (never tried) we are going to see some serious advancements.

I understand people's minds have been brutally injured by JavaScript in the past(I'm one of them), but then it *is* a capable language, and it doesn't harm if someone is willing enough to bring reusability and structure to apps written in it by means of a framework.

Cheers!
--
Yati Sagade

Twitter: @yati_itay

Organizing member of TEDx EasternMetropolitanBypass
http://www.ted.com/tedx/events/4933
https://www.facebook.com/pages/TEDx-EasternMetropolitanBypass/337763226244869


DvD

unread,
May 2, 2012, 12:15:02 PM5/2/12
to django...@googlegroups.com
Actually, I already put together some code that works on node.js inspired by Django, have a look https://github.com/brokenseal/broke
My original intention was to create a framework that would work seamlessly on the server and on the client side but it was just too much for me that I left that project aside to concentrate on the client side only with https://github.com/brokenseal/broke-client

I'm not asking help to start the project, I'm asking for help to make an already existing project a kick ass open source project with a community around it and I think that this is the right place since we all share Django love :)

>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>
>
>
>
> --
>
> Gerald Klein DBA
>
> Cont...@geraldklein.com
>
> www.geraldklein.com
>
> j...@zognet.com
>
> 708-599-0352
>
>
> Linux registered user #548580
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django...@googlegroups.com.
> To unsubscribe from this group, send email to

> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

yati sagade

unread,
May 2, 2012, 1:13:08 PM5/2/12
to django...@googlegroups.com
With ya. Let me get done with my exams, and hopefully I'll be able to contribute(and use, obviously) :) 
PS: Why the name Broke?? :O

To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/wuaJSGzRuaYJ.

To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Reply all
Reply to author
Forward
0 new messages