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 1 year has passed since last update.

Djangoの環境構築

Last updated at Posted at 2022-07-03

この記事の概要

Djangoの環境構築について記す

Djangoのインストール→プロジェクト作成→アプリ作成→アプリ起動

Djangoのインストール

// python3,pip3のインストール(homebrew)
$ brew install python3
// .zshrcにpathを書く
export PATH="/usr/local/opt/python@3.7/libexec/bin:$PATH"
// djangoのインストール(pip3)
$ pip3 install django
// djangoのインストール確認
$ pip3 list

Djangoのプロジェクト作成

// djangoプロジェクト作成
$ django-admin startproject config .

Djangoのアプリ作成

// djangoアプリ作成
$ python3 manage.py startapp app
// 初期マイグレーション
$ python3 manage.py migrate
config/settings.py
// アプリの設定
INSTALLED_APPS = [
    'app' # 追加
]

Djangoアプリ起動

// djangoアプリ起動
$ python3 manage.py runserver
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?