pythondjango-models

How to snip Django TextField?


I want to create a simple blog using Django, this is my code :

class Blog(models.Model):
    title = models.CharField(max_length = 50)
    content = models.TextField(max_length = 10000)
    publication_date = models.DateField(blank = True, null = True)
    author = models.CharField(max_length = 50)
    image = models.ImageField(upload_to='image',verbose_name = 'My photos',blank = True)
    def __str__(self):
        return self.title

When I display the content field, I don't know how to add images (in the body of content field).


Solution

  • This is to be done using Rich text editors. See the list of available django packages here. CKEditor and TinyMCE are promising to easily handle images.