• Complain

Marty Alchin - Pro Django

Here you can read online Marty Alchin - Pro Django full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. year: 2013, publisher: Apress, Berkeley, CA, 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.

Marty Alchin Pro Django
  • Book:
    Pro Django
  • Author:
  • Publisher:
    Apress, Berkeley, CA
  • Genre:
  • Year:
    2013
  • Rating:
    5 / 5
  • Favourites:
    Add to favourites
  • Your mark:
    • 100
    • 1
    • 2
    • 3
    • 4
    • 5

Pro Django: summary, description and annotation

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

Marty Alchin: author's other books


Who wrote Pro Django? Find out the surname, the name of the author of the book and a list of all author's works by series.

Pro Django — 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 "Pro Django" 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
Marty Alchin Pro Django Second Edition 10.1007/978-1-4302-5810-0_1
Apress 2013
1. Understanding Django
Marty Alchin 1
(1)
CA, USA
Abstract
Code alone isnt enough. Sure, its what the computer runs, but code has to come from somewhere. A programmer has to sit down and decide what features to include, how they should be implemented, what other software to utilize, and how to provide hooks for future enhancements to be added. Its easy to skip straight to code, ignoring the cognitive process that produces it, but great programmers always have reasons for the decisions they make.
Code alone isnt enough. Sure, its what the computer runs, but code has to come from somewhere. A programmer has to sit down and decide what features to include, how they should be implemented, what other software to utilize, and how to provide hooks for future enhancements to be added. Its easy to skip straight to code, ignoring the cognitive process that produces it, but great programmers always have reasons for the decisions they make.
With a framework, like Django, many such decisions have already been made, and the tools provided are shaped by these decisions, and by the programmers who made them. By adopting these philosophies in your own code, not only will you be consistent with Django and other applications, but you may even be amazed at what youre able to accomplish.
Beneath even the simplest code is the thought process that went into its creation. Decisions were made about what it should do and how it should do it. This thought process is a step often overlooked in books and manuals, leading to an army of technicians slaving away, writing code that manages to accomplish the task at hand but without a vision for its future.
While the rest of this book will explain in detail the many basic building blocks Django provides for even the most complicated of projects, this chapter will focus on even more fundamental aspects of the framework. For those readers coming from other backgrounds, the ideas presented in this chapter may seem considerably foreign, but that doesnt make them any less important. All programmers working with Python and Django would do well to have a solid understanding of the reasons Django works the way it does, and how those principles can be applied to other projects.
You may want to read this chapter more than once, and perhaps refer to it often as you work with Django. Many of the topics are common knowledge in the Django community, so reading this chapter carefully is essential if you plan to interact with other programmers.
Philosophy
Django relies heavily on philosophy, both in how its code is written and how decisions are made about what goes into the framework. This isnt unique in programming, but its something newcomers often have trouble with. It is essential to maintain both consistency and quality, and having a set of common principles to refer to when making decisions helps maintain both. Since these concepts are also important to individual applications, and even collections of applications, a firm grasp on these philosophies will yield similar benefits.
Perhaps the best-known and most-quoted passage of Python philosophy comes from Tim Peters, a longtime Python guru who wrote down many of the principles that guide Pythons own development process. The 19 lines he came up with, called the Zen of Python, have been so influential to Python programmers over time that they are immortalized as Python Enhancement Proposal (PEP) 20 and in the Python distribution itself, as an Easter egg module called this .
>>> import this
Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!
While some of this is clearly intended for humor, it sums up common Python attitudes pretty well. The remainder of this chapter highlights some specific principles that are often cited within the Django community, but all professional Python programmers should keep this text in mind and reference it often.
One important thing to keep in mind is that many of the lines in the Zen of Python are subjective. For example, beautiful may be better than ugly, but definitions of beautiful are plentiful and can vary as much as the people who provide them. Similarly, consider notions of simplicity and complexity, practicality and purity; each developer will have a different opinion on which side of the line a particular piece of code should be placed.
Djangos Interpretation of the MVC Pattern
One of the most common application architecturesadopted by hobbyists and corporations alikeis the Model-View-Controller (MVC) pattern, as it provides clean separation of tasks and responsibilities between the prominent aspects of an application. Django only loosely follows this approach. A proper discussion should kick off with a quick overview of its components.
  • The model is generally responsible for managing data and core business logic.
  • The view displays that data to the user.
The controller accepts user input and performs logic specific to the application.Although this pattern has proven very effective in many domains, Djangos authors werent looking to conform to any kind of pattern at the outset. They were simply interested in finding the most effective way to develop software for the Web. After all, Django was built for the daily needs of a working newspaper, where things have to happen very quickly if theyre to happen at all. Ultimately, the separation of tasks into discrete groups serves a few different purposes.
  • Code that is designed for a specific set of tasks is much more maintainable because it doesnt need to make assumptions about completely unrelated parts of the application. In general, this concept is called separation of concerns and is applicable throughout software development.
  • Application development becomes more flexible, as multiple distinctly different view and controller layers may connect to a single model layer. This enables a variety of applications to share the same business logic and data, presenting it and interacting with it in different ways, for different audiences.
  • Developers are able to learn just those parts of the system that are pertinent to the work being performed. This specialization helps to curb frustration and fatigue, while fostering creativity and excellence within each developers domain of specialty.
There are certainly other smaller benefits, but these are generally the main goals achieved with the use of MVC. Its interesting to note, however, that the only part of those benefits that applies to any specific division in the MVC pattern is the ability to plug multiple applications into a single model layer. The rest is just an arbitrary division based on common development plans.
Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «Pro Django»

Look at similar books to Pro Django. 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 «Pro Django»

Discussion, reviews of the book Pro Django 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.