python:django:django_install

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
python:django:django_install [2016/01/10 09:51] – [Django Adminツールの動作確認] ともやんpython:django:django_install [2020/12/11 17:34] (現在) – [Linux] ともやん
行 1: 行 1:
-====== Djangoのインストール ====== +====== Django のインストール ====== 
-ここでは、Pythonがインストールされていることを前提に説明を進めることにする。\\+ここでは、Python がインストールされていることを前提に説明を進めることにする。\\
 Python 環境の整え方は、[[python:pythonbrew|pythonbrew の使い方]]や[[python:python_install|Python のインストール]]を参照のこと。\\ Python 環境の整え方は、[[python:pythonbrew|pythonbrew の使い方]]や[[python:python_install|Python のインストール]]を参照のこと。\\
 +
 ===== pip を利用する場合 ===== ===== pip を利用する場合 =====
 +
 +==== Linux ====
 <code> <code>
 $ pip install django $ pip install django
 +</code>
 +<WRAP prewrap 100% #result>
 +<code>
 +Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
 Collecting django Collecting django
-  Downloading Django-1.9.1-py2.py3-none-any.whl (6.6MB+  Downloading https://files.pythonhosted.org/packages/08/c7/7ce40e5a5cb47ede081b9fa8a3dd93d101c884882ae34927967b0792f5fb/Django-3.1.4-py3-none-any.whl (7.8MB) 
-    100% |████████████████████████████████| 6.6MB 80kB/s  +    100% |████████████████████████████████| 7.8MB 4.2kB/s 
-Installing collected packages: django +Collecting asgiref<4,>=3.2.10 (from django) 
-Successfully installed django-1.9.1+  Downloading https://files.pythonhosted.org/packages/89/49/5531992efc62f9c6d08a7199dc31176c8c60f7b2548c6ef245f96f29d0d9/asgiref-3.3.1-py3-none-any.whl 
 +Collecting sqlparse>=0.2.2 (from django) 
 +  Downloading https://files.pythonhosted.org/packages/14/05/6e8eb62ca685b10e34051a80d7ea94b7137369d8c0be5c3b9d9b6e3f5dae/sqlparse-0.4.1-py3-none-any.whl (42kB
 +    100% |████████████████████████████████| 51kB 155kB/s 
 +Collecting pytz (from django) 
 +  Downloading https://files.pythonhosted.org/packages/12/f8/ff09af6ff61a3efaad5f61ba5facdf17e7722c4393f7d8a66674d2dbd29f/pytz-2020.4-py2.py3-none-any.whl (509kB) 
 +    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
 </code> </code>
 +</WRAP>
 +
 +<code>
 +$ python -m django --version"
 +</code>
 +<WRAP prewrap 100% #result>
 +<code>
 +3.1.4
 +</code>
 +</WRAP>
 +
 +==== Windows ====
 +<code>
 +> pip install django
 +</code>
 +<WRAP prewrap 100% #result>
 +<code>
 +Collecting django
 +  Downloading Django-3.0.4-py3-none-any.whl (7.5 MB)
 +     |████████████████████████████████| 7.5 MB 1.1 MB/s
 +Collecting sqlparse>=0.2.2
 +  Downloading sqlparse-0.3.1-py2.py3-none-any.whl (40 kB)
 +     |████████████████████████████████| 40 kB 2.5 MB/s
 +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)
 +     |████████████████████████████████| 509 kB 1.7 MB/s
 +Installing collected packages: sqlparse, asgiref, pytz, django
 +Successfully installed asgiref-3.2.7 django-3.0.4 pytz-2019.3 sqlparse-0.3.1
 +</code>
 +</WRAP>
 +
 +<code>
 +> python -c "import django; print(django.get_version())"
 +</code>
 +<WRAP prewrap 100% #result>
 +<code>
 +3.0.4
 +</code>
 +</WRAP>
 +
 ===== Windows tar ボールからインストールする場合 ===== ===== Windows tar ボールからインストールする場合 =====
 ※pipでインストール可能。 ※pipでインストール可能。
行 26: 行 83:
  
 ====== Django Adminツールの動作確認 ====== ====== Django Adminツールの動作確認 ======
-上記のインストールが完了すると、django-admin.py がパスの通った場所に存在するので、以下のコマンドを実行して動作確認を行う。+上記のインストールが完了すると、django-admin.py がパスの通った場所に存在するので、以下のコマンドを実行して動作確認を行う。\\ 
 + 
 +===== Linux =====
 <code> <code>
 $ django-admin.py $ django-admin.py
 +</code> 
 +<WRAP prewrap 100% #result_long> 
 +<code>
 Type 'django-admin.py help <subcommand>' for help on a specific subcommand. Type 'django-admin.py help <subcommand>' for help on a specific subcommand.
  
行 48: 行 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, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.).
 </code> </code>
-参考文献:\\+</WRAP> 
 + 
 +===== Windows ===== 
 +<code> 
 +> django-admin 
 +</code> 
 +<WRAP prewrap 100% #result_long> 
 +<code> 
 +Type 'django-admin help <subcommand>' for help on a specific subcommand. 
 + 
 +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, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.). 
 +</code> 
 +</WRAP> 
 + 
 +====== 参考文献 ======
 [[http://www.ibm.com/developerworks/jp/linux/library/l-django/index.html|Python Webフレームワーク、第1回: DjangoとPythonを使ってWeb開発]]\\ [[http://www.ibm.com/developerworks/jp/linux/library/l-django/index.html|Python Webフレームワーク、第1回: DjangoとPythonを使ってWeb開発]]\\
  • python/django/django_install.1452387067.txt.gz
  • 最終更新: 2019/05/18 02:23
  • (外部編集)