서승완

refactor: downgrade django to 1.11

1 +MIT License
2 +
3 +Copyright (c) 김대연, 서승완, 이우진, 홍준식
4 +
5 +Permission is hereby granted, free of charge, to any person obtaining a copy
6 +of this software and associated documentation files (the "Software"), to deal
7 +in the Software without restriction, including without limitation the rights
8 +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 +copies of the Software, and to permit persons to whom the Software is
10 +furnished to do so, subject to the following conditions:
11 +
12 +The above copyright notice and this permission notice shall be included in all
13 +copies or substantial portions of the Software.
14 +
15 +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 +SOFTWARE.
1 -# KhuBox 1 +# KhuBox · [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE) [![Python 3.6.5](https://img.shields.io/badge/python-3.6.5-blue.svg)](https://www.python.org/downloads/release/python-365/) [![Node 12.16.3](https://img.shields.io/badge/node-12.16.3-brightgreen.svg)](https://nodejs.org/dist/v12.16.3/) [![build status](http://khuhub.khu.ac.kr/2020-1-CloudComputing-E/E_Team_KhuBox/badges/master/build.svg)](http://khuhub.khu.ac.kr/2020-1-CloudComputing-E/E_Team_KhuBox/commits/master)
2 2
3 -경희대학교 클라우드컴퓨팅(CSE335) E조 3 +2020년 1학기 경희대학교 클라우드컴퓨팅(CSE335) E조
4 4
5 AWS를 활용한 Dropbox 개발 프로젝트 5 AWS를 활용한 Dropbox 개발 프로젝트
6 6
...@@ -13,3 +13,19 @@ AWS를 활용한 Dropbox 개발 프로젝트 ...@@ -13,3 +13,19 @@ AWS를 활용한 Dropbox 개발 프로젝트
13 - 컴퓨터공학과 2016104147 이우진 13 - 컴퓨터공학과 2016104147 이우진
14 14
15 - 컴퓨터공학과 2018102249 홍준식 15 - 컴퓨터공학과 2018102249 홍준식
16 +
17 +## 기술 스택
18 +
19 +1. Front-end : React
20 +
21 +2. Back-end : Django
22 +
23 +3. Database : MySQL
24 +
25 +4. DevOps : GitLab CI
26 +
27 +5. Infrastructure : AWS Lambda, Amazon API Gateway, Amazon CloudFront, Amazon RDS, Amazon S3
28 +
29 +## 라이선스
30 +
31 +[MIT License](LICENSE)
......
1 +import pymysql
2 +
3 +pymysql.install_as_MySQLdb()
......
1 -"""
2 -ASGI config for config project.
3 -
4 -It exposes the ASGI callable as a module-level variable named ``application``.
5 -
6 -For more information on this file, see
7 -https://docs.djangoproject.com/en/3.0/howto/deployment/asgi/
8 -"""
9 -
10 -import os
11 -
12 -from django.core.asgi import get_asgi_application
13 -
14 -os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings')
15 -
16 -application = get_asgi_application()
1 """ 1 """
2 Django settings for config project. 2 Django settings for config project.
3 3
4 -Generated by 'django-admin startproject' using Django 3.0.5. 4 +Generated by 'django-admin startproject' using Django 1.11.29.
5 5
6 For more information on this file, see 6 For more information on this file, see
7 -https://docs.djangoproject.com/en/3.0/topics/settings/ 7 +https://docs.djangoproject.com/en/1.11/topics/settings/
8 8
9 For the full list of settings and their values, see 9 For the full list of settings and their values, see
10 -https://docs.djangoproject.com/en/3.0/ref/settings/ 10 +https://docs.djangoproject.com/en/1.11/ref/settings/
11 """ 11 """
12 12
13 import os 13 import os
...@@ -17,21 +17,20 @@ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) ...@@ -17,21 +17,20 @@ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
17 17
18 18
19 # Quick-start development settings - unsuitable for production 19 # Quick-start development settings - unsuitable for production
20 -# See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/ 20 +# See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/
21 21
22 # SECURITY WARNING: keep the secret key used in production secret! 22 # SECURITY WARNING: keep the secret key used in production secret!
23 -SECRET_KEY = '54%9+(m*y8^!3ndhohxko%fd*$z==)k=$5jwx55-v@$y_f7=co' 23 +SECRET_KEY = 'wfs076redt^-5_*dw6!_dqz*2z!a_#()33y@r_q7&+4r_40h9$'
24 24
25 # SECURITY WARNING: don't run with debug turned on in production! 25 # SECURITY WARNING: don't run with debug turned on in production!
26 DEBUG = True 26 DEBUG = True
27 27
28 -ALLOWED_HOSTS = [] 28 +ALLOWED_HOSTS = ['127.0.0.1', 'khubox-api.khunet.net']
29 29
30 30
31 # Application definition 31 # Application definition
32 32
33 INSTALLED_APPS = [ 33 INSTALLED_APPS = [
34 - 'khubox.apps.KhuboxConfig',
35 'django.contrib.admin', 34 'django.contrib.admin',
36 'django.contrib.auth', 35 'django.contrib.auth',
37 'django.contrib.contenttypes', 36 'django.contrib.contenttypes',
...@@ -72,22 +71,22 @@ WSGI_APPLICATION = 'config.wsgi.application' ...@@ -72,22 +71,22 @@ WSGI_APPLICATION = 'config.wsgi.application'
72 71
73 72
74 # Database 73 # Database
75 -# https://docs.djangoproject.com/en/3.0/ref/settings/#databases 74 +# https://docs.djangoproject.com/en/1.11/ref/settings/#databases
76 75
77 DATABASES = { 76 DATABASES = {
78 'default': { 77 'default': {
79 'ENGINE': 'django.db.backends.mysql', 78 'ENGINE': 'django.db.backends.mysql',
80 'NAME': 'khubox', 79 'NAME': 'khubox',
81 'USER': 'khubox', 80 'USER': 'khubox',
82 - 'PASSWORD': 'khubox', 81 + 'PASSWORD': '8f13dd391805db193227d3544b570b69',
83 - 'HOST': '127.0.0.1', 82 + 'HOST': 'khubox.cogff6stbbkv.ap-northeast-2.rds.amazonaws.com',
84 'PORT': '3306', 83 'PORT': '3306',
85 } 84 }
86 } 85 }
87 86
88 87
89 # Password validation 88 # Password validation
90 -# https://docs.djangoproject.com/en/3.0/ref/settings/#auth-password-validators 89 +# https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators
91 90
92 AUTH_PASSWORD_VALIDATORS = [ 91 AUTH_PASSWORD_VALIDATORS = [
93 { 92 {
...@@ -106,7 +105,7 @@ AUTH_PASSWORD_VALIDATORS = [ ...@@ -106,7 +105,7 @@ AUTH_PASSWORD_VALIDATORS = [
106 105
107 106
108 # Internationalization 107 # Internationalization
109 -# https://docs.djangoproject.com/en/3.0/topics/i18n/ 108 +# https://docs.djangoproject.com/en/1.11/topics/i18n/
110 109
111 LANGUAGE_CODE = 'ko-kr' 110 LANGUAGE_CODE = 'ko-kr'
112 111
...@@ -120,6 +119,6 @@ USE_TZ = True ...@@ -120,6 +119,6 @@ USE_TZ = True
120 119
121 120
122 # Static files (CSS, JavaScript, Images) 121 # Static files (CSS, JavaScript, Images)
123 -# https://docs.djangoproject.com/en/3.0/howto/static-files/ 122 +# https://docs.djangoproject.com/en/1.11/howto/static-files/
124 123
125 STATIC_URL = '/static/' 124 STATIC_URL = '/static/'
......
1 +"""config URL Configuration
2 +
3 +The `urlpatterns` list routes URLs to views. For more information please see:
4 + https://docs.djangoproject.com/en/1.11/topics/http/urls/
5 +Examples:
6 +Function views
7 + 1. Add an import: from my_app import views
8 + 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
9 +Class-based views
10 + 1. Add an import: from other_app.views import Home
11 + 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home')
12 +Including another URLconf
13 + 1. Import the include() function: from django.conf.urls import url, include
14 + 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
15 +"""
16 +from django.conf.urls import url
1 from django.contrib import admin 17 from django.contrib import admin
2 -from django.urls import include, path
3 18
4 urlpatterns = [ 19 urlpatterns = [
5 - path('', include('khubox.urls')), 20 + url(r'^admin/', admin.site.urls),
6 - path('admin/', admin.site.urls),
7 ] 21 ]
......
...@@ -4,13 +4,13 @@ WSGI config for config project. ...@@ -4,13 +4,13 @@ WSGI config for config project.
4 It exposes the WSGI callable as a module-level variable named ``application``. 4 It exposes the WSGI callable as a module-level variable named ``application``.
5 5
6 For more information on this file, see 6 For more information on this file, see
7 -https://docs.djangoproject.com/en/3.0/howto/deployment/wsgi/ 7 +https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/
8 """ 8 """
9 9
10 import os 10 import os
11 11
12 from django.core.wsgi import get_wsgi_application 12 from django.core.wsgi import get_wsgi_application
13 13
14 -os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings') 14 +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings")
15 15
16 application = get_wsgi_application() 16 application = get_wsgi_application()
......
1 -from django.urls import path
2 -
3 -from . import views
4 -
5 -urlpatterns = [
6 - path('', views.index, name='index'),
7 -]
1 -from django.http import HttpResponse 1 +from django.shortcuts import render
2 2
3 - 3 +# Create your views here.
4 -def index(request):
5 - return HttpResponse("Hello, world. You're at the index.")
......
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 -"""Django's command-line utility for administrative tasks."""
3 import os 2 import os
4 import sys 3 import sys
5 4
6 - 5 +if __name__ == "__main__":
7 -def main(): 6 + os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings")
8 - os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings')
9 try: 7 try:
10 from django.core.management import execute_from_command_line 8 from django.core.management import execute_from_command_line
11 - except ImportError as exc: 9 + except ImportError:
10 + # The above import may fail for some other reason. Ensure that the
11 + # issue is really that Django is missing to avoid masking other
12 + # exceptions on Python 2.
13 + try:
14 + import django
15 + except ImportError:
12 raise ImportError( 16 raise ImportError(
13 "Couldn't import Django. Are you sure it's installed and " 17 "Couldn't import Django. Are you sure it's installed and "
14 "available on your PYTHONPATH environment variable? Did you " 18 "available on your PYTHONPATH environment variable? Did you "
15 "forget to activate a virtual environment?" 19 "forget to activate a virtual environment?"
16 - ) from exc 20 + )
21 + raise
17 execute_from_command_line(sys.argv) 22 execute_from_command_line(sys.argv)
18 -
19 -
20 -if __name__ == '__main__':
21 - main()
......
1 +argcomplete==1.11.1
2 +boto3==1.13.16
3 +botocore==1.16.16
4 +certifi==2020.4.5.1
5 +cfn-flip==1.2.3
6 +chardet==3.0.4
7 +click==7.1.2
8 +Django==1.11.29
9 +docutils==0.15.2
10 +durationpy==0.5
11 +future==0.18.2
12 +hjson==3.0.1
13 +idna==2.9
14 +importlib-metadata==1.6.0
15 +jmespath==0.10.0
16 +-e git+http://khuhub.khu.ac.kr/2016104129/kappa.git@1b0e17bb6da7460d9d494828c682a5ef66736aa3#egg=kappa
17 +pip-tools==5.1.2
18 +placebo==0.9.0
19 +PyMySQL==0.9.3
20 +python-dateutil==2.6.1
21 +python-slugify==4.0.0
22 +pytz==2020.1
23 +PyYAML==5.3.1
24 +requests==2.23.0
25 +s3transfer==0.3.3
26 +six==1.15.0
27 +text-unidecode==1.3
28 +toml==0.10.1
29 +tqdm==4.46.0
30 +troposphere==2.6.1
31 +urllib3==1.25.9
32 +Werkzeug==0.16.1
33 +wsgi-request-logger==0.4.6
34 +zappa==0.51.0
35 +zipp==3.1.0
1 +{
2 + "production": {
3 + "aws_region": "ap-northeast-2",
4 + "django_settings": "config.settings",
5 + "profile_name": "default",
6 + "project_name": "khubox-api",
7 + "runtime": "python3.6",
8 + "s3_bucket": "khubox-deploy",
9 + "memory_size": 128,
10 + "vpc_config": {
11 + "SubnetIds": ["subnet-02d51e69"],
12 + "SecurityGroupIds": ["sg-09c30d37d6a504f5c"]
13 + }
14 + }
15 +}