diff --git a/apps/member/views.py b/apps/member/views.py index 870079cc..d4bbc592 100644 --- a/apps/member/views.py +++ b/apps/member/views.py @@ -238,17 +238,18 @@ class ProfilePictureUpdateView(LoginRequiredMixin, FormMixin, DetailView): h = form.cleaned_data['height'] # image crop and resize image_file = io.BytesIO(image_field.read()) - ext = image_field.name.split('.')[-1] + ext = image_field.name.split('.')[-1].lower() + #TODO: support GIF format image = Image.open(image_file) image = image.crop((x, y, x+w, y+h)) image_clean = image.resize((settings.PIC_WIDTH, settings.PIC_RATIO*settings.PIC_WIDTH), Image.ANTIALIAS) image_file = io.BytesIO() - image_clean.save(image_file,ext) + image_clean.save(image_file,"PNG") image_field.file = image_file # renaming - filename = "{}_pic.{}".format(self.object.note.pk, ext) + filename = "{}_pic.png".format(self.object.note.pk) image_field.name = filename self.object.note.display_image = image_field self.object.note.save() diff --git a/nginx_note.conf_example b/nginx_note.conf_example index 1f7ce4ca..204784d0 100644 --- a/nginx_note.conf_example +++ b/nginx_note.conf_example @@ -9,7 +9,7 @@ server { # the port your site will be served on listen 80; # the domain name it will serve for - server_name note.comby.xyz; # substitute your machine's IP address or FQDN + server_name note.example.org; # substitute your machine's IP address or FQDN charset utf-8; # max upload size diff --git a/note_kfet/settings/development.py b/note_kfet/settings/development.py index e16b6cf2..83436339 100644 --- a/note_kfet/settings/development.py +++ b/note_kfet/settings/development.py @@ -51,9 +51,10 @@ SESSION_COOKIE_AGE = 60 * 60 * 3 # CAS Client settings # Can be modified in secrets.py -CAS_SERVER_URL = "https://note.comby.xyz/cas/" +CAS_SERVER_URL = "http://localhost:8000/cas/" STATIC_ROOT = '' # not needed in development settings STATICFILES_DIRS = [ os.path.join(BASE_DIR, 'static')] +