Git Product home page Git Product logo

danirus / django-comments-xtd Goto Github PK

View Code? Open in Web Editor NEW
593.0 593.0 157.0 7.22 MB

A pluggable Django comments application with thread support, follow-up notifications, mail confirmation, like/dislike flags, moderation, a ReactJS plugin and Bootstrap 5.3.

Home Page: https://django-comments-xtd.readthedocs.io

License: BSD 2-Clause "Simplified" License

Python 60.55% HTML 13.56% Shell 0.50% JavaScript 25.39%
comments django javascript python reactjs

django-comments-xtd's People

Contributors

andytwoods avatar ashwani99 avatar blag avatar danirus avatar dest81 avatar dlrsp-dev avatar drholera avatar dvorberg avatar fcurella avatar galeo avatar hornn avatar ivanychev avatar janmalte avatar jladage avatar juanpabloacierno avatar khoding avatar mands avatar mikhail-sakhnov avatar ojh avatar petrdlouhy avatar pnizet avatar pylixm avatar r4fek avatar rczajka avatar richardasymmetric avatar rybkin-me avatar sanastasiou avatar terotik avatar tombreit avatar yhoiseth avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

django-comments-xtd's Issues

templates bug

Good day!
django-comments-xtd/django_comments_xtd/templates/django_comments_xtd/reply.html
Need add {% block content %}

How to customize xtd-comments framework?

How to customize xtd-comments framework? For example, create a custom xtd-comment Model that adds on the “title” field.

I have tried following the steps in "Customizing the comments framework" of django-comments official manual, but it didn't work. https://docs.djangoproject.com/en/1.7/ref/contrib/comments/custom/

And I also tried writing a new model and form which is as same as XtdCommnet and XtdCommentForm besides adding a new field, and changing COMMENTS_XTD_FORM_CLASS and COMMENTS_XTD_MODEL in the setting file. But it didn't work neither.

Is there any chance to do that?

Missing .mo files for French

Hi, the pypi package lacks the *.mo files for French (the Spanish ones are there). As they are not tracked by git, could you make a new release with the compiled French translations? Thanks.

Force moderation of a comment

I think I may be missing something obvious, but I can't seem to get a comment to be created with is_public = False, and from what I can tell, the _create_comment function causes this by always setting the is_public to True.

Is connecting to the pre_save signal the best way to accomplish this?

PyPi Package is different?

I have django-comment installed

$pip freeze 
...
django-comments-xtd==1.2
django-contrib-comments==1.6.1
...

I've inatalled comments-xtd using PyPi.

$sudo pip install django-comments-xtd==1.2

But I got an import error trying to start my app. (trace back above)

seems the pypi package diffs from the repository,
althought the last package is equal to the last commit .

the models.py I have on my environment, installed from pypi

from django.db import models, transaction
from django.db.models import F, Max, Min
from django.contrib.comments.models import Comment
from django.contrib.contenttypes.models import ContentType
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext, ugettext_lazy as _
from django_comments_xtd.conf import settings

Entire traceback

Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/Users/cadu/.virtualenvs/treeio_dj18/lib/python2.7/site-packages/django/core/management/__init__.py", line 338, in execute_from_command_line
    utility.execute()
  File "/Users/cadu/.virtualenvs/treeio_dj18/lib/python2.7/site-packages/django/core/management/__init__.py", line 312, in execute
    django.setup()
  File "/Users/cadu/.virtualenvs/treeio_dj18/lib/python2.7/site-packages/django/__init__.py", line 18, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/Users/cadu/.virtualenvs/treeio_dj18/lib/python2.7/site-packages/django/apps/registry.py", line 85, in populate
    app_config = AppConfig.create(entry)
  File "/Users/cadu/.virtualenvs/treeio_dj18/lib/python2.7/site-packages/django/apps/config.py", line 86, in create
    module = import_module(entry)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/Users/cadu/.virtualenvs/treeio_dj18/lib/python2.7/site-packages/django_comments_xtd/__init__.py", line 1, in <module>
    from django_comments_xtd.models import XtdComment
  File "/Users/cadu/.virtualenvs/treeio_dj18/lib/python2.7/site-packages/django_comments_xtd/models.py", line 5, in <module>
    from django.contrib.comments.models import Comment
ImportError: No module named comments.models

New release for Django 1.6.x

Hi,

Could you please release a new version using master - release 1.2a1 won't run under Django 1.6 - master works.

Thanks,
Robert

Demo errors

After installing django_comments_xtd from github and running, I get the error:
django_comments_xtd.XtdComment.comment_ptr: (fields.E300) Field defines a relation with model 'Comment', which is either not installed, or is abstract.

I don't see any problem with either my code nor the django_comments_xtd code, such as a ForeignKey error where one app needs to link to another app, e.g.:
comment_ptr = models.ForeignKey(Comment)
should be:
comment_ptr = models.ForeignKey(django_comments_xtd.Comment)

See also:
http://stackoverflow.com/questions/29810195/fields-e300-error-with-django-threadedcomments

Thanks,
Walter Goedecke

Cannot install in pip >= 1.4 due to versioning scheme

pip >= 1.4 thinks that "1.2f1" is a pre-release and will only let me install if I specify the "--pre" option.

$ pip install django-comments-xtd
Downloading/unpacking django-comments-xtd
  Could not find a version that satisfies the requirement django-comments-xtd (from versions: 1.0a5, 1.1a1, 1.2a1, 1.2f, 1.2f1)
Cleaning up...
No distributions matching the version for django-comments-xtd
Storing debug log for failure in .pip/pip.log

See here:
http://stackoverflow.com/questions/18230956/could-not-find-a-version-that-satisfies-the-requirement-pytz/18319230#18319230

Please add select_related to XtdCommentManager.get_queryset to reduce number of queries

I use the following monkey patch to speed up things on my page (reduce the number of queries) - would be nice if this could be added directly into master - but fine with me if not

from django_comments_xtd.models import XtdCommentManager

# select_related on comments to speed up things
def get_queryset(self):
    qs = super(XtdCommentManager, self).get_queryset()
    return qs.\
        select_related('user', 'content_type').\
        order_by('-submit_date')
XtdCommentManager.get_queryset = get_queryset

PS: here you could als add the order settings mentioned in #48

Way to take email address from User model

Is there a way to ask name and email only from anonymous user? If we already have confirmed email we should not ask for it again. I did not find easy way to make request.user accessible from the form or use different form for logged in users.

Comment confirmation url can generate invalid url

The url generated for confirming comments can exceed the 4096 character limit even if the comment itself is a single character. This is due to what data gets pickled in the url generation process.

I've tracked down the issue to the XtdCommentForm.get_comment_create_data which inserts the full content_object into the TmpXtdComment object which is to be pickled. The problem is that the content_object (in my case) is for a blog post which has a content length near to the 4k limit, thus when the comment is pickled and base64 encoded, the eventual url is greater than 4k characters.

It might be able to be fixed by removing the content_object from the TmpXtdComment, then load it manually once verified.

Adding the "reply" link?

I've been looking through the docs and I can't seem to find much on adding a "reply" link to each comment so threaded comments can be used. I'm sorry if this is obvious, but I'm not seeing it. Can anyone point me in the right direction? Seems I've got everything else working, just want to mess around with threads.

Give back the maintainer right

Hi,

This repository seems to lack maintenance, I propose myself as a new maintainer.

Could you give me the right to push in your repository or just transfer it on my account in github?

Thank you

Migrating old django_comments to django_comments_xtd data

Hello! I'm loving this project so far. It has thus far been very easy to switch to the valuable extensions provided by this project. However, I'm struggling with migrating my old comment data (from django_comments) to the new format. Am I missing a command or method which would make this simple?

TypeError: <django.utils.functional.__proxy__ object at ...> is not JSON serializable

The above exception is thrown when sending emails using Sparkpost's Django Email Backend. From the traceback, all errors point to the django-comments-xtd/django_comments_xtd/views.py and have everything to do with translation. The lines are:

subject = _("comment confirmation request") (line 47)
subject = _("new comment posted") (line 208)

My temporary workaround was to remove the translation altogether, and the problem was gone!

