Hacker News new | past | comments | ask | show | jobs | submit login
Why You Should Try Django (fiveandlime.com)
32 points by petercooper on Dec 20, 2008 | hide | past | favorite | 15 comments



I'm writing something in Django at the moment, and it's really nice. However this bullet from the presentation scares me slightly:

"No need to know any SQL".

This seems very wrong to me.

The Django data model is just a light abstraction over the fundamental model of tables and relationships. If you learned how to work with Django models then you would know the logical constructs of SQL, just not the syntax.

Django models are no easier or harder to think about than SQL (just there is less code to write and maintain because the boilerplate is done for you). It is not a quick fix for an inability to master the basics.


> It is not a quick fix for an inability to master the basics.

True. In general, there are few quick fixes that get you out of having to master the basics. If you don't know what you're doing, it'll probably rebound on you.

And it's not as if the ideas behind relational databases are hard, in any case.


i don't use jango, but is SQL really needed? does hn use sql?

personally, not having to deal with SQL is actually a plus


This high-level overviews aren't very helpful anymore. All web frameworks fit into this description, replace Django with your favorite X.

I wish someone had written a comprehensive comparison of Django and RoR. There were some attempts, but people involved inevitably happen to be much more familiar (and efficient) with one framework than the other. Therefore every comparison I've seen to date was heavily biased.


Well as someone w/ about equal experience in both (but not enough). I find rails URL mapping implementation overcomplicated compared to django's KISS "regular expression table" implementation.

I do like rails DB layer a lot better than django's although. You can do a bit more with it schema evolution/definition is a lot easier/cleaner.



Having tried _major_ python frameworks Django, TurboGears, and Pylons. I've always had an issue with the "magic" that powers them. Mind you, I do not want to appear trollish what so ever but I do prefer web.py amongst all of them.

I would personally sacrifice magic in favor of creating my own.


Where's the magic in Django?


The magic in Django is present in the Admin module or whatever term the Django community uses. I have to admit it's useful but it kinda bothers me in the sense that I do not any idea where the wiring begins and ends. Another thing that bothers me is that when you code in Django you code in whatever style the developers have envisioned it to be.

Whilst in web.py you pretty much code in Python which in my opinion is a lot easier to do. In addition to that web.py is pretty transparent providing me a sense of how _everything_ is working together.


Made me visit the django homepage, but seeing this code there made me depressed:

  class Person(models.Model):
      first_name = models.CharField(max_length=30)
      last_name = models.CharField(max_length=30)

Maybe I am just in a bad mood, but that doesn't look very elegant to me :-( Somehow I struggle with Rails, but I guess there would be no point for me to try Django instead.


I'd like to say that Django is actually the most promising Web framework that i know.

But in #10, i think that "Can deploy on _SOME_ shared hosting" would be more accurate (For example you can install it on Dreamhost shared hosting, but it's more of a hack). And installing MySQL-Python library can be a bit tricky if you are new to compiling your own stuff.


You shouldn't be compiling your own packages. Then you have to pay close attention to bug fixes, new versions, etc.

Instead, sudo apt-get install python-mysqldb

See: http://diveintomark.org/archives/2007/11/11/installing-mysql...

[edit: I know you are talking about shared hosting plans, which are a different beast, but the general rule that you shouldn't compile your own stuff is still valid.]


thanks for the advice


As a designer (primarily) with some basic PHP and Ruby on Rails knowledge, Django has been surprisingly easy for me to "figure out." The generic views are very useful and the only thing that seemed particularly foreign to me were the regular expression URLs, but there are plenty of references for figuring those out :)

Plus, Python syntax is so...pretty.


If you are writing python in vim then the following settings (in your .vimrc) might help you not hate the whitespace rules, plus having ctrl-space auto-complete is nice:

autocmd FileType python set omnifunc=pythoncomplete#Complete

inoremap <Nul> <C-x><C-o>

syntax on

set tabstop=4

set expandtab

set softtabstop=4

set shiftwidth=4

set autoindent

autocmd BufRead *.py set smartindent cinwords=if,elif,else,for,while,try,except,finally,def,class




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: