-
Notifications
You must be signed in to change notification settings - Fork 2
/
hello.py
48 lines (37 loc) · 1.5 KB
/
hello.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import os
import PIL
from flask import Flask, render_template
from modes.Image.image import image
from modes.Audio.audio import audio
from modes.Text.text import text
from modes.Video.video import video
from pathlib import Path
UPLOAD_IMAGE_FOLDER = Path('modes/Image/static')
IMAGE_CACHE_FOLDER = Path('modes/Image/__pycache__')
UPLOAD_TEXT_FOLDER = Path('modes/Text/static')
TEXT_CACHE_FOLDER = Path('modes/Text/__pycache__')
UPLOAD_AUDIO_FOLDER = Path('modes/Audio/static')
AUDIO_CACHE_FOLDER = Path('modes/Audio/__pycache__')
UPLOAD_VIDEO_FOLDER = Path('modes/Video/static')
VIDEO_CACHE_FOLDER = Path('modes/Video/__pycache__')
# ALLOWED_EXTENSIONS = {'png', 'jpg', 'jpeg'}
app = Flask(__name__)
app.secret_key = "hello"
app.config['UPLOAD_VIDEO_FOLDER'] = UPLOAD_VIDEO_FOLDER
app.config['VIDEO_CACHE_FOLDER'] = VIDEO_CACHE_FOLDER
app.config['UPLOAD_AUDIO_FOLDER'] = UPLOAD_AUDIO_FOLDER
app.config['AUDIO_CACHE_FOLDER'] = AUDIO_CACHE_FOLDER
app.config['UPLOAD_IMAGE_FOLDER'] = UPLOAD_IMAGE_FOLDER
app.config['IMAGE_CACHE_FOLDER'] = IMAGE_CACHE_FOLDER
app.config['UPLOAD_TEXT_FOLDER'] = UPLOAD_TEXT_FOLDER
app.config['IMAGE_TEXT_FOLDER'] = TEXT_CACHE_FOLDER
app.register_blueprint(text, url_prefix="/text")
app.register_blueprint(video, url_prefix="/video")
app.register_blueprint(audio, url_prefix="/audio")
app.register_blueprint(image, url_prefix="/image")
@app.route("/")
def home():
#return render_template("check.html")
return render_template("home.html")
if __name__ == "__main__":
app.run(debug=False)