How can we ensure that the above exception isn't thrown while maintaining the translation?

Thanks

Associate comments with an already authorized user.

Thanks for this project!

I have little question. I successfully added this app to my project and use {% render_comment_form for object %} in template. Is shows me fields like "Name", "Email", "Url" and "Comment".

Question: Is it possible to show only "Сomment" field and associate these comments with an already authorized user. What I need to customize? I am little bit comfused.

django.contrib.comments is deprecated, should depend on django-contrib-comments

Since django.contrib.comments has been deprecated and will be removed before Django 1.8 now might be a good idea to merge over to django "excontrib" comments instead.

I have just recently started using comments xtd however so I don't know if there's another plan for this? If not I'd be happy to write together a pull request for this.

object don't have get_absolute_url method

I have implemented the commenting package into my template. Everything is working fine except when i press the send buttin it goes to a page and shows this (see Screenshot) http://prntscr.com/f2mjbl, but when I goes back to my commenting page and refresh it then the comment is there. I want to redirect to the same page when i click on send button. Please help me i have a project to complete asap. Thanks

Cannot send HTML email when COMMENTS_XTD_THREADED_EMAILS is True

When COMMENTS_XTD_THREADED_EMAILS is True, the html part of the email is discarded.

in utils.py:

    def run(self):
        _send_mail(self.subject, self.body, self.from_email, 
                   self.recipient_list, self.html, self.fail_silently)
        mail_sent_queue.put(True)        


def _send_mail(subject, body, from_email, recipient_list, 
               fail_silently=False, html=None):

the parameters are inverted between fail_silently & self.html

XtdComment has no field named 'parent'

git clone git://github.com/danirus/django-comments-xtd.git
cp -rf django-comments-xtd/django_comments_xtd ../pathtomyapp/
add to INSTALL_APPS
./manage.py syncdb

http://domain/admin/django_comments_xtd/xtdcomment/add/

Environment:


Request Method: GET
Request URL: /admin/django_comments_xtd/xtdcomment/add/

Django Version: 1.3.4
Python Version: 2.6.6
Installed Applications:
['django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.messages',
 'django.contrib.admin',
 'flatpages',
 'filebrowser',
 'news',
 'tagging_smartcomplete',
 'tagging',
 'comments',
 'musicgroups',
 'clubs',
 'events',
 'yandexmaps',
 'photologue',
 'django_extensions',
 'sam',
 'podcasts',
 'shop',
 'mptt',
 'debug_toolbar',
 'disqus',
 'django_comments_xtd']
Installed Middleware:
('django.middleware.cache.UpdateCacheMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.cache.FetchFromCacheMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.gzip.GZipMiddleware',
 'django.middleware.http.ConditionalGetMiddleware',
 'lib.external_url_redirect.ExternalUrlRedirect',
 'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',
 'lib.multihost.MultiHostMiddleware')


Traceback:
File "/storage/coolchevy/dev/colorsound/www/engine/django/core/handlers/base.py" in get_response
  111.                         response = callback(request, *callback_args, **callback_kwargs)
File "/storage/coolchevy/dev/colorsound/www/engine/django/contrib/admin/options.py" in wrapper
  307.                 return self.admin_site.admin_view(view)(*args, **kwargs)
File "/storage/coolchevy/dev/colorsound/www/engine/django/utils/decorators.py" in _wrapped_view
  93.                     response = view_func(request, *args, **kwargs)
File "/storage/coolchevy/dev/colorsound/www/engine/django/views/decorators/cache.py" in _wrapped_view_func
  79.         response = view_func(request, *args, **kwargs)
File "/storage/coolchevy/dev/colorsound/www/engine/django/contrib/admin/sites.py" in inner
  197.             return view(request, *args, **kwargs)
File "/storage/coolchevy/dev/colorsound/www/engine/django/utils/decorators.py" in _wrapper
  28.             return bound_func(*args, **kwargs)
File "/storage/coolchevy/dev/colorsound/www/engine/django/utils/decorators.py" in _wrapped_view
  93.                     response = view_func(request, *args, **kwargs)
