Be considerate • Be respectful • Be careful in the words that you choose • Be constructive than destructive speakup.io/coc.html & djangoproject.com/conduct
install a package $ pip install [package-name] • Easy to uninstall a package $ pip uninstall [package-name] • Easy to list all installed packages $ pip freeze > requirements.txt • Easy to install package list $ pip install -r requirements.txt
products in the form of a Python package • App : Django : : Package : Python • A project can have multiple apps. An app can be in multiple projects. • Can be created via command line • To convert a folder into package, add __init__.py
Uses regex for maximum flexibility • Table of contents for site urlpatterns = patterns('', url(r'^articles/(\d{4})/$', views.year_archive), url(r'^articles/(\d{4})/(\d{2})/$', views.month_archive), url(r'^articles/(\d{4})/(\d{2})/(\d+)/$', views.article_detail), )
requests passed on via the URLConf • Gets data from the model and passes them to the template for rendering • Determines WHAT data the user should see, not HOW data should be rendered
a page via a URL 1 2 Django checks URLConf for URL patterns and executes view function to handle request 2 3 View requests data from model 3 4 Model queries the database and returns data to the view 4 5 View passes the data to template 5 6 Template renders data and returns HTML to the view 6 7 View returns HTML to the browser 7
tag • {% extends %} - inherits from parent or base template • {% block %} - defines a placeholder that can be overridden by child templates • includes vs extends: • extends is the “inside-out” version of server-side includes • includes: define sections that are common • extends: define sections that are unique
After installing a new package, what is the best thing to do next? • What is an app? • How do you convert a folder into a Python package? • After activating new apps in settings, what is the best thing to do next?