Commit 8107639f by 이태호

- main.html -> 기본 화면

- result_confirm.html -> 결과 확인 화면
- 촬영 요청 API: /image/capture
- 업로드 요청 API: /image/upload
parent da7dfa3a
venv
data/temp/* data/temp/*
data/upload/* data/upload/*
data/logs/* data/logs/*
...@@ -6,4 +7,4 @@ data/logs/* ...@@ -6,4 +7,4 @@ data/logs/*
web/static/js/**/*.js web/static/js/**/*.js
*.pyc *.pyc
.idea .idea
*.pot *.pot
\ No newline at end of file
...@@ -2,7 +2,11 @@ ...@@ -2,7 +2,11 @@
### 기본 정보 ### 기본 정보
- Flask 2.0.2 이상 - Flask 2.0.2 이상
<<<<<<< HEAD
- nodejs 10.x 이상
=======
- nodejs 11.x 이상 - nodejs 11.x 이상
>>>>>>> 449771c (- main.html -> 기본 화면)
- 기본 모듈과 패키지 구성, 설정 파일 구성 포함 - 기본 모듈과 패키지 구성, 설정 파일 구성 포함
- 폴더 구조 - 폴더 구조
...@@ -42,7 +46,37 @@ $. nvm use 10 ...@@ -42,7 +46,37 @@ $. nvm use 10
### JS 라이브러리 관련 ### JS 라이브러리 관련
- jss 폴더에 소스가 있고 webpack 을 이용하여 빌드하면 web/static/js 에 deploy 됨 - jss 폴더에 소스가 있고 webpack 을 이용하여 빌드하면 web/static/js 에 deploy 됨
<<<<<<< HEAD
- `npm install`, `npm run build`, `npm run watch` 등을 이용하여 사용
### 사용 방법
- 빌드 방법이 있긴하지만 절대로 이 프로젝트에 바로 사용하지 않는다.
- 다른 웹 기반 프로젝트 생성 시 최초에 본 프로젝트를 머지해서 사용한다.
- pull request 와 비슷한 방법으로 사용한다.
```bash
# 신규 프로젝트를 git 에서 생성, 예시 프로젝트명 : gogosing
# 생성한 프로젝트 clone
$> git clone https://...../gogosing
$> cd gogosing
# 신규 프로젝트의 remote에 레파지토리 등록, 예시 Alias : flask1st
$> git remote add flask1st https://gitlab.synap.co.kr/innodev/flask1st.git
# flask1st 를 pull 하여 최신 버전 유지
$> git pull flask1st
# flask1st 의 내용을 신규 프로젝트에 merge
$> git merge flask1st/master
# 신규 프로젝트에 생성된 템플릿 추가
$> git push origin
# 옵션) 필요 없는 경우 템플릿 리모트 제거
$> git remote remove flask1st
=======
- `npm install`, `npm run prod`, `npm run debug` 등을 이용하여 사용 - `npm install`, `npm run prod`, `npm run debug` 등을 이용하여 사용
>>>>>>> 449771c (- main.html -> 기본 화면)
``` ```
### 사용 방법 ### 사용 방법
......
...@@ -63,5 +63,4 @@ def init_app(config_object): ...@@ -63,5 +63,4 @@ def init_app(config_object):
# ------- register controller ------------------ # ------- register controller ------------------
from web.main import controller from web.main.controllers import main_controller
import os.path
from werkzeug.utils import secure_filename
from web import app
from flask import Flask, render_template, redirect
from flask import flash, request, redirect, url_for
@app.route('/')
def index():
return redirect('main')
@app.route('/main')
def main():
return render_template("main.html", msg="Hello World!")
@app.route('/image/capture')
def imageCapture():
print("image capture request \n")
return render_template("result_confirm.html")
@app.route('/image/upload')
def imageUpload():
print("image upload request \n")
return render_template("result_confirm.html")
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
<!--
The MIT License (MIT)
Copyright (c) 2013-2023 Start Bootstrap LLC
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.
-->
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content=""> <meta name="description" content="">
<meta name="author" content=""> <meta name="author" content="">
<<<<<<< HEAD
<title>Default Template</title> <title>Default Template</title>
<link href="/static/bundle/main.css" rel="stylesheet"> <link href="/static/bundle/main.css" rel="stylesheet">
=======
<title>Final OT</title>
>>>>>>> 449771c (- main.html -> 기본 화면)
<!-- Favicon-->
<link rel="icon" type="image/x-icon" href="../static/icon/favicon.ico" />
<!-- Bootstrap icons-->
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.5.0/font/bootstrap-icons.css" rel="stylesheet" type="text/css" />
<!-- Google fonts-->
<link href="https://fonts.googleapis.com/css?family=Lato:300,400,700,300italic,400italic,700italic" rel="stylesheet" type="text/css" />
<!-- Core theme CSS (includes Bootstrap)-->
<link href="../static/css/main_styles.css" rel="stylesheet" />
<!-- jQuery CDN 링크 -->
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<!-- Custom JavaScript -->
<script src="../static/js/main.js"></script>
</head> </head>
<body> <body>
<<<<<<< HEAD
<!-- Navigation --> <!-- Navigation -->
<nav class="navbar navbar-inverse"> <nav class="navbar navbar-inverse">
...@@ -57,14 +97,68 @@ ...@@ -57,14 +97,68 @@
<p class="card-text">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Sapiente dicta fugit fugiat hic aliquam itaque facere, soluta. Totam id dolores, sint aperiam sequi pariatur praesentium animi perspiciatis molestias iure, ducimus!</p> <p class="card-text">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Sapiente dicta fugit fugiat hic aliquam itaque facere, soluta. Totam id dolores, sint aperiam sequi pariatur praesentium animi perspiciatis molestias iure, ducimus!</p>
<span class="text-warning">&#9733; &#9733; &#9733; &#9733; &#9734;</span> <span class="text-warning">&#9733; &#9733; &#9733; &#9733; &#9734;</span>
4.0 stars 4.0 stars
=======
<!-- Masthead-->
<header class="masthead">
<div class="container position-relative" style="height: 300px; top: -150px">
<div class="row justify-content-center">
<div class="col-xl-6">
<div class="text-center text-white">
<!-- Page heading-->
<h1 class="mb-5">기본 화면</h1>
<div class="row">
<div class="col">
<input class="form-control form-control-lg" id="filePath" type="text" placeholder="파일 위치" />
</div>
<div class="col-auto">
<button class="btn btn-primary btn-lg" id="imgCaptureBtn" type="submit">촬영</button>
</div>
<div class="col-auto">
<button class="btn btn-primary btn-lg" id="uploadImgBtn" type="submit">업로드</button>
</div>
<form id="uploadForm" enctype="multipart/form-data" style="display: none;">
<input type="file" id="fileInput" name="file" accept=".jpg, .jpeg, .png, .gif, .pdf, .txt">
</form>
</div>
</div>
</div>
</div>
>>>>>>> 449771c (- main.html -> 기본 화면)
</div> </div>
</div> </header>
<!-- /.card -->
<!-- Footer-->
<div class="card card-outline-secondary my-4"> <footer class="footer bg-light">
<div class="card-header"> <div class="container">
Product Reviews <div class="row">
<div class="col-lg-6 h-100 text-center text-lg-start my-auto">
<ul class="list-inline mb-2">
<li class="list-inline-item"><a href="#!">About</a></li>
<li class="list-inline-item"></li>
<li class="list-inline-item"><a href="#!">Contact</a></li>
<li class="list-inline-item"></li>
<li class="list-inline-item"><a href="#!">Terms of Use</a></li>
<li class="list-inline-item"></li>
<li class="list-inline-item"><a href="#!">Privacy Policy</a></li>
</ul>
<p class="text-muted small mb-4 mb-lg-0">&copy; Your Website 2023. All Rights Reserved.</p>
</div>
<div class="col-lg-6 h-100 text-center text-lg-end my-auto">
<ul class="list-inline mb-0">
<li class="list-inline-item me-4">
<a href="#!"><i class="bi-facebook fs-3"></i></a>
</li>
<li class="list-inline-item me-4">
<a href="#!"><i class="bi-twitter fs-3"></i></a>
</li>
<li class="list-inline-item">
<a href="#!"><i class="bi-instagram fs-3"></i></a>
</li>
</ul>
</div>
</div>
</div> </div>
<<<<<<< HEAD
<div class="card-body"> <div class="card-body">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Omnis et enim aperiam inventore, similique necessitatibus neque non! Doloribus, modi sapiente laboriosam aperiam fugiat laborum. Sequi mollitia, necessitatibus quae sint natus.</p> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Omnis et enim aperiam inventore, similique necessitatibus neque non! Doloribus, modi sapiente laboriosam aperiam fugiat laborum. Sequi mollitia, necessitatibus quae sint natus.</p>
<small class="text-muted">Posted by Anonymous on 3/1/17</small> <small class="text-muted">Posted by Anonymous on 3/1/17</small>
...@@ -100,5 +194,18 @@ ...@@ -100,5 +194,18 @@
<script src='/static/bundle/main.js'></script> <script src='/static/bundle/main.js'></script>
</body> </body>
=======
</footer>
<!-- Bootstrap core JS-->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js"></script>
<!-- Core theme JS-->
<!-- <script src="js/scripts.js"></script> -->
<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *-->
<!-- * * SB Forms JS * *-->
<!-- * * Activate your form at https://startbootstrap.com/solution/contact-forms * *-->
<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *-->
<!-- <script src="https://cdn.startbootstrap.com/sb-forms-latest.js"></script>-->
</body>
>>>>>>> 449771c (- main.html -> 기본 화면)
</html> </html>
<!--
The MIT License (MIT)
Copyright (c) 2013-2023 Start Bootstrap LLC
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.
-->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<title>Final OT</title>
<!-- Favicon-->
<link rel="icon" type="image/x-icon" href="../static/icon/favicon.ico" />
<!-- Bootstrap icons-->
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.5.0/font/bootstrap-icons.css" rel="stylesheet" type="text/css" />
<!-- Google fonts-->
<link href="https://fonts.googleapis.com/css?family=Lato:300,400,700,300italic,400italic,700italic" rel="stylesheet" type="text/css" />
<!-- Core theme CSS (includes Bootstrap)-->
<link href="../static/css/result_confirm_styles.css" rel="stylesheet" />
<!-- jQuery CDN 링크 -->
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<!-- Custom JavaScript -->
<script src="../static/js/main.js"></script>
</head>
<body>
<!-- Masthead-->
<header class="masthead">
<div class="container position-relative" style="top: -100px">
<div class="row justify-content-center">
<div class="col-xl-6">
<div class="text-center text-white">
<!-- Page heading-->
<h1 class="mb-5">결과 확인</h1>
<div class="row">
<div class="col">
<input class="form-control form-control-lg" id="filePath" type="text" placeholder="파일 위치" />
</div>
<div class="col-auto">
<button class="btn btn-primary btn-lg" id="imgCaptureBtn" type="submit">촬영</button>
</div>
<div class="col-auto">
<button class="btn btn-primary btn-lg" id="uploadImgBtn" type="submit">업로드</button>
</div>
<form id="uploadForm" enctype="multipart/form-data" style="display: none;">
<input type="file" id="fileInput" name="file" accept=".jpg, .jpeg, .png, .gif, .pdf, .txt">
</form>
</div>
</div>
</div>
</div>
</div>
</header>
<!-- Footer-->
<footer class="footer bg-light">
<div class="container">
<div class="row">
<div class="col-lg-6 h-100 text-center text-lg-start my-auto">
<ul class="list-inline mb-2">
<li class="list-inline-item"><a href="#!">About</a></li>
<li class="list-inline-item"></li>
<li class="list-inline-item"><a href="#!">Contact</a></li>
<li class="list-inline-item"></li>
<li class="list-inline-item"><a href="#!">Terms of Use</a></li>
<li class="list-inline-item"></li>
<li class="list-inline-item"><a href="#!">Privacy Policy</a></li>
</ul>
<p class="text-muted small mb-4 mb-lg-0">&copy; Your Website 2023. All Rights Reserved.</p>
</div>
<div class="col-lg-6 h-100 text-center text-lg-end my-auto">
<ul class="list-inline mb-0">
<li class="list-inline-item me-4">
<a href="#!"><i class="bi-facebook fs-3"></i></a>
</li>
<li class="list-inline-item me-4">
<a href="#!"><i class="bi-twitter fs-3"></i></a>
</li>
<li class="list-inline-item">
<a href="#!"><i class="bi-instagram fs-3"></i></a>
</li>
</ul>
</div>
</div>
</div>
</footer>
<!-- Bootstrap core JS-->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js"></script>
<!-- Core theme JS-->
<!-- <script src="js/scripts.js"></script> -->
<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *-->
<!-- * * SB Forms JS * *-->
<!-- * * Activate your form at https://startbootstrap.com/solution/contact-forms * *-->
<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *-->
<!-- <script src="https://cdn.startbootstrap.com/sb-forms-latest.js"></script>-->
</body>
</html>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment