django / django-contrib-comments

BSD 3-Clause "New" or "Revised" License
614 stars 196 forks source link

Unable to customize textarea for comment #149

Closed painkkiller closed 4 years ago

painkkiller commented 4 years ago

I am using Django 3.0.3 with django-contrib-comments. Everything is working ok, except one thing - I am unable customize form according to documentation.

So I created form:

class ProjectCommentForm(CommentForm):
    comment = forms.CharField(label="", help_text="", max_length=3000, widget=forms.Textarea(attrs={'class': 'my-custom-class' }))

and make get_form function in init.py file in the root of the app, where template with comments is located:

def get_form():
    from .forms import ProjectCommentForm
    return ProjectCommentForm

And see nothing changed... Thanks in advance.

painkkiller commented 4 years ago

This https://stackoverflow.com/questions/11899868/django-contrib-comments-how-to-override-the-comments-textarea-widget also didn't helped

painkkiller commented 4 years ago

Sorry, miss this line in settings.py file

COMMENTS_APP = 'my_comment_app'

Everything now fine