Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions application.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,10 @@

@application.route("/")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

start3.html이 아무 url에서도 연결되지 않더라고.
그래서 아예 사용되질 않는데,
이거 start3.html 파일 아는 사람이 처리해줬으면 좋겠어!

혹시 빼기로 한 거면 아예 파일을 0temp폴더로 옮겨주면 좋을 것 같아.

일단 홈에는 list.html만 연결해놨어.

def hello():
return render_template("index.html")
return render_template("list.html")

@application.route("/index")
def view_list():


.3
return render_template("index.html")

@application.route("/restaurantRegister")
Expand All @@ -22,9 +19,9 @@ def view_restaurantRegister():
def view_detail():
return render_template("detail.html")

@application.route("/menuRegister")
def view_menuRegister():
return render_template("menuRegister.html")
# @application.route("/menuRegister")
# def view_menuRegister():
# return render_template("menuRegister.html")

@application.route("/menuView")
def view_menuView():
Expand Down Expand Up @@ -68,7 +65,11 @@ def view_reviewSubmit():
return "입력값이 POST방식으로 잘 넘어왔는지 확인하는 페이지입니다. 여기 말고 터미널을 확인해주세요."



@application.route("/menuRegister", methods=['POST'])
def reg_menu():
data=request.form
print(data)
return render_template("menuRegister.html", data=data)


if __name__ == "__main__":
Expand Down
Binary file added final/.DS_Store
Binary file not shown.
47 changes: 47 additions & 0 deletions final/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
```
┌───────────────────────────────────────────────┐
_
__ _ ___ ___ _ __ _ __ ___ (_) ___
/ _` |/ _ \ / _ \| '__| '_ ` _ \ | |/ _ \
| (_| | (_) | (_) | | | | | | | |_| | (_) |
\__, |\___/ \___/|_| |_| |_| |_(_)_|\___/
|___/
🌩 𝘼𝙣𝙮𝙤𝙣𝙚 𝙘𝙖𝙣 𝙙𝙚𝙫𝙚𝙡𝙤𝙥!
└───────────────────────────────────────────────┘
```

# goormIDE
Welcome to goormIDE!

goormIDE is a powerful cloud IDE service to maximize productivity for developers and teams.
**DEVELOP WITH EXCELLENCE**

`Happy coding! The goormIDE team`


## 🔧 Tip & Guide

* Command feature
* You can simply run your script using the shortcut icons on the top right.
* Check out `PROJECT > Common/Build/Run/Test/Find Command` in the top menu.

* Get URL and Port
* Click `PROJECT > URL/PORT` in top menu bar.
* You can get default URL/Port and add URL/Port in the top menu.

* Useful shortcut

| Shortcuts name | Command (Mac) | Command (Window) |
| ------------------ | :-----------: | :--------------: |
| Copy in Terminal | ⌘ + C | Ctrl + Shift + C |
| Paste in Terminal | ⌘ + V | Ctrl + Shift + V |
| Search File | ⌥ + ⇧ + F | Alt + Shift + F |
| Terminal Toggle | ⌥ + ⇧ + B | Alt + Shift + B |
| New Terminal | ⌥ + ⇧ + T | Alt + Shift + T |
| Code Formatting | ⌥ + ⇧ + P | Alt + Shift + P |
| Show All Shortcuts | ⌘ + H | Ctrl + H |

## 💬 Support & Documentation

