Change module name and Dockerfile
This commit is contained in:
parent
de60ca084a
commit
5d4d9d3e33
0
ih/__init__.py
Normal file
0
ih/__init__.py
Normal file
13
ih/images.py
Normal file
13
ih/images.py
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
from PIL import Image
|
||||||
|
|
||||||
|
|
||||||
|
def resize_image(fh, img_prop):
|
||||||
|
im = Image.open(fh)
|
||||||
|
# size = 100, 100
|
||||||
|
im.thumbnail(img_prop['size'])
|
||||||
|
print(img_prop['size'])
|
||||||
|
# im.thumbnail(size)
|
||||||
|
thumb_name = img_prop['dest'] + '/thumb_' + img_prop['name']
|
||||||
|
im.save(thumb_name)
|
||||||
|
|
||||||
|
return thumb_name
|
|
@ -71,7 +71,7 @@ TEMPLATES = [
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
WSGI_APPLICATION = 'mysite.wsgi.application'
|
WSGI_APPLICATION = 'imagehost.wsgi.application'
|
||||||
|
|
||||||
|
|
||||||
# Database
|
# Database
|
||||||
|
|
|
@ -12,6 +12,6 @@ import os
|
||||||
|
|
||||||
from django.core.wsgi import get_wsgi_application
|
from django.core.wsgi import get_wsgi_application
|
||||||
|
|
||||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mysite.settings")
|
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "imagehost.settings")
|
||||||
|
|
||||||
application = get_wsgi_application()
|
application = get_wsgi_application()
|
||||||
|
|
|
@ -3,7 +3,7 @@ import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mysite.settings")
|
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "imagehost.settings")
|
||||||
|
|
||||||
from django.core.management import execute_from_command_line
|
from django.core.management import execute_from_command_line
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user