1
1

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 5 years have passed since last update.

Django Girls Tutorialを復習する(1) 〜Djangoのインストール+プロジェクトを作成しよう!〜

Last updated at Posted at 2019-07-04

注意事項はこちら。
https://qiita.com/K-Kazutaka/items/1a432bda4f723e6757d6
写経用の記事です。

~$ mkdir djangogirls
 #プロジェクトを作成。mkdir + プロジェクト名

~$ cd djangogirls
 #ディレクトリを移動。cd + プロジェクト名

~$ python3 -m venv myvenv
 #仮想環境を構築。python3 -m venv +仮想環境名

~$ source myvenv/bin/activate
 #仮想環境内へ。source 仮想環境名/bin/activate

~$ python3 -m pip install --upgrade pip
 #Djangoのインストール

~$ echo "Django~=2.0.6" > requirements.txt
 #djangogirls内に、DjangoのVerを記したファイルを作成

~$ pip install -r requirements.txt
 #requirements.txt を実行してDjangoをインストール。   

~$ django-admin startproject mysite .
 #プロジェクトを作成。

mysite/settings.py
TIME_ZONE = 'Asia/Tokyo'

LANGUAGE_CODE = 'ja'


STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static')


ALLOWED_HOSTS = ['127.0.0.1', '.pythonanywhere.com']

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
    }
}

~$ python manage.py migrate
 #ブログのデータベースを作成する

~$ python manage.py runserver
 #ウェブサーバを起動する

1
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
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?