diff options
author | prathamesh | 2014-03-26 14:48:45 +0530 |
---|---|---|
committer | prathamesh | 2014-03-26 14:48:45 +0530 |
commit | ba50e500a1da9266f9bee5bc38b69635637f6129 (patch) | |
tree | 4836211b8109824d9f8912e80f83be1e6f857ce0 /testapp/settings.py | |
parent | b2a95b4f99debc4d165bb0122b03b8e67f26b669 (diff) | |
download | online_test-ba50e500a1da9266f9bee5bc38b69635637f6129.tar.gz online_test-ba50e500a1da9266f9bee5bc38b69635637f6129.tar.bz2 online_test-ba50e500a1da9266f9bee5bc38b69635637f6129.zip |
User authentication using external database.
Django authentication backend overriden to authenticate user
using spoken tutorial database.
Added database router to handle the database operations.
Diffstat (limited to 'testapp/settings.py')
-rw-r--r-- | testapp/settings.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/testapp/settings.py b/testapp/settings.py index 0002476..e809cf4 100644 --- a/testapp/settings.py +++ b/testapp/settings.py @@ -5,6 +5,14 @@ from os.path import dirname, join, basename, abspath DEBUG = True TEMPLATE_DEBUG = DEBUG +# Authentication using other database table. +# Comment the line below if you want the authentication to be done +# using django user table. +AUTHENTICATION_BACKENDS = ('myauthentication.backend.MyBackend',) + +# Router for database +DATABASE_ROUTERS = ['myauthentication.router.MyDatabaseRouter',] + # The ports the code server should run on. This will run one separate # server for each port listed in the following list. SERVER_PORTS = [8001] # range(8001, 8026) @@ -41,6 +49,14 @@ DATABASES = { 'PASSWORD': '', # Not used with sqlite3. 'HOST': '', # Set to empty string for localhost. Not used with sqlite3. 'PORT': '', # Set to empty string for default. Not used with sqlite3. + }, + 'spoken' : { + 'ENGINE' : 'django.db.backends.mysql', + 'NAME' : 'YOUR DATABASE', + 'USER' : 'YOUR USERNAME', + 'PASSWORD': 'YOUR PASSWORD', + 'HOST' :'', + 'PORT' :'', } } |