runtest.settings fixed if django-oauth-plus or oauth2 are not installed

oauth_provider can be added to INSTALLED_APPS only if these packages are installed
This commit is contained in:
swistakm 2013-02-26 11:27:06 +01:00
parent d84c2cf275
commit a4304458f5

View File

@ -98,10 +98,18 @@ INSTALLED_APPS = (
'rest_framework', 'rest_framework',
'rest_framework.authtoken', 'rest_framework.authtoken',
'rest_framework.tests', 'rest_framework.tests',
'oauth_provider',
) )
# OAuth is optional and won't work if there is no oauth_provider & oauth2
try:
import oauth_provider
import oauth2
except ImportError:
pass
else:
INSTALLED_APPS += ('oauth_provider',)
STATIC_URL = '/static/' STATIC_URL = '/static/'
PASSWORD_HASHERS = ( PASSWORD_HASHERS = (