6 ms·
Building a Hacker News clone in Django - Part 1 (Screencast)
- smnrchrds 13y agoCurious. I was watching a screencast from Tuts+ Premium the other day that was meant to teach Django to beginners, by building a Hacker News clone. [1] https://tutsplus.com/course/django-unchained/ https://tutsplus.com/course/django-unchained/
- daGrevis 13y agoThis is pretty interesting. Looking for 2nd part!
- benregn 13y agoMaybe this is a nitpick but I'd revise the opening sentance: "There is no better way to learn something than to watch someone else do it". I think we can all agree that when it comes to programming the _best_ way to learn it is to actually program.
- arocks 13y agoHi! This is the author. I was pretty sure that someone would point this out and I completely agree. But, even Programming has to be taught. Among the many ways to learn programming, I think the best approach is to demonstrate how a good progammer programs and explain the thought process.
- benregn 13y agoI agree with you on that. I didn't mean to say that the idea or the video wasn't good.
- Widdershin 13y agoWhen you say programming has to be taught, do you include being self taught?
- jawr 13y agoDefinitely agree with this. I learnt to program with a lot of trial and error.. no screencasts or online workshops. Also - I haven't actually watched the screencast, but looking at the text the virtualenv setup seems very wrong.
- Widdershin 13y agoEmbarrassingly enough, I learnt to program in Game Maker when I was pretty young. I still remember the day when it clicked what variables were :P
- qu4z-2 13y agoDon't be embarrassed. You've got to start somewhere.
- krapp 13y agoGame Maker is fun, I still play around with it now and then.
- Widdershin 13y agoI still consider Game Maker to have the best standard library for actually making 2D games of any engine I've encountered.
- krapp 13y agoIt is really quite good at what it does, and it's an easy way of building quick and dirty .exes too. I do wish knowing GML was good for something somewhere else though. Or that it used another language like Python for its scripting.
- Widdershin 13y agoNothing would make me happier than being able to use Python with Game Maker's functionality.
- gamesbrainiac 13y agoI gotta say, this looks like it was copied from tutsplus. But hey, if it helps people, who cares. I don't.
- rakeshmenon 13y agoyeah is copied from tutsplus :-/ the only difference being its distributed for free
- schlecht 13y agoRubs me the wrong way where people don't give the necessary credit.
- arocks 13y agoI would like to clarify that I was working on this, on and off, since last year (yes, it takes quite a bit of effort to create video tutorials). I read the tutsplus course page and it seems it is a course for teaching Django to beginners. It seems our approaches are different too.
- superchan 13y agoAnyone have a reference to the Tutsplus tutorial? Curious to see how that differs from this one.
- hdra 13y agoI would agree that the best way to learn programming is to program, not just following along, but find a real problem and try to solve it, but then again, I know a lot of people who kept getting stuck because of the fear of "doing it wrong". So, yeah, watching other people do it has its merits as well.
- esalman 13y agoIt helps a lot if we watch some videos before actually program in a new language. It is also faster way to learn than reading a book, although reference books can be invaluable. I practically learned ActionScript by watching a screencast.
- mhd 13y agoDifferent strokes, I personally get pretty bored by watching people enter code and manipulate their windows, I read a lot faster than that and don't get distracted by all the non-code parts. Never mind different setups. I also much rather read a blog article than watch a long-winded podcast. As Sartre said, Hell is watching other people use a computer.
- serans 13y agoI know many people enjoy screencasts, but they are just not for me. I can't copy-paste code from a video. Searching is orders of magnitude slower than just pressing "Page Up"/"Page Down". This is particularly important when I just want to take a glance and figure out if the text/video is of any interest. I have to adapt myself to the speed of the video, and maybe most importantly, I have to swallow all the non-relevant parts (such as moving windows, launching commands, typing, etc.). It takes me so much more effort (and patience) to watch a video instead of reading an equivalent text, that I almost never do so (khan academy being the exception).
- frankblizzard 13y agoThat's great - coming from Rails I was always curious learning Python and especially see how Django differs from Rails. Will definitely watch this..
- wilfra 13y agoI built something similar with Rails as a 'hacker news for poker' and open sourced the code, if anybody wants to play around with it (or use it). Pull requests welcomed :) https://github.com/wilfra/theplayr https://github.com/wilfra/theplayr (live site: http://theplayr.com http://theplayr.com)
- targusman 13y agoHow does this compare to 2scoops of django(1)? I bought it but it seems like that's the book after this one. If so, how come you put that one out first? It would be nice if these books came out in order of skill 1) https://django.2scoops.org https://django.2scoops.org
- pydanny 13y agoDisclaimer: I'm one of the authors of Two Scoops of Django. This screencast looks awesome! Okay, now to your questions: First, the screencast for creating a HN/Reddit clone is a tutorial. It's a good place to start when developing in Django, or as a reinforcement for the existing tutorial. Second, Two Scoops of Django came out first because we (me and Audrey Roy) wrote it first. Arun Ravindran, who is making this tutorial, is a separate person and completely unaffiliated with us.
- brickmort 13y agoI'm not affiliated with either party, but I wanted to chime in and say that I HIGHLY recommend two scoops for anybody looking to learn Django, expecially if you found this screencast helpful and are looking for something more to supplement it. There's so much to learn in that book that I can pretty much consider it required reading for serious prospective Django developers. Thanks Pydanny/Audrey! You guys did an amazing job!
- ambiate 13y agoI have been intending to buy this book for over 3 months now. I finally got around to it today. The coding conventions won me over in the first 5 minutes.
- stephen_mcd 13y agoCool! Doing this from scratch is great for learning. I wrote the same article and demo a month ago, albiet a more comprehensive and complete approach using Mezzanine (a Django based CMS). The article focuses on how most of the features needed for something like this come out of the box with Mezzanine: http://blog.jupo.org/2013/04/30/building-social-apps-with-mezzanine-drum/ http://blog.jupo.org/2013/04/30/building-social-apps-with-me...
- ra 13y agoProbably worth noting that stephen_mcd is the author of Mezzanine. I really like some aspects of Mezzanine, and I've used it on a couple of projects with success. But I don't like Grappelli much, I prefer django-admintools so for this reason alone I prefer FeinCMS or Ella.
- stephen_mcd 13y agoMezzanine intentionally works fine without Grappelli, just remove it from your project settings :-)
- ra 13y agoWill do, thanks. Never understood why Grappelli removes the button click from admin actions!
- arocks 13y agoThis is brilliant and looks much more comprehensive. My intention was to use Django to the fullest without the help of a third party library. Mainly to cover some of the recent features of the framework which were not covered elsewhere.
- jnazario 13y agoneat, and a nice clean demo of django. myself, i wrote a HN clone one afternoon (when HN was down for several hours) using flask. since i'm the only user, i feed it with twitter. what i did was set up a twitter account - @hacktweetnews - and have it follow most of the top twitter users from the HN community [1] and then score it reddit-like. no votes aside from what people post as duplicates, no comments - so it definitely lacks the full features you have, but then again it's just me. however, like your django example, it was super easy to set up in a framework. yours is definitely far more feature-filled! 1. http://talkfast.org/2010/07/28/twitter-users-most-followed-by-readers-of-hacker-news/ http://talkfast.org/2010/07/28/twitter-users-most-followed-b...
- dysoco 13y agoIs there any kind of streaming service like Twitch.tv but for programmers? Maybe it's weird... but I really like watching other people writing a project (Like in the Ludum Dare), I like to see how they tackle the design, how they work, what cool tricks they use, etc. You can even interact with them via chat, and not only help but also ask questions about what they are doing... is great for people who are still learning. Any?
- mrcharles 13y agoThis would be so great. It's really difficult to get a good video stream for displaying text, and often the only recourse is to go for super high quality, which is killer if you have limited upload rates.
- dysoco 13y agoYeah, my upload speed is about 0.5Mb so I guess I can stream at 640x480 :P Although many people seem to do fine for the Ludum Dare.
- jmcdowell 13y agoI remember the guys at Big Block Games made this game in a 2 week sprint for charity where one of the artists or programmers had to be online at any time of the day: http://www.bigblockgames.com/games/coffeehero/ http://www.bigblockgames.com/games/coffeehero/ It was completely streamed live and was really enjoyable, they'd work and chat to the watchers at the same time, answer any questions and give advice on what they were currently doing. Rather annoyingly it worked really well but I haven't seen anyone repeat anything similar since.
- heliostatic 13y agohttp://codestre.am/ http://codestre.am/ seems to be gone, but served this role.
- mmanfrin 13y agoBaader-Meinhof -- I was just looking an hour ago for something like this. The best I could find was: http://thecodeplayer.com/ http://thecodeplayer.com/
- nkuttler 13y agoIsn't the more interesting aspect of HN how it scales? Simply writing a few models, views and templates is certainly a nice exercise but only a first step. Not to mention getting the audience, but that's not really a technical problem.
- publicfig 13y agoI think this is more of a Django tutorial than anything.
- whatsup 13y agowill the DB be filled with sycophantic PG user profiles?