کامپیوترها

توسعه قالب جنگو 1.0

Django 1.0 Template Development

دانلود کتاب Django 1.0 Template Development (به فارسی: توسعه قالب جنگو 1.0) نوشته شده توسط «Scott Newman»


اطلاعات کتاب توسعه قالب جنگو 1.0

موضوع اصلی: کامپیوترها

نوع: کتاب الکترونیکی

ناشر: Packt Publishing

نویسنده: Scott Newman

زبان: English

فرمت کتاب: pdf (قابل تبدیل به سایر فرمت ها)

سال انتشار: 2008

تعداد صفحه: 272

حجم کتاب: 7 مگابایت

کد کتاب: 1847195709 , 9781847195708

توضیحات کتاب توسعه قالب جنگو 1.0

توسعه قالب جنگو 1.0 توسط اسکات نیومن شیوه های توسعه را برای سیستم قالب چارچوب وب جنگو آموزش می دهد. این کتاب خود را به‌عنوان «راهنمای عملی برای توسعه قالب جنگو با برچسب‌های سفارشی، فیلترها، قالب‌های متعدد، (و) کش» معرفی می‌کند و توسط Packt Publishing منتشر شده است.

به نظر من این کتاب یک مرجع قوی اما فنی است، به ویژه در مورد نماها، پیکربندی URL، و صفحه بندی، که آن را برای مخاطبان مورد نظر کتاب «توسعه دهندگان وب و نویسندگان قالب» مناسب تر می کند. من با توسعه قالب جنگو در طول کارم به عنوان یک طراح تعامل، جایی که جنگو در روزنامه لاورنس ژورنال-جهان در لارنس، کان ایجاد شد، آشنا هستم.

این کتاب فرض می‌کند که خواننده نصب جنگو و آموزش‌های مقدماتی، به‌ویژه ایجاد یک پروژه، یک برنامه کاربردی، و برخی مدل‌ها و توسعه را با استفاده از حداقل جنگو 1.0 تکمیل کرده است. این کتاب همچنین برخی از دانش های اولیه HTML، Python و محیطی شبیه به یونیکس را در نظر گرفته است. توصیه می‌کنم قبل از خواندن این کتاب، موارد ضروری را یاد بگیرید، مانند راه‌اندازی محیط‌های اولیه مشابه یونیکس و نحوه استفاده آن‌ها از پایتون از طریق مسیر پایتون.

فصل 1 “مقدمه ای بر سیستم قالب جنگو” یک مرور کلی و فلسفه خوب از سیستم قالب است. فصل 2 “نماها، URL ها و نماهای عمومی” و فصل 3 “زمینه قالب” پیشینه فنی نحوه رندر قالب ها توسط جنگو را پوشش می دهد و عمدتا برای توسعه دهندگان وب نوشته شده است. فصل 4 “استفاده از برچسب ها و فیلترهای داخلی” شامل نمونه هایی از تقریباً هر برچسب و فیلتری است که جنگو به صورت رایگان ارائه می دهد، که بسیار مورد استقبال قرار می گیرد زیرا حتی اسناد رسمی جنگو نیز چنین مرجعی ندارند!

فصل 5 «بارگیری و به ارث بردن الگوها» نمونه‌های الگوهای واقعی را شروع می‌کند، اما توصیه می‌کند الگوها را در «پروژه‌ها/(نام پروژه)/قالب‌ها/» به‌عنوان بهترین روش ذخیره کنید، که به نظر من مشکوک است: رایج‌ترین شیوه‌های ذخیره‌سازی الگو که من “(نام پروژه)/(نام برنامه)/الگوها/” یا یک فهرست اختصاصی دیده شده است. مورد اول به ویژه در برنامه های کاربردی جنگو قابل توزیع مجدد در Google Code و GitHub رایج است.

فصل 6 “ارائه الگوهای چندگانه” بخش های آبدارتر کتاب را پوشش می دهد: صفحات مناسب چاپگر، مضامین سایت، و نسخه های موبایل (به لطف همکار سابقم مت کرویدون هی، مت!). صفحات سازگار با چاپگر قوی بودند، اگرچه راه حل تلفن همراه با استفاده نکردن از کوکی ها به حد کمال نمی رسد. من دریافتم که مضامین سایت به صورت دستی اضافه کردن و حذف دایرکتوری های الگو راه حلی عملی نیست.

