February 23, 2021
←前回:Day 39 djangoで静的ファイルの使用方法
「Djangoを一から学びたい」とのことでありましたら[Day 1]Djangoの開発環境から読むことをおすすめします。
今日やったこと
・requirements.txtの追加
・Procfileの追加
・gitであれこれ
・GitHubにアップロード
requirements.txtとProcfileの追加
requirements.txtとProcfileをdjango_website02の直下に作成します。
中身は以下の通りです。
django
whitenoise
gunicorn
web: gunicorn django_website02.wsgi
ここで、GitHubとHerokuのアカウント設定をしておいてください
gitであれこれ
% git init
% git status
#ここに何かしらでます
#赤字になっているものをaddしていきます
% git add Profile
% git add requirements.txt
#さっき赤字だったものがみどりに変わったかと思います
% git status
% git commit -m 'Add'
GitHubにアップロード
ここは適当に作る
右上のプラスを押して作る
% git remote set-url origin https://github.com/kizashi7512/django-webisite-test02.git
#もし上のものでエラーが出れば
% git remote add origin https://github.com/kizashi7512/django-webisite-test02.git
% git push origin master
おわりに
paizacloudでやるとできるのですが自分のパソコンでやるとできません。
これがでます。なぞです。調べてもよくわかりませんでした。
djangoとは関係ないので一旦飛ばします
それではまたまた
←前回:Day 38 毎日続けるために方針を変えました
→次回:Day 41 djangoといろんなデータベースを接続する