Search code examples
djangodjango-comments

Use custom Comment app and the default Comment from Django


I have a custom comment app but also want to use the original Comment app, without the added fields of my custom app. Is there a way to do this?

Thanks!


Solution

  • Sure, but if you named your custom app "comments" as well, you'll have to be extra careful to keep things straight. It would probably be best to import Django's comment system like so:

    from django.contrib import comments as django_comments
    

    You can then access the comment model like:

    django_comments.Comment
    

    Which will signal where it's actually coming from at a glance.