Two Scoop OfDjango

2y ago
11 Views
3 Downloads
5.16 MB
18 Pages
Last View : 1m ago
Last Download : 3m ago
Upload by : Philip Renner
Transcription

Two Scoop ofDjango Best Practices For Django 1.6Daniel GreenfeldAudrey RoyNo.· signout4

ContentsinDedicationList of FiguresxxiList of TablesxxivAuthors' NotesxxviiAbout the Dedication0000000000A Few Words From Daniel Greenfeld0A Few Words From Audrey Roy0IntroductionWhy Two Scoops ofDjango?Before You Begin0000000000000xxix00000000Each Chapter Stands On Its OwnConventions Used in This Book00000000Keep It Simple, StupidFat Models, Helper Modules, Thin Views, Stupid Templates00000000Be Familiar with Django's Design PhilosophiesThe Twelve Factor AppOur Writing Concepts0000XXXlllxxxiii0oXXXVoXXXV000000000Stand on the Shoulders of GiantsXXXVlxxxvixxxvi. xxxvii0Provide the Best Materialxxx.iiio XXXlV0Start With Django By Defaultx:xxi. xxxiiThis book is intended for and Python 2o7ox/3o3ox0Listen to Our Readers and ReviewerstVxxviiixxxiA Word About Our RecommendationsCore Conceptsxxvii00XXXVllxxxviixxxviixxxviii

ContentsPublish Errata .1Coding Style11.1The Importance of Making Your Code Readable1PEP821.21.2.1234 0 The 79 Character Limit .21.3The Word on Imports1.4Use Explicit Relative Imports41.5Avoid Using Import*7 003 001.6Django Coding Style Guideline.s91.7Never Code to the IDE (or Text Editor)91.8Summary . . . . . . . . . . . . . . .9The Optimal Django Environment Setup112.111Use the Same Database Engine Everywhere2.1.1Fixtures Are Not a Magic Solution .2.1.2You Can't Examine an Exact Copy of Production Data Locally122.1.3Different Databases Have Different Field Types/Constraints12112.2Use Pip and Virtualenv2.3Install Django and Other Dependencies via Pip15 0000 0 000132.4Use a Version Control System . . . . . . . . . .162.5Consider Using Vagrant for Development Setup162.6Summary . . . . . . . . . .17 0How to Lay Out Django Projects193.1Django 1.6's Default Project Layout .193.2Our Preferred Project Layout203.2.111. xxxviii 000Top Level: Repository Root.213.2.2Second Level: Django Project Root .213.2.3Third Level: Configuration Root213.3Sample Project Layout . . . . . . . . . .223.4What About the Virtualenv?25 0 3.5Using a Startproject Template to Generate Our Layout263.6Other Alternatives .273.7Summary . . . . . .27Fundamentals ofDjango App Design29v

Contents4.1The Golden Rule ofDjango App Design . . . . .4.1.1A Practical Example of Apps in a Project .What to Name Your Django Apps324.3When in Doubt, Keep Apps Small334.4Summary . . . . . . . . . .33355.1Avoid Non-Versioned Local Settings365.2Using Multiple Settings Files . . . .375.35.4, 5.55.2.1A Development Settings Example405.2.2Multiple Development Settings .41Separate Configuration from Code . . . .425.3.1A Caution Before Using Environment Variables for Secrets435.3.2How to Set Environment Variables Locally . . .445.3.3How to Set Environment Variables in Production455.3.4Handling Missing Secret Key Exceptions46When You Can't Use Environment Variables485.4.1UsingJSON Files . . . . . . . . . .485.4.2Using Config, YAML, andXML File Formats50Using Multiple Requirements Files . . . . . . . . . . .505.5.1Installing From Multiple Requirements Files. .515.5.2Using Multiple Requirements Files With Platforms as a Service (PaaS) 525.6Handling File Paths in Settings525.7Summary. . . . . . . . .55Database/Model Best Practices575858586.1Basics6.1.16.2Vt314.25 Settings and Requirements Files630Break Up Apps With Too Many Models .RawS 6.1.2Don't Drop Down to6.1.3Add Indexes as N ceded . . . . . . .596.1.4Be Careful With Model Inheritance606.1.5Model Inheritance in Practice: The TimeStampedModel626.1.6Use South for Migrations .63Until It's Necessary.Django Model Design . . . . . . .656.2.1Start Normalized . . . . .656.2.2Cache Before Denormalizing65

