Working with django

39 views
Skip to first unread message

Shailesh Ahuja

unread,
May 3, 2016, 3:37:35 AM5/3/16
to airbnb_caravel
Hi,
May I know if there's a way to get individual views for django? Is the code written in such a way that I can easily translate it to work for django?

Shailesh

Maxime Beauchemin

unread,
May 3, 2016, 11:16:21 AM5/3/16
to airbnb_caravel
I don't think so. What are you trying to accomplish? Ae you just trying to embed charts in your Django application?

Max

Shailesh Ahuja

unread,
May 3, 2016, 10:56:39 PM5/3/16
to airbnb_caravel
I guess if I have to embed charts, it's better to work directly with D3.js.

It would be great though if we could use this as a django plugin and map certain pages directly to django URLs.

I am afraid if I change too much of the source code to make it work then any future updates will be very difficult to integrate.

I have a django app that is used to maintain and update the database. I want to visualize the data using caravel, but I feel using an iframe is a hacky way to get things done. I would ideally want to run everything in one container.

I am just exploring at the moment though, so your feedback will be very helpful.

Maxime Beauchemin

unread,
May 4, 2016, 12:17:12 PM5/4/16
to airbnb_caravel
There may be a way to package Caravel as a "blueprint" (Flask's equivalent to Django's reusable app), and for other Flask apps to integrate Caravel components (template tags, ...), but there's little hope for a "non hacky" integration outside of Flask. I'm all hears if people have ideas specific to Flask>Django integration.

<iframe> is probably your best bet. We could support a better "iframable" mode where there would be no navbar and links would open in new windows.

There's also been talks internally of bringing more logic into the frontend, and breaking down the building blocks to expose an "Analytical Application Development Toolkit" that Caravel would be build on, and that other products could integrate, but that would be on the longer term vision (not this quarter for sure)

Shailesh Ahuja

unread,
May 4, 2016, 11:16:49 PM5/4/16
to Maxime Beauchemin, airbnb_caravel

I don't have experience with flask, but the code looks really similar in architecture to a django app. Someone who has knowledge in both wouldn't have any problem to convert it. I am not sure what level of abstraction is needed to maintain the same core logic for both.

For now, I will work with iframe :) Thanks for the feedback.


--
You received this message because you are subscribed to a topic in the Google Groups "airbnb_caravel" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/airbnb_caravel/FBSe0Hp6Fms/unsubscribe.
To unsubscribe from this group and all its topics, send an email to airbnb_carave...@googlegroups.com.
To post to this group, send email to airbnb_...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/airbnb_caravel/432fc4db-fd78-4b1a-bc2b-b7300837f462%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Karma Kolabor

unread,
May 12, 2016, 1:51:19 PM5/12/16
to airbnb_caravel
Hi, my experince with these things is not guru-like, however I have seen enough to tell you, that you hit one of the main pain points of django with your question - django is an island in the python world, they have their own orm and they have their own concept of extending code ("django apps") - and this generates a wall around you and your project and right know you are hitting that wall painfully.

I am afraid to tell you that there is no easy way of integrating a flask app into django. As the base for the flask app builder is sqlalchemy, you could start transitioning your django app to sqlalchemy - what is possible, but then you will loose a lot of django functionality. Again here you feel the pain of the django walls you have put yourself into - you can not easily use the best ORM in the python world, like everybody else does.

You might feel the temptation to build a flask-django-frankenstein now, but you should not go that way, it will eat you.

The better way for everybody would be to make caravel a web service thing that spits out nice graphics - this would be much easier to integrate into anything else, not just django. That would be the best way to go - caravel code is half way there, from what I understand it will not be too much of a hassle to build an API with it, as there are flask puzzle pieces already waiting - also the gui is already based on React, so it is kind of a natural progression to add an api layer to caravel.


Maxime Beauchemin

unread,
May 13, 2016, 11:42:46 AM5/13/16
to airbnb_caravel
Well explained Karma. 

We're considering moving more logic to the Javascript layer and eventually sharing visualizations and controls as React components with a nice, composable API. An "analytical application development toolkit" if you will, allowing people to build interactive data visualization components in their applications.

Note that our main goal is to make the Caravel product great, so refactoring the guts isn't the top priority at the moment. We may get there shortly though.

Max
Reply all
Reply to author
Forward
0 new messages