File "/storage/coolchevy/dev/colorsound/www/engine/django/utils/decorators.py" in bound_func
  24.                 return func(self, *args2, **kwargs2)
File "/storage/coolchevy/dev/colorsound/www/engine/django/db/transaction.py" in inner
  217.                 res = func(*args, **kwargs)
File "/storage/coolchevy/dev/colorsound/www/engine/django/contrib/admin/options.py" in add_view
  900.             form = ModelForm(initial=initial)
File "/storage/coolchevy/dev/colorsound/www/engine/django/forms/models.py" in __init__
  233.             self.instance = opts.model()
File "/storage/coolchevy/dev/colorsound/www/engine/mptt/models.py" in __init__
  249.         self._mptt_meta.update_mptt_cached_fields(self)
File "/storage/coolchevy/dev/colorsound/www/engine/mptt/models.py" in update_mptt_cached_fields
  94.             instance._mptt_cached_fields[field_name] = self.get_raw_field_value(instance, field_name)
File "/storage/coolchevy/dev/colorsound/www/engine/mptt/models.py" in get_raw_field_value
  68.         field = instance._meta.get_field(field_name)
File "/storage/coolchevy/dev/colorsound/www/engine/django/db/models/options.py" in get_field
  289.         raise FieldDoesNotExist('%s has no field named %r' % (self.object_name, name))

Exception Type: FieldDoesNotExist at /admin/django_comments_xtd/xtdcomment/add/
Exception Value: XtdComment has no field named 'parent'

any help?

DRF Requires CommentCreate view to define a queryset

Looks like a permission check is done automatically and so a queryset needs to be defined:

 if not permission.has_permission(request, self):
web_1     |   File "/usr/local/lib/python3.6/site-packages/rest_framework/permissions.py", line 124, in has_permission
web_1     |     queryset = view.get_queryset()
web_1     |   File "/usr/local/lib/python3.6/site-packages/rest_framework/generics.py", line 68, in get_queryset
web_1     |     % self.__class__.__name__
web_1     | AssertionError: 'CommentCreate' should either include a `queryset` attribute, or override the `get_queryset()` method.

DRF == 3.6.3
xtd == 2.0.3
django==1.10.6

Django 1.9

We get a rather unhelpful traceback

Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python3.4/site-packages/django/core/management/__init__.py", line 350, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python3.4/site-packages/django/core/management/__init__.py", line 342, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python3.4/site-packages/django/core/management/__init__.py", line 176, in fetch_command
    commands = get_commands()
  File "/usr/local/lib/python3.4/functools.py", line 448, in wrapper
    result = user_function(*args, **kwds)
  File "/usr/local/lib/python3.4/site-packages/django/core/management/__init__.py", line 71, in get_commands
    for app_config in reversed(list(apps.get_app_configs())):
  File "/usr/local/lib/python3.4/site-packages/django/apps/registry.py", line 137, in get_app_configs
    self.check_apps_ready()
  File "/usr/local/lib/python3.4/site-packages/django/apps/registry.py", line 124, in check_apps_ready
    raise AppRegistryNotReady("Apps aren't loaded yet.")
django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.

Reproduced with a brand new django 1.9 project and adding comments xtd. I think 1.9 doesn't allow you to access models at startup.

Dynamically associate CommentBox with different comments

I am working on integrating this project with a one-page app that associates comments with multiple resources, one at a time. As far as I can tell, I cannot easily change the comments associated with the #comments div. However, I think it would be a useful feature for this library and is one I'd like to implement.

As I don't have much experience with React, I'm wondering what the best way to go about this would be?
Would it make sense to have an event on the div that would change the comments associated? Or perhaps there is already a way to do this?

Localization in form.py

Hello contributors,
I'm trying to run your code under Django 1.6 and Python 3.3.4. One issue that I see is that in forms.py you put some fields in small letters so it won't get translated in view. I can name a few :

self.fields['email'] = forms.EmailField(
label=("Email"), help_text=("Required for comment verification"),
widget=forms.TextInput(attrs={'placeholder':_('email')})
)

placeholder email should change to Email.

And here

