Skip to main content
=======
django-mentions
=======

Facebook-like mentions for Django
-----------------------------------------------------

Installation
""""""""""""
Add aplication to INSTALLED_APPS in **settings.py**:
::

INSTALLED_APPS = (
...,
'mentions',
)

Add app urls to your **urls.py**:
::

urlpatterns = patterns('',
...
url(r'^mentions/', include('mentions.urls')),
)

Implement a mention provider:
::

from mentions.providers import Provider

class UserProvider(Provider):
model = User

def get_title(self, obj):
return obj.username

def search(self, request, term):
return self.get_queryset().filter(username__istartswith=term)

Add this provider to your **settings.py**:
::
MENTIONS_PROVIDERS = {
# You can put your provider anywhere you want
'default': [
'accounts.mentions.UserProvider'
]
}

Use `mentions.forms.MentionTextarea` widget instead of the default one:
::
from mentions.forms import MentionTextarea

class PostForm(forms.ModelForm):
class Meta:
model = Post
widgets = {
'text': MentionTextarea
}

To urlize mentions in your templates, use `urlize_mentions` filter:
::
{{ post.text|urlize_mentions }}

Release files for django-mentions 0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-mentions 0.2
File Size Uploaded
django-mentions-0.2.tar.gz 15.2 kB Details

Release files / django-mentions-0.2.tar.gz

Download URL django-mentions-0.2.tar.gz
Size 15.2 kB
Tags Source
SHA-256 checksum
How to use checksums
7911e36d65979dfb4fb14d2905d2bd6c956b9bc744a52d376a0a655e44e3b114
BLAKE2b-256 checksum
How to use checksums
3f58c1a4315d7edc06a7dec179f4dea1931e13bd9131d587f7efbe2c43883ad3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.2 This release

1 release file

0.1.10

1 release file

0.1.9

1 release file

0.1.8

1 release file

0.1.7

1 release file

0.1.5

1 release file

0.1.4

1 release file

0.1.3

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page