Visit [https://ide.goorm.io](https://ide.goorm.io) to support and learn more about using goormIDE.
To watch some usage guides, visit [https://help.goorm.io/en/goormide](https://help.goorm.io/en/goormide)
Binary file added final/__pycache__/database.cpython-37.pyc
Binary file not shown.
95 changes: 95 additions & 0 deletions final/application.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
from flask import Flask, render_template, request
from database import DBhandler
import sys
application = Flask(__name__)

DB = DBhandler()


@application.route("/")
def hello():
return render_template("list.html")

@application.route("/index")
def view_list():
return render_template("list.html")

@application.route("/restaurantRegister")
def view_restaurantRegister():
return render_template("restaurantRegister.html")

@application.route("/detail")
def view_detail():
return render_template("detail.html")

@application.route("/menuRegister", methods=['POST'])
def reg_menu():
data=request.form
print(data)
return render_template("menuRegister.html", data=data)


#@application.route("/menuRegister")
#def view_menuRegister():
#return render_template("menuRegister.html")


@application.route("/menuView")
def view_menuView():
return render_template("menuView.html")

@application.route("/reviewRegister")
def view_reviewRegister():
return render_template("reviewRegister.html")

@application.route("/reviewView")
def view_reviewView():
return render_template("reviewView.html")

@application.route("/worldCup")
def view_worldCup():
return render_template("worldCup.html")


#아래는 과제2 (11/15마감) 제출용 페이지들
@application.route("/menuSubmit", methods=['POST'])
def view_menuSubmit():
global idx
image_file=request.files["img"]
image_file.save("./static/image/{}".format(image_file.filename))
data=request.form

if DB.insert_menu(data['foodname'], data, image_file.filename):
return render_template("menuResult.html", data=data, image_path="static/image/"+image_file.filename)
else:
return "Menu name is already exist."


@application.route("/restaurantSubmit", methods=['POST'])
def view_restaurantSubmit():
global idx
image_file=request.files["file"]
image_file.save("./static/image/{}".format(image_file.filename))
data=request.form

if DB.insert_restaurant(data['name'], data, image_file.filename):
return render_template("result.html", data=data, image_path="static/image/"+image_file.filename)
else:
return "Restaurant name already exist!"

@application.route("/reviewSubmit", methods=['POST'])
def view_reviewSubmit():
image_file=request.files["img"]
image_file.save("./static/image/{}".format(image_file.filename))
data=request.form

if DB.insert_review(data['reviewerName'], data, image_file.filename):
return render_template("reviewResult.html", data=data, image_path="static/image/"+image_file.filename)
else:
return "Enter the review!"




if __name__ == "__main__":
application.run(host='0.0.0.0', debug=True)
10 changes: 10 additions & 0 deletions final/authentication/firebase_auth.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"apiKey": "AIzaSyCfh1j3Z-STWZC2JCoPBvFAmaF2WPSf15Q",
"authDomain": "ewha-diner.firebaseapp.com",
"databaseURL": "https://ewha-diner-default-rtdb.firebaseio.com",
"projectId": "ewha-diner",
"storageBucket": "ewha-diner.appspot.com",
"messagingSenderId": "907261550992",
"appId": "1:907261550992:web:eca71177457cdd65d95315",
"measurementId": "G-SBFM91TPM1"
}
77 changes: 77 additions & 0 deletions final/database.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
import pyrebase
import json

class DBhandler:
def __init__(self):
with open('./authentication/firebase_auth.json') as f:
config=json.load(f)

firebase = pyrebase.initialize_app(config)
self.db = firebase.database()

#restaurant check
def restaurant_duplicate_check(self, name):
restaurants = self.db.child("restaurant").get()
for res in restaurants.each():
if res.key()==name:
return False
return True


def insert_restaurant(self, name, data, img_path):
restaurant_info = {
"addr":data['addr'],
"tel":data['tel'],
"category":data['category'],
"money":data['money'],
"park":data['park'],
"time":data['time'],
"site":data['site'],
"img_path":img_path
}
if self.restaurant_duplicate_check(name):
self.db.child("restaurant").child(name).set(restaurant_info)
print(data, img_path)
return True
else:
return False

#menu check

def menu_duplicate_check(self, foodname):
menus = self.db.child("menu").get()
for res in menus.each():
if res.key()==foodname:
return False
return True


def insert_menu(self, foodname, data, img_path):
menu_info = {
"restaurant":data['restaurantName'],
"foodprice":data['foodprice'],
"allergy":data['allergy'],
"vegan":data['vegan'],
"img_path":img_path
}
if self.menu_duplicate_check(foodname):
self.db.child("menu").child(foodname).set(menu_info)
print(data, img_path)
return True
else:
return False

#review check
def insert_review(self, reviewerName, data, img_path):
review_info = {

"menu":data['menu'],
"text":data['text'],
"rating":data['rating'],
"img_path":img_path
}
self.db.child("review").child(reviewerName).set(review_info)
print(data, img_path)
return True


1 change: 1 addition & 0 deletions final/goorm.manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"author":"102210278618261545366_bg3ot_google","name":"flask_project","type":"python","detailedtype":"flask","description":"","date":"2022-11-13T08:22:30.000Z","plugins":{"goorm.plugin.python":[{"plugin.python.compiler_type":"python3","plugin.python.main":"application","plugin.python.source_path":"","plugin.python.run_on":"server","plugin.python.run_option":"$USER_PORT","plugin.python.log_path":"./server.log","name":"python"}]},"is_user_plugin":false,"storage":"container","project_domain":[{"id":"102210278618261545366_bg3ot_google","url":"ewhadiner.run.goorm.io","port":"5000"}],"show_preview_btn":true,"author_email":"charlottejruby@gmail.com","author_name":"Charlotte Nam","ignore_patterns":[],"visibility":1}
Binary file added final/static/emptyheart.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added final/static/food.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added final/static/heart.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added final/static/image/konangji.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added final/static/image/momiji.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added final/static/image/momiji3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added final/static/image/test_image.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added final/static/image/test_image_menu.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added final/static/image/yuyaketokyo.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions final/static/image/제출자및githubLink 2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
2176121 남승현, 2176123 남지민, 2176278 이원주, 2176349 정유라, 2176355 정혜교

https://github.com/EwhaConan/yummy/tree/server/server/HW02
3 changes: 3 additions & 0 deletions final/static/image/제출자및githubLink.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
2176121 남승현, 2176123 남지민, 2176278 이원주, 2176349 정유라, 2176355 정혜교

https://github.com/EwhaConan/yummy/tree/server/server/HW01
Binary file added final/static/konangji.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added final/static/momiji.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added final/static/momiji.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added final/static/momiji3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added final/static/momiji4.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added final/static/momiji5.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added final/static/momoji2.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
80 changes: 80 additions & 0 deletions final/static/start3.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}

body {
display: grid;
place-items: center;
height: 100vh;
background: #ffec94;
font-family: "Lato", sans-serif;
color: #2b2b2b;
}

a {
text-decoration: none;
color: #d33f2e;
font-size: 0.9rem;
}

.container {
width: 100%;
max-width: 800px;
height: 100%;
padding: 1em;
display: grid;
grid-template-rows: 800px 1fr;
-webkit-box-align: start;
align-items: start;
}

section {
width: 100%;
max-width: 800px;
height: 100%;
max-height: 800px;
position: relative;
}

.svg-content {
position: absolute;
top: 0;
left: 0;
}

footer {
padding: 1em 0 2em;
text-align: center;
display: grid;
place-items: center;
}
footer a {
margin-top: 20px;
}
footer div {
border: none;
outline: none;
width: 40px;
height: 40px;
background: #ffec94;
border-radius: 50%;
display: grid;
place-items: center;
cursor: pointer;
}
footer div svg {
width: 20px;
height: 20px;
fill: none;
stroke-width: 3;
stroke: #fff;
text-align: center;
}

@media (max-width: 580px) {
.container {
grid-template-rows: 1fr 30%;
}
}
Loading