FIxes in imagefield
This commit is contained in:
parent
2f3ee90e26
commit
a741e51a76
2 changed files with 15 additions and 6 deletions
|
|
@ -178,6 +178,13 @@ def start():
|
||||||
|
|
||||||
conf=conf.replace("domain_url='http://localhost:5000'", "domain_url='"+domain_url+"'")
|
conf=conf.replace("domain_url='http://localhost:5000'", "domain_url='"+domain_url+"'")
|
||||||
|
|
||||||
|
# Question about email
|
||||||
|
|
||||||
|
e_q=input('Email for site: ')
|
||||||
|
|
||||||
|
#if e_q=='':
|
||||||
|
|
||||||
|
|
||||||
#domain_url='http://localhost:8080'
|
#domain_url='http://localhost:8080'
|
||||||
|
|
||||||
with open(path_settings+'/config.py', 'w') as f:
|
with open(path_settings+'/config.py', 'w') as f:
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,10 @@ from paramecio2.libraries.db.corefields import CharField
|
||||||
from paramecio2.libraries.db.extraforms.fileform import FileForm
|
from paramecio2.libraries.db.extraforms.fileform import FileForm
|
||||||
from paramecio2.libraries.keyutils import create_key
|
from paramecio2.libraries.keyutils import create_key
|
||||||
import traceback
|
import traceback
|
||||||
|
from flask import request
|
||||||
|
from werkzeug.utils import secure_filename
|
||||||
|
|
||||||
from bottle import request
|
# from bottle import request
|
||||||
try:
|
try:
|
||||||
from PIL import Image
|
from PIL import Image
|
||||||
except:
|
except:
|
||||||
|
|
@ -111,13 +113,13 @@ class ImageField(CharField):
|
||||||
|
|
||||||
# Load image file
|
# Load image file
|
||||||
|
|
||||||
file_bytecode=files_uploaded[field_file].file
|
#file_bytecode=files_uploaded[field_file].file
|
||||||
|
|
||||||
filename=files_uploaded[field_file].filename
|
filename=secure_filename(files_uploaded[field_file].filename)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
||||||
im=Image.open(file_bytecode)
|
im=Image.open(files_uploaded[field_file])
|
||||||
|
|
||||||
except IOError:
|
except IOError:
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue