image stuff
This commit is contained in:
@@ -29,7 +29,7 @@ MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
|
|||||||
|
|
||||||
|
|
||||||
# SECURITY WARNING: don't run with debug turned on in production!
|
# SECURITY WARNING: don't run with debug turned on in production!
|
||||||
DEBUG = False
|
DEBUG = True
|
||||||
|
|
||||||
ALLOWED_HOSTS = ['*']
|
ALLOWED_HOSTS = ['*']
|
||||||
|
|
||||||
|
|||||||
@@ -309,9 +309,9 @@ def startgh(request):
|
|||||||
return HttpResponse('')
|
return HttpResponse('')
|
||||||
|
|
||||||
def save_png(file, uuid, domain):
|
def save_png(file, uuid, domain):
|
||||||
file_save_path = "png/%s/%s" % uuid, file.name
|
file_save_path = "png/%s/%s" % (uuid, file.name)
|
||||||
Path("png/%s" % uuid).mkdir(parents=True, exist_ok=True)
|
Path("png/%s" % uuid).mkdir(parents=True, exist_ok=True)
|
||||||
with open(file_save_path, "wb+") as f:
|
with open(file_save_path, "wb+") as f:
|
||||||
for chunk in file.chunks():
|
for chunk in file.chunks():
|
||||||
f.write(chunk)
|
f.write(chunk)
|
||||||
return "%s/%s" % domain, file_save_path
|
return "%s/%s" % (domain, file_save_path)
|
||||||
Reference in New Issue
Block a user