فصل‌های 7 تا 11 دارای موضوعات مستندات آنلاین متناظر هستند: برچسب‌ها و فیلترهای سفارشی، صفحه‌بندی، سفارشی‌سازی ادمین، حافظه پنهان و بین‌المللی‌سازی. فصل مربوط به صفحه بندی به طور عجیبی اشاره ای به برنامه جنگو-صفحه بندی نکرده است، اما فصل مربوط به ذخیره سازی در حافظه پنهان به یک موضوع گیج کننده می پردازد.

این کتاب اسکرین شات های مفید زیادی را نشان می دهد، اما من بیشتر از سه گرافیک اطلاعاتی آن که متن قبل از آن را تکرار می کند، دوست داشتم. با این حال من متوجه شدم که متن به طور کلی عاری از خطاهای فنی است.

این کتاب باید به برخی از سوالات اساسی‌تر من در هنگام یادگیری الگوها پاسخ می‌داد:

– چرا الگوها به جای پسوند قالب جنگو مانند “.django-html” به پسوند html ختم می شوند؟ پاسخ:
– سازندگان جنگو می خواستند ویرایشگر متن فعلی شما به برجسته کردن عناصر HTML ادامه دهد. اگر اهل PHP هستید، این قطعاً قابل توجه است.
– نحو یک متغیر الگو چیست؟ پاسخ: {{ model.field }}. این کتاب به ندرت به مدل ها اشاره می کند.
– آیا استراتژی قالب متنوعی وجود دارد که باید از آن استفاده کنم؟ پاسخ: این بستگی دارد، احتمالا با طرح بندی طراحی.

کتاب به طور عجیبی تصمیم گرفت تا یک برنامه انتشار مطبوعاتی را بنویسد و نه مطلوب ترین برنامه وبلاگ را، که فقط نماهای عمومی ساده، فهرستی و مبتنی بر جزئیات را پوشش می دهد نه نماهای عمومی مبتنی بر تاریخ، که مطلوب بود، اما بهترین شیوه ها، مانند بلوک های خالی برای CSS و جاوا اسکریپت اضافی در قالب پایه، پوشش داده شده است.

اذعان به برنامه‌های رایگان و باز دنیای جنگو در اینترنت می‌توانست به طراحان و توسعه‌دهندگان جلویی در درخشش قالب‌هایشان برتری بدهد، مانند:

– typogrify: برچسب ها و فیلترها در زیباسازی متن شما
– django-template-utils: بهبودهای قالب رایج فراتر از برچسب ها و فیلترهای djbuilt-in
– django-robots: ایجاد آسان robots.txt برای موتورهای جستجو
– django-oembed: تشخیص خودکار URL های رسانه ای و جایگزینی بدون سر و صدا آنها
– flatpages: تأیید اولیه ترین برنامه داخلی جنگو که مبانی قالب را نشان می دهد

این موضوعات مستندات و فصل‌های کتاب جنگو تقریباً با بسیاری از فصل‌های توسعه قالب جنگو 1.0 مطابقت دارد:

– زبان قالب جنگو
– برچسب ها و فیلترهای قالب داخلی
– زبان قالب جنگو: برای برنامه نویسان پایتون
– برچسب ها و فیلترهای قالب سفارشی
– کتاب جنگو، فصل 4: الگوها
– کتاب جنگو، فصل 9: الگوهای پیشرفته

در نهایت، خرید توسعه قالب جنگو 1.0 به چه نوع بستگی دارد


Django 1.0 Template Development by Scott Newman teaches development practices for the Django Web framework template system. The book brands itself as “a practical guide to Django template development with custom tags, filters, multiple templates, (and) caching,” and is published by Packt Publishing.

I found the book to be a solid but also technical reference, especially on views, URL configuration, and pagination, making it more appropriate for the book’s intended audience of “Web developers and template authors.” I’m familiar with Django template development during my work as an Interaction Designer where Django was created at the Lawrence Journal-World newspaper in Lawrence, Kan.