self.fields['comment'] = forms.CharField(
label= ("Comment"),
widget=forms.Textarea(attrs={'placeholder':
('comment')}),
max_length=settings.COMMENT_MAX_LENGTH)

I manually added label since your code is missing that. Am I right about that?

One tiny question, I have used git for personal project, but if I want to contribute to the current project what should I do?

Comments not deleting when object is deleted

When render comment form and render comment tree are bound to an object, say a blog post, comments don't delete when the blog post is deleted so what happens is that when a new blog posts that has the same id/pk is created, old comments re-surface and are bound this new object.

How to remove email follow ups?

Hi,

I've been using django-comments-xtd and it looks very nice.

I only do not figure out how to disable e-mail follow ups after a user subscribe to receive e-mail notifications.

There is a way?

Best Regards,

Missing staticfiles?

After installing pip install django-comments-xtd==1.7.1 django_comments_xtd folder doesn't have any static in it.

Pythonanywhere error log:
ValueError: Missing staticfiles manifest entry for 'django_comments_xtd/css/bootstrap.min.css'

Not sure it's an issue. Maybe I have to set the staticfiles somehow.

It works in DEBUG = True mode without styling.

Size of the JS bundles

Hi, I've noticed while installing the latest version that the package size on pypi has jumped. That's due to all the JS bundles being bigger since the 2.0.3 release, especially the vendor file going from 1Mo to 2.8Mo. I don't know the reason, as I'm unable to reproduce the issue on my computer. 3Mo is big for a production environment, could you fix the problem?

Besides, would it be possible for you to build the bundles with webpack -p when releasing ? It will optimize the bundles for production (and limit the size of the pypi package).

Make {{contact}} template variable configurable

Right now it uses COMMENTS_XTD_FROM_EMAIL variable. This does not suit me well because in my scenario I would like to send comments from "noreply@" address (to avoid all kinds of automated responses filling my inbox) but have a fallback "info/report incident" address in the text so people who really want to complain/contact me have a chance.
I presume the new settings name could be COMMENTS_XTD_CONTACT and should fall back to COMMENTS_XTD_FROM_EMAIL if not supplied.

What do you think?

Comments not being sent correctly

My comments are not being sent correctly. I suspect the problem is in the action URL.
Here is my 'form.html':
`
{% load i18n %}
{% load comments %}

  <form action="{% comment_form_target %}" method="post">{% csrf_token %}
  {% if next %}
<div><input type="hidden" name="next" value="{{ next }}"/></div>{% endif %}
<div class="alert alert-danger hidden" data-comment-element="errors">
</div>

{% for field in form %}
  {% if field.is_hidden %}<div>{{ field }}</div>{% endif %}
{% endfor %}

<div style="display:none">{{ form.honeypot }}</div>

<div class="form-group {% if 'comment' in form.errors %}has-error{% endif %}">
  <div class="col-lg-offset-1 col-md-offset-1 col-lg-10 col-md-10">
    {{ form.comment }}
  </div>
</div>



<div class="form-group {% if 'url' in form.errors %}has-error{% endif %}">
  <label for="id_url" class="control-label col-lg-3 col-md-3">
    {{ form.url.label }}
  </label>
  <div class="col-lg-7 col-md-7">
    {{ form.url }}
  </div>
</div>
`

Here is the post template:
`{% load comments %}
{% load comments_xtd %}

Comments

    {% get_comment_count for post as comment_count %}
        <div style="padding-top:20px">

            {% if comment_count > 1%}
            <p style="color: gray">{{ comment_count }} comments have been posted.</p>
        {% endif %}
        {% if comment_count == 1 %}
            <p style="color: gray">1 comment has been posted.</p>
        {% endif %}
        {% if comment_count == 0%}
            <p style="color:gray;">No comments have been posted.</p>
        {% endif %}
        </div>
</div>

<hr>

<div class="well">

    {% render_comment_form for post %}


</div>

{% if comment_count %}


    {% get_xtdcomment_tree with_participants for post as comments_tree %}

    {% include "comments/comments_tree.html" with comments=comments_tree %}

{% endif %}`

