没有合适的资源?快使用搜索试试~ 我知道了~
How to Tango with Django 1.7
4星 · 超过85%的资源 需积分: 9 78 下载量 24 浏览量
2015-09-15
11:28:07
上传
评论 1
收藏 4.56MB PDF 举报
温馨提示
试读
269页
How to Tango with Django 1.7 这本书的pdf版本。 在线版本: http://www.tangowithdjango.com/book17/
资源推荐
资源详情
资源评论
1. New in TwD 1.7
Warning
Please note that this version of the book is still in the draft phase. Though it should all pretty much work
(however some links and screenshots need to be updated). Please report any bugs, problems, etc, or submit
change requests via GitHub: https://github.com/leifos/tango_with_django_book/tree/master/17
In this version of the online tutorial / book, we have updated and added a number of
things:
The code has been ported to work with Django 1.7
The database interaction has been updated from syncdb to
migratesql and migrate
Rendering responses has been updated from render_to_response to
render. So now there is no need to request the context in every view.
The url template tag is now being used in templates, which provides a
relative reference to urls rather than an absolute reference..
Loading static files in the templates is now done with {% load
staticfiles %}
Using slugify to create well formed URL strings
A new chapter on authentication has been added
Where the login and registration is done with Django-Registration-
Redux (see Chapter 12)
The Bootstrap chapter has been updated to use Bootstrap 3.2.0 (see Chapter
13)
Also, includes some notes on how to use Django-Bootstrap-Toolkit
A new chapter has been added on using template tags (see Chapter 14 )
Add a chapter on using JQuery with Django (see Chapter 18)
next
How To Tango With Django 1.7How To Tango With Django 1.7 »
The chapter on testing has been expanded - but is still a work in progress (see
Chapter 20)
Includes how to use the package coverage to measure test coverage
(see http://nedbatchelder.com/code/coverage/ )
Navigation
© Copyright 2013, Leif Azzopardi and David Maxwell. Created using Sphinx 1.2b3.
2. Overview
The aim of this book is to provide you with a practical guide to web development
using Django 1.7. The book is designed primarily for students, providing a
walkthrough of the steps involved in getting your first web applications up and
running, as well as deploying them to a web server.
This book seeks to complement the official Django Tutorials and many of the other
excellent tutorials available online. By putting everything together in one place, this
book fills in many of the gaps in the official Django documentation providing an
example-based design driven approach to learning the Django framework.
Furthermore, this book provides an introduction to many of the aspects required to
master web application development.
2.1. Why Work with this Book?
This book will save you time. On many occasions we've seen clever students get
stuck, spending hours trying to fight with Django and other aspects of web
development. More often than not, the problem was usually because a key piece of
information was not provided, or something was not made clear. While the
occasional blip might set you back 10-15 minutes, sometimes they can take hours to
resolve. We've tried to remove as many of these hurdles as possible. This will mean
you can get on with developing your application, and not have to sit there scratching
your head.
This book will lower the learning curve. Web application frameworks can save
you a lot of hassle and lot of time. Well, that is if you know how to use them in the
first place! Often the learning curve is steep. This book tries to get you going - and
going fast. By showing you how to put together a web application with all the bells
and whistle from the onset, the book shortens the learning curve.
This book will improve your workflow. Using web application frameworks
requires you to pick up and run with a particular design pattern - so you only have to
fill in certain pieces in certain places. After working with many students, we heard
lots of complaints about using web application frameworks - specifically about how
they take control away from them (i.e. inversion of control). To help you, we've
created a number of workflows to focus your development process so that you can
regain that sense of control and build your web application in a disciplined manner.
This book is not designed to be read. Whatever you do, do not read this book! It
is a hands-on guide to building web applications in Django. Reading is not doing. To
increase the value you gain from this experience, go through and develop the
application. When you code up the application, do not just cut and paste the code.
Type it in, think about what it does, then read the explanations we have provided to
describe what is going on. If you still do not understand, then check out the Django
documentation, go to Stack Overflow or other helpful websites and fill in this gap in
your knowledge. If you think it is worth mentioning, please get in touch with us so
that we can improve the book - we already have a number of contributors and we
will happily acknowledge your contribution!
2.2. What You will Learn
In this book, we will be taking an exampled-based approach (or inquiry-based
learning). The book will show you how to design a web application called Rango (see
the Design Brief in Section 2.4.1 below). Along the way, we'll show you how to
perform the following tasks.
Setup a development environment - including how to use the terminal, the Pip
installer, how to work with Git, etc.
Setup a Django project and create a basic Django application.
Configure the Django project to serve static media and other media files.
Work with Django's Model-View-Template design pattern.
Create database models and use the object relational mapping functionality
provided by Django.
Create forms that can utilise your database models to create dynamically
generated webpages.
Use the User Authentication services provided by Django.
Incorporate external services into the application.
Include Cascading Styling Sheets (CSS) and JavaScript within a web application.
Design and apply CSS to improve the look and feel the web application.
Work with cookies and sessions with Django.
Include more advanced functionality like AJAX into your application.
Deploy your application to a web server using PythonAnywhere.
At the end of each chapter, we have included a number of exercises designed to
push you harder and to see if you can apply what you have learned. The later
chapters of the book provide a number of open development exercises along with
coded solutions and explanations. Finally, all the code is available from GitHub at
https://github.com/leifos/tango_with_django.
To see a fully-functional version of the application, you can also visit the How to
Tango with Django website at http://www.tangowithdjango.com/rango/.
2.3. Technologies and Services
Through the course of this book, we will used various technologies and external
services, including:
Python, http://www.python.org
Pip, http://www.pip-installer.org
Django, https://www.djangoproject.com
Git, http://git-scm.com
GitHub, https://github.com
HTML, http://www.w3.org/html/
CSS, http://www.w3.org/Style/CSS/
Javascript
JQuery, http://jquery.com
Twitter Bootstrap, http://getbootstrap.com/
Bing Search API via Azure Datamarket, http://datamarket.azure.com
PythonAnywhere, https://www.pythonanywhere.com
We've selected these technologies and services as they are either fundamental to
web development, and/or enable us to provide examples on how to integrate your
web application with CSS toolkits (like Twitter Bootstrap), external services like
(those provided by Microsoft Azure) and deploy your application quickly and easily
(with PythonAnywhere).
剩余268页未读,继续阅读
资源评论
- LDCRWL2017-09-26下载下来看看先!
迈克暖风
- 粉丝: 25
- 资源: 59
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功