The comment you are replying to does not exist.

Using Django's Databrowse With Inspectdb

The Django databrowse application is an interesting piece of software that I've wanted to try out ever since its creator, Adrian Holovaty, demoed it in Vancouver last year. Its purpose is to allow you to navigate data, using a web interface, looking for trends and other interesting aspects.

In conjunction with Django's inspectdb command, which creates Django model definitions by inspecting the schema of an existing database, you can potentially use databrowse on data from any application.

One annoyance with databrowse is having to register each model with it. I created a shell concoction to generate register statements for each model created by inspectdb and append them to urls.py:

python manage.py inspectdb\
  | grep "^class"\
  | sed "s/^class //g"\
  | cut -d"(" -f1\
  | xargs -I {} echo 'databrowse.site.register({})'\
  >> urls.py

I attempted to use databrowse on a database full of Drupal data, however, and ran into a current limitation of Django. Django models can't employ primary keys composed of multiple columns. Drupal's database schema uses this kind of primary key repeatedly.

23 comments on Using Django's Databrowse With Inspectdb

  1. cheilitis cure (not verified)
    Fri, 2010-07-30 07:04

    I havent tried that particuar piece of software yet, though I know many have, sounds interesting

  2. internal criticism (not verified)
    Mon, 2010-07-26 02:44

    i hope django can employ primary keys with multiple columns..
    adult add treatment

  3. internal criticism (not verified)
    Mon, 2010-07-26 02:40

    i hope django update can employ primary keys with multiple columns.
    adult add treatment

  4. Paloza (not verified)
    Wed, 2010-07-07 14:09

    This is a real beauty of his own art world. wedding bands | crystal beads

  5. cheilitis cure (not verified)
    Fri, 2010-07-30 07:01

    art can be very nice depending on the artist and whats been created,

  • best scar removal cream (not verified)
    Sat, 2010-06-19 17:49

    I found this a bit too late. I really needed it few days ago. But now it will be in my list.

  • シティカード (not verified)
    Thu, 2010-07-01 05:43

    北京桔色成人用品性健康用品商城、商品均来自正规渠道。
    最新化妆品的基本介绍以及颇受使用者们好评的彩妆DHC官方网站

  • jessie (not verified)
    Mon, 2010-06-14 10:33

    Well, thank you for your hard work!! I appreciate it very much!!
    free ads |part time jobs|soaking tubs

  • james caine (not verified)
    Mon, 2010-05-17 01:31

    Django application to so good to use. I think they made a great product with this.

    wedding favors

  • Allen (not verified)
    Tue, 2010-05-04 07:41

    I have working in search marketing group. I have never seen this type of database before it. Thanks for this useful article.

  • Anonymous (not verified)
    Wed, 2010-04-14 06:16

    Very informative and trustworthy blog. Please keep updating with great posts like this one. Technology Information | IT management Very Useful software that one. Thanks for sharing.

  • 出会い (not verified)
    Tue, 2010-03-30 10:49

    セレブな熟女や不倫したい人妻のような大人の割り切り関係より萌え系のの妹とイチャイチャしたい、処女を捨てたいと思ってる女の子、援助交際サポしてほしい10代の子と出会いたいのであれば、
    近頃ニュースで話題になっている家出 掲示板が意外と出会いのスポットです。
    家出したい人使う掲示板なのに、なぜ出会えるかというと、家出サイトを利用して、泊めてもらう代わりにセックスしてもと、エッチ覚悟、あるいはむしろエッチを楽しみたい家出少女がかなり増えてきているのです。

    セフレを作りたいと思うなら、ご近所の出会い掲示板がおすすめだ。メル友の募集は当然できるし、セフレを作ることも逆援助交際相手募集もできる、さらにほかでは中々見つけにくい人妻出会いだって簡単に見つかります!

    とくにこだわりはないけど、近くで会えたらなぁ~なんて思う人にオススメしたいのが、メル友募集掲示板 地域別と全国各地で近くにいる人を探せる出会い系サイトです。

    よき出会いを☆

  • James Keller (not verified)
    Tue, 2010-03-30 06:39

    Thank you for providing us the information about using Django with inspectdb. I hope they could upgrade the software to access a full database of Drupal.

    Research Papers

  • pyjamas (not verified)
    Wed, 2010-02-17 21:58

    I have been using Django for a while now and it is a very useful piece of software indeed. white pyjamas

  • realexams.com (not verified)
    Sat, 2009-11-28 08:11

    Its a very useful and interesting stuff. Keep sharing.

  • Anonymous (not verified)
    Sat, 2009-11-14 05:03

    If your collation is not set to this in MySql?, it will report the wrong size. In my case, my table is configured to be 'latin1'. Changing the charset to 'latin1' in base.py caused inspectdb to report the correct length. However, that's obviously not a general solution. It would be best to make this caller-configurable (or better yet detected and altered when pulling the description off of the cursor object).

    life experience degree | Online Associate nursing degrees | life experience bachelor degree

  • echealth (not verified)
    Sun, 2010-07-18 20:43

    great post!

  • Anonymous (not verified)
    Tue, 2010-05-18 19:33

    yes right you are!

    -------------------
    Andy trades
    custom logo design

  • Johnny (not verified)
    Sat, 2010-05-08 02:41

    I have used this type of database in some of my projects (otimização de sites, desentupidora, cabos eletricos clinica estetica, acompanhantes sao paulo, relogio de ponto) and have had mixed results and a better organization. I highly recommend that this database is extremely reliable. Thank you.

  • mike99 (not verified)
    Wed, 2009-10-28 12:28

    By contrast, Django has you define a model class — a subclass of django.db.models.Model — which explicitly declares all of its relevant fields via specialized subclasses of Field, including relational information. Coupled with any custom methods you want to define, and optional metadata inside an inner Meta class, this means that all the information about your model is encapsulated explicitly in the model class. Generally, Python has a preference for being explicit in this fashion, so it’s a good thing, but sometimes it’s nice to have the flexibility of a model that’s mostly 646-223 “auto-generated” from your database. which generates output you can save to a file and then edit and — once you’re happy with it — use as your live models. If you’ve got access to add new tables to the database, you can also add some of Django’s bundled applications (like the authentication and admin apps) to your INSTALLED_APPS, and hit the ground running. 1z0-051 This means that it’s fairly easy to take a database from an existing a et me start by talking about the language Django is written in. Django is a Python Framework, not a content management system, so you will be using Python to build Django web sites. That's a good thing, and these are some of the reasons why.
    Python is a dynamic language that is easy to read and work with. Including when you're working with other people's code. HP0-J25 Python is written in a procedural style, and has classes and objects when you need them, so it will be familiar to C++ and Java programmers. owever, it has dynamic types means you write less code and it's much faster to develop in than C++, Java. Also, It's a scripting language so there's no compiler to wait for.

    People run it everywhere from embedded systems to huge server clusters.

  • Anonymous (not verified)
    Sat, 2008-10-04 16:08

    It's a bit OT but you can write that shell script a bit better:

    python manage.py inspectdb |
    grep "^class" |
    sed "s/^class //g" |
    cut -d"(" -f1 |
    xargs -I {} echo 'databrowse.site.register({})'\
    >> urls.py

    E.g., why use both a \ and a | when the | alone suffices?
    And of course you can go better: the following will
    combine the sed and grep steps:

    sed -n "/^class /s///gp" |

    With more work you could combine the grep, sed and cut with a single sed or (preferably) awk.

  • Criar site (not verified)
    Mon, 2010-06-07 16:53

    Great tip, thank

  • jack white (not verified)
    Thu, 2010-07-29 06:41

    100% agree with you my friend!great tips!thx a lot!
    essay topics