1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

LinuxでDjangoのバージョンをすぐに確認するコマンド

Posted at

Djangoのバージョン確認したいとき

Python で import django して print(django.get_version()) とか書くの面倒くさい…
そんなときに 一行で Django のバージョンを確認する方法があったので共有させていただきます。


✅ 方法

terminal(ターミナル)で以下のコマンドを打つだけ👇

python3 -m django --version

🖨️ 実行結果(例)

5.1.7

🧠 補足

  • Ubuntu では pythonpython3 にリンクされていない場合があるため、python3 を使おう
  • Django がインストールされていない場合は ModuleNotFoundError になるので注意!

✅ まとめ

やりたいこと コマンド
Djangoのバージョン確認 python3 -m django --version

1行で終わるから、毎回 python 起動 → import → print... の手間いらず!

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?