検索 - みる会図書館

全データから 12305件ヒットしました。

Two Scoops of Django Best Practices for Django 1.8


C み 4 ア / 35. ・ / ア ア % C. ・ / ノ イ 4 / 犬 ぉ 尾 ぉ Intermediate/Advanced Django Material Video : Two Scoops Academy twoscoopsacademy . com Learn intermediate and advanced Django 丘 om the authors of Two Scoops of Django ・ Two scoops Academy has a growing series ofcourses on Djang0' Python' JavaScript' and more. For more detail, see the prevlous page ・ GoDjango godjango. com A series ofshort videos that each focus on something challenging t0 do with Django. You can access 1 れ ore by going pro . Books : High Performance Django amazon. com/High—Performance—Django/dp/[email protected]/ https://highperformancedjango. com (eb00k) written with a focus on scaling Django, this book espouses many good practices. Full of useful information and tricks, as as questions in each section that force メ ou tO think about what you are doing ・ Lightweight Django amazon.com/Lightweight-Djang0-Julia-EIman/dp/149194594X A good book by Django veterans Julia Elman and Mark Lavin that focuses heavily on the front-end. Amongst other things, a handy reference for making Django work with Web sockets. Django Design Patterns and Best Practices amazon. com/Django—Design¯Patterns—Best—Practices/dp/1783986646 Arun Ravindran's book is a useful and quite funny book on design patterns ・ Two scoops ofDjango: Best Practices for l)jango 1.6 (print) http://amzn. t0/1dpCOIt %e second printed edition of this book. We maintain a list ofcurrent and outdated Django b00 at: twoscoopspress.org/pages/current¯django¯books 458

Two Scoops of Django Best Practices for Django 1.8


丁 WO SCOOPS OF D 」 ANGO BEST PRACTICES ん 「 DJ 6 ◎ A70 AVDREY ROY GR こ こ 「 こ し 0 BY DANICL ROY GRECNFELD What'sInside This Book C0ding StyIe The Op m 引 Django Environment Setup HOW t0 Lay Out Django P 「 ojects FundamentaIs of Django App Design Settings and Requirements Files ModelBest P 「 actices Que 「 ies and the Database Laye 「 (NEW) Function- and Class-Based Vlews Best P 「 actices fO 「 Function-Based Views Best P 「 actices fo 「 Class-Based Vlews Fo Fundamentals Common Pattems fo 「 FO 「 ms TempIates: Best P 「 actices TempIate Tags and FiIters Django TempIates and Jinja2 BuiIding REST APIs Consuming REST APIS Tradeoffs of RepIacing Core Components Worklng With the Django Admin DeaIing with the Use 「 M0deI Django's Secret Sauce: Thi 「 d-Party Packages Testing Chapte 「 Of Doom! Documentation: Be Obsessed Finding and Reducing BottIenecks Asynch 「 onous Task Queues Security Best P 「 actices Logging: What's は FO 「 , Anyway? Signals: Use Cases and Avoidance Techniques What About Those Random Uti lities? DepIoyment: PIatforms as a Service Deploying Django P 「 0Jects Continuouslntegration The Art of Debugging Whe 「 e and HOW tO Ask Django Questions ClOSing Thoughts Packages Mentioned in This B00k T 「 oubleshooting Additional Resources lnternationalization and Localization SettIngs AIternatives Security Settlngs Reference WO 鹵 ng with Python 3 5 ( ?5 0 9 780981 467344 PRESS 5 ( 00P5 0 90000 > ISBN 9780981467344 feedback 丘 om prevrous editions. lmprovements and ne 、 material based on Django 1.8. lt contains significant lhis is the third edition, updated for over the years. Audrey Roy Greenfeld have picked up smppets, and techniques that Daniel and various tips, tricks, patterns, code Two Scoops ofDjango introduces you to applications. development ofmaintainable framework that encourages the rapid Django is a high-level Python web

Two Scoops of Django Best Practices for Django 1.8


