mirror of
https://github.com/Hopiu/django-markdownx.git
synced 2026-04-25 15:34:42 +00:00
Path fix by argaen
This commit is contained in:
parent
ce3062dc07
commit
df753824de
3 changed files with 8 additions and 4 deletions
|
|
@ -133,6 +133,10 @@ It is easy customizable, i.e. when you want to use Bootstrap 3 and "real" side-b
|
|||
|
||||
# Changelog
|
||||
|
||||
### v0.4.2
|
||||
|
||||
* Path fix by argaen
|
||||
|
||||
### v0.4.1
|
||||
|
||||
* Better editor height updates
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import os.path
|
||||
import os
|
||||
import uuid
|
||||
import StringIO
|
||||
|
||||
|
|
@ -28,7 +28,7 @@ class ImageForm(forms.Form):
|
|||
img = InMemoryUploadedFile(thumb_io, "image", file_name, self.files['image'].content_type, thumb_io.len, None)
|
||||
|
||||
unique_file_name = self.get_unique_file_name(file_name)
|
||||
full_path = settings.MEDIA_ROOT + MARKDOWNX_MEDIA_PATH + unique_file_name
|
||||
full_path = os.path.join(settings.MEDIA_ROOT, MARKDOWNX_MEDIA_PATH, unique_file_name)
|
||||
if not os.path.exists(os.path.dirname(full_path)):
|
||||
os.makedirs(os.path.dirname(full_path))
|
||||
|
||||
|
|
@ -37,7 +37,7 @@ class ImageForm(forms.Form):
|
|||
destination.write(chunk)
|
||||
destination.close()
|
||||
|
||||
return settings.MEDIA_URL + MARKDOWNX_MEDIA_PATH + unique_file_name
|
||||
return os.path.join(settings.MEDIA_URL, MARKDOWNX_MEDIA_PATH, unique_file_name)
|
||||
|
||||
def get_unique_file_name(instance, filename):
|
||||
ext = filename.split('.')[-1]
|
||||
|
|
|
|||
2
setup.py
2
setup.py
|
|
@ -6,7 +6,7 @@ if 'vagrant' in str(os.environ):
|
|||
|
||||
setup(
|
||||
name='django-markdownx',
|
||||
version='0.4.1',
|
||||
version='0.4.2',
|
||||
packages=find_packages(),
|
||||
include_package_data=True,
|
||||
description='Simple markdown editor (with live preview and images uploads) built for Django',
|
||||
|
|
|
|||
Loading…
Reference in a new issue