Skip to content

Commit 273e816

Browse files
committed
move to psql
1 parent 1fdc855 commit 273e816

4 files changed

Lines changed: 16 additions & 2 deletions

File tree

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ WORKDIR /src
55
ADD requirements.txt /src/
66
RUN pip3 install -r /src/requirements.txt
77
ADD . /src/
8+
CMD ["python3", "/src/manage.py", "migrate"]

README.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,11 @@ Contributing
2222
$ python manage.py createsuperuser --username admin --email=team@python.ru
2323

2424

25+
How to run from Docker:
26+
27+
::
28+
29+
$ docker-compose build --no-cache
30+
$ docker-compose run web python3 /src/manage.py migrate
31+
$ docker-compose run web python3 /src/manage.py make_fish_data
32+
$ docker-compose up

python_ru/settings.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,11 @@
5454

5555
DATABASES = {
5656
'default': {
57-
'ENGINE': 'django.db.backends.sqlite3',
58-
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
57+
'ENGINE': 'django.db.backends.postgresql',
58+
'NAME': 'postgres',
59+
'USER': 'postgres',
60+
'HOST': 'db',
61+
'PORT': 5432,
5962
}
6063
}
6164

requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ ipython==6.1.0
55
factory-boy==2.7.0
66
django-ckeditor==5.3.0
77
Pillow==4.0.0
8+
psycopg2==2.6.2
9+
Faker==0.7.7

0 commit comments

Comments
 (0)