Appendix ( : AdditionaI Resources FIhis appendix lists additional resources that are applicable to modern Django and python. FIhere- fore, we will only list content that is current and applicable to Django 1.8 , python 2.7. x , or Python 3.4. x. TWO Scoops Academy Two Scoops Academy makes learning Python, Django, JavaScript, CSS, and HTML as fun as ice cream. are a gro 、 series ()f beginner—t()—advanced online by the ofthis book, Danie1 and Audrey Ro メ Greenfeld. Subjects covered include: Building projects 伝 om start to finish following best practices. How to install, configure, use, and improve open source packages. Super-fast test authoring and test coverage checking. Fancy image uploads (drag and drop). Asynchronous tasks with CeIery. lntegrating with third-party APIs. Flagging spam and moderation queues. Advanced ORM query tricks. Advanced use of Cookiecutter and cookiecutter-django. Dep10yment with Docker. Much, much more. twoscoopsacademy . com 457

Two Scoops of Django Best Practices for Django 1.8


Python core developers whom we greatly respect. We've had this book reviewed by more tech- nical reviewers than the average technical bOOk, poured countless intO reVISions. FIhat being said, there is always the possibility oferrors or omissions. lhere is also the possibility that better practices may emerge than those described here. We are ållly committed to iterating on and improving this book, and we mean it. lfyou see any practices that you disagree with or anything that can be done better, we humbly ask that you send us your suggestions for best way tO send us feedback is tO 升 le an issue at https://github. com/twoscoops/two—scoops—of—django—l .8/issues. P1ease don't hesitate to tell us what can be improved. We will take your feedback constructively. ErratawiIIbepublishedat http://www. 2SC00PS. C0/1.8-errata/. Why Two Scoops of Django? Like most people, we, the authors of this book, love ice cream. Every Saturday night we throw caution tO the wind and indulge in ice cream. anyone, but sometimes we even have some when it s not Saturday night! Figure 1 : lhrowing caution t0 the wind. We like to try new flavors and discuss their merits against our 01d favorites. Tracking our progress through 砠 these flavors, and possibly building a club around it, makes for a great sample Django pr0J ect ・

Two Scoops of Django Best Practices for Django 1.8


C み 4 ア / 0. ・ ル / ル ノ 既 石 Without 砠 ofthe talented, creative, and generous developers who make up the Django, Python, and general open source software communities, this b00k would not exist. We strongly believe in recognizing the people 、 as and as 、 as informatlon, and we've tried our best tO give credit whenever credit is due. Listen tO Ou 「 Readers and Reviewers ln the prevlous editions of this book, we received a huge amount of feedback 丘 om a veritable legion ofreaders and reviewers. Flhis allowed us to greatly improve the quality of the book. lt is now at a level that we hoped for but never expected to achieve. ln return, we've shared credit at the back of the book and are continually working on ways to pay it forward by improving the lives ofdevelopers around the world. If you have any questions, comments, or other feedback about this edition, please share your input by submitting issues in our issue tracker, at: https://github . com/twoscoops/two-scoops—of-django-l .8/issues 用 so , at the end of the book is a link to leave a review for Two Scoops of Django on Amazon. Doing this will help others make an informed decision about whether this book is right for them. PubIish lssues and Errata Nothing is perfect, even after extensive reuew cycles. We will be publishing issues and errata at the Two Scoops ofDjango 1.8 GitHub repo: https://github. com/twoscoops/two-scoops-of-django-l . 8 VZ

Two Scoops of Django Best Practices for Django 1.8


C み 4 ア / 26. ・ S ど 覦 召 ぉ / Pra は 26.32 Keep Up-t0-Date on GeneralSecuritY Practices we end this chapter with some common-sense advice. First, keep in mind that security practlces are constantly evolving' both in the Django commu- ⅲ Ⅳ and beyond. subscribe to http: //2SC00PS ・ co/django-announce and checkTwitter' Hacker News, and various security blogs regularly ・ second, remember that security best practices extend well beyond those practices specific to Django. You should research the security issues ofevery part ofyour web application stack' and you should 応 Ⅱ ow the corresponding sources to stay up to date. TIP: Good Books and ArticIes on Security paul McMi11an, Django core developer, security expert' and Two Scoops reviewer' rec- ommends the following books: http://amzn.to/lhXAAyx http://amzn. to/ldZ7xEY ln addition, we recommend the 応Ⅱ() 、 ving reference site: https://wiki .mozilla.org/WebAppSec/Secure—Coding—GuideIines 26.33 Summary Please use this chapter as a starting point for l)jango securitY' not the ultimate reference guide. See the Django documentation's list for additional security topics: http://2SCOOPS. C0/1.8¯additionaI¯securitY¯topics Django comes with a good security record due tO the diligence ofits community and attention to detail. security is one ofthose areas where it's a particularly good idea to ask for help. lfyou find yourself confused about anything, ask questlons and turn to others in the Django community for help. 362

Two Scoops of Django Best Practices for Django 1.8


Web: Django Package https://www. djangopackages . com A directory of reusable apps, sites, t001S , and more for your Django projects maintained by the authors ofTwo Scoops of Django. CIassy CIass-Based Views http://ccbv . co . uk/ A website that has provides detailed descriptions, with ん Ⅱ methods and attributes, for each ()f class—based generic vie 、 %. CIassy Django REST Framework http://www. cdrf. co/ Detailed descriptions, with ん Ⅱ methods and attributes, for each ofDjango REST Frame- class—based Views serializers. pydanny's blog http://pydanny. com/tag/django. htmt A good amount of this blog is about modern Django. As the author of this blog is also one ofthis book's authors, the style ofthe blog loosely resembles the content ofthis book. Getting Started with Django Rest Framework and Angu1arJS http://www.2scoops. co/kevin-stone-django-angular—tutorial/ Kevin Stone's amazing Django + AnguIar tutorial is an epic piece of work. lt is over 25 pages long when printed out, and great for kickstarting yourself into understanding l)jango, Django Rest Framework, and AnguIar ・ js. Django ModeI Behaviors http://btog. kevinastone. com/django-modet-behaviors. htmt Kevin Stone explores how to structure models and associated code in large l)jango projects ・ Linc01n Loop's Django Best Practices http://lincotnloop. com/django-best-practices/ free 、 resource is a really good reference ofpractices similar tO in this book. Awesome-Django http://awesome-django ・ com/ A curated list of awesome Django apps, projects and resources. 459

Two Scoops of Django Best Practices for Django 1.8


The TweIve-Factor App A comprehensive approach to web-based application design, the 7 ど ん ど 一 方 / / ア ア approach is growmg in popularity amongst many senior and core Django developers. lt is a methodology for building deployable, scalable applications worth reading and understanding. Parts of it closely match the practices espoused in Two Scoops of Django, and we like to think of it as suggested reading for any web-based application developer. See http://12factor. net Our Writing Concepts When we wrote this book,we wanted to provide to the reader and ourselves the absolute best material possible. To do that, we adopted the following principles: Provide the Best MateriaI We've done our absolute best to provide the best material possible, going to the known resources on every topic covered tO vet our material. We weren't afraid tO ask questions! Flhen we distilled the articles, responses and advice ofexperts into the content that exists in the book today,. \'Vhen that didn't sufflce, we came up with our own solutions and vetted them with various subject matter experts. lt has been a 10t ofwork, and we hope you are pleased with the results. If you are curious about the differences between this edition (Django 1.8 ) and the prevlous edition (Django 1.6 ) of the book, you can find the shortlist of changes at: http://www.2scoops . C0/1.8-change-Iist/ Stand on the ShouIders of Giants Whi1e we take credit and responsibility for our work, we certainly did not come up with 砠 the practices described in this bOOk on our ( ) 、 Ⅵ 1. XXXV

Two Scoops of Django Best Practices for Django 1.8


20 DeaIing With the User ModeI lhe best practices for this changed significantly in Django 1.5. "right way" before Django 1.5 was a bit confusing, and there's still confusion around pre-l. 5, so it's especially important that what we describe here is only applied to Django 1.5 or higher. SO let's go over best practices for Django 1.8. 20.1 Use Django's TooIs fo 「 Finding the User ModeI %e advised way to get to the user class is as 応Ⅱ() 、 # Stock user modet definition EXAMPLE 20.1 > > > sfrom django ・ contrib. auth import get_user_modet # When the project has a custom user model definit-ion く ctass ー django. contrib. auth. models. User'> > > > get—user—model() > > > from django. contrib. auth import get_user_modet く ctass fprofites. models. UserProfiIef > > > > get—user—model() 267 departure 伝 om earlier versions of Django. project can customize its own Use r model. Flhis was introduced in Django 1.5 and a radical ration.%is doesn t mean that a project can have two different Use r models., it means that every lt is now possible to get two different Use r model definitions depending on the project con 五 ー

Two Scoops of Django Best Practices for Django 1.8


C み 孕 / 26. ・ & 覦 り 召 ぉ / Pra は な お 26.24 Embrace SecurityMiddleware We'vementionedDjango 1.8'snewbuiltindjango. middteware. security. securityMiddteware several times already in this chapter. lt replaces most of the functionality of the venerable django-secure package. 、 () 、 it tO ourselves and our users to embrace and use this a れ 江 e of Django ・ 26.25 Force the Use 0f Strong Passwords A strong password is one that more than a list of characters. lt is suitably complex' including punctuation, digits, and both character cases. Let's pledge t0 protect our users by enforcing the use Of such pass 、 vords. PACKAGE TIP: TooIs fo 「 Strong Passwords ln order to expedite this practice, we encourage the use 0f django-passwords' a project created by core Django developer, PiP/PyPl maintaineg and Two Scoops of Django 1.5 security reviewer, Donald Stu 飛 Another gotcha with strong passwords is with automatically generated Django sites' such as those created by configuratlon management t001S. Since the creation of su- perusers is bypassed, we always have tO COOk up our own work arounds. FortunatelY' Roberto Rosario has provided us with django-autoadmin' which provides automatic admin users complete with passwords for Django projects ・ https://github. com/dstufft/django-passwords https://github. com/rosarior/django-autoadmin 26.26 Give Your Site a Security Checkup Erik Romijn has created pony Checkup' an automated security checkup t001 for Django web- sites. There are several security practices that can easily be probed 伝 om the outsid% and this is what his site checks 応 r. lt's not a security audit' but it's a great' free way tO make certain that your production deployment doesn't have any gaping security holes. lfyou have a Django site in production, we recommend that you go and try out: http://ponycheckup. com 356