Windowsでpycharmでdjangoのチュートリアル開始まで

タイトル変だが気にしない
virtualenvの場所も変だけど気にしない

# 環境

| 必要なもの        |     バージョン     |
|:-----------------|:------------------|
| OS               |         Windows10 |
| python           | python-2.7.12     |
| pycharm          | pycharm-community-2016.2.3 |

# pythonのインストール

https://www.python.org/downloads/ からpythonのインストーラーをダウンロードします。

今回はこちらのバージョン
https://www.python.org/ftp/python/2.7.12/python-2.7.12.msi

![001.PNG](https://qiita-image-store.s3.amazonaws.com/0/33674/cfecd0c9-e325-40b3-d37a-111458b3d51c.png)

![002.PNG](https://qiita-image-store.s3.amazonaws.com/0/33674/6bd575a6-5dd5-dc7a-7c41-39b8c9ce7758.png)

![003.PNG](https://qiita-image-store.s3.amazonaws.com/0/33674/dab4266e-52db-a77c-fd88-4f4587038938.png)

![004.PNG](https://qiita-image-store.s3.amazonaws.com/0/33674/8cfc7a7f-f453-7fb3-b518-d97ffc022f06.png)


# pycharmのインストール

PyCharm :: Download Latest Version of PyCharm https://www.jetbrains.com/pycharm/download/#section=windows
から"Community"版（無償）をダウンロードしてインストールします。

![005.PNG](https://qiita-image-store.s3.amazonaws.com/0/33674/5cf25990-4a02-58be-8304-400d2b7f4fd8.png)

![006.PNG](https://qiita-image-store.s3.amazonaws.com/0/33674/00b98de9-d84e-b37a-14f1-f3f948130ef8.png)

![007.PNG](https://qiita-image-store.s3.amazonaws.com/0/33674/75140e3a-f1bb-7486-651d-f8861fc44468.png)

![008.PNG](https://qiita-image-store.s3.amazonaws.com/0/33674/6b3d9389-dd4f-bca4-9cc3-59e6c8d87003.png)

![009.PNG](https://qiita-image-store.s3.amazonaws.com/0/33674/b85d2f52-3773-1ecf-2aff-4b12aa861c94.png)

# pycharmの初期設定

![010.PNG](https://qiita-image-store.s3.amazonaws.com/0/33674/21f61ed2-e6f8-abe5-f3d3-99e64ecc9e54.png)

![011.PNG](https://qiita-image-store.s3.amazonaws.com/0/33674/a27b45fd-3f7d-a80b-0be2-735d793f4b63.png)

![011_5.PNG](https://qiita-image-store.s3.amazonaws.com/0/33674/75ec024d-9013-4384-15dc-4bb2318d735e.png)

![012.PNG](https://qiita-image-store.s3.amazonaws.com/0/33674/c710087e-ead3-d8a6-c78f-6a5bc954fdfa.png)

![012_5.PNG](https://qiita-image-store.s3.amazonaws.com/0/33674/01080caa-354b-13b6-d3a1-7ef3593e106d.png)

![013.PNG](https://qiita-image-store.s3.amazonaws.com/0/33674/d393ae9c-c9b6-431b-ea3a-2f0491e48c70.png)

![014.PNG](https://qiita-image-store.s3.amazonaws.com/0/33674/779fbcc2-5a39-8569-7e01-158e824aeae7.png)

# チュートリアルの最初まで

![015.PNG](https://qiita-image-store.s3.amazonaws.com/0/33674/cfccc7b8-63f0-51d9-9ddb-aa6635b7254a.png)

![016.PNG](https://qiita-image-store.s3.amazonaws.com/0/33674/01fc52a9-1c4b-a27e-1c66-c480c6efd46e.png)

![017.PNG](https://qiita-image-store.s3.amazonaws.com/0/33674/746ebbe5-2b54-e05f-4b86-a6dcd0cede8c.png)

![018.PNG](https://qiita-image-store.s3.amazonaws.com/0/33674/941338fa-5131-b3e1-41d1-29d54f292794.png)

![019.PNG](https://qiita-image-store.s3.amazonaws.com/0/33674/63552d3d-2db8-e04b-6bbd-ae7e01e87d11.png)

![020.PNG](https://qiita-image-store.s3.amazonaws.com/0/33674/e9870963-dc98-6d6e-5991-71f4ce201a95.png)

![20_5.PNG](https://qiita-image-store.s3.amazonaws.com/0/33674/0ac41c2c-7532-63ee-6d83-227f2a0a438f.png)

![20_6.PNG](https://qiita-image-store.s3.amazonaws.com/0/33674/ac0bf7c3-c494-2828-2a94-72c7f4bf52ec.png)

![20_7.PNG](https://qiita-image-store.s3.amazonaws.com/0/33674/2e51556e-def2-dd8c-9de0-a2dfd9570523.png)


![021.PNG](https://qiita-image-store.s3.amazonaws.com/0/33674/dec70d84-2f87-46a1-2da2-3a0451e08d49.png)

Shell pathには
`"cmd.exe" /k ""C:\Users\＜ログオンユーザー名＞\untitled\Scripts\activate.bat""`を入力

![022.PNG](https://qiita-image-store.s3.amazonaws.com/0/33674/f54e19e4-eb50-69d1-7494-7e70df3c78e8.png)


![023.PNG](https://qiita-image-store.s3.amazonaws.com/0/33674/c03fc697-f3b7-3b48-d6cc-438faa3f7a77.png)

![024.PNG](https://qiita-image-store.s3.amazonaws.com/0/33674/54c10feb-9cee-72da-9c1a-1c76071c9546.png)

![025.PNG](https://qiita-image-store.s3.amazonaws.com/0/33674/147df2db-0f79-3399-f0e2-dbf1d432c57d.png)

![026.PNG](https://qiita-image-store.s3.amazonaws.com/0/33674/38a96eb1-f6ca-cfd3-ec3e-f7a73be047aa.png)

![027.PNG](https://qiita-image-store.s3.amazonaws.com/0/33674/3714e47e-8143-e8d2-afbd-e4975ac1aedf.png)

`> django-admin startproject mysite`

![028.PNG](https://qiita-image-store.s3.amazonaws.com/0/33674/00c5b85d-d7cf-6432-9ea0-44ca37e0698c.png)

`>cd site`
`>python manage.py runserver`


![029.PNG](https://qiita-image-store.s3.amazonaws.com/0/33674/35b6a0f9-dfe5-13ab-4cf6-562ba062e508.png)

続きは以下参照

はじめての Django アプリ作成、その 1 | Django documentation | Django https://docs.djangoproject.com/ja/1.10/intro/tutorial01/


# 参考

PyCharmによるパッケージの追加方法 - Qiita
http://qiita.com/yamaAtsu/items/34e2a04408695365d586

PyCharmでpyenvとvirtualenvで構築したライブラリにパスを通す方法 - Qiita
http://qiita.com/m2t9/items/11aea3d8e6ebbeef88c9

PycharmでPython Interpreterの変更を行う方法 - Qiita
http://qiita.com/r-tamura/items/e3441054279def096eee

WindowsにPythonをインストール + pip + virtualenv - Qiita
http://qiita.com/zkangaroo/items/4bb48b405e1651f2e273

Django ドキュメント | Django documentation | Django
https://docs.djangoproject.com/ja/1.10/

Pycharmで自動的にvirtualenvにactivateした状態のTerminalを起動したい(Windows) - ノート的ななにか
http://zenmaibane.hatenablog.com/entry/2016/09/26/174514

使用しているPythonやDjangoのバージョンを調べる - Django Tips 
http://www.gesource.jp/programming/python/django/004.html


最強のPython統合開発環境PyCharm - Qiita
http://qiita.com/yamionp/items/f88d50da8d6b548fc44c