python - how to post a new comment through a method in django? -
i using 'django_comments' commenting in site. want post new comment via method in 'views.py'.
i searched , found posting comments using {{ forms }} in templates.
so how can post new comment through method. please me.. , in advance.
you don't have use form, or post request matter. need create instance of comment model can via django's orm.
to this, need have of necessary parameters model expects, it's simple as:
comment = comment.objects.create(**params)
Comments
Post a Comment