서승완

refactor: downgrade django to 1.11

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