Skip to content

Commit 059046b

Browse files
authored
Merge pull request #1 from tiangolo/master
Merge in tiangolo/master
2 parents 14fe548 + 45317e5 commit 059046b

File tree

6 files changed

+18
-11
lines changed

6 files changed

+18
-11
lines changed

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,12 @@ After using this generator, your new project (the directory created) will contai
150150

151151
* Update development scripts.
152152

153+
* Read Alembic configs from env vars. PR <a href="https://github.com/tiangolo/full-stack-fastapi-postgresql/pull/9" target="_blank">#9</a> by <a href="https://github.com/ebreton" target="_blank">@ebreton</a>.
154+
155+
* Create DB Item objects from all Pydantic model's fields.
156+
157+
* Update Jupyter Lab installation and util script/environment variable for local development.
158+
153159
### 0.3.0
154160

155161
* PR <a href="https://github.com/tiangolo/full-stack-fastapi-postgresql/pull/14" target="_blank">#14</a>:
@@ -163,7 +169,7 @@ After using this generator, your new project (the directory created) will contai
163169
* Update migrations to include new Items.
164170
* Update project README.md with tips about how to start with backend.
165171

166-
* Upgrade Python to 3.7 as Celery is now compatible too. <a href="https://github.com/tiangolo/full-stack-fastapi-postgresql/pull/10" target="_blank">PR #10</a> by <a href="https://github.com/ebreton" target="_blank">@ebreton</a>.
172+
* Upgrade Python to 3.7 as Celery is now compatible too. PR <a href="https://github.com/tiangolo/full-stack-fastapi-postgresql/pull/10" target="_blank">#10</a> by <a href="https://github.com/ebreton" target="_blank">@ebreton</a>.
167173

168174
### 0.2.2
169175

{{cookiecutter.project_slug}}/backend/app/app/crud/item.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ def get_multi_by_owner(
2828

2929

3030
def create(db_session: Session, *, item_in: ItemCreate, owner_id: int) -> Item:
31-
item = Item(title=item_in.title, description=item_in.description, owner_id=owner_id)
31+
item_in_data = jsonable_encoder(item_in)
32+
item = Item(**item_in_data, owner_id=owner_id)
3233
db_session.add(item)
3334
db_session.commit()
3435
db_session.refresh(item)

{{cookiecutter.project_slug}}/backend/backend.dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ RUN pip install celery~=4.3 passlib[bcrypt] tenacity requests emails "fastapi>=0
44

55
# For development, Jupyter remote kernel, Hydrogen
66
# Using inside the container:
7-
# jupyter notebook --ip=0.0.0.0 --allow-root
7+
# jupyter lab --ip=0.0.0.0 --allow-root --NotebookApp.custom_display_url=http://127.0.0.1:8888
88
ARG env=prod
9-
RUN bash -c "if [ $env == 'dev' ] ; then pip install jupyter ; fi"
9+
RUN bash -c "if [ $env == 'dev' ] ; then pip install jupyterlab ; fi"
1010
EXPOSE 8888
1111

1212
COPY ./app /app

{{cookiecutter.project_slug}}/backend/celeryworker.dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ RUN pip install raven celery~=4.3 passlib[bcrypt] tenacity requests "fastapi>=0.
44

55
# For development, Jupyter remote kernel, Hydrogen
66
# Using inside the container:
7-
# jupyter notebook --ip=0.0.0.0 --allow-root
7+
# jupyter lab --ip=0.0.0.0 --allow-root --NotebookApp.custom_display_url=http://127.0.0.1:8888
88
ARG env=prod
9-
RUN bash -c "if [ $env == 'dev' ] ; then pip install jupyter ; fi"
9+
RUN bash -c "if [ $env == 'dev' ] ; then pip install jupyterlab ; fi"
1010
EXPOSE 8888
1111

1212
ENV C_FORCE_ROOT=1

{{cookiecutter.project_slug}}/backend/tests.dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ RUN pip install requests pytest tenacity passlib[bcrypt] "fastapi>=0.16.0" psyco
44

55
# For development, Jupyter remote kernel, Hydrogen
66
# Using inside the container:
7-
# jupyter notebook --ip=0.0.0.0 --allow-root
7+
# jupyter lab --ip=0.0.0.0 --allow-root --NotebookApp.custom_display_url=http://127.0.0.1:8888
88
ARG env=prod
9-
RUN bash -c "if [ $env == 'dev' ] ; then pip install jupyter ; fi"
9+
RUN bash -c "if [ $env == 'dev' ] ; then pip install jupyterlab ; fi"
1010
EXPOSE 8888
1111

1212
COPY ./app /app

{{cookiecutter.project_slug}}/docker-compose.dev.env.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ version: '3.3'
22
services:
33
backend:
44
environment:
5-
- 'JUPYTER=jupyter notebook --ip=0.0.0.0 --allow-root'
5+
- JUPYTER=jupyter lab --ip=0.0.0.0 --allow-root --NotebookApp.custom_display_url=http://127.0.0.1:8888
66
- SERVER_HOST=http://${DOMAIN}
77
celeryworker:
88
environment:
99
- RUN=celery worker -A app.worker -l info -Q main-queue -c 1
10-
- JUPYTER=jupyter notebook --ip=0.0.0.0 --allow-root
10+
- JUPYTER=jupyter lab --ip=0.0.0.0 --allow-root --NotebookApp.custom_display_url=http://127.0.0.1:8888
1111
- SERVER_HOST=http://${DOMAIN}
1212
backend-tests:
1313
environment:
14-
- JUPYTER=jupyter notebook --ip=0.0.0.0 --allow-root
14+
- JUPYTER=jupyter lab --ip=0.0.0.0 --allow-root --NotebookApp.custom_display_url=http://127.0.0.1:8888

0 commit comments

Comments
 (0)