TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

How to Tango with Django: A Python Django Tutorial

233 pointsby pajjuover 11 years ago

17 comments

leephillipsover 11 years ago
This looks like it might eventually become a useful resource, as there is nothing else out there with its particular approach and combination of topics, and it seems fundamentally sound.<p>However, I wouldn&#x27;t recommend trying to learn from it in its current form, unless you already know a lot.<p>Just skimming over it, I found that it was teeming with grammatical errors and typos, with entire sentences garbled to the point where I couldn&#x27;t tell what the authors had intended to say. I saw syntax errors in the code samples, which means that they weren&#x27;t all verified to run as printed. Again, not a real problem except for beginners, but beginners are the target audience.<p>Finally, there is some utility to the concept of <i>prerequisite</i> that the authors seem to avoid.<p>This book tries to teach the beginner everything that he might need to know, from what &quot;ls&quot; does in the shell to how to use git and set up virtual environments. Maybe it is practical to go from never having seen the command line to deploying working, secure Django projects just by using a (cleaned up version of) this book, but doesn&#x27;t it make more sense to learn things in a more solid progression of stages? It&#x27;s OK to expect the student to already know some basics, and build on those. You don&#x27;t find a tutorial on arithmetic in a book about topology.
评论 #6592627 未加载
评论 #6592231 未加载
评论 #6598305 未加载
评论 #6592634 未加载
rmrfrmrfover 11 years ago
Question for Rails and Django users: is there a site that gives definitive best practices for both? I&#x27;ve actually been thinking about building a thrown-together site for just that purpose.<p>I&#x27;ve tried to get into <i>both</i> Rails and Django twice now (I&#x27;m a PHP guy usually), but every time I seem to get going, I get bogged down by StackOverflow after StackOverflow that have seemingly contradictory information or offer a third party solution rather than solving the problem within the framework.<p>In Rails, for example, Rails is easy enough, until you&#x27;re dealing with RVM * , Passenger * , and installing correct dev versions of database drivers.<p>In Django, you deal with South migrations when you want to update your database schemas, virtualenv * , virtualenvwrapper * ; in fact, I&#x27;ve heard that one of the criticisms of Django is that, in order to get to production quality, you essentially have to switch out every component of it with a third party.<p>* The starred apps don&#x27;t technically have anything to do with the framework; they&#x27;re more utilities for managing multiple framework instances. Still, you&#x27;re likely to find tutorials that use them as a de facto standard, which only adds to noob confusion.<p>I&#x27;ve started reading Michael Hartl&#x27;s Rails tutorial, which seems promising. I found that the highly-recommended &quot;Two Scoops of Django&quot; book was a little too narrative for me (just tell me what to do, dammit!); there&#x27;s definitely a need for more Django tutorials than just the Django website&#x27;s basic one -- kudos to the author for that.
评论 #6592105 未加载
评论 #6593870 未加载
评论 #6592261 未加载
评论 #6599021 未加载
评论 #6591945 未加载
评论 #6591939 未加载
评论 #6592582 未加载
评论 #6592055 未加载
BenderVover 11 years ago
For people starting with Web Framework or new to Python, I would suggest starting with a lightweight framework, such as Flask or Pylons.<p>I used to struggle with Django, so I started to look into Flask, and I really feel like I finally understood what I was doing.<p>Flask tuto : <a href="http://flask.pocoo.org/" rel="nofollow">http:&#x2F;&#x2F;flask.pocoo.org&#x2F;</a>
评论 #6592070 未加载
评论 #6592750 未加载
mladenkovacevicover 11 years ago
This would&#x27;ve been immensely useful when starting out.<p>Official tutorials and docs don&#x27;t cover nearly all of the accepted standard practices. As a relative outsider it seems a lot of this Django&#x2F;Python knowledge is taken for granted by the tightly knit community of the skillful developers who interact with each other and exchange various tips, while a beginner who is not really embedded in the community misses out on all that and picks it up only when it&#x27;s widely enough used that it hits the blogs and podcasts in bits and pieces.
brabramover 11 years ago
From a quick overview I really like your approach: you start by a hello world directly (then template, then models) instead of doing this strange approach of the django official tutorial that starts with model then admin interface then show an hello world at part 3. I also really like the presence of exercices.<p>Quick comment: here, you are teaching render_to_response <a href="http://www.tangowithdjango.com/book/chapters/templates_static.html#adding-a-template" rel="nofollow">http:&#x2F;&#x2F;www.tangowithdjango.com&#x2F;book&#x2F;chapters&#x2F;templates_stati...</a> while you should be using render instead <a href="https://docs.djangoproject.com/en/1.5/topics/http/shortcuts/#django.shortcuts.render" rel="nofollow">https:&#x2F;&#x2F;docs.djangoproject.com&#x2F;en&#x2F;1.5&#x2F;topics&#x2F;http&#x2F;shortcuts&#x2F;...</a> which is simplier than render_to_reponse (where you have to use the horrible context_instance=RequestContext(request) to be able to do certain things in the template which confuse a lot people).<p>Thanks for this contribution to the django community!
lahwfover 11 years ago
Another awesome resource for Django Screencasts is Neckbeard Republic.<p><a href="https://www.neckbeardrepublic.com/tagged/django" rel="nofollow">https:&#x2F;&#x2F;www.neckbeardrepublic.com&#x2F;tagged&#x2F;django</a>
kmfrkover 11 years ago
You should probably not use django-registration for user auth as referred to in the guide, since it&#x27;s been abandoned at this point: <a href="https://news.ycombinator.com/item?id=6278464" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=6278464</a>.
评论 #6591867 未加载
评论 #6598321 未加载
amarsahinovicover 11 years ago
Django screencasts for the interested:<p><a href="https://godjango.com/" rel="nofollow">https:&#x2F;&#x2F;godjango.com&#x2F;</a><p><a href="http://gettingstartedwithdjango.com/" rel="nofollow">http:&#x2F;&#x2F;gettingstartedwithdjango.com&#x2F;</a>
评论 #6592724 未加载
htaunayover 11 years ago
Another great resource is <a href="http://gettingstartedwithdjango.com/" rel="nofollow">http:&#x2F;&#x2F;gettingstartedwithdjango.com&#x2F;</a>
djd606over 11 years ago
This is fantastic! Congrats and keep up the good work! Will there be an ebook version available any time in the future? Thanks again.
评论 #6598318 未加载
hawkharrisover 11 years ago
I recently started to learn Ruby on Rails. I like the language and the framework, but I also appreciate the simplicity and power of Python.<p>Which framework should I focus on if my priorities are professional development and ease of workflow? I realize this is a hard question to answer, but I&#x27;m interested in hearing different perspectives.
评论 #6596544 未加载
erokarover 11 years ago
Looks impressive. I&#x27;m a Ruby guy, but I would probably start with this if I was getting into Python&#x2F;Django.
STRiDEXover 11 years ago
Looks good! The part I chose to jump to was deployment as there&#x27;s a million ways to do it and I&#x27;ve been looking for a best practices. Was a little saddened to see you chose PythonAnywhere not because the service is bad, but because it has a limited use case.
评论 #6598621 未加载
Siecjeover 11 years ago
Good Tutorial. I like how you are building a website and adding features.<p>So far I have made it to the Ajax page.<p>Why don&#x27;t you use render in your views, and url tags with the name in urls.py?<p>Also there is a lot of typos. Is the site open source?
n1ghtm4nover 11 years ago
Thank you for putting so much work into this, but it&#x27;s not Python 3!
评论 #6598331 未加载
orenbarzilaiover 11 years ago
Another recommended resource for learning Django: <a href="http://www.djangobook.com/en/2.0/index.html" rel="nofollow">http:&#x2F;&#x2F;www.djangobook.com&#x2F;en&#x2F;2.0&#x2F;index.html</a>
评论 #6591879 未加载
leifosover 11 years ago
Thanks for all your comments and suggestions so far. Please keep the coming.