python:django:django_install

差分

このページの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: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
-Downloading/unpacking django 
-  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 '__pycache__' found under directory '*' 
-    warning: no previously-included files matching '*.py[co]' found under directory '*' 
-Installing collected packages: django 
-  Running setup.py install for django 
-    changing mode of build/scripts-3.3/django-admin.py from 664 to 775 
-     
-    warning: no previously-included files matching '__pycache__' found under directory '*' 
-    warning: no previously-included files matching '*.py[co]' found under directory '*' 
-    changing mode of /home/tomoyan/.pythonbrew/venvs/Python-3.3.0/py33dj15/bin/django-admin.py to 775 
-Successfully installed django 
-Cleaning up... 
 </code> </code>
 +<WRAP prewrap 100% #result>
 +<code>
 +Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
 +Collecting django
 +  Downloading https://files.pythonhosted.org/packages/08/c7/7ce40e5a5cb47ede081b9fa8a3dd93d101c884882ae34927967b0792f5fb/Django-3.1.4-py3-none-any.whl (7.8MB)
 +    100% |████████████████████████████████| 7.8MB 4.2kB/s
 +Collecting asgiref<4,>=3.2.10 (from django)
 +  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>
 +</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でインストール可能。
行 36: 行 83:
  
 ====== Django Adminツールの動作確認 ====== ====== Django Adminツールの動作確認 ======
-上記のインストールが完了すると、django-admin.py がパスの通った場所に存在するので、以下のコマンドを実行して動作確認を行う。+上記のインストールが完了すると、django-admin.py がパスの通った場所に存在するので、以下のコマンドを実行して動作確認を行う。\\ 
 + 
 +===== Linux =====
 <code> <code>
-$ django-admin.py help +$ django-admin.py 
-Usage: django-admin.py subcommand [options] [args]+</code> 
 +<WRAP prewrap 100% #result_long> 
 +<code> 
 +Type 'django-admin.py help <subcommand>' for help on a specific subcommand.
  
-Options+Available subcommands
-  -v VERBOSITY, --verbosity=VERBOSITY + 
-                        Verbosity level; 0=minimal output, 1=normal output, +[django] 
-                        2=verbose output, 3=very verbose output +    check 
-  --settings=SETTINGS   The Python path to a settings module, e.g. +    compilemessages 
-                        "myproject.settings.main". If this isn't provided, the +    createcachetable 
-                        DJANGO_SETTINGS_MODULE environment variable will be +    dbshell 
-                        used. +    diffsettings 
-  --pythonpath=PYTHONPATH +    dumpdata 
-                        A directory to add to the Python path, e.g. +    flush 
-                        "/home/djangoprojects/myproject". +    inspectdb 
-  --traceback           Print traceback on exception +    loaddata 
-  --version             show program's version number and exit +    makemessages 
-  -h, --help            show this help message and exit +    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> </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.1437393935.txt.gz
  • 最終更新: 2019/05/18 02:23
  • (外部編集)