1. 이미지 업로드(동영상, 파일 업로드도 동일)
0) 에디터 설정
- 사이냅에디터 초기화 시 아래와 같은 설정값을 추가해줘야 합니다.
Code Block | ||
---|---|---|
| ||
// 사이냅에디터 설정 객체
var SynapEditorConfig = {
...
'editor.upload.image.param': {
'csrfmiddlewaretoken': '{{ csrf_token }}'
}
...
} |
1) 업로드 경로 설정
Code Block | ||
---|---|---|
| ||
# 프로젝트 urls.py urlpatterns = [ ... ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) |
...