Posted on 2019-11-18T09:42:21Z by Kevin Foong
This is the second part of my earlier Flask / TinyMCE tutorial. See the first part here.
In this blog post I will outline the steps I used to save a thumbnail version of any image I upload to my post. Here I used the very useful Pillow (Python Imaging Library) library.
TinyMCE has a great image uploader feature where you can simply drag and drop images to directly upload into your post. I have summarised some of the main implementation points below:
Read more ...
Tags:
tinymce
flask
python
Posted on 2019-04-30T04:33:47Z by Kevin Foong
In this post I will run through process of setting up the TinyMCE editor with Flask. TinyMCE is a great WYSIWYG editor and suitable for things like blog posts. It also enables you to upload images directly into your text.
Follow the instructions below to set up TinyMCE as a local download.
- In Flask I create your forms as per normal using Flask-WTF. Note that the
post
field is defined as a TextAreaField. Later we will be using the TinyMCE editor to replace this field.
class PostForm(FlaskForm):
heading = StringField('Title', validators=[InputRequired(), Length(max=100)])
post = TextAreaField('Write something')
tags = StringField('Tags')
submit = SubmitField('Submit')
- Now download TinyMCE (see https://www.tiny.cloud/docs/general-configuration-guide/advanced-install/#sdkinstall)
and unzip the contents into a web accessible location. I downloaded mine into a folder named "tinymce" under the static folder.
- Create a route which will look something like this.
Read more ...
Tags:
tinymce
flask
python