The book assumes the reader completed the installation of Django and the introductory tutorials, in particular creating a project, an application, and some models, and development using at least Django 1.0. The book also assumes some basic knowledge of HTML, Python, and a Unix-like environment. I recommend learning essentials, such as the set up of basic Unix-like environments and how they use Python via the Python Path, before reading this book.

Chapter 1’s “An Introduction to the Django Template System” is a good overview and philosophy of the template system. Chapter 2’s “Views, URLs, and Generic Views” and Chapter 3’s “Template Context” cover the technical background in how Django renders templates and was mainly written for Web developers. Chapter 4’s “Using the Built-In Tags and Filters” contains examples of almost every tag and filter Django gives for free, which is very welcome because not even Django’s official documentation has such a reference!

Chapter 5’s “Loading and Inheriting Templates” starts real-world template examples, but recommends storing templates in “projects/(project name)/templates/” as a best practice, which I found to be questionable: The most common template storage practices I have seen are “(project name)/(application name)/templates/” or a dedicated directory; the former is especially common in redistributable Django applications on Google Code and GitHub.

Chapter 6’s “Serving Multiple Templates” covers the juicier parts of the book: printer-friendly pages, site themes, and mobile versions (courtesy of my former co-worker Matt CroydonHi, Matt!). The printer-friendly pages were solid, although the mobile solution falls just short of perfection by not using cookies. I found site themesmanually adding and remove template directoriesnot to be a practical solution.

Chapters 7 through 11 have corresponding online documentation topics: custom tags and filters, pagination, customizing the admin, caching, and internationalization. The chapter on pagination curiously failed to mention the django-pagination application, but the chapter on caching elegantly addresses a confusing topic.

The book shows many helpful screenshots, but I would have liked more than its three information graphics, which reiterated the text preceding it; however I did find the text to be generally free of technical errors.

The book should have answered some of the more basic questions I had when first learning templates:

– Why do templates end in the .html extension rather than some kind of Django template extension, such as “.django-html”? Answer: The
– Django creators wanted your current text editor to continue highlighting HTML elements. If you come from PHP, this is definitely noteworthy.
– What is a template variable’s syntax? Answer: {{ model.field }}. The book rarely mentions models.
– Is there a diverse template strategy I should use? Answer: It depends, possibly with design layouts.

The book oddly chose to author a press release application and not the most-desired blog application, covering only simple, list-, and detail-based generic viewsnot date-based generic views, which would have been desirable, but best practices, such as empty blocks for extra CSS and JavaScript in the base template, are covered.

Acknowledgment of the Django universe’s free and open applications on the Internet could have given designers and front-end developers the edge in making their templates shine, such as:

– typogrify: Tags and filters in prettifying your text
– django-template-utils: Commonly used template enhancements beyond djbuilt-in tags and filters
– django-robots: Easy creation of robots.txt for search engines
– django-oembed: Auto-detection of media-esque URLs and their no-fuss replacement
– flatpages: Acknowledgment of the most basic built-in Django application showing template basics

These documentation topics and Django Book chapters roughly correspond to many of the chapters in Django 1.0 Template Development:

– The Django template language
– Built-in template tags and filters
– The Django template language: For Python programmers
– Custom template tags and filters
– Django Book, Chapter 4: Templates
– Django Book, Chapter 9: Advanced Templates

Ultimately, buying Django 1.0 Template Development comes down to what kind of learner you are: Django’s official documentation, the Django Book, and the Django users Google Group, should give most Web developers and template authors enough to learn most of the template system, but the book can be a handy reference and walk-through that will hold your hand in a lot of sticky points. The examples in the book are bound to teach something to even the most seasoned Django developers.

دانلود کتاب «توسعه قالب جنگو 1.0»

مبلغی که بابت خرید کتاب می‌پردازیم به مراتب پایین‌تر از هزینه‌هایی است که در آینده بابت نخواندن آن خواهیم پرداخت.

برای دریافت کد تخفیف ۲۰ درصدی این کتاب، ابتدا صفحه اینستاگرام کازرون آنلاین (@kazerun.online ) را دنبال کنید. سپس، کلمه «بلیان» را در دایرکت ارسال کنید تا کد تخفیف به شما ارسال شود.