How to get an app name using python in django

You could do:

from django.core.urlresolvers import resolve

....

resolve(request.path).app_name

See How to get current application in Django and resolve()

EDIT: You can now use request.resolver_match.app_name which avoids resolving a second time and avoids an import. Do it this way:

request.resolver_match.app_name

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)