Change module name and Dockerfile

This commit is contained in:
Denis Zheleztsov 2017-10-10 14:49:33 +03:00
parent de60ca084a
commit 5d4d9d3e33
5 changed files with 16 additions and 3 deletions

0
ih/__init__.py Normal file
View File

13
ih/images.py Normal file
View 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

View File

@ -71,7 +71,7 @@ TEMPLATES = [
},
]
WSGI_APPLICATION = 'mysite.wsgi.application'
WSGI_APPLICATION = 'imagehost.wsgi.application'
# Database

View File

@ -12,6 +12,6 @@ import os
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()

View File

@ -3,7 +3,7 @@ import os
import sys
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