• Complain

Daniel Rubio - Beginning Django: Web Application Development and Deployment with Python

Here you can read online Daniel Rubio - Beginning Django: Web Application Development and Deployment with Python full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. year: 2017, publisher: Apress, genre: Computer. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:

Romance novel Science fiction Adventure Detective Science History Home and family Prose Art Politics Computer Non-fiction Religion Business Children Humor

Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.

Daniel Rubio Beginning Django: Web Application Development and Deployment with Python
  • Book:
    Beginning Django: Web Application Development and Deployment with Python
  • Author:
  • Publisher:
    Apress
  • Genre:
  • Year:
    2017
  • Rating:
    4 / 5
  • Favourites:
    Add to favourites
  • Your mark:
    • 80
    • 1
    • 2
    • 3
    • 4
    • 5

Beginning Django: Web Application Development and Deployment with Python: summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "Beginning Django: Web Application Development and Deployment with Python" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

Discover the Django web application framework and get started building Python-based web applications. This book takes you from the basics of Django all the way through to cutting-edge topics such as creating RESTful applications. Beginning Django also covers ancillary, but essential, development topics, including configuration settings, static resource management, logging, debugging, and email. Along with material on data access with SQL queries, youll have all you need to get up and running with Django 1.11 LTS, which is compatible with Python 2 and Python 3.

Once youve built your web application, youll need to be the admin, so the next part of the book covers how to enforce permission management with users and groups. This technique allows you to restrict access to URLs and content, giving you total control of your data. In addition, youll work with and customize the Django admin site, which provides access to a Django projects data.

After reading and using this book, youll be able to build a Django application top to bottom and be ready to move on to more advanced or complex Django application development.

What Youll Learn

  • Get started with the Django framework

  • Use Django views, class-based views, URLs, middleware, forms, templates, and Jinja templates

  • Take advantage of Django models, including model relationships, migrations, queries, and forms

  • Leverage the Django admin site to get access to the database used by a Django project

  • Deploy Django REST services to serve as the data backbone for mobile, IoT, and SaaS systems

Who This Book Is For

Python developers new to the Django web application development framework and web developers new to Python and Django.

Daniel Rubio: author's other books


Who wrote Beginning Django: Web Application Development and Deployment with Python? Find out the surname, the name of the author of the book and a list of all author's works by series.

Beginning Django: Web Application Development and Deployment with Python — read online for free the complete book (whole text) full work

Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "Beginning Django: Web Application Development and Deployment with Python" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.

Light

Font size:

Reset

Interval:

Bookmark:

