Skip to content

Commit

Permalink
updating webproject_3 high version
Browse files Browse the repository at this point in the history
  • Loading branch information
juyeonblue committed May 2, 2020
1 parent 03ba5a5 commit f9475bb
Show file tree
Hide file tree
Showing 11,705 changed files with 1,860,766 additions and 0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
3 changes: 3 additions & 0 deletions webproject_3_versionUp/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"python.pythonPath": "/usr/local/bin/python3"
}
Empty file.
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
3 changes: 3 additions & 0 deletions webproject_3_versionUp/exchangeproject/exchangeapp/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.contrib import admin

# Register your models here.
5 changes: 5 additions & 0 deletions webproject_3_versionUp/exchangeproject/exchangeapp/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from django.apps import AppConfig


class ExchangeappConfig(AppConfig):
name = 'exchangeapp'
Empty file.
Binary file not shown.
3 changes: 3 additions & 0 deletions webproject_3_versionUp/exchangeproject/exchangeapp/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.db import models

# Create your models here.
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<h1>캐나다 환전 결과페이지입니다.</h1>

<h3>입력한 한국 돈</h3>
{{korea}}

<h3>캐나다 환전 결과</h3>
{{can}}

<br>
<a href="{% url 'home' %}">home</a>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<head>
<meta charset="UTF-8">
</head>

<h1>환율페이지입니다.</h1>

<form action="{% url 'result' %}" method="post" >
{% csrf_token %}
<div class="form-group">
원화 환전
<input type="number" placeholder="숫자를 입력하시오" name='korea'>
환전하고 싶은 한국 돈을 숫자로 입력하세요.
</div>
<br>
<div class="buttoncollector">
<button type="submit" name="USD">미국</button>
<button type="submit" name="JPY">일본</button>
<button type="submit" name="EUR">유럽연합</button>
<button type="submit" name="CNY">중국</button>
<button type="submit" name="GBP">영국</button>
<button type="submit" name="AUD">호주</button>
<button type="submit" name="CAD">캐나다</button>
<button type="submit" name="NZD">뉴질랜드</button>
</div>
</form>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<h1>일본 환전 결과페이지입니다.</h1>

<h3>입력한 한국 돈</h3>
{{korea}}

<h3>일본 환전 결과</h3>
{{jpy}}

<br>
<a href="{% url 'home' %}">home</a>
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<head>
<meta charset="UTF-8">
</head>

<h1>환율 결과 페이지입니다.</h1>

<h4> 입력한 KOR 원</h4>
<div class = "card">
<div class = "container">
{{korea}}
</div>
</div>

<h4> KOR -> {{name}} 환전결과</h4>
<div class = "card">
<div class = "container">
{{country}}
</div>
</div>

<!-- <p>
<a href=''>home으로</a>
{{home}}
</p> -->
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<h1>미국 환전 결과페이지입니다.</h1>

<h3>입력한 한국 돈</h3>
{{korea}}

<h3>미국 환전 결과</h3>
{{usd}}

<br>
<a href="{% url 'home' %}">home</a>
3 changes: 3 additions & 0 deletions webproject_3_versionUp/exchangeproject/exchangeapp/tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.test import TestCase

# Create your tests here.
45 changes: 45 additions & 0 deletions webproject_3_versionUp/exchangeproject/exchangeapp/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
from django.shortcuts import render
import pandas as pd

url = 'https://search.naver.com/search.naver?sm=top_hty&fbm=1&ie=utf8&query=%EB%84%A4%EC%9D%B4%EB%B2%84+%ED%99%98%EC%9C%A8%EC%A1%B0%ED%9A%8C'
tables = pd.read_html(url)
df = tables[1]
df.columns
df=df[['매매기준율']]
exchange_list = df.values.tolist()
exchange_list = sum(exchange_list,[])

def home(request):
return render(request,'exchangeapp/home.html')

def about(request):
return render(request,'exchangeapp/about.html')


def usd(request):
korea = request.POST['korea']
korea = int(korea)
usd = korea/1217.50
return render(request,'exchangeapp/usd.html',{'korea':korea,'usd':usd})

def jpy(request):
korea = request.POST['korea']
korea = int(korea)
jpy = korea/1127.26*100
return render(request,'exchangeapp/jpy.html',{'korea':korea,'jpy':jpy})

def can(request):
korea = request.POST['korea']
korea = int(korea)
can = korea/871.70
return render(request,'exchangeapp/can.html',{'korea':korea,'can':can})

def result(request):
nation = list(['USD','JPY','EUR','CNY','GBP','AUD','CAD','NZD'])
for i in range(8):
if nation[i] in request.POST:
name = nation[i]
korea = request.POST['korea']
tocountry = int(korea)
tocountry = tocountry / exchange_list[i]
return render(request, 'exchangeapp/result.html', {'country': tocountry, 'name': name, 'korea': korea})
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
16 changes: 16 additions & 0 deletions webproject_3_versionUp/exchangeproject/exchangeproject/asgi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"""
ASGI config for exchangeproject 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', 'exchangeproject.settings')

application = get_asgi_application()
121 changes: 121 additions & 0 deletions webproject_3_versionUp/exchangeproject/exchangeproject/settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
"""
Django settings for exchangeproject project.
Generated by 'django-admin startproject' using Django 3.0.5.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.0/ref/settings/
"""

import os

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
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/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'nm1on%#-h(-rnf)*l84$!d!^ti_x=nvo#8)a%=%72uzskutzbj'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS = []


# Application definition

INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'exchangeapp.apps.ExchangeappConfig',
]

MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]

ROOT_URLCONF = 'exchangeproject.urls'

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]

WSGI_APPLICATION = 'exchangeproject.wsgi.application'


# Database
# https://docs.djangoproject.com/en/3.0/ref/settings/#databases

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}


# Password validation
# https://docs.djangoproject.com/en/3.0/ref/settings/#auth-password-validators

AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]


# Internationalization
# https://docs.djangoproject.com/en/3.0/topics/i18n/

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/3.0/howto/static-files/

STATIC_URL = '/static/'
28 changes: 28 additions & 0 deletions webproject_3_versionUp/exchangeproject/exchangeproject/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
"""exchangeproject URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
Including another URLconf
1. Import the include() function: from django.urls import include, path
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path
import exchangeapp.views

urlpatterns = [
path('admin/', admin.site.urls),
path('',exchangeapp.views.home,name='home'),
path('usd/',exchangeapp.views.usd,name='usd'),
path('jpy/',exchangeapp.views.jpy,name='jpy'),
path('can/',exchangeapp.views.can,name='can'),
path('result/',exchangeapp.views.result,name='result'),
path('about/',exchangeapp.views.about,name='about')
]
16 changes: 16 additions & 0 deletions webproject_3_versionUp/exchangeproject/exchangeproject/wsgi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"""
WSGI config for exchangeproject 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/
"""

import os

from django.core.wsgi import get_wsgi_application

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'exchangeproject.settings')

application = get_wsgi_application()
21 changes: 21 additions & 0 deletions webproject_3_versionUp/exchangeproject/manage.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys


def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'exchangeproject.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
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
execute_from_command_line(sys.argv)


if __name__ == '__main__':
main()
Binary file not shown.
Loading

0 comments on commit f9475bb

Please sign in to comment.