20
7

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.

Python3.7とDjango1系が一緒に使えない

Last updated at Posted at 2018-07-25

やろうとしたこと

DockerでDjango環境の構築
https://docs.docker.com/compose/django/#connect-the-database
公式に従ってやろうとした

エラー

SyntaxError: Generator expression must be parenthesized

原因

Python3.7とDjango1系を併用してはいけないっぽい

解決策

Dockerfile

# ここが元々はFROM python:3になってるせいでPython3.7がインストールされてた
FROM python:3.6
ENV PYTHONUNBUFFERED 1
RUN mkdir /code
WORKDIR /code
ADD requirements.txt /code/
RUN pip install -r requirements.txt
ADD . /code/

もし引っかかってからこの記事を見たら

誤って構成されたimageを消し、生成されたDjango関係のmanage.pyやディレクトリを消してからやり直しましょう

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?