LoginSignup
0
1

More than 3 years have passed since last update.

Python仮想環境でDjangoプロジェクトとアプリケーションを作成し、サーバ起動まで

Posted at

ほぼ自分用メモです。

Python仮想環境を作成する

C:\Users\UserName> python -m venv my_venv

my_venv: 仮想環境名

Scriptsディレクトリに移動

C:\Users\UserName> cd my_venv\Scripts

仮想環境に入る

> activate
(my_venv) C:\Users\UserName>

pipをアップグレードする

(my_venv) C:\Users\UserName> python -m pip install --upgrade pip

Djangoをインストールする

(my_venv) C:\Users\UserName> pip install django

Djangoプロジェクトを作成する

(my_venv) C:\Users\UserName> django-admin startproject myproject

myproject: プロジェクト名

アプリケーションを作成する

(my_venv) C:\Users\UserName> python manage.py startapp myapp

myapp: アプリケーション名

プロジェクトフォルダに移動する

(my_venv) C:\Users\UserName> cd myproject

サーバを起動する

(my_venv) C:\Users\UserName>myproject> python manage.py runserver
0
1
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
1