신은섭(Shin Eun Seop)

delete s3direct module

......@@ -23,7 +23,6 @@ INSTALLED_APPS = [
'rest_framework',
'restful.apps.RestfulConfig',
'website',
's3direct',
]
MIDDLEWARE = [
......@@ -122,44 +121,4 @@ LOGIN_REDIRECT_URL = '/'
AWS_ACCESS_KEY_ID = aws_conf.AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY = aws_conf.AWS_SECRET_ACCESS_KEY
AWS_STORAGE_BUCKET_NAME = aws_conf.AWS_STORAGE_BUCKET_NAME
# The region of your bucket, more info:
# http://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region
S3DIRECT_REGION = 'ap-northeast-2'
# Destinations, with the following keys:
#
# key [required] Where to upload the file to, can be either:
# 1. '/' = Upload to root with the original filename.
# 2. 'some/path' = Upload to some/path with the original filename.
# 3. functionName = Pass a function and create your own path/filename.
# key_args [optional] Arguments to be passed to 'key' if it's a function.
# auth [optional] An ACL function to whether the current Django user can perform this action.
# allowed [optional] List of allowed MIME types.
# acl [optional] Give the object another ACL rather than 'public-read'.
# cache_control [optional] Cache control headers, eg 'max-age=2592000'.
# content_disposition [optional] Useful for sending files as attachments.
# bucket [optional] Specify a different bucket for this particular object.
# server_side_encryption [optional] Encryption headers for buckets that require it.
S3DIRECT_DESTINATIONS = {
'example_destination': {
# REQUIRED
'key': '/',
# OPTIONAL
#'auth': lambda u: u.is_staff, # Default allow anybody to upload
#'allowed': ['image/jpeg', 'image/png', 'video/mp4'], # Default allow all mime types
#'bucket': 'pdf-bucket', # Default is 'AWS_STORAGE_BUCKET_NAME'
'acl': 'private', # Defaults to 'public-read'
'cache_control': 'max-age=2592000', # Default no cache-control
#'content_disposition': 'attachment', # Default no content disposition
#'content_length_range': (5000, 20000000), # Default allow any size
#'server_side_encryption': 'AES256', # Default no encryption
},
'example_other': {
'key': lambda filename, args: args + '/' + filename,
'key_args': 'uploads/images', # Only if 'key' is a function
}
}
AWS_STORAGE_BUCKET_NAME = aws_conf.AWS_STORAGE_BUCKET_NAME
\ No newline at end of file
......
......@@ -10,6 +10,5 @@ urlpatterns = [
url(r'^accounts/login/$', views.login, name='login'),
url(r'^accounts/logout/$', views.logout, name='logout', kwargs={'next_page': '/'}),
url(r'^s3direct/', include('s3direct.urls')),
]
......
from django import forms
from s3direct.widgets import S3DirectWidget
class S3DirectUploadForm(forms.Form):
images = forms.URLField(widget=S3DirectWidget(dest='example_destination'))
......
from django.db import models
from s3direct.fields import S3DirectField
class Example(models.Model):
video = S3DirectField(dest='example_destination')
\ No newline at end of file
from django.db import models
\ No newline at end of file
......
......@@ -2,7 +2,6 @@ from django.shortcuts import render, get_object_or_404, redirect, Http404
from django.utils import timezone
from django.contrib.auth.decorators import login_required
from django.views.generic import FormView
from website.forms import S3DirectUploadForm
from restful.models import File
import requests
......