Boston Python Workshop/Friday handout/Windows: Difference between revisions

removing spam
imported>Paulproteus
imported>Brittag
(removing spam)
 
(28 intermediate revisions by 6 users not shown)
Line 3:
* You may need to login as Administrator, or give the Administrator password when installing some programs, depending on your Windows version and user settings.
== Open a Command Prompt ==
* Open a command prompt window, and keep it open along with your browser. Much of installing Python and using Django is typing commands and hitting '''<enter>'''. Your experience using RailsPython on Windows greatly depends on your making friends with the command prompt window.
* This is also called the command prompt, command window, command-line window, MS-DOS or DOS window.
http://www.wiki.devchix.com/index.php?title=Opening_a_command_prompt_window
Line 18:
* Go to http://python.org/download/ and download the latest version of Python ''2.7'' (2.7.1 at the time of writing).
 
* Test your Python install in the command prompt using the "-v" version flag:
 
\python27\python.exe -v
 
You should see something like
Line 36:
 
== Install Git for Windows ==
* Go to http[https://code.google.com/p/msysgit/downloads/list the downloads page (akafor GitBash)]
** Click on the top "Downloads" tab
** Download the top .exe file link with the Summary something like "Full installer for official Git 1.7.x.x"
* Run the install.
 
'''Note''': You can't just click through the installer. You have to answer some questions!
 
* In the "Select Components" dialog, make sure the checkboxes "Associate ... configuration files ..." and "Use a TrueType font ..." are checked.
 
* ''Important'': In the "Adjusting your PATH environment" dialog, make sure "Run Git from the Windows Command Prompt" is selected.
* In the "Configuring the line ending conversions" dialog, make sure "Checkout Windows-style, commit Unix-style line endings" is selected.
* To run git, open Programs > Git > '''Git Bash'''
* Then to test the Git install and see Git commands, intype this into the command'''Git promptBash''' typeprompt:
<pre>
git
</pre>
 
'''Note''': From here forward, when we need a command prompt, we'll use the '''Git Bash''' prompt, because it is more featureful.
 
== Configure Git ==
* Set up Git with your name and email to tag your code changes. In the command prompt type:
<pre> git config --global user.name <"''Your ActualName> </pre> ''"
* Replace ''Your ActualName'' with your actual name.
and:
<pre> git config --global user.email <YourEmail@domain.com> </pre>
 
 
* Tip: '''Colors'''
<pre> git config --global user.email <YourEmail@domain.com> </pre>
<br/>
* Replace ''YourEmail@domain.com'' with your email address.
 
Test it:
 
git config --global user.name
git config --global user.email
 
 
*=== Tip: '''Colors''' ===
To have colored output, in the command prompt type each line followed by '''<enter>''':
 
<pre>
git config --global color.diff auto
git config --global color.status auto
git config --global color.branch auto
</pre>
 
== Install SQLite Manager ==
Line 85 ⟶ 96:
 
== Create an ssh public key ==
You'll need one of these to creatework yourwith Heroku account in the next sectionGithub.
 
* OpenGet upinto a new GitBash window.
* <code>ssh-keygen -C &quot;''Your Actual Email''&quot; -t rsa</code> (email should match git config setting)
* Hit enter to accept default location for ssh key.
* Hit enter to accept blank passphrase (if computer is shared with other people, as in a work laptop, you should create a passphrase). Hit enter again to accept blank passphrase (or enter passphrase again).
 
* [[Output of ssh-keygen command]]
* Your brand-new public key is now stored at <code>~/.ssh/id_rsa.pub</code> inside your Windows profile.
 
'''Note''': The ''ssh-keygen'' command will give you a bunch of output. You don't have to record that output anywhere.
 
== Django ==
 
* Open a new GitBash window. Type each of these, and press enter at the end of the line.
 
curl -L http://www.djangoproject.com/download/1.2.5/tarball/ -o Django-1.2.5.tar.gz
tar zxvf Django-1.2.5.tar.gz
cd Django-1.2.5
/c/python27/python setup.py install
cd ..
 
== Verify you can create a new Django app ==
Line 115 ⟶ 130:
* In your browser, go to http://localhost:8000/
* Back in the Terminal window where you ran <code>manage.py runserver</code>, type control-c to kill the server.
 
== Cleanup ==
Ok, there is one more step. You won't be using the test project in the workshop; we just created it to make sure everything was working. '''You should delete it now to reduce confusion during the workshop.''' Don't worry about losing information; it just has the test project in it.
 
* Exit the GitBash terminal
* Drag the myproject folder (inside django_projects) to the Recycle Bin. Leave django_projects on the desktop.
 
== Congratulations! ==
Line 133 ⟶ 154:
** '''Start'''->'''Programs'''->'''PuTTY'''
 
'''Now go back to the [https://openhatch.org/wiki/Setting_up_the_web_app#Section_3:_Configuring_your_accounts_on_the_web web app install instructions]'''
== Cleanup ==
Ok, there is one more step. You won't be using the test project in the workshop; we just created it to make sure everything was working. '''You should delete it now to reduce confusion during the workshop.''' Don't worry about losing information; it just has the test project in it.
 
* Drag the myproject folder (inside django_projects) to the Recycle Bin. Leave django_projects on the desktop.
Anonymous user