-
X
/home/ryan/Eating Django Crow -- Sep 11, 2008 10:00am
The time has finally come...actualy its time for two things. Time for me to add another entry to this rather inactive blog and time to eat crow. I might as well do both at once.
If you'll recall I've recently been tasked with figuring out Python/Django. My first experiences with it was't bad, but nothing I really thought that I needed to write home about. (Odd though since I did write about it). As a matter of fact, I got downright frustrated with it. I thought the learning curve was too steep, felt as if they'd left some things out, etc. Even though I backed the decision to start using Django, I admittedly began to regret it.
Now, having been using Django -- almost solely -- for the past few months, I can't imagine, (get ready for it), I can't imagine using any other framework to accomplish the goals of the projects that I get myself wrapped up into. There...I said it. (Hey, crow isn't so bad if its well done I guess).
There are many things that I like about Django and there are a few things that bother me, but the good far exceed the bad and I'll try my best to outline my favorite and least favorite features for you.
First off, what I like:
The code is clean! I mean SQUEAKY CLEAN!! It feels clean when you write it, and it looks clean when you read it. At first I thought I was going to hate the whole "whitespace counts" issue and the passing of "self" to methods on my models, and all those underscores but it turns out that only bothered me for a short time. Syntax is syntax and even my favorite editor "gedit" has ways of easing that transition with snippets and the like. You really get used to it, then you really like it.
When you read someones code, there is really no question in your mind what that code is intended to do, and its very readable. (Granted, as with all code, there are some complexities that I'm not even mentioning here, and they're only complex as far as being new keywords or functions whose purpose you just haven't learned yet, etc). I tell everyone, (and I'm going to pick on my second favorite framework "Grails" here), with Grails I feel like I'm writing less code, but I end up with so much more and with Django, I feel like I'm writing more code, but end up with so much less. In actuality, they're probably pretty close. I know the Grails folks are going to be saying to me, "You don't have any code when using scaffolding..." but everyone out there knows, unless you are writing the simplest of applications, you're not going to scaffold all of your code. I'm by no means dissing Grails here, I love Grails and if ever I'm brought on to do Java again, it damn well better be Grails. I'm simply stating that Django, while it may not have the "scaffold" idea, it certainly has that functionality, its just that you don't tell it to scaffold and the code is really there, you just didn't have to write it and really feels like you wind up with less code in the end. Which is kind of a segue into my next favorite thing about Django:
The Admin Utililty:
Django has something known as the Admin application. You simply add this to your list of installed "apps" and register your models with it and Django automatically builds you a simple to use, nicely styled -- take that Rails -- administration application for your objects. Its not something that can really be explained. It has to be shown to you. You sort of wind up having that same "AH-HA" moment that you get whens someone shows your Grails for the first time. Except the Admin utility is a step above that. Its not scaffolding, its code, but again code you didn't have to write. All I can say is find someone using it, and ask them to show you what I'm talking about. You'll thank them.
The Architecture:
This took me a while to get used to. Arhictecturally, its designed like your typical MVC application, but naturally, they just had to do it a bit different. Models are still models, but your Controller is basically called a "View" and the Views are now "Templates." (This makes sense since Django has its own templating language to deal with the end user interface and the Views are responsible for handing off the data to those templates.)
As a subset of the arhcitecture, the structure of the files themselves and where they are arranged on the filesystem more closely resemble a Rails application. You have a project that contains a number of mini apps. Each app has its own models and views and those models and views are all contained within one file each: models.py and views.py. Models are your everyday run of the mill class objects but they all inherit from Django's models which is what gives them their convention over configuration powers. Views aren't objects but individual methods being called by Django. Whereas in Grails you have a Controller class with functions inside it, here you just have the functions. You may ask, how does it know what url goes to what view then which is yet another segue:
Url Pattern Matching:
Django uses regular expressions to map url requests to the individual views you have defined. As expected, this can get _very_ involved and is very powerful. There are ways to do most anything you can think of. Its very flexible and I know I've yet to tap the power hidden in this functionality. (My regex was always kinda weak...but Django is helping).
The Template Language:
I have a love/hate relationship with the templating language. Its extendable and allows you to create your own template tags fairly easily. For me it has some wierdness that I"m not used to. For instance, I can't say "if somevalue == 'othervalue'", instead I have to say "ifequal somevalue othervalue" which is a bit offputting for me. I think it was an attempt to make the templating language less "programmer centric" so that you can really have a non-programmer writing templates, though its not something I've seen very often. In my world, the programmers write it all, soup to nuts.
Forms, Formsets, Validation...etc:
Django's forms just f*cking rocks! There's no two ways about it. There's nothing like it out there. Create a form object, perhaps what they call a "ModelForm". Tie that to your object and all the validation is built right in. Done, finished, over, Django Forms FTW! Who here likes writing validation? Its mundane, boring, reptitive, etc. And what about when you have multiple forms for the same object within one form. Formsets do the trick quite nicely. Django Forms is in reality my favorite feature of all frameworks anywhere period. Don't even think of trying to do a form "your way" in Django...bite the bullet early and learn Django forms first. I tried doing things my way first and found that had I just taken the leap of faith first, everything would have been so much simpler.
Now for the small nit-picky things that I didn't like.
Getting Help:
Django has great documentation and a ton of it...the good news is, its great documentation, the bad news is, there's a ton of it. When learning something brand new, you don't know what you don't know which makes sifting through tons of documentation when you're not even sure what you're looking for kind of tough. So upon not finding what you're looking for in the docs, you think you may head over to IRC (as suggested in the docs). If the answer to your question can be found in the docs, you will be slightly chastised for asking about it. Responses will normally be just a link -- (which is fine at least there's something to read, but sometimes newibies need examples) -- or will be either preceded or followed with the words "...as documented..." thereby making you feel like a complete idiot for even asking. Not everyone in the room acts that way, but the most knowledgable ones seem to be bothered by the fact that your asking something that can be found on page 42,003 in the third paragraph that talks about something you've never even heard of until now. I understand that they are trying to teach you to fish, but who the hell wants to fish anymore after being made to feel like a complete dumb-ass? They're not putting the best foot forward in my opinion when it comes to the IRC channel. One more for instance and I'll shut up:
A particular newbie was having a problem with and received this response: "blank and null are MODEL field options, so obviously they don't work on FORM fields" -- again, I'm nit-picking here but is the "obviously" _really_ necessary when you could have just said, "...those are MODEL fields and won't work on FORM fields"?? You still get your point across, the newbie feels like they have an answer and don't feel stupid because its apparently an "obvious" thing...(beginners don't always know the obvious, or else they wouldn't be asking the questions in the first place!)
For a newbie, going into a channel on IRC -- if they even know what that is -- to seek help is a daunting thing. For many, I think it feels like they've walked into the 7th circle of hell! For a few, I'm sure they're convinced that is the case after being virtually pistol-whipped by sarcasm and adjective that suggest their intelligence is sub-par.
I've had my share of *duh* moments in the channel but if you let that extraneous commentary run off your back, then you can get some good answers and feedback from the experts that reside in #django. I'm in there daily attempting to be a bit software when I help someone, and also attempting not to ask "dumb" questions myself. There have been numerous newbies that complain about the attitude they're given when finding answers and I fear that they're right and its not giving Django a good image in my mind.
No Ajax Helpers:
In grails I got used to being able to say "form:remote..." etc. There is no such thing in Django...you want to submit something via ajax, etc...its all up to you baby. If I wanted to write my own javascript, I would..but I don't...maybe someone will add it. I got told to add it myself and submit it, but again...if I wanted to write javascript, I would...see where I'm going with this?
Do It Their Way:
Really this last one isn't a big deal. It just seems that really, in the Python world there is only one way to do things. Thats great, but that can be a serious kink if your not used to thinking a certain way. (A colleague just mentioned to me today that I'm turning into one of those "Python" guys).
Django has a steeper learning curve, especially if you are used to doing things "your own way." Now I may be off my rocker a bit here, but I've found that thus far in Django/Python there are two ways to do things -- the right way, or the wrong way. Often times when just starting out, "your way" will wind up being the wrong way. Often times, doing it the wrong way and then taking that idea into the affore mentioned IRC channel will get you slightly chastised.
Closing Remarks
In the end, I've added Django as my primary web framework. PHP is still easier to find hosting than any other language I've worked with and naturally I'll be using that for quite some time to come. Grails will continue to be my framework of choice where Java is required or where I have to interact with it. Django however I think will become my swiss army knife, if not mainly for the forms portion, for the mere fact that you can tell it was written by perfectionists. Just when you think you've found the big gotcha with something they left out, it surprises you and you think..."Man, these guys thought of everything..."
With that said, my crow is getting cold...better get back to it!
~
:wq!
-
X
/home/iongion -- 2008-11-11 16:02:38
Tell em' :D !!!
In the dislike side:
suppose you have a base template that a child extends then several parrts of the layou bring certain javascripts/css files ... unless you choke them all in the base template there is no clean/easy way of adding them to the page output, overall, django is superb, what needs few lines of code it surely will have .. what will need more code lines, it most probably have many of them, but then again ... that template part ...
~
:wq!
-
X
/home/mark -- 2008-11-11 19:53:18
The Jython is making progress toward supporting Django, so you'll be able to host Django apps on any Java app server via Jython. Good times!
~
:wq!
-
X
/home/Ryan -- 2008-11-12 12:24:17
@mark -- I haven't messed wit Python on the JVM yet. I know I was impressed with JRuby when I saw that though. (Still not a Rails guy)...I think for me, if I need to use the JVM, I'm still all about Grails. Thats not to say I won't give Jython/Django a try someday. I think it just depends on if I have to interact with Java objects or not.
@iongion -- I haven't run into that issue yet. I try to keep javascript to a minimum at all costs....
~
:wq!
-
X
/home/signsmanor85 -- 2010-06-21 00:10:57
Fun forum
~
:wq!
-
X
/home/Ionincideda -- 2010-07-05 15:35:29
Hey Guys! Just wanted to say hello to the new community :). Thanks for letting me in! :D
~
:wq!
-
X
/home/balirark -- 2010-07-16 02:35:05
I apologise, but, in my opinion, you are mistaken. Write to me in PM, we will communicate.
jhgHj.
~
:wq!
-
X
/home/Ritotorgo -- 2010-07-17 10:33:22
Hello, I am new here.
I like www.sudovi.com because I learned a lot here. Now it's time for me to pay back.
The reason I post this guide on this of www.sudovi.com is to help people solve the same problem.
Please let me know if it is inapproprate here.
Here is the guide, wish it would help you.
Best Video Converter(, ): How to convert RM to MPEG
This article will teach you how to convert RM to MPEG with the best Video Converter(, ). Free download is available.
How to convert RM to MPEG? How to convert WMV to AVI? How to convert WMV to MPEG? And where to find a best Video Converter(, )? With the best Video Converter(, ), you will no long be confused by these questions. This article will teach you how to convert RM to MPEG with the best Video Converter(, ). The best Video Converter(, ) supports large number of video files including AVI MPEG DVD VCD SVCD WMV ASF MP4 SWF MP3 WAV 3GP ,mp4a VOB H263 H264 OGG MP2 MP4V AAC MOV raw YUV RM etc.
I hope the article will be helpful for you.
The Best Video Converter(, ) Introduction
YASA best Video Converter(, ) is also a RM to MPEG converter to convert RM to MPEG supporting converting WMV to AVI and converting WMV to MPEG.
How to convert RM to MPEG? How to convert WMV to AVI? How to convert WMV to MPEG? And where to find a best Video Converter(, )? With the best Video Converter(, ), you will no long be confused by these questions.
YASA Video Converter(, ) is an expert and easy-to-used video and audio format converter. YASA Video Converter(, ) supports large number of video files including AVI MPEG DVD VCD SVCD WMV ASF MP4 SWF MP3 WAV 3GP ,mp4a VOB H263 H264 OGG MP2 MP4V AAC MOV raw YUV RM etc. And it has the ability to convert video files to DVD VOB AVI DivX MP4 WMV ASF 3GP H263 MOV VCD MP3 WAV; Can extract audio from video files, Can also remove audio from the video files. All codec are built-in.
YASA Video Converter(, ) is very easy to use. If you are a newbie, you only do choose the video files;choose output profile that you want to convert to; and click "converting" button. If you are an expert on video, YASA Video Converter(, ) also provides variable options to control the specification and quality of output video files. The variable options including video codec, audio codec, video size, bitrate, Audio Samples, NTSC/PAL, frame rate etc.
YASA Video Converter(, ) has been improved the conerting speed, the video file is converted within a short time. so you don't have to wait so long. If you have a lot of video to convert, YASA Video Converter(, ) also supports unattended batch convertsion even if the files in the list use various settings or have different target formats.
Best Video Converter(, ): How to convert RM to MPEG
Step 1: Free Download the best Video Converter(, ) and then run it.
Step 2: Launch the best Video Converter(, ) and the interface is as follows:
Step 3: Click "Add Video Files" button to load RM video file:
Step 4: Highlight the file to be converted to MPEG, and the file information will be displayed in the right area, and the status of many output options will be activated:
Step 5: Click "Output Profiles" combo-box to choose MPEG as the output file:
Step 6: Output path
Choose an output path or rename the output file name, or use the defaulf path and file name:
Step 7: Set output format:
Step 8: Click "Convert" button to start to convert RM to MPEG:
OK. You will complete to convert RM to MPEG with the Best Video Converter(, ).
Just free download the Best Video Converter(, ) to convert between almost all popular video formats.
~
:wq!
-
X
/home/SBIGGY -- 2010-07-23 21:28:43
Hey guys,
~
:wq!
-
X
/home/howtomeetagirluw -- 2010-07-24 04:13:13
Hey guys I'm not quite for certain if this is the sound category to mail this, but I am having some legitimate difficulty learning things to ask a girl when you first meet I read things to ask a girl when you first meet that website, but it actually didn't appear to make alot of sentiment to me. Can someone please improve me? It's so impregnable to foregather the girls of my dreams.
This magazine article wasn't coherant to read
Tips on How to satisfy Ladies at the Mall
If that you are a single guy and aren't the best at getting a lot of less meeting girls and are wondering exactly where you would possibly visit come across and deal with a young girl, then these ten acceptable hints on how to satisfy a gal along at the mall, should come in mighty handy.
1 - Go for the foodstuff court. Think it or not, the foodstuff court will be the absolute most helpful area within the shopping mall to satisfy a female. Here's what you do. Choose a foods position and get in line for the meal. Though you are in line, start looking close to the region where anybody is sitting and eating. Look for any gal seated alone, and even two girls sitting together. When you may have your meal in hand, walk more than to where by she or they're sitting and inquire if it is possible to join them. If you are sincere and straightforward with them, your probabilities are quite high-quality.
2- Do some thinking. Earlier than you even consider planning on the shopping mall to satisfy a woman, sit on your own down and do some considerable thinking. Give consideration to how you could possibly run into a girlfriend and what you could possibly say to her if you might be successful. Think of which parts of your local mall you'd visit. Also, you are going to really need to acquire some thing even while there, what do you'll need? Finally, want to consider what meeting a toddler in a public destination entails. Certainly you are going to have a need to take a look for the wedding ring previous to speaking into a girl, and you're likely to need to take into consideration if it's wiser to speak with a girl alone or 1 who's with others. At last, you might have for being reasonable about your personal age and also the ages belonging to the young lady you want to fulfill. As in, you can expect to really have to tell all by yourself to get realistic and don't attempt to fulfill women which have been a whole lot younger or older than you were, or that look out of one's league.
three - Ask for advice. As soon as you will be last but not least with the shopping mall, a person from the methods to satisfy women is by asking them for boost. Women realize that guys have no strategy what they can indeed be doing when they are shopping, so asking for boost will not appear such a ridiculous concept. Request aid in picking out a jacket for all by yourself one example is. Executing so let's the woman know that you just are single. If she agrees to aid you, talk to her other queries as you grab various jackets to look at on.
Hey guys I'm not quite for certain if this is the greatestl category to send this, but I am having some corporeal strife learning things to ask a girl when you first meet I infer from things to ask a girl when you first meet that site, but it in actuality didn't look as if to make alot of substance to me. Can someone hold it in their heart to assist me? It's so intricate to convene the girls of my dreams.
~
:wq!
-
X
/home/businesscardonlinelg -- 2010-07-30 07:16:41
Your business card online is an extension of the supplier and it is vital for product or service branding. It reflects your firm profile, your products and services and is also appropriate for advertising likewise as networking. A effectively planned business card online makes a lasting first impression, which is vital if you happen to will not want your business card thrown away. At Pixellogo, we make available online ingenious design solutions that are significant though branding your business image. Browse via our stationery catalogue and select customizable theme templates or use our develop products to exclusively produce your very own business card. Whether that you're a smaller start-up manufacturer or an currently established business, you may find out your wonderful business card structure on this web page.
Pioneering layouts for the business card online! Make the ideal use of our business card online solutions
We make business card online styles to suit your company?s needs, but which convey your reputable company profile in an attention-grabbing way. You will find patterns suiting just about every business have to have ranging through the food community for the sports industry the following! We offer you ready-to-use business card online templates which you can download and modify as per your needs. We also give you exclusive types which will reflect your network persona inside most specialist way. You can still design a business card online by collaborating with our business card maker, who will endow you using a assortment of styles you will be able to opt for from. Once you approve of any theme but would like it to be modified, our business card online maker will alter it for 100 % free! We even add creation fx to your cards to create them far more catchy. So what are you waiting for!? Generate your eye-catching business cards online, best below on our homepage.
premium business cards
business card photographer
business card designer
photo business card
elegant business cards
business card printer
business cards design online
business card designs online
professional business card
business card designs
business card online template
online business card maker
make your own business card online
creative business card
business cards online
digital business cards
cool business card design
mini business cards
free business card
professional business cards
~
:wq!
-
X
Add Comments