slug = models.SlugFiled(unique=True)
url(r'^(?P<slug>[-a-zA-Z0-9_]+)$', 'article_detail', name='article_detail'),
def article_detail(request, slug):
article = get_object_or_404(Article, slug=slug)
...
all_product_colors = Colors.objects.filter(s=all_products.get(product_name=name)).values()
result = [{k: v for k, v in color.items() if v is True} for color in all_product_colors]
ACCOUNT_USER_DISPLAY (=a callable returning user.username)
A callable (or string of the form 'some.module.callable_name') that takes a user as its only argument and returns the display name of the user. The default implementation returns user.username.
ACCOUNT_USER_DISPLAY = lambda user: u'%s %s' % (user.first_name, user.last_name)
илиACCOUNT_USER_DISPLAY = lambda user: user.get_full_name()
илиACCOUNT_USER_DISPLAY = 'myapp.somemodule.utils.user_display'
venv\Scripts\activate
python manage.py runserver