Hacker News new | past | comments | ask | show | jobs | submit login
Getting Started with Django (gettingstartedwithdjango.com)
383 points by gklein on Jan 22, 2013 | hide | past | web | favorite | 72 comments



While others are complaining about all the up front set up; this is actually something I like. Base tutorials always seem to be missing that 'something' that takes what you've learned and turns it into a real world application.

Even if its not step one, I would prefer more tutorials to have a full fledged 'Getting Set Up' section; even if it becomes arbitrary. It makes sure everyone can get on the same page no matter where they come from.


Exactly my thoughts. When I just started programming, there were so many tutorials I started on rails, django, and various other frameworks that I couldn't get to work the same way as in the tutorial. This was very important to me when I just started programming because if my results didn't match exactly that of the tutorials, I would not want to continue further since I am not sure if I am doing everything right.

One of the better tutorials I have found that takes extra care in making sure you are doing everything right, is the famous rails tutorial found here: http://ruby.railstutorial.org/ruby-on-rails-tutorial-book


I agree, and in this case it's setting up a very consistent environment that will be almost exactly the same as the one he's going to be using.

Additionally, these are the actual procedures you could use to set up a very real and serious tool. I'm loving this!


This is an excellent idea and the instructions almost worked as is even on an old windows vista machine (with the exception I had to download PuTTY, but the messages were very intuitive. What is missing is perhaps a comments page, if nothing else to thank the author.


I like where this series is headed, I will certainly be following it.

A few suggestions on how to improve the consumption of these videos.

1) Break down the video into smaller bite sized chunks to provide for natural breaks. Unlike movies where it's more a passive viewing experience, educational videos, especially ones where you're expected to follow along, require a lot more mental engagement. This makes it difficult to sit through a 50 minute video in one sitting.

3) Use a basic video editor (e.g ScreenFlow) to zoom into the sections you're working on. It's difficult to follow what you're doing when viewing the entire screen, text is tiny and difficult to read. Also forcing me to go into full screen mode to view the text, doesn't help when I want to follow along.

Overall, I love it. Keep up the good work.


When the official download comes out in a day or two, it'll have chapter markers in it for QuickTime, so you'll be able to jump around as needed.


>Break down the video into smaller bite sized chunks to provide for natural breaks.

I agree with this. Find a natural stopping point if you can or just make the videos smaller regardless. ~15 min is OK IMHO.


Wow, this looks really good. A decent django tutorial that covers all the ops side is somewhat lacking I feel, and this certainly looks pretty full.

How do you plan to fund the other lessons?


The Kickstarter is funding all 10 originally planned episodes plus ~5 more covering FAQ-type situations.


Is it worth putting a link to the kickstarter on the front page? Would certainly help explain a lot about the project and if it's still running people can chip in.


Probably not a bad idea, since a lot of people are (self-entitedly) misunderstanding the scope of the project.


I'm very glad that you created this video series. It's going to be incredibly helpful for many developers. Keep up the good work!


This seems to be the perfect video to get setup before reading your book, which is very light on the "proper setup". I imagine that a book might not be the best format for that, or simply that this is not the content your main audience expect to start with.


Indeed, it's a good corollary. :-)


From Wikipedia: A corollary is a statement that follows readily from a previous statement.

Huh?


That's just one of the formal definitions:

http://www.merriam-webster.com/dictionary/corollary

check out the second definitions part a and b:

2.a : something that naturally follows : result

2.b : something that incidentally or naturally accompanies or parallels


chef, vagrant, ubuntu, apt-get, pip, virtualenv, heroku, ssh.. oh there it is, sth about learning django. I'm saying it not to diss your work, but don't you think setting up a linux env on a vm and signing up to heroku shouldn't be the point of a django tutorial? point explained in another discussion about zed's approach to writing 'learn x the hard way' https://news.ycombinator.com/item?id=4961593


One of the thing I usually find hardest about trying out any new web-stack is not necessarily writing the code but wrangling with all the ecosystem BS around it.

It's nice for a tutorial to acknowledge this and give you a VM to play around with.


