Toggle navigation
Toggle navigation
This project
Loading...
Sign in
신은섭(Shin Eun Seop)
/
2018-1-d.cloud
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
10
Merge Requests
0
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
신은섭(Shin Eun Seop)
2018-05-31 13:06:14 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
5244815cc27a19a5c92aba8a31527b50f6f8f737
5244815c
1 parent
a507c766
fix website file list
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
18 deletions
dcloud/restful/views.py
dcloud/website/urls.py
dcloud/website/views.py
dcloud/restful/views.py
View file @
5244815
...
...
@@ -13,21 +13,14 @@ class FileList(APIView):
List all file, or create a new snippet.
"""
def
get
(
self
,
request
,
path
=
'/'
,
format
=
None
):
# file = File.objects.all()
# serializer = FileSerializer(file, many=True)
# print(serializer.data)
# return Response(serializer.data)
def
get
(
self
,
request
,
path
=
"/"
,
format
=
None
):
data
=
s3_interface
.
list_path
(
s3_interface
.
BUCKET
,
'test1'
,
path
)
return
Response
(
data
)
def
post
(
self
,
request
,
format
=
None
):
serializer
=
FileSerializer
(
data
=
request
.
data
)
if
serializer
.
is_valid
():
serializer
.
save
()
return
Response
(
serializer
.
data
,
status
=
status
.
HTTP_201_CREATED
)
return
Response
(
serializer
.
errors
,
status
=
status
.
HTTP_400_BAD_REQUEST
)
def
post
(
self
,
request
,
path
=
"/"
,
format
=
None
):
# TODO file upload
return
Response
({})
class
FileDetail
(
APIView
):
...
...
dcloud/website/urls.py
View file @
5244815
...
...
@@ -11,5 +11,4 @@ urlpatterns = [
# blog
url
(
r'^$'
,
views
.
home
),
url
(
r'^files/'
,
views
.
file_list
,
name
=
'file_list'
),
url
(
r'^upload/'
,
views
.
upload
.
as_view
(),
name
=
'upload'
)
]
\ No newline at end of file
...
...
dcloud/website/views.py
View file @
5244815
...
...
@@ -13,11 +13,6 @@ def home(request):
@login_required
def
file_list
(
request
):
files
=
requests
.
get
(
'http://localhost:8000/restapi/
files
'
)
files
=
requests
.
get
(
'http://localhost:8000/restapi/
list
'
)
files
=
files
.
json
()
return
render
(
request
,
'website/file_list.html'
,
files
)
class
upload
(
FormView
):
template_name
=
'website/s3direct.html'
form_class
=
S3DirectUploadForm
\ No newline at end of file
...
...
Please
register
or
login
to post a comment