Only add the django-oauth2-provider apps if the module is installed

otherwise log a warning
This commit is contained in:
Pierre Dulac 2013-03-02 20:20:26 +01:00
parent 6f5764105b
commit cda21a306e

View File

@ -98,10 +98,18 @@ INSTALLED_APPS = (
'rest_framework',
'rest_framework.authtoken',
'rest_framework.tests',
'provider',
'provider.oauth2',
)
try:
import provider
INSTALLED_APPS += (
'provider',
'provider.oauth2',
)
except ImportError, inst:
import logging
logging.warning("django-oauth2-provider is not install, some tests will be skipped")
STATIC_URL = '/static/'
PASSWORD_HASHERS = (