Contents6.2.3Denormalize Only if Absolutely Needed666.2.4When to Use Null and Blank .666.2.5When to Use BinaryField .686.3Model Managers . . . . . . . . . .696.4Transactions . . . . . . . . . . . .716.4.16.57726.4.2Explicit Transaction Declaration . . . . . . . . .746.4.3django.http.StreamingHttpResponse and Transactions756.4.4Transactions in. . . . . . .766.4.5Django ORM Transaction Resources.76Summary . . . . . . . . . . . . . . . . . . . .76MyS Function- and Class-Based Views797.1When to Use FBVs or CBVs797.2Keep View Logic Out ofURLConfs807.3Stick to Loose Coupling in URLConfs82What IfWe Aren't Using CBVs? .85Use URL Namespaces . . . . . . . . . . .857.3.17.47.4.1Makes for Shorter, More Obvious and Don't Repeat Yourself URLnames . . . . . . . . . . . . . . . . . . . . . . . . .86Increases Interoperability with Third-Party Libraries .877.4.3Easier Searches, Upgrades, and Refactors. . . . .887.4.4Allows for More App and Template Reverse Tricks887.4.27.5Try to Keep Business Logic Out of Views887.6Django Views are Functions.Summary . . . . . . . . . .898990Best Practices for Function-Based Views918.1Advantages ofFBVs . . . . . . .918.2Passing the Http Request Object928.3Decorators are Sweet . . . . . .957.6.17.78Wrapping Each HTTP Request In a TransactionThe Simplest Views8.3.1Be Conservative with Decorators978.3.2Additional Resources on Decorators9898988.4Passing the HttpResponse object8.5Summary . . . . . . . . . . . . .vzz

Contents9Best Practices for Class-Based Views999.1Guidelines When Working With CBVs1009.2Using Mixins With CBVs. . . . . . . .1009.3Which Django GCBV Should Be Used for What Task? .1029.4General Tips for Django CBVs . . . . . . . . . . . . . .1039.59.4.1Constraining Django CBV/GCBV Access to Authenticated Users9.4.2Performing Custom Actions on Views With Valid Forms .1049.4.3Performing Custom Actions on Views With Invalid Forms9.4.4Using the View Object . . . .105106How GCBVs and Forms Fit Together1041089.5.1Views ModelForm Example9.5.2Views Form Example . . .1091139.6Using Just django.views.generic.View1159.7Additional Resources9.8Summary . . . . . . .11711810 Common Patterns for Forms119The Power ofDjango Forms . . . . . . . . . . . . . . .11910.2Pattern 1: Simple ModelForm With Default Validators12010.3Pattern 2: Custom Form Field Validators in ModelForms12110.4Pattern 3: Overriding the Clean Stage of Validation . .12610.5Pattern 4: Hacking Form Fields (2 CBVs, 2 Forms, 1 Model)12910.6Pattern 5: Reusable Search Mixin View .13310.7Summary . . . . . . . . . . . .13510.111 More Things to Know About Forms11.1Use the POST Method in HTML Forms138Know How Form Validation Works . . . . . . . .13811.2.111.3Form Data Is Saved to the Form, Then the Model InstanceSummary . . . . . .12 Templates: Best Practices13914114312.1Follow a Minimalist Approach14312.2Template Architecture Patterns14412.2.1Vttt137Don't Disable Django's CSRF Protection.11.1.111.21372-Tier Template Architecture Example .144

Contents120312.2.23-Tier Template Architecture Example 014412.2.3Flat Is Better Than Nested 0 0 0 0 0145000000000146120301Limit Processing in TemplatesGotcha 1: Aggregation in Templates 0 01481203.2Gotcha 2: Filtering With Conditionals in Templates150120303Gotcha 3: Complex Implied Qleries in Templates 01521203.4Gotcha 4: Hidden CPU Load in Templates 0 0 015412.305Gotcha 5: Hidden REST API Calls in Templates15412.4Don't Bother Making Your Generated HTML Pretty15512.5Exploring Template Inheritance 0 0 0 0 01561206block. super Gives the Power of Control 0 0 0 0 0 0 0 0159120 7Useful Things to Consider 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0161120701Avoid Coupling Styles Too Tightly to Python Code 0161120702Common Conventions 0 0 0 0162120703Location, Location, Location! 0 0 0 0 0 0 0 01621207.4Use Named Context Objects 0 0 0 0 0 0 0 0 01621207.5Use URL Names Instead ofHardcoded Paths163120706Debugging Complex Templates164120707Don't Replace the Django Template Engine0000001641208Error Page Templates1641209Summary 0 0 0 0 0 016516713 Template Tags and Filters130113.2Filters Are Functions1671301.1Filters Are Easy to Test 0 0 0 0 0 0 0 01681301.2Filters, Code Reuse, and Performance1681301.3When to Write Filters00000000169Custom Template Tags 0 0 0 0 0 0 0 0 0 0 0 016913.201Template Tags Are Harder To Debug169130202Template Tags Make Code Reuse Harder169130203The Performance Cost ofTemplate Tags1691302.4When to Write Template Tags1701711711721721303Naming Your Template Tag Libraries 0 0 0 0 0 013.4Loading Your Template Tag Modules 0 0 0 0 0 013.40113.5Watch Out for This Crazy Anti-PatternSummary 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0ix

Contents14 Building REST APis175Fundamentals ofBasic REST API Design17614.2Implementing a SimpleJSON API . . . .17814.3REST API Architecture . . . . . . . . . .18014.114.414.3.1Code for an App Should Remain in the App .18014.3.2Try to Keep Business Logic Out of API Views18014.3.3Grouping API URLs18114.3.4Test Your API . . . .18314.3.5Version Your API .183Evaluating REST Frameworks. 18314.4.1How Much Boilerplate Do You Want to Write? .18414.4.2Are Remote Procedure Calls Easy to Implement?18414.4.3CBVs or FBVs?18414.5Additional Reading18514.6Summary . . . . . .18515 Consuming REST APis in Templates18715.1Learn How to Debug the Client15.2Consider UsingJavaScript-Powered Static Asset Preprocessors18815.3Making Content Indexable by Search Engines . .18915.3.1Hand-Craft the sitemap.xml . . . . . . . .18915.3.2Use a Service to Make Your Site Crawlable19015.3.3Wait for Search Engines to Figure It Out .190Real-Time Woes a.k.a. Latency . . . . . . . . . . .19015.415.515.615 .4.1Solution: Mask the Latency with Animations19115.4.2Solution: Fake Successful Transactions .19115.4.3Solution: Geographically Based Servers19115.4.4Solution: Restrict Users Geographically192192Avoid the Anti-Patterns . . . . . . . . . . . . .15.5.1Building Single Page Apps When Multi-Page Apps Suffice .19215.5.2Not Writing Tests . . . . . . . . . . . . . . . . . . .19215.5.3Not UnderstandingJavaScript Memory Management19315.5.4Storing Data in the DOM When It's Not j(@ery193AJAX and the CSRF Token aScript Skills195

Contents)33150701Assessing Skill Levels 0 0 0 01951507.2Learn MoreJavaScript! 0 0 01951508Follow Javascript Coding Standards 01951509Django andJavascriptTutorials19615010 Summary 0 0 0 0 0 0 0 o 0 0 0 019616 Tradeoffs of Replacing Core Components1971601The Temptation to Build FrankenDjango 0 0 0 0 0 0 019816.2Case Study: Replacing the Django Template Engine 0199199316.201Excuses, Excuses4160202What if I'm Hitting the Limits ofTemplates?199416.203What About My Unusual Use Case? 0 0 0 02004160316.4201201Non-Relational Databases vso Relational Databases160301)0 0 0 0 0 0 0 0 0 0 0 0 0 0 0Understand ACID0000000000000160302Don't Use Non-Relational Databases for Relational Tasks 0202160303Ignore the Hype and Do Your Own Research 0 0 0 0 020216.3.4How We Use Non-Relational Databases With Django202Summary 0 0 0 0 0 0 0 0 0 0 020317 Working With the Django Admin2051701It's Not for End Users 0 0 0 02061702Admin Customization vso New Views2061703Viewing String Representations of Objects20617.4Adding Callables to ModelAdmin Classes210117.5Don't Use lisLeditable in Multiuser Environments21111706Django's Admin Documentation Generator1707Securing the Django Admin and Django Admin Docs1708Using Custom Skins with the Django Admin1709212000213000000213170801Evaluation Point: Documentation is Everything214170802Write Tests for Any Admin Extensions You Create214Summary 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0215318 Dealing With the User Model31801217Use Django's Tools for Finding the User Model 0 0 0 0 0 0 0 0 0 0 0 0 0)1801.1Use settingsoAUTH USERMODEL for Foreign Keys to User)1801.2Don't Use get user model() for Foreign Keys to User000000217218218xz

Contents18.2Migrating Prc-1.5 User models to 1.5 's Custom User Models18.3Custom User Fields for Django 1.6 Projects .18.418.3.1Option 1: Subclass AbstractUser . . .18.3.2Option 2: Subclass AbstractBaseUser .18.3.3Option 3: Linking Back From a Related Model000219219220221221Summary . . . . . . . . . . . . . . . .22319 Django's Secret Sauce: 'Third-Party Packages22519.1Examples ofThird-Party Packages . . .22619.2Know About the Python Package Index22619.3Know About DjangoPackages.com . . .19.4Know Your Resources . . . . . . . . . .19.5Tools for Installing and Managing Packages19.6Package Requirements . . . . . . . . . . . .22819.7Wiring Up Django Packages: The Basics .22800022722719.7.1Step 1: Read the Documentation for the Package19.7.2Step 2: Add Package and Version Number to Your Requirements. 22819.7.3Step 3: Install the Requirements Into Your Virtualenv . . . . 22919.7.4Step 4: Follow the Package's Installation Instructions Exactly23022819.8Troubleshooting Third-Party Packages23019.9Releasing Your Own Django Packages23019.10 What Makes a Good Package?19.10.1 Purpose . . . .231023119.10.2 Scope . . . . .23219.10.3 Documentation23219.10.4 Tests . . . .23219.10.5 Activity .23219.10.6 Community23319.10.7 Modularity19.10.8 Availability on PyPI .xii2270023323319.10.9 Uses the Broadest Requirements Specifiers Possible23319.10.10 Proper Version Numbers23519.10.11 Name . . . . .19.10.12 License . . . . . . . .23623619.10.13 Clarity of Code . . . .23719.10.14 Use URL Namespaces237

Contents)19.11 Creating Your Own Packages the Easy Way23719.12 Maintaining Your Open-Source Package238)5777319.12.1 Give Credit for Pull Requests .23919.12.2 Handling Bad Pull Requests .23919.12.3 Do Formal PyPI Releases . . .24019.12.4 Create and Deploy Wheels to PyPI24119.12.5 Upgrade the Package to New Versions ofDjango24219.12.6 Follow Good Security Practices .24219.12.7 Provide Sample Base Templates24319.12.8 Give the Package Away .24319.13 Additional Reading24319.14 Summary . . . . . .24420 Testing Stinks and Is a Waste ofMoney!24520.1Testing Saves Money, Jobs, and Lives .245820.2How to Structure Tests .246820.3How to Write Unit Tests24720.3.1Each Test Method Tests One Thing247D20.3.2For Views, When Possible Use the Request Factory250D20.3.3Don't Write Tests That Have to Be Tested . . . . .250020.3.4Don't Repeat Yourself Doesn't Apply to Writing Tests .250120.3.5Don't Rely on Fixtures. . . . . . .251120.3.6Things That Should Be Tested . . .251220.3.7Document the Purpose of Each Test253220.4Continuous Integration . . . . . . . . . . .253220.5Who Cares? We Don't Have Time for Tests!253220.6The Game ofTest Coverage . . . . .3320.7Setting Up the Test Coverage Game3356254. 25420. 7.1Step 1: Start Writing Tests .25420.7.2Step 2: Run Tests and Generate Coverage Report25420.7.3Step 3: Generate the report!25520.8Playing the Game ofTest Coverage .25620.9Summary . . . . . . . . . . . . . . .25667721 Documentation: Be Obsessed21.1Use reStructuredText for Python Docs257257Xlll

Contents. 25921.2Use Sphinx to Generate Documentation From reStructuredText .21.3What Docs Should Django Projects Contain?26021.4Additional Documentation Resources . . . .26121.5The Markdown Alternative . . . . . . . . .26121.6Wikis and Other Documentation Methods .26221.7Summary . . . . . . . . . . .26222 Finding and Reducing Bottlenecks26322.1Should You Even Care? . . .26322.2Speed Up Q!ery-Heavy Pages . . . . . . . . . . . . .; . .26322.326322.2.1Find Excessive Qyeries With Django Debug Toolbar22.2.2Reduce the Number of Qyeries . . . . . . 26422.2.3Speed Up Common Qyeries . . . . . . .26522.2.4Switch ATOMic REQUESTS to False .266Get the Most Out of Your Database . . . . . . .266Know What Doesn't Belong in the Database .26722.3.2Getting the Most Out of PostgreSQ!.,26722.3.3Getting the Most Out ofMySQ!.,26822.4Cache Qyeries With Memcached or Redis26822.5IdentifY Specific Places to Cache . . . . .26822.6Consider Third-Party Caching Packages .26922.7Compression and Minification ofHTML, CSS, andJavaScript26922.8Use Upstream Caching or a Content Delivery Network27022.9Other Resources27022.10 Summary . . . .27122.3.123 Security Best Practices27323.1Harden Your Servers . 27323.2Know Django's Security Features . . . . 27323.3Turn Off DEBUG Mode in Production. 27423.4Keep Your Secret Keys Secret. 27423.5HTTPS Everywhere. . . . . . . . . . 27423.5.1Use Secure Cookies . . . . . . .27623.5.2Use HTTP Strict Transport Security (HSTS)27623.6Use Django 1.6's Allowed Hosts Validation . . . . . .27723.7Always Use CSRF Protection With HTTP Forms That ModifY Data . 277

Contents)PostingDataviaAJAX . . . . . . . . . . . 278Prevent Against Cross-Site Scripting (XSS) Attacks. 27923.8.1Use Django Templates Over mark safe . . . 27923.8.2Don't Allow Users to Set Individual HTML Tag Attributes . 279223.8.3Use JSON Encoding for Data Consumed by J avaScript. 279223.8.4Additional Reading . . . . . . . . . . . 279)23.7.123.8l23.9333456677888990'0'1'3'3Defend Against Python Code Injection Attacks. 28023.9.1Python Built-ins That Execute Code .28023.9.2Python Standard Library Modules That Can Execute Code .28023.9.3Third-Party Libraries That Can Execute Code23.9.4Be Careful with Cookie-Based Sessions. 28128123.10 Validate All Incoming Data With Django Forms.28223.11 Disable the Autocomplete On Payment Fields28523.12 Handle User-Uploaded Files Carefully .28523.12.1 When a CDN Is Not An Option .28523.12.2 Django and User-Uploaded Files .28623.13 Don't Use ModelForms.Meta.exclude . . .28723.13.1 Mass Assignment Vulnerabilities . 28923.14 Don't Use ModelForms.Meta.fields " all ". 28923.15 Beware ofS Injection Attacks. 29023.16 Never Store Credit Card Data . 29023.17 Secure the Django Admin . . . 29123.17.1 Change the Default Admin URL . 29123.17.2 Use django-admin-honeypot . . . 29123.17.3 Only Allow Admin Access via HTTPS. 29123.17.4 Limit Admin Access Based on IP. 292. . .23.17.5 Use the allow tags Attribute With Caution. 292'323.18 Secure the Admin Docs. 292'4-23.19 Monitor Your Sites. 293'423.20 Keep Your Dependencies Up-to-Date'423.21 Prevent Clickjacking . . . . . . . . . .293'6'6'77723.22 Guard against XML Bombing With defusedxml .29323.23 Give Your Site a Security Checkup . . . . . . . .29423.24 Put Up a Vulnerability Reporting Page . . . . . .29423.25 Have a Plan Ready For When Things Go Wrong. 293. 294XV

Contents23.25.1 Shut Everything Down or Put It in Read-Only Mode .29523.25.2 Put Up a Static HTML Page . . . . . . . . . . . . . .29523.25.3 Back Everything Up296. . . .23.25.4 Email security@djangoproject.com, Even iflt's Your Fault29623.25.5 Start Looking Into the Problem . . . .29723.26 Keep Up-to-Date on General Security Practices29723.27 Summary . . . . . . . . . . . . . . . . . . . . .29824 Logging: What's It For, Anyway?29924.1Application Logs vs. Other Logs29924.2Why Bother With Logging? . .30024.3When to Use Each Log Level . .30024.3.1Log Catastrophes With CRITICAL .30124.3.2Log Production Errors With ERROR30124.3.3Log Lower-Priority Problems With WARNING30224.3.4Log Useful State Information With INFO .30324.3.5Log Debug-Related Messages to DEBUG .30324.4Log Tracebacks When Catching Exceptions30524.5One Logger Per Module That Uses Logging30624.6Log Locally to Rotating Files30624.7Other Logging Tips . . . . .30724.8Necessary Reading Material .24.9Useful Third-Party Tools30830824.10 Summary . . . . . . . . .30825 Signals: Use Cases and Avoidance Techniques25.125.225.3When to Use and Avoid Signals.Signal Avoidance Techniques . . . . . . . . . . . . . . . . . . . . .30931025 .2.1Using Custom Model Manager Methods Instead of Signals .31025.2.2Validate Your Model Elsewhere . . . . . . . . . . . . .31325.2.3Override Your Model's Save or Delete Method Instead31325.2.4Use a Helper Function Instead of Signals .313Summary . . . . . . . . . . . . .26 What About Those Random Utilities?26.1309Create a Core App for Your Utilities314315315

Contents26.2Django's Own Swiss Army Knife . . . . . . .31626.2.1django.contrib.humanize . . . . . . .31726.2.2django.utils.encoding.force text(value)31726.2.3django.utils.functional.cached property .31726.2.4django.utils.html.format html(formaLstr, *args, **kwargs)31826.2.5django.utils.html.remove tags(value, tags)31826.2.6django.utils.html.strip tags(value) .26.2.7django.utils.six . . . . . . . . .318318J26.2.8django.utils.text.slugifY(value) .319J26.2.9django.utils.timezone ., .320)26.2.10 django.utils. translation .320Exceptions . . . . . . . . . . . .321)26.3l26.3 .1dj 3django.core.exceptions.PermissionDenied .322Serializers and Deserializers . . . . . . . . . . . . yaml . . . .32626.4.3django.core.serializers.xml serializer326626.5Summary . . . . . . . . . . . . . . . . . . .3277827 Deployment: Platforms as a Service27.1Evaluating a PaaS 7.1.6Documentation333327.1.7Performance Degradation .333l327.1.8Geography . . . . . . . .334L327.1.9Company Stability . . . .l4L5t527.2Best Practices for Deploying to PaaS33433527.2.1Aim For Identical Environments33527.2.2Automate All the Things! . .33527.2.3Maintain a Staging Instance336xvu

-Contents27.327.2.4Prepare for Disaster With Backups And Rollbacks .33627.2.5Keep External Backups336336Summary . . . . . . .33928 Deploying Django Projects28.1Single-Server For Small Projects33928.2Multi-Server For Medium to Large Projects34028.328.428.528.2.1Basic Multi-Server Setup . . .34028.2.2Advanced Multi-Server Setup341WSGI Application Servers . . . . . .29.234528.3.1uWSGI and Django28.3.2Apache and Environment Variables .34528.3.3Apache and Virtualenv . . . . .346Automated, Repeatable Deployments . .346.28.4.1Infrastructure Automation Tools34728.4.2SaltStack35028.4.3Ansible352Summary . . . .29 Identical Environments: The Holy Grail29.1343The Present: Vagrant . . . . . . .35235335429.1.1Advantages ofVagrant .35429.1.2Disadvantages ofVagrant35529.1.3Vagrant Resources . .355Experimental: Docker . . . . .35529.2.1Advantages of Docker.35529.2.2Warning: Docker Is Under Heavy D evelopment .35629.2.3Docker Resources356Summary . . . . .35630 Continuous Integration35729.330.130.2Principles of Continuous Integration30.1.1Write Lots ofTests! .35830.1.2Keeping the Build Fast358Tools for Continuously Integrating your Project30.2.1XVUt358Tox. .359359

ContentsJenkins . . . . . . . . . . . .36030.330.2.2Continuous Integration as a Service .36030.4Additional Resources36030.5Summary . . . . . . .361:9·931 Where and HowtoAskDjango Questions3631031.1What to Do When You're Stuck .3631031.2How to Ask Great Django Qyestions in IRC363 31.3Insider Tip: Be Active in the Community36431.3.113151531.410 Easy Ways to Participate .Summary .36436632 Closing Thoughts367Appendix A: Packages Mentioned In This Book369jQAppendix B: Troubleshooting375i2IdentifYing the Issue . . . .375i2Our Recommended Solutions .37516 617Check Your Virtualenv Installation .376;3Check If Your Virtualenv Has Django 1.6 Installed37754Check For Other Problems377Appendix C: Additional Resources379)4)5555555565656575858585959. . .379Beginner Django Material . . .379More Advanced Django Material .380Useful Python Material381JavaScript Resources382Beginner Python MaterialAppendix D: Internationalization and Localization383Start Early . . . . . . . . . . . . . . . . . . . . .383Wrap Content Strings with Translation Functions384Don't Interpolate Words in Sentences385Browser Page Layout . . . . . .388Appendix E: Settings AlternativesTwelve Factor-Style Settings . .391391XtX

ContentsMultiple Settings with Configuration Objects392Resources . . .395395397397398Acknowledgments399Index403Appendix F: Working with Python 3Most Critical Packages Work with Python 3Use Python 3.3.3 or Later . . .Working With Python 2 and 3

Start With Django By Default 0 0 0 0 0 0 0 0 0 Be Familiar with Django's Design Philosophies The Twelve Factor App 0 0 Our Writing Concepts 0 0 0 0 0 Provide the Best Material 0 Stand on the Shoulders of Giants 0 Listen to Our Readers and Reviewers in xxi xxiv xxvii 0 xxvii 0 xxviii 0 xxix xxxi 0 x:xxi . xxxii 0 xxx .

Related Documents:

Arthroscopy Instruments Arthroscopy Punches (con't) Basket Punches - Scoop 106-424123130 Basket Punch Scoop, Straight 1.0mm 106-424123151 Basket Punch Scoop, Curved left 1.3mm 106-424123152 Basket Punch Scoop, Curved right 1.3mm 106-424123141 Basket Punch Scoop, Upbiter 1.3mm 106-424123153 Basket Punch Scoop, Upbiter curved left 1.3mm

AIR SCOOP DUCT OPENING NOM. LENGTH Duct Dia. 34681012 x 6 x 8 xxx 10 xxxx 12 xxxxx 14 xxxxxx 16 xxxxxx 18 xxxxxx 20 xxxxxx 22 xxxxxx 24 xxxxxx 26 xxxxxx 28 xxxxxx 30 xxxxxx 32 xxxxxx 36 xxxxxx Nom. Widths Available Sizes AIR SCOOP (CABLE OPERATOR) OPTIONAL AIR SCOOP DAMPER OPTIONS: AS: AIR SCOOP (ROD OPERATOR) ASC: AIR SCOOP (CABLE OPERATOR)

1 Scoop US 4.00 / 2 Scoop US 8.00 / 3 Scoop US 12.00 QUERIDO ARTESANO ICE CREAM Mexican Dark Chocolate / American Vanilla / Pistachio / Coconut QUERIDO ARTESANO SORBET Mango / Papaya And Pink Guava Sorbet / Water Melon Sorbet / Mix Berry Sorbet Prices are quoted in US Dollars and subject

Note: If cooking white rice, use the included Measuring Scoop. Do not use a standard measuring cup. Scoop desired amount of white rice into the Pot, rinse, and then fill the Pot with water to the line that corresponds to the number of scoops of white rice being cooked. For example, if you place ½ Measuring Scoop of rice into the Pot, fill the

Mar 19, 2020 · Scooped ICE CREAM (Served in a cup or cake cone) Kid’s scoop, One scoop, Two scoops Pints Quarts Additional cones: waffle .

ice-cream scoop waxed paper make one Scoop the ice cream onto one cookie; then top it with the other cookie. Gently press the two cookies together to squeeze the ice cream to the edge. Roll the edge of the cookie sandwich in a layer of chocolate sprinkles. Arctic cream pie: Freeze the Arctic

May 04, 2016 · Ice cream! An ice cream parlor has n different flavors available. How many ways are there to order a two-scoop ice cream cone (where you specify which scoop goes on bottom and w

10. Efrain Balli Jr. 23. Madelynn Cortez 36. Alfredo Avila Lopez . 11 . Eligio Meudiola 24. George Garcia 37. Jesus Ruben Briseno . 12. Natalia Quintero Moreno 25. Diego Gonzalez Corpus 38. Juan E. Vela . NUMBER OF VOTES RECEIVED -49 . ELECTORS FOR TOM HOEFLING . 1. Tim Sedgwick 2. Dixie Sedgwick 3. Jared McCurrin 4. Jessica Kimberly Fagin 5. Andrew C. Sanders 6. Megan Sanders 7. Lynn Sanders .