I have an HTML page (not django admin) showing a WYSIYYG tinymce field: What i need to do with it is writing some text (it works), upload some images to illustrate the text (it doesn't work) and finally if possible give a class to these uploaded images.
This is for a kind of 'page' generator, every content written in the edidor will show up as new page on my webite.
the form :
class PageForm(forms.Form):
name = forms.CharField(max_length=255)
content = forms.CharField(widget=TinyMCE())
the model:
class Page(models.Model):
name = models.CharField(max_length=255,
null=False,
blank=False,
unique=True,)
content = models.TextField(null=False,
blank=False)
slug = models.CharField(max_length=255)
def save(self, *args, **kwargs):
self.slug = slugify(self.name)
super(Page, self).save(*args, **kwargs)
the html page (basic):
<body>
{% if error %}
<p>Une erreur est survenue</p>
{% endif %}
{% if action == "update-page" %}
<form method="post" action="{% url "page_update" page.slug %}">
{% elif action == "create-page" %}
<form method="post" action="{% url 'page_create' %}">
{% endif %}
{% csrf_token %}
{{ form.as_p }}
<input type="submit" value="Enregistrer" />
</form>
</body>
For the moment when i click on the insert/edit icon it just offers me to give a 'link' and not upload an image.
So how do i have to setup my django and/or setup tinymce
Thank you. (please consider in your answers that my english and my dev lvl is sometimes too weak to understand some parts of technical documentation)