The submit URL says they are being sent to 'comments/post', but clicking this only sends me to a blank page. Returning to the post, the comment has not been saved. What could I be doing wrong?
Any help would be greatly appreciated.

'OrderedDict' object has no attribute 'move_to_end'

I'm with Python 2.7.13. I try to replicate the Tutorial, but when I create the form.py I have an error in this line:

 self.fields.move_to_end('comment', last=False)

The error is 'OrderedDict' object has no attribute 'move_to_end' I read the error is at Python 2.6, but I have Python 2.7. I don't understand the error...

Urls.py

Shouldnt this line url(r'', include(django_comments_urls)) be url(r'', include(django_comments.urls)),

Make comment model manager API consistent with django-contrib-comments

In django-comments-xtd, XtdComment reimpliments the model manager that inherit from models.Manager. It have only one API: for_app_models. This is not consistent with django-contrib-comments model manager API which contains two API: in_moderation and for_model. So it's hard to plugin the app to some project which using some django-contrib-comments API. That what I get in trouble. I have no idea how to custom it instead of change the source code.
So why the model manager not inherit from django-contrib-comments model manager that make the app more compatible?

How to customize comment form ??

Currently while post a comment you need to post name,email,website and your comment. Is there annyway I can exclude email and the website ?

__init__() got an unexpected keyword argument 'verify_exists'

I got this error while running the Multiple demo in my virtualenv, all the other demos ran perfectly:

Unhandled exception in thread started by <bound method Command.inner_run of <django.core.management.commands.runserver.Command object at 0x1016d6290>>
Traceback (most recent call last):
File "/Users/qliu/django-comments/trial3/venv/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 92, in inner_run
self.validate(display_num_errors=True)
File "/Users/qliu/django-comments/trial3/venv/lib/python2.7/site-packages/django/core/management/base.py", line 280, in validate
num_errors = get_validation_errors(s, app)
File "/Users/qliu/django-comments/trial3/venv/lib/python2.7/site-packages/django/core/management/validation.py", line 35, in get_validation_errors
for (app_name, error) in get_app_errors().items():
File "/Users/qliu/django-comments/trial3/venv/lib/python2.7/site-packages/django/db/models/loading.py", line 166, in get_app_errors
self._populate()
File "/Users/qliu/django-comments/trial3/venv/lib/python2.7/site-packages/django/db/models/loading.py", line 72, in _populate
self.load_app(app_name, True)
File "/Users/qliu/django-comments/trial3/venv/lib/python2.7/site-packages/django/db/models/loading.py", line 96, in load_app
models = import_module('.models', app_name)
File "/Users/qliu/django-comments/trial3/venv/lib/python2.7/site-packages/django/utils/importlib.py", line 35, in import_module
import(name)
File "/Users/qliu/django-comments/trial3/django-comments-xtd/django_comments_xtd/demos/multiple/../multiple/blog/models.py", line 44, in
class Quote(models.Model):
File "/Users/qliu/django-comments/trial3/django-comments-xtd/django_comments_xtd/demos/multiple/../multiple/blog/models.py", line 52, in Quote
blank=True, null=True)
File "/Users/qliu/django-comments/trial3/venv/lib/python2.7/site-packages/django/db/models/fields/init.py", line 1277, in init
CharField.init(self, verbose_name, name, *_kwargs)
File "/Users/qliu/django-comments/trial3/venv/lib/python2.7/site-packages/django/db/models/fields/init.py", line 626, in init
super(CharField, self).init(_args, **kwargs)
TypeError: init() got an unexpected keyword argument 'verify_exists'

Not quite sure whether this is a bug in the code or an error on my part.

Support for passing in site via request.site (CurrentSiteMiddleware)

https://github.com/django/django/blob/7724879b524711d61b7491a4a9c104d9cff2e1e3/django/contrib/sites/middleware.py#L12

I think this may have intended to be implemented:

def get_comment_create_data(self, site_id=None):

White the site_id didn't end up being used inside the function, I think the intention may have been to pass it in, if it existed. I think this is the desirable behavior to default to.

With this middleware, the site can be passed in through the view/request and passed to the model. This works around requiring settings.SITE_ID.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.