差分
このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン | ||
python:django:django_install [2015/07/20 21:05] – 外部編集 非ログインユーザー | python:django:django_install [2020/12/11 17:34] (現在) – [Linux] ともやん | ||
---|---|---|---|
行 1: | 行 1: | ||
- | ====== Djangoのインストール ====== | + | ====== Django のインストール ====== |
- | ここでは、Pythonがインストールされていることを前提に説明を進めることにする。\\ | + | ここでは、Python がインストールされていることを前提に説明を進めることにする。\\ |
Python 環境の整え方は、[[python: | Python 環境の整え方は、[[python: | ||
+ | |||
===== pip を利用する場合 ===== | ===== pip を利用する場合 ===== | ||
+ | |||
+ | ==== Linux ==== | ||
< | < | ||
$ pip install django | $ pip install django | ||
- | Downloading/ | ||
- | Downloading Django-1.5.tar.gz (8.0MB): 8.0MB downloaded | ||
- | Running setup.py egg_info for package django | ||
- | | ||
- | warning: no previously-included files matching ' | ||
- | warning: no previously-included files matching ' | ||
- | Installing collected packages: django | ||
- | Running setup.py install for django | ||
- | changing mode of build/ | ||
- | | ||
- | warning: no previously-included files matching ' | ||
- | warning: no previously-included files matching ' | ||
- | changing mode of / | ||
- | Successfully installed django | ||
- | Cleaning up... | ||
</ | </ | ||
+ | <WRAP prewrap 100% #result> | ||
+ | < | ||
+ | Looking in indexes: https:// | ||
+ | Collecting django | ||
+ | Downloading https:// | ||
+ | 100% |████████████████████████████████| 7.8MB 4.2kB/s | ||
+ | Collecting asgiref< | ||
+ | Downloading https:// | ||
+ | Collecting sqlparse> | ||
+ | Downloading https:// | ||
+ | 100% |████████████████████████████████| 51kB 155kB/s | ||
+ | Collecting pytz (from django) | ||
+ | Downloading https:// | ||
+ | 100% |████████████████████████████████| 512kB 52kB/s | ||
+ | Installing collected packages: asgiref, sqlparse, pytz, django | ||
+ | Successfully installed asgiref-3.3.1 django-3.1.4 pytz-2020.4 sqlparse-0.4.1 | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | $ python -m django --version" | ||
+ | </ | ||
+ | <WRAP prewrap 100% #result> | ||
+ | < | ||
+ | 3.1.4 | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ==== Windows ==== | ||
+ | < | ||
+ | > pip install django | ||
+ | </ | ||
+ | <WRAP prewrap 100% #result> | ||
+ | < | ||
+ | Collecting django | ||
+ | Downloading Django-3.0.4-py3-none-any.whl (7.5 MB) | ||
+ | | ||
+ | Collecting sqlparse> | ||
+ | Downloading sqlparse-0.3.1-py2.py3-none-any.whl (40 kB) | ||
+ | | ||
+ | Collecting asgiref~=3.2 | ||
+ | Downloading asgiref-3.2.7-py2.py3-none-any.whl (19 kB) | ||
+ | Collecting pytz | ||
+ | Downloading pytz-2019.3-py2.py3-none-any.whl (509 kB) | ||
+ | | ||
+ | Installing collected packages: sqlparse, asgiref, pytz, django | ||
+ | Successfully installed asgiref-3.2.7 django-3.0.4 pytz-2019.3 sqlparse-0.3.1 | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | > python -c " | ||
+ | </ | ||
+ | <WRAP prewrap 100% #result> | ||
+ | < | ||
+ | 3.0.4 | ||
+ | </ | ||
+ | </ | ||
+ | |||
===== Windows tar ボールからインストールする場合 ===== | ===== Windows tar ボールからインストールする場合 ===== | ||
※pipでインストール可能。 | ※pipでインストール可能。 | ||
行 36: | 行 83: | ||
====== Django Adminツールの動作確認 ====== | ====== Django Adminツールの動作確認 ====== | ||
- | 上記のインストールが完了すると、django-admin.py がパスの通った場所に存在するので、以下のコマンドを実行して動作確認を行う。 | + | 上記のインストールが完了すると、django-admin.py がパスの通った場所に存在するので、以下のコマンドを実行して動作確認を行う。\\ |
+ | |||
+ | ===== Linux ===== | ||
< | < | ||
- | $ django-admin.py | + | $ django-admin.py |
- | Usage: | + | </ |
+ | <WRAP prewrap 100% # | ||
+ | < | ||
+ | Type 'django-admin.py | ||
- | Options: | + | Available subcommands: |
- | -v VERBOSITY, --verbosity=VERBOSITY | + | |
- | | + | [django] |
- | | + | check |
- | | + | |
- | " | + | |
- | | + | |
- | used. | + | |
- | | + | |
- | A directory to add to the Python path, e.g. | + | flush |
- | "/ | + | |
- | | + | |
- | | + | |
- | -h, --help | + | |
- | ~省略~ | + | |
+ | 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:// |