Python3
下書きの肥やしになっていたdjangoの試した時のメモ。 環境 software version django 2.2.1 アプリケーションファイル views.py from django.http import HttpResponse def index(request): return HttpResponse("Hello, world. You're at the polls index."…
Pythonで以下のようなif not 条件1 or 条件2を実行する。 def sleep_in(weekday, vacation): if not weekday or vacation: return True else: return False すると以下のような結果となる。 weekday vacation 実行結果 True True True True False False Fals…
環境 software version amazon linux 2018.03 python 3.7.3 django 2.2.1 mysql 5.7 DjangoとMySQLを接続するにあたって公式の推奨に従い、mysqlclientを選択する。 docs.djangoproject.com python の設定 以下を参考に実施する。 danieleriksson.net パッケ…