Merge remote-tracking branch 'origin/master' into feature/frontend
# Conflicts: # backend/api/views.py # backend/khudrive/settings.py
Showing
5 changed files
with
24 additions
and
4 deletions
... | @@ -14,7 +14,7 @@ class Item(models.Model): | ... | @@ -14,7 +14,7 @@ class Item(models.Model): |
14 | is_deleted = models.BooleanField(default = False) | 14 | is_deleted = models.BooleanField(default = False) |
15 | created_time = models.DateTimeField(auto_now=True) | 15 | created_time = models.DateTimeField(auto_now=True) |
16 | updated_time = models.DateTimeField(null=True) | 16 | updated_time = models.DateTimeField(null=True) |
17 | - status = models.BooleanField() | 17 | + status = models.BooleanField(default=False) |
18 | 18 | ||
19 | #file = models.FileField(upload_to = \path) | 19 | #file = models.FileField(upload_to = \path) |
20 | 20 | ... | ... |
This diff is collapsed. Click to expand it.
... | @@ -11,10 +11,17 @@ https://docs.djangoproject.com/en/3.0/ref/settings/ | ... | @@ -11,10 +11,17 @@ https://docs.djangoproject.com/en/3.0/ref/settings/ |
11 | """ | 11 | """ |
12 | 12 | ||
13 | import os | 13 | import os |
14 | +import sys | ||
15 | +import json | ||
14 | 16 | ||
15 | # Build paths inside the project like this: os.path.join(BASE_DIR, ...) | 17 | # Build paths inside the project like this: os.path.join(BASE_DIR, ...) |
16 | BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) | 18 | BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) |
17 | 19 | ||
20 | +ROOT_DIR = os.path.dirname(BASE_DIR) | ||
21 | +# secrets.json의 경로 | ||
22 | +SECRETS_PATH = os.path.join(ROOT_DIR, 'secrets.json') | ||
23 | +# json파일을 파이썬 객체로 변환 | ||
24 | +secrets = json.loads(open(SECRETS_PATH).read()) | ||
18 | 25 | ||
19 | # Quick-start development settings - unsuitable for production | 26 | # Quick-start development settings - unsuitable for production |
20 | # See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/ | 27 | # See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/ |
... | @@ -127,3 +134,11 @@ USE_TZ = True | ... | @@ -127,3 +134,11 @@ USE_TZ = True |
127 | # https://docs.djangoproject.com/en/3.0/howto/static-files/ | 134 | # https://docs.djangoproject.com/en/3.0/howto/static-files/ |
128 | 135 | ||
129 | STATIC_URL = '/static/' | 136 | STATIC_URL = '/static/' |
137 | + | ||
138 | + | ||
139 | +#S3 | ||
140 | +DEFAULT_FILE_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage' | ||
141 | +STATICFILES_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage' | ||
142 | + | ||
143 | +for key, value in secrets.items(): | ||
144 | + setattr(sys.modules[__name__], key, value) | ||
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
... | @@ -30,11 +30,15 @@ urlpatterns = [ | ... | @@ -30,11 +30,15 @@ urlpatterns = [ |
30 | path('admin/', admin.site.urls), | 30 | path('admin/', admin.site.urls), |
31 | path('', include(router.urls)), | 31 | path('', include(router.urls)), |
32 | url(r'^search/$', views.ItemViewSet.search, name='search'), | 32 | url(r'^search/$', views.ItemViewSet.search, name='search'), |
33 | + url(r'^<int:pk>/delete/$', views.ItemViewSet.delete, name='delete'), | ||
34 | + url(r'^<int:pk>/restore/$', views.ItemViewSet.restore, name='restore'), | ||
33 | url(r'^<int:pk>/share/$', views.SharedItemViewSet.share, name='share'), | 35 | url(r'^<int:pk>/share/$', views.SharedItemViewSet.share, name='share'), |
34 | url(r'^<int:pk>/move/$', views.ItemViewSet.move, name='move'), | 36 | url(r'^<int:pk>/move/$', views.ItemViewSet.move, name='move'), |
35 | url(r'^<int:pk>/copy/$', views.ItemViewSet.copy, name='copy'), | 37 | url(r'^<int:pk>/copy/$', views.ItemViewSet.copy, name='copy'), |
36 | - url(r'^<int:pk>/children/$', views.ItemViewSet.children, name='copy'), | 38 | + url(r'^<int:pk>/children/$', views.ItemViewSet.children, name='children'), |
39 | + url(r'^trash/$', views.ItemViewSet.trash, name='trash'), | ||
37 | url(r'^signup/$', views.UserViewSet.signup, name='signup'), | 40 | url(r'^signup/$', views.UserViewSet.signup, name='signup'), |
38 | url(r'^login/$', views.UserViewSet.login, name='login'), | 41 | url(r'^login/$', views.UserViewSet.login, name='login'), |
39 | - | 42 | + url(r'^upload/$', views.ItemViewSet.upload, name='upload'), |
40 | -] | 43 | + url(r'^status/$', views.ItemViewSet.status, name='status'), |
44 | +] | ||
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
-
Please register or login to post a comment