Skip to main content
Join the official 2020 Python Developers SurveyStart the survey!

Facebook-like mentions for Django

Project description


Facebook-like mentions for Django

Add aplication to INSTALLED_APPS in ****:


Add app urls to your ****:

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 ****:
# You can put your provider anywhere you want
'default': [

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 }}

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for django-mentions, version 0.2
Filename, size File type Python version Upload date Hashes
Filename, size django-mentions-0.2.tar.gz (15.2 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page