Django for beginners 2.1

所需积分/C币:50 2018-11-12 23:58:48 7.1MB PDF
收藏 收藏
举报

django python 3 .
Also By William S. vincent REST APIS with django Contents Introduction Why django Why this book Book structure Book layout Conclusion Chapter 1: Initial Set up 2345788 The command line Install Python 3 on Mac Os X(click here for Windows or Linux 11 Install Python 3 on Windows Install Python 3 on Linux Virtual environments Install diango 16 Install git 20 Text editors Conclusion Chapter 2: Hello World app 22 Initial Set UI P 22 Create an app 25 Views and uRlConfs 27 Hello, world 31 CONTENTS Git Bitbucket 33 Conclusion 38 Chapter 3: Pages app 39 Initial Set Up 39 Templates 42 Class-Based views 44 URLS 45 Add an about page 47 Extending Templates 49 Tests 52 Git and bitbucket 54 Localⅴ s Production Heroku Additional files 59 Deploy 61 Conclusion 64 Chapter 4: Message Board app 65 Initial Set Up 65 Create a database model 68 Activating models 69 Django admin Views/Templates/URLs Adding new posts Tests 84 Bitbucket 89 Heroku configuration 90 Heroku deployment 92 CONTENTS Conclusion 93 Chapter 5: Blog app 95 Initial Set Up 95 Database models 97 admin 99 URLS 104 Views 105 Templates 106 Static files 109 Individual blog pages 114 Tests 119 Git 122 Conclusion 122 Chapter 6: Forms 124 Forms 124 Update Form 133 DeleteⅤie 139 Tests 145 Conclusion 148 Chapter 7: User Accounts 150 Log 150 Updated homepage 153 Log out link 155 Sign up 158 Bitbucket 163 Heroku config 164 Heroku deployment 166 CONTENTS Conclusion 170 Chapter 8: Custom User Model Set u Custom user mod 173 Forms 176 Superuser 179 Conclusion 182 Chapter 9: User Authentication 183 Templates 183 URLS 187 Admin 192 Conclusion 196 Chapter 10: Bootstrap 197 Pages app 197 Tests 201 Bootstrap 204 Sign Up Form 213 Next Steps 219 Chapter 11: Password Change and Reset 220 Password Change 220 Customizing password change 222 Password reset 225 Custom Templates 229 Conclusion 233 Chapter 12: Email 234 Sendgrid 234 CONTENTS Custom emails 246 Conclusion 251 Chapter 13: Newspaper app 252 Articles app 252 URLs and views 258 Edit/ dele 263 Create page 270 Conclusion 278 Chapter 14: Permissions and authorization 279 Improved createView 279 authorizations 281 Mixins 283 LoginRequiredMixin 286 Updateview and deleteview 288 Conclusion 290 Chapter 15: Comments 291 Model 291 Admin 293 Templat 300 Conclusion 305 Conclusion 306 Open source resources 307 Django resources 308 Python books 308 Blogs to Follow 309 Feedback 309 Introduction Welcome to Django for beginners a project-based approach to learning web devel opment with the Django web framework. In this book you will build five progressively more complex web applications, starting with a simple " Hello, World"app, progressing to a blog app with forms and user accounts, and finally a newspaper app using a custom user model, email integration, foreign keys, authorization, permissions, and more By the end of this book you should feel confident creating your own Django projects from scratch using current best practices Django is a free, open source web framework written in the Python programming language and used by millions of programmers every year Its popularity is due to its friendliness to both beginners and advanced programmers: Django is robust enough to be used by the largest websites in the world-Instagram, Interest, Bitbucket, Disqus-but also flexible enough to be a good choice for early-stage startups and prototyping personal projects This book is regularly updated and features the latest versions of both Django(2.1 )and Python(3.7x). It also uses Pipenv which is now the officially recommended package manager by Python.org for managing Python packages and virtual environments Throughout we'll be using modern best practices from the django, Python, and web development communities, especially the thorough use of testing Introduction 2 Why django a web framework is a collection of modular tools that abstracts away much of the difficulty-and repetition -inherent in web development. For example, most websites need the same basic functionality the ability to connect to a database, set UrL routes, display content on a page, handle security properly, and so on. Rather than recreate all of this from scratch, programmers over the years have created web frameworks in all the major programming languages: Django and Flask in Python, Rails in Ruby, and Express in JavaScript among many many others jango inherited Python's"batteries-included approach and includes out-of-the box support for common tasks in web development · user authentication templates, routes, and views admin interface · robust secur support for multiple database backends · and much much more This approach makes our job as web developers much, much easier We can focus on what makes our web application unique rather than reinventing the wheel when it comes to standard web application functionality. In contrast, several popular frameworks-most notably Flask in Python and Express in Java Script-adopt a"microframework"approach. They provide only the bare minimum required for a simple web page and leave it up to the developer to install and configure third-party packages to replicate basic website functionality. This approach provides more flexibility to the developer but also yields more opportunities for mistakes

...展开详情
试读 127P Django for beginners 2.1
立即下载 低至0.43元/次 身份认证VIP会员低至7折
    一个资源只可评论一次,评论内容不能少于5个字
    niubi2015 不错,非常好的资源
    2019-02-12
    回复
    关注 私信 TA的资源
    上传资源赚积分,得勋章
    最新推荐
    Django for beginners 2.1 50积分/C币 立即下载
    1/127
    Django for beginners 2.1第1页
    Django for beginners 2.1第2页
    Django for beginners 2.1第3页
    Django for beginners 2.1第4页
    Django for beginners 2.1第5页
    Django for beginners 2.1第6页
    Django for beginners 2.1第7页
    Django for beginners 2.1第8页
    Django for beginners 2.1第9页
    Django for beginners 2.1第10页
    Django for beginners 2.1第11页
    Django for beginners 2.1第12页
    Django for beginners 2.1第13页
    Django for beginners 2.1第14页
    Django for beginners 2.1第15页
    Django for beginners 2.1第16页
    Django for beginners 2.1第17页
    Django for beginners 2.1第18页
    Django for beginners 2.1第19页
    Django for beginners 2.1第20页

    试读已结束,剩余107页未读...

    50积分/C币 立即下载 >