0
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?

More than 3 years have passed since last update.

【自分用メモ】PyCharm/Djangoの開発環境構築

Last updated at Posted at 2019-11-09

Pythonの仮想環境を設定

pyenvに使用するPythonがインストールされていない場合はPythonをインストールする

# インストールされているpythonのバージョン確認
pyenv versions
# Pythonをインストール
pyenv install 3.7.2
# プロジェクトで使用するフォルダで実行
# Pythonのバージョンを切り替える
pyenv local 3.7.2
# 仮想環境を作成して有効にする
python -m venv venv
source ./venv/bin/activate

仮想環境を無効化したい場合は以下のコマンドで無効化できます。

deactivate

PyCharmの設定

Project Structureを設定する

1.Preferencesを選択する
pycharm_menu.png

2.Projectを選択する
3.Project Structureを選択する
pycharm_project_structure.png

4.django-admin startprojectで作成したフォルダを選択してSourcesをクリックするpycharm_project_structure_sources.png

pycharm_project_structure_sources_created.png

Project Interpreterを設定する

project_interpreter.png
Add_Local_Python_Interpreter.png

Djangoを有効にする

Preferences_django.png

runserverを設定する

edit_configurations.png
Run_Debug_Configurations.png
Run_Debug_Configurations-2.png

0
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
0
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?