Yes this is hard. In Django especially, not very easy for beginners.

But put it at the end of the tutorial, not at the beginning

Come on guys, they're doing the tutorial to learn Django, not "all the things around it" (which are important, but it is not Django).


This is true, but you need to do battle with "all the things around it" in order to get the thing to work properly in the first place.

I agree that to learn a language you should not focus on "operational" stuff, but once you get into web frameworks that line can get a little blurry.


"3. Make it work for Windows, OSX, and Linux if you can."

This is the reason the VM was introduced. So that no matter what OS the user is running, they can follow along without having to go search for ways to get all this setup and running. The setup is very minimal thanks to Chef and Vagrant.

Kenneth is trying to teach best practices and tools to use. He also explained in the beginning of the video that you should be comfortable with a terminal and text editor that you like. This shouldn't be your first time looking at a terminal.

Heroku is a simple way to get your project out to the public and it's free. Nothing inspired me more as a developer than having others look at my work. I think it adds a little bit of excitement to be able to show your work to others almost immediately. Even if it's something small, it's still something to "show off" and feel good about.


I feel like that reasoning should be outlined in the tutorial. As a newbie, it seems like a pain to get django running if I have to set up a VM just to do it, and the author provides little explanation.

Coming from rails, its weird to me that he seems to emphasize their 'gem install' equivalent over their bundler equivalent.

Otherwise, a great tutorial.


That's because there isn't really a good "bundler equivalent" that I know of. That was one of the more frustrating parts of Python work for me. Virtualenv is kind of a hybrid between gem and bundler, and it works, but it's nowhere near as elegant.


The jobs are divided a bit differently but the combo of gem/rvm/bundler is matched quite nicely by pip and virtualenv (with virtualenvwrapper adding some nice conveniences)

This article covers some of the equivalent jobs using Ruby and Python:

http://gillesfabio.com/blog/2011/03/01/rvm-for-pythonistas-v...

The article misses covering the freeze command in pip which is great for generating requirements.txt files:

pip freeze > requirements.txt

Covered in detail here: http://www.pip-installer.org/en/latest/requirements.html


Requirements.txt is the gemlock equivalent then?


Gemlock sounds more like Yolk:

http://pypi.python.org/pypi/yolk/0.4.3


I actually think setting up those tools in the tutorial video is great. It's nice to see how a real django dev builds a production app. This stuff is rarely covered in other more simplified tutorials.


Perhaps a better title for the series would be "Getting Started with Django in the Real World"

Because in the real world, you need to know things like chef, vagrant, ubuntu, apt-get, pip, virtualenv, heroku, ssh... if you want to do anything beyond building a demo app that only runs locally. I use all this stuff every day and I'm looking forward to going through this tutorial.

I'm also quite excited about the prebuilt VM that targets Heroku as my colleagues and I were just about to do this ourselves to retool our deploy process. This'll be an awesome start, thanks!


I've built plenty of very real Django apps without any of these (except ssh). Heroku's not the only platofrm, Ubuntu's not the only OS. Neither are even significantly mainstream in the industry.

This tutorial is so myopic. It reads more like a recipe from a beginner's cookbook than anything else.


I've also built plenty of Django projects without a lot of the mentioned utilities, but that doesn't make them any less useful or recommended. I'm certain the developer knows that Ubuntu isn't the only OS and Heroku isn't the only deployment platform. I'd argue against the mainstream statement. Ubuntu is one of the more popular server distros used. Do you expect someone to cover every possible platform and PaaS provider?

What Kenneth is offering is obviously a guide with recommendations and not requiring you to use them for your projects. It's ultimately up to the developer to decide what to use.


I became a much better developer after I tried to port my Django apps to dotCloud and Heroku, using these PaaS forced me to really learn how to use git, virtualenv and pip.

Chef and vagrant are going a long way towards giving me most of the things I love about Heroku and dotCloud but with more control.


I actually think it's quite nice to supply a Vagrant VM (or at least the definition and cookbook) to get someone started quickly.

I'm only confused at why installing pip/python isn't done via the chef file also. If you ever wanted to destroy the VM instance it'd be nice to not have to re-run any setup.

This tutorial doesn't require you to learn chef or use it directly in anyway so I don't think that's fair to include on the list of complaints.


I started learning Python/Django 4 months ago. At first I avoided deployment but when I got around to it, I easily spent over 1/3 of the last 4 months messing with most of the things outlined in the first lesson - and in fact I ended up making a VM (with VMware and dotcloud in my case) to ease setup pain for future projects. This one lesson alone would have saved me at least 2 weeks.


I don't see why giving the user more info on how to handle a full project since the beginning is a bad thing, the django part will certainly be independent of the rest of the tools.


it's not really the same thing. the learn the hard way method is fine for learning something like python or ruby (or whatever language), but not extendable for something like django where you have to set up the db and set the method for deployment. All the other stuff is the teachers way of saying here is the best way to get this set up no matter what your os and what state of disrepair it is in because of all the other tutorials you might have done.

On a tangent, it really goes to show how heavy django development really is. Almost frustratingly so. I keep hearing that it's the web framework for developers on a deadline (it being developed by and for journalists from the get-go), but holy smokes does it take a while to get your stack set up. and for me, I've never done it all in one shot. Whenever I decide to sitdown and take a crack at django, I end up debugging the configuration for about a day and a half.


>>Learning an editor, the terminal for you computer, and a new language is not something to do while learning a framework.

I made this mistake when I was learning Ruby. Ha! Good times!


I'm looking for a good Django tutorial that includes examples of developing with BDD and TDD. The way I learned Rails included RSpec and Cucumber, and that made a huge difference.



The TDD Django Tutorial is both a good example of Django TDD and a good introduction to using Selenium for integration/functional tests. It was my first introduction to both.


The video was fairly long and I wish there was a way for specific sections in the video to be indexed so one can just to sections that are of interest. Then again the text transcript is below so I guess that's an easy way to look up what is needed. I am particularly interested in all the different ways developers set up their settings files. I use a solution which works but I always feel could be a bit more elegant as it requires passing a DJANGO_SETTINGS_MODULE variable when activating a virtualenv (different settings file is activated depending on whether it's a development, staging or production environment)... I think I copied this method from Zachary Voase's blog. Maybe the method you use is better for Heroku, I'm not sure.


The Getting Started with Django series is off to a great start. Kenneth's soothing voice and background music makes it easy on the ears to listen to. The video quality is also great. The initial subjects are, in my opinion, essential to almost every web developer working in a multi-environment setting. Not to mention a great introduction for those just getting into Django. I'm looking forward to more of Getting Started with Django from Kenneth to see what else is in store for those new to Django and to those that utilize Django often.


This is awesome, thanks for posting this.

I'm having trouble getting the VM going and I have a pretty vanilla set up so I'm worried the requirements might need some more detail such as version numbers.

I'm running Ubuntu 12.04 LTS on an i3-2350M and all BIOS settings for virtualization are enabled.

I installed Vagrant 1.0.6 and VirtualBox 4.2.6.

Vagrant gives the following error:

[default] The guest additions on this VM do not match the install version of VirtualBox! This may cause things such as forwarded ports, shared folders, and more to not work properly. If any of those things fail on this machine, please update the guest additions and repackage the box.

And running directly from the VirtualBox GUI gives an error:

Failed to open a session for the virtual machine gswd_1358906798.

VT-x features locked or unavailable in MSR. (VERR_VMX_MSR_LOCKED_OR_DISABLED).

My hardware is 6 months old, would you expect people with 4 year old hardware to run this without trouble?

Any ideas would be appreciated.


I'm running VirtualBox 4.2.4 but I would think, since it creates the VM when you `vagrant up`, that it wouldn't matter what version of VB you were running. So that's odd.

The Vagrant version I have is 1.0.5, just for completeness sake.

I just downloaded the zip file again to check, and there's nothing in there (at least that I can find) that mentions a version of VirtualBox. You're also the first person to mention a problem like this (one other person had a problem after running the VM with getting packages from Google).

You could try downgrading, or, since you're on a sane OS, just running everything sans VM. You'll need to install Git and PostgreSQL yourself, though.

Let me know if anything changes, please. I'll ask around and let you know if I find anything out.

Thanks, and sorry for your problems.


Looks like my problems were completely my fault. On my ThinkPad the virtualization setting is in the BIOS under Security and it was not set correctly. There were some other settings under CPU that I initially thought were the right ones. I'm sorry to waste your time.


Glad you found out what it was!


Wow just what I needed!

As a Desktop/Systems developer I find it hard to integrate all the HTML - CSS - JS - Python and then deploy a Web Application, I've been taking a look at the Django Book but it kinds of assumes you know Web Development.

This looks like just what I need, I'll finish my Poll application and check your tutorials.


Kenneth, sorry if this has been asked, but how often will you be releasing videos ? Monthly ?

Also thank you for making series ;)


The plan is to do 1-2 per month, ideally about 1 every 2 weeks. I have to do them in my (and my editor's) off time, so some months that may slip.


Any chance you can add a subscribe by email form so we can be notified when you release new videos?


I've added a link to subscribe to the mailing list to the top of the site.


I thought I had one. I'll add it this evening.


Why do I need to go through the Django tutorial before starting "Getting Started with Django"? I thought this would be my first stop, not something after the official Polls app.


Why would you want this to duplicate material well-covered by the official-Django-site tutorial?

Even if you like this format better, the official-site tutorial is pretty good, and helpfully sets a common baseline for all Django learners (and all followup teaching). Having a 'canon' helps future steps, even if they diverge.


DRY?


why is that HN crowd is so much into Django? Every day I see something Django-related on the top page. I feel like I'm left out... is Django like the world's number one web framework (for hackers)?


Django is the leading Python framework (by any usage measure) for web development. Python is a popular language. Ergo . . .

As someone who has been learning Django/Python for 4 months, I very much appreciate both the getting started with Django site and the book 2 Scoops of Django that just came out. Would have saved me weeks of time if I had access to these 4 months ago. It's coincidence that they came out within a few days of each other (and a few days after Django 1.5 release candidate came out).

There's even greater interest in Ruby on Rails, the leading web development framework for Ruby.


Because of the love for Python in general. I used Django to fairly good success last year and I'm glad to see it's still going strong. It's far from he Drupal where everything is a CMS option. It's more of a developer-centric CMS system with some sugar on top. Check it out if you are interested in learning. It's a fairly simple platform. The headaches, in my experience, comes from the documentation. It lags behind and the community moves quickly.


Thanks; sounds like I really should learn at least some.


Django is a pretty decent web framework for Python (Python being a language that's loved very much by a large majority of folks here).

Pinterest, Disqus, Instagram, PBS site, Washington Post site, etc. etc. are all Django projects. It's definitely worth learning -- the community is helpful and in large numbers, the framework is quite 'complete' -- there are lots of plugins available, it's fairly secure... and it's a pleasure to work with. :)


Thanks =) I certainly know what Django is (although have no experience with it whatsoever), but was a little surprised as to why it is so popular here, specifically. However, that list of Django projects is impressive enough, I guess.


Django has a massive ecosystem where most of the hard work has been done for you. Some people argue it's too much and you should use something like Flask or Web.py but you're going to end up reinventing stuff that's already been solved.


This is great. Just one thing though:

body {width: 80%; margin:0 auto; min-width:1080px;}


a minor nit: fix the spelling in the header "Getting to Heorku"


done


Is there a way to save HN stories, aside from commenting on them? I don't want to leave a pointless comment just so I can find it later (I didn't want to leave this one.).


Upvote it and it will show in your "Saved Stories" page (link on your profile page).


I don't think it works for me. Maybe I don't have enough Karma or it is a bug. http://news.ycombinator.com/item?id=4462292


Your browser should have a bookmark function...


I was not at my own personal computer.


Pocket's my go-to tool for that. http://getpocket.com/


Try using kippt. They have a Chrome addon that allows you to save HN stories into your links.


Step 1. Unchain him.




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

Search: