Mastering Django.
About This BookGain a complete understanding of Django-the most popular, Python-based web framework in the worldGain the skills to successfully designing, developing, and deploying your appThis book is packaged with fully described code so you can learn the fundamentals and the advanced topics to ge...
Clasificación: | Libro Electrónico |
---|---|
Autor principal: | |
Formato: | Electrónico eBook |
Idioma: | Inglés |
Publicado: |
Birmingham :
Packt Publishing,
2016.
|
Temas: | |
Acceso en línea: | Texto completo |
Tabla de Contenidos:
- Cover; Copyright; Credits; About the Author; www.PacktPub.com; Table of Contents; Preface; Chapter 1: Introduction to Django and Getting Started; Introducing Django; Django's history; Installing Django; Installing Python; Python versions; Installation; Installing a Python Virtual Environment; Installing Django; Setting up a database; Starting a project; Django settings; The development server; The Model-View-Controller (MVC) design pattern; What's next?; Chapter 2: Views and URLconfs; Your first Django-powered page: Hello World; Your first view; Your first URLconf; Regular expressions.
- A quick note about 404 errorsA quick note about the site root; How Django processes a request; Your second view: dynamic content; URLconfs and loose coupling; Your third view: dynamic URLs; Django's pretty error pages; What's next?; Chapter 3: Templates; Template system basics; Using the template system; Creating template objects; Rendering a template; Dictionaries and contexts; Multiple contexts, same template; Context variable lookup; Method call behavior; How invalid variables are handled; Basic template-tags and filters; Tags; if/else; for; ifequal/ifnotequal; Comments; Filters.
- Philosophies and limitationsUsing templates in views; Template loading; Template directories; render(); Template subdirectories; The include template tag; Template inheritance; What's next?; Chapter 4: Models; The "dumb" way to do database queries in views; Configuring the database; Your first app; Defining Models in Python; Your first model; Installing the Model; Basic data access; Adding model string representations; Inserting and updating data; Selecting objects; Filtering data; Retrieving single objects; Ordering data; Chaining lookups; Slicing data.
- Updating multiple objects in one statementDeleting objects; What's next?; Chapter 5: The Django Admin Site; Using the admin site; Start the development server; Enter the admin site; Adding your models to the admin site; Making fields optional; Making date and numeric fields optional; Customizing field labels; Custom model admin classes; Customizing change lists; Customizing edit forms; Users, groups, and permissions; When and why to use the admin interface-and when not to; What's next?; Chapter 6: Forms; Getting data from the Request Object; Information about the URL.
- Other information about the RequestInformation about submitted data; A simple form-handling example; Query string parameters; Improving our simple form-handling example; Simple validation; Making a contact form; Your first form class; Tying form objects into views; Changing how fields are rendered; Setting a maximum length; Setting initial values; Custom validation rules; Specifying labels; Customizing form design; What's next?; Chapter 7: Advanced Views and URLconfs; URLconf Tips and Tricks; Streamlining function imports; Special-Casing URLs in debug mode; Named groupsPreview.