Django for ISchoolers: Difference between revisions

Undo revision 19296; minus URLs to avoid captcha
imported>Aldeka
(Undo revision 19296; minus URLs to avoid captcha)
 
(5 intermediate revisions by 3 users not shown)
Line 14:
 
TODO: Actually write my own dang installation instructions.
 
On Debian Wheezy: aptitude install python git python-virtualenv python-django-south python-django python-pip
 
Prior to starting this tutorial, please install Python, git, pip, virtualenv, Django, and South on your computer. There's instructions for all of those at [http://pystar.org/setup_machine.html http://pystar.org/setup_machine.html].
Line 67 ⟶ 69:
Think of branches in git as alternate timelines--you "branch" off of the main timeline of changes to the code into a separate timeline. You can try out a new feature or code setup in a branch, without overwriting or getting in the way of yourself or anybody else working on the code as-is. Sometimes a new idea doesn't work out, and you delete the branch or just let it sit around. Sometimes the new feature works, though, and if so you can merge it into the "real" timeline. You can make as many branches as you want, and branches of branches. You can even share branches with others (though we won't be doing that today). Git's branching system (and its non-centralized architecture generally) make it easy to try out new ideas in code without having to ask permission of everyone else on the project first.
 
To make your first branch, be sure you've changed directories to the django-for-ischoolers directory and then type <source lang="python">$ git branch my-chunk-1</source> to make your new branch, and <source lang="python">$ git checkout my-chunk-1</source> to switch into that branch. Type <source lang="python">$ git branch</source> to confirm that you're in your new branch (and that you only have two branches so far).
 
If you're not following this tutorial in class, just run <source lang="python">$ git init</source>.
Line 361 ⟶ 363:
)</source>
 
Suppose a visitor goes to http:// 127.0.0.1:8000/questions/23/.
# which regex pattern is tripped?
# what function is then called?
Line 1,054 ⟶ 1,056:
===Create the form===
 
Recall that the prototype spec allows users to add answers to questions. We are going to use a form for that functionality. As an alternative, we could have used AJAX Requests, a special url (‘/polls/11/choice/3/upvote’) or some other mechanism.
 
* Update our question detail template (qandabear/detail.html) to contain an HTML <form> element:
Line 1,101 ⟶ 1,103:
* Review your work at [http://127.0.0.1:8000/questions/1/ http://127.0.0.1:8000/questions/1/] .
* Save and commit.
 
 
===Process the form===
Line 1,148 ⟶ 1,149:
 
== Static files (aka: Django for designers) ==
 
TODO: Write this!
 
[https://docs.djangoproject.com/en/1.3/howto/static-files/ https://docs.djangoproject.com/en/1.3/howto/static-files/]
 
== AJAX and Django ==
Line 1,164 ⟶ 1,169:
 
== Authentication and Users (and reusing apps) ==
 
[https://docs.djangoproject.com/en/dev/topics/auth/ https://docs.djangoproject.com/en/dev/topics/auth/]
 
== Deploying to a real live server ==
 
TODO
Anonymous user