Make
Daniel Rubio 2017
Daniel Rubio Beginning Django
1. Introduction to the Django Framework
Daniel Rubio 1
(1)
F. Bahia, Ensenada, Baja California, Mexico
The Django framework started in 2003, as a project done by Adrian Holovaty and Simon Willison at the Journal-World newspaper in Lawrence, Kansas, in the United States. In 2005, Holovaty and Willison released the first public version of the framework, naming it after the Belgian-French guitarist Django Reinhardt.
Fast forward to 2017 the Django framework now operates under the guidance of the Django Software Foundation (DSF) , the framework core has over 1000 contributors with more than 15 release versions, and there are over 3000 packages specifically designed to work with the Django framework.
The Django framework has remained true to its origins as a Model-View-Controller (MVC) server-side framework designed to operate with relational databases. Nevertheless, Django has stayed up to date with most web development tendencies via third-party packages to operate alongside technologies like non-relational databases (NoSQL) , real-time Internet communication, and modern JavaScript practices. All this to the point, the Django framework is now the web development framework of choice for a wide array of organizations, including the photo sharing sites Instagram; and with the help of this book, your organization!
In this chapter youll learn about the Django framework design principles, which are key to understanding the day-to-day aspects of working with the Django framework. Next, youll learn how to install Django in various ways: as a tar.gz file, with pip, using git, and with virtualenv.
Once you install the Django framework, youll learn how to start a Django project and how to set it up with a relational database. Next, youll learn about the core building blocks in the Django framework urls, templates, and apps and how they work with one another to set up content. Finally, youll learn how to set up the Django admin site, which is a web-based interface designed to access the relational database connected to a Django project.
Django Framework Design Principles
If you work long enough in web development, youll eventually come to the conclusion that you can produce the same results with just about any web framework and programming language. But while you can, in fact, produce identical results, what will vary drastically is the time you spend creating a solution: the time creating a prototype, the time adding new features, the time doing testing, the time doing debugging, and the time deploying to scale, among other things.
In this sense, the Django framework uses a set of design principles that produces one of the most productive web development processes compared to many other web frameworks. Note, Im not saying Django is a silver bullet (e.g., the best at prototyping, the most scalable); Im saying that at the end of the day, the Django framework incorporates a set of design principles and trade-offs that make it one of the most productive frameworks for building the features needed by most medium to large web applications.
Now, while you might think Im biased after all Im writing an entire book about the topic Ill lay out these design principles first, so you can gain a better understanding of what gives the Django framework this edge.
Dont Repeat Yourself (DRY) Principle
Repetition might be good to emphasize a point, but when it comes to web development, it just leads to additional and time-consuming work. In fact, the very nature of web development, which operates across multiple tiers interacting with one another (e.g., HTML templates, business logic methods, and databases), lends itself to repetition.
The Django framework really tries to force you not to repeat yourself, so lets see how Django enforces not repeating yourself and why this is a good thing.
Lets say you want to build a coffeehouse application to publish information about stores and also have a contact form for customers. The first thing youll need to do is determine what kind of information is required for stores and the contact form. Figure illustrates a mock-up of two Django models for each of these entities.
Figure 1-1 Django models for store and contact entities Notice how the - photo 1
Figure 1-1.
Django models for store and contact entities
Notice how the Django models in Figure each have different field names and a data type to restrict values. For example, the statement name = models.CharField(max_length=30) tells Django a store name should have a maximum of 30 characters, while the statement email = models.EmailField() tells Django the contact entity should contain a valid email value. If the coffeehouse is like most web applications, youll generally end up doing the following for the store and contact entities:
  • Create relational database tables to save entity information.
  • Create business logic to ensure the entities comply with requirements.
  • Create HTML forms to allow data to be submitted for the entities.
  • Create an interface to allow administrative users to access entities in the database.
  • Create REST services to expose entities for a mobile app version.
The crux of doing this last task list is you have the potential of repeating dozens of similar pieces of information (e.g., names, value limits) in database definition language (DDL), HTML forms, business validation logic, and URLs, among other things process thats not only time consuming, but also error prone.
Wouldnt it be easier that based on a statement like models.CharField(max_length=30) you could generate an HTML form input, a DDL statement, and automatically validate information to only contain 30 characters? This is exactly what Djangos DRY design principle does.
Figure and the various constructs you can generate from the same models without the need to repeat yourself.
Figure 1-2 Django models create separate constructs based on DRY principle - photo 2
Figure 1-2.
Django models create separate constructs based on DRY principle
As you can see in Figure , the entities that represent Django models are capable of generating HTML forms to present to the public, an administrative interface to manage the entities, validation logic to enforce entity values, as well as the DDL to generate database tables representing the entities.
While its a little premature to discuss the actual techniques to generate such constructs from Django models, needless to say its much simpler than keeping track of multiple references of the same thing (e.g., name, email) in HTML forms, DDL, validation logic, and other locations.
In this sense, Django really helps you define things in a single place and not have to repeat them elsewhere. Note that its always possible to repeat yourself to obtain custom behaviors, but by default, Django enforces DRY principles in nearly everything you do with it.
Explicit Is Better Than Implicit
Python, the programming language used by Django, has a mantra-like statement called The Zen of Python defined as part of the languages Python Enhancement Proposals (PEP) , specifically PEP 20. One of the statements in PEP 20 states Explicit is better than implicit and with Django being based on Python, this principle is also taken to heart.
Being explicit leads to web applications that are easily understood and maintained by a greater number of people. Adding new features or understanding the logic behind a web application can be hard enough for someone that didnt write it originally, but if you toss into the mix constructs that have implicit behaviors, users only face greater frustration trying to figure out whats being done implicitly. Explicit does require a little more work typing, but its well worth it when you compare it to the potential effort you can face trying to debug or solve a problem.
Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «Beginning Django: Web Application Development and Deployment with Python»

Look at similar books to Beginning Django: Web Application Development and Deployment with Python. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.


Reviews about «Beginning Django: Web Application Development and Deployment with Python»

Discussion, reviews of the book Beginning Django: Web Application Development and Deployment with Python and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.