Skip to content

Instantly share code, notes, and snippets.

@ymyzk
Last active October 21, 2015 05:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ymyzk/354d10f8c6bf38fa6196 to your computer and use it in GitHub Desktop.
Save ymyzk/354d10f8c6bf38fa6196 to your computer and use it in GitHub Desktop.
第2回 プログラミング大相談会 Django 入門

第2回 プログラミング大相談会 Django 入門

Python 環境整備

OS X の標準の Python 環境は Python 3 が入っていないので Homebrew 等でインストールしましょう.

Homebrew の導入

http://brew.sh/index_ja.html を参考に

Python を Homebrew で導入する

brew update
brew upgrade
brew install python
brew install python3

virtualenv 入門

インストール

pip install virtualenv

virtualenv を作る

# Python 2
virtualenv -p /usr/local/bin/python2 venv
# Python 3
virtualenv -p /usr/local/bin/python3 venv

virtualenv に入る

source venv/bin/activate

virtualenv を出る

deactivate

iPython 入門

高機能 REPL として使えるので Python 入門に最適.

インストール

# virtualenv 内推奨
pip install ipython

起動

ipython

終了

exit()
# または Ctrl-D

Python 入門

公式がわかりやすい.

Django 入門

インストール

virtualenv 内に Django をインストールする. 今なら Django 1.8.x が入る.

pip install Django

チュートリアル

最新の Django 1.8 のチュートリアルは日本語版がないので英語版を読む. https://docs.djangoproject.com/en/1.8/intro/tutorial01/

少し古い Django 1.4 のチュートリアルは日本語訳もある. ただし Django 1.8 までの間に変わっているところも多々あるので要注意. http://docs.djangoproject.jp/en/latest/intro/tutorial01.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment