差分
このページの2つのバージョン間の差分を表示します。
| 両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン | ||
| python:django:django_install [2019/07/24 17:52] – [pip を利用する場合] ともやん | python:django:django_install [2020/12/11 17:34] (現在) – [Linux] ともやん | ||
|---|---|---|---|
| 行 1: | 行 1: | ||
| - | ====== Djangoのインストール ====== | + | ====== Django のインストール ====== |
| - | ここでは、Pythonがインストールされていることを前提に説明を進めることにする。\\ | + | ここでは、Python がインストールされていることを前提に説明を進めることにする。\\ |
| Python 環境の整え方は、[[python: | Python 環境の整え方は、[[python: | ||
| + | |||
| ===== pip を利用する場合 ===== | ===== pip を利用する場合 ===== | ||
| 行 8: | 行 9: | ||
| $ pip install django | $ pip install django | ||
| </ | </ | ||
| + | <WRAP prewrap 100% #result> | ||
| < | < | ||
| + | Looking in indexes: https:// | ||
| Collecting django | Collecting django | ||
| - | Downloading Django-1.9.1-py2.py3-none-any.whl (6.6MB) | + | Downloading |
| - | 100% |████████████████████████████████| | + | 100% |████████████████████████████████| 7.8MB 4.2kB/s |
| - | Installing collected packages: django | + | Collecting asgiref< |
| - | Successfully installed django-1.9.1 | + | Downloading https:// |
| + | Collecting sqlparse> | ||
| + | Downloading https:// | ||
| + | 100% |████████████████████████████████| | ||
| + | Collecting pytz (from django) | ||
| + | Downloading https:// | ||
| + | 100% |████████████████████████████████| 512kB 52kB/s | ||
| + | Installing collected packages: | ||
| + | Successfully installed | ||
| </ | </ | ||
| + | </ | ||
| + | |||
| < | < | ||
| - | $ python -c " | + | $ python -m django |
| </ | </ | ||
| + | <WRAP prewrap 100% #result> | ||
| < | < | ||
| - | 1.9.1 | + | 3.1.4 |
| </ | </ | ||
| + | </ | ||
| ==== Windows ==== | ==== Windows ==== | ||
| 行 26: | 行 41: | ||
| > pip install django | > pip install django | ||
| </ | </ | ||
| - | <WRAP prewrap 100%> | + | <WRAP prewrap 100% #result> |
| < | < | ||
| Collecting django | Collecting django | ||
| - | Downloading | + | Downloading Django-3.0.4-py3-none-any.whl (7.5 MB) |
| - | | + | |
| - | Collecting sqlparse | + | Collecting sqlparse>=0.2.2 |
| - | Downloading | + | Downloading sqlparse-0.3.1-py2.py3-none-any.whl |
| - | Requirement already satisfied: pytz in c: | + | |████████████████████████████████| 40 kB 2.5 MB/s |
| - | Installing collected packages: sqlparse, django | + | Collecting asgiref~=3.2 |
| - | Successfully installed | + | Downloading asgiref-3.2.7-py2.py3-none-any.whl |
| + | Collecting pytz | ||
| + | Downloading pytz-2019.3-py2.py3-none-any.whl (509 kB) | ||
| + | | ||
| + | Installing collected packages: sqlparse, asgiref, pytz, django | ||
| + | Successfully installed | ||
| </ | </ | ||
| </ | </ | ||
| + | |||
| + | < | ||
| + | > python -c " | ||
| + | </ | ||
| + | <WRAP prewrap 100% #result> | ||
| + | < | ||
| + | 3.0.4 | ||
| + | </ | ||
| + | </ | ||
| + | |||
| ===== Windows tar ボールからインストールする場合 ===== | ===== Windows tar ボールからインストールする場合 ===== | ||
| ※pipでインストール可能。 | ※pipでインストール可能。 | ||
| 行 53: | 行 83: | ||
| ====== Django Adminツールの動作確認 ====== | ====== Django Adminツールの動作確認 ====== | ||
| - | 上記のインストールが完了すると、django-admin.py がパスの通った場所に存在するので、以下のコマンドを実行して動作確認を行う。 | + | 上記のインストールが完了すると、django-admin.py がパスの通った場所に存在するので、以下のコマンドを実行して動作確認を行う。\\ |
| + | |||
| + | ===== Linux ===== | ||
| < | < | ||
| $ django-admin.py | $ django-admin.py | ||
| + | </ | ||
| + | <WRAP prewrap 100% # | ||
| + | < | ||
| Type ' | Type ' | ||
| 行 75: | 行 109: | ||
| migrate | migrate | ||
| runserver | runserver | ||
| - | ~省略~ | + | sendtestemail |
| + | shell | ||
| + | showmigrations | ||
| + | sqlflush | ||
| + | sqlmigrate | ||
| + | sqlsequencereset | ||
| + | squashmigrations | ||
| + | startapp | ||
| + | startproject | ||
| + | test | ||
| + | testserver | ||
| + | Note that only Django core commands are listed as settings are not properly configured (error: Requested setting INSTALLED_APPS, | ||
| </ | </ | ||
| - | 参考文献:\\ | + | </ |
| + | |||
| + | ===== Windows ===== | ||
| + | < | ||
| + | > django-admin | ||
| + | </ | ||
| + | <WRAP prewrap 100% # | ||
| + | < | ||
| + | Type ' | ||
| + | |||
| + | Available subcommands: | ||
| + | |||
| + | [django] | ||
| + | check | ||
| + | compilemessages | ||
| + | createcachetable | ||
| + | dbshell | ||
| + | diffsettings | ||
| + | dumpdata | ||
| + | flush | ||
| + | inspectdb | ||
| + | loaddata | ||
| + | makemessages | ||
| + | makemigrations | ||
| + | migrate | ||
| + | runserver | ||
| + | sendtestemail | ||
| + | shell | ||
| + | showmigrations | ||
| + | sqlflush | ||
| + | sqlmigrate | ||
| + | sqlsequencereset | ||
| + | squashmigrations | ||
| + | startapp | ||
| + | startproject | ||
| + | test | ||
| + | testserver | ||
| + | Note that only Django core commands are listed as settings are not properly configured (error: Requested setting INSTALLED_APPS, | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | ====== | ||
| [[http:// | [[http:// | ||