Skip to content

Commit 522d143

Browse files
committed
files API
1 parent 90b73ce commit 522d143

File tree

22 files changed

+1546
-42
lines changed

22 files changed

+1546
-42
lines changed

.envs/.local/.django

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# General
22
# ------------------------------------------------------------------------------
3+
DATALAKE_STRICT_WHATS=False
4+
DATALAKE_STRICT_WORK_ID=False
35
USE_DOCKER=yes
46
IPYTHONDIR=/app/.ipython
57
DJANGO_JWT_SECRET=ILIKEASCREThowlongdoesitNeedtTOBeHey
8+
DJANGO_FILE_STORAGE_PATH=/tmp/django-file-storage

Pipfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ python-jose = "*"
2323
tabulate = "*"
2424
django-environ = "*"
2525
python-dateutil = "*"
26+
boto3 = "*"
27+
datalake-common-dtkav = ">=0.29"
28+
py-multihash = "*"
29+
py-multibase = "*"
2630

2731
[dev-packages]
2832
pylint = "*"

Pipfile.lock

Lines changed: 119 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cli/psql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
COMPOSE_ENV=${COMPOSE_ENV:-local.yml}
33
CMD='PGPASSWORD=$POSTGRES_PASSWORD psql -h $POSTGRES_HOST -U $POSTGRES_USER -p $POSTGRES_PORT $POSTGRES_DB'
44

5-
docker-compose -f $COMPOSE_ENV run --rm postgres \
5+
docker-compose -f $COMPOSE_ENV exec postgres \
66
bash -c "$CMD"

config/settings/base.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
LOCAL_APPS = [
7575
# Your stuff: custom apps go here
7676
'home',
77+
'datalake',
7778
]
7879
# https://docs.djangoproject.com/en/dev/ref/settings/#installed-apps
7980
INSTALLED_APPS = DJANGO_APPS + THIRD_PARTY_APPS + LOCAL_APPS
@@ -260,6 +261,11 @@
260261
}
261262

262263

264+
# Datalake
265+
# ------------------------------------------------------------------------------
266+
DATALAKE_STRICT_WHATS = True
267+
DATALAKE_STRICT_WORK_ID = True
268+
263269
# Your stuff...
264270
# ------------------------------------------------------------------------------
265271
EPHEM_DIR = os.path.abspath(os.path.join(APPS_DIR, 'ephemeris'))
@@ -279,3 +285,5 @@ def immutable_file_test(path, url):
279285

280286

281287
WHITENOISE_IMMUTABLE_FILE_TEST = immutable_file_test
288+
289+
FILE_STORAGE_PATH = env.str('DJANGO_FILE_STORAGE_PATH')

config/settings/test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,4 @@
5353

5454
# Your stuff...
5555
# ------------------------------------------------------------------------------
56+
FILE_STORAGE_PATH = 's3://bucketname/django-file-storage/'

local.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ services:
2020
ports:
2121
- "8000:8000"
2222
command: /start
23+
restart: always
2324

2425
frontend:
2526
build:

missioncontrol/api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def object_does_not_exist(exception):
1919

2020

2121
def validation_error(exception):
22-
problem = connexion.problem(400, "Validation Error", str(exception))
22+
problem = connexion.problem(400, "Validation Error", exception.messages)
2323
return connexion.FlaskApi.get_response(problem)
2424

2525

missioncontrol/datalake/__init__.py

Whitespace-only changes.

missioncontrol/datalake/admin.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from django.contrib import admin
2+
from django import forms
3+
from . import models
4+
5+
admin.site.register(models.What)
6+
admin.site.register(models.RelatedFile)

0 commit comments

Comments
 (0)