Skip to content

mm0202-template/vscode-remote-dev_django

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vscode-remote-dev-container

Template of vscode remote development container

dev container setup

Create new repository

ページ右上にある、Use this templateをクリックして、新しいリポジトリを作成してください。

作成したリポジトリをクローン

Remote Container 拡張機能のインストール

Remote Containerをインストールしていない場合は、以下のページの「「Dev Container」用の拡張機能のインストール」を参照してください。

「Dev Container」用の拡張機能のインストール | 【VS Code】Remote Development テンプレートを作ってみました!

表示名の設定

.devcontainer/devcontainer.jsonname フィールドに、適当な名称を設定してください。

その他

その他の調整は以下のページを参照してください。

【VS Code】Remote Development テンプレートを作ってみました!

start dev container

コマンドパレットからRemote-Containers: Reopen in Containerを選択

create project

django-admin startproject [project_name] .

add DB access setting

[project_name]/settings.pyDATABASESを以下のように置き換えてください。

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql',
        'NAME': 'postgres',
        'USER': 'postgres',
        'PASSWORD': 'postgres',
        'HOST': 'db',
        'PORT': 5432,
    }
}

start dev server

python manage.py runserver 0:8000

check page

http://localhost:8000を開いて、以下のように表示されれば設定完了です。

注意事項

パスワードがべた書きなので、必要に合わせて.envファイルなどを利用してください。

  • docker-compose.yml - POSTGRES_PASSWORD
  • [project_name]/settings.py - DATABESES - PASSWORD

About

Template for Django dev environment

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published