add funct
This commit is contained in:
12
app.py
12
app.py
@@ -1,6 +1,4 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from turtle import st
|
||||
from flask import Flask, render_template, request, flash, redirect, url_for
|
||||
from werkzeug.utils import secure_filename
|
||||
import os
|
||||
@@ -37,15 +35,16 @@ def admipage():
|
||||
if request.method == 'POST':
|
||||
logging.debug("POST QUERY loaded")
|
||||
|
||||
|
||||
image_file = request.files['imgfile']
|
||||
stl_file = request.files['stlfile']
|
||||
|
||||
logging.debug(image_file)
|
||||
logging.debug(stl_file)
|
||||
|
||||
image_file.save(os.path.join(app.config['UPLOAD_FOLDER'], image_file.filename))
|
||||
stl_file.save(os.path.join(app.config['UPLOAD_FOLDER2'], stl_file.filename))
|
||||
image_file.save(os.path.join(
|
||||
app.config['UPLOAD_FOLDER'], image_file.filename))
|
||||
stl_file.save(os.path.join(
|
||||
app.config['UPLOAD_FOLDER2'], stl_file.filename))
|
||||
|
||||
if request.form.get('isprinted') == 'on':
|
||||
isprinered = True
|
||||
@@ -67,11 +66,14 @@ def admipage():
|
||||
else:
|
||||
return render_template("adminpage.html")
|
||||
|
||||
|
||||
@app.route('/uploader', methods=['GET', 'POST'])
|
||||
def upload_file():
|
||||
if request.method == 'POST':
|
||||
f = request.files['file']
|
||||
f.save(secure_filename(f.filename))
|
||||
return 'file uploaded successfully'
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
app.run(host="0.0.0.0", debug="True", port="3800")
|
||||
|
||||
@@ -8,4 +8,5 @@ class PrintedDetal(db.Model):
|
||||
id = db.Column(db.Integer, primary_key=True, autoincrement=True)
|
||||
imgpath = db.Column(db.String(3000))
|
||||
stlpath = db.Column(db.String(3000))
|
||||
srcpath = db.Column(db.String(3000))
|
||||
isprinted = db.Column(db.Boolean())
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.7 MiB |
Binary file not shown.
|
Before Width: | Height: | Size: 295 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 482 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 12 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 585 KiB |
@@ -31,10 +31,6 @@
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/js/bootstrap.bundle.min.js"
|
||||
integrity="sha384-OERcA2EqjJCMA+/3y+gxIOqMEjwtxJY7qPCqsdltbNJuaOe923+mo//f6V8Qbsw3"
|
||||
crossorigin="anonymous"></script>
|
||||
|
||||
Reference in New Issue
Block a user