From ba50e500a1da9266f9bee5bc38b69635637f6129 Mon Sep 17 00:00:00 2001 From: prathamesh Date: Wed, 26 Mar 2014 14:48:45 +0530 Subject: User authentication using external database. Django authentication backend overriden to authenticate user using spoken tutorial database. Added database router to handle the database operations. --- testapp/settings.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'testapp/settings.py') 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' :'', } } -- cgit From 6ed7eb5a06d16a3a761f4c6c99b9fc78ed4027d5 Mon Sep 17 00:00:00 2001 From: prathamesh Date: Fri, 6 Jun 2014 12:21:31 +0530 Subject: README file added to the authentication app. --- testapp/settings.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'testapp/settings.py') diff --git a/testapp/settings.py b/testapp/settings.py index e809cf4..543c0e3 100644 --- a/testapp/settings.py +++ b/testapp/settings.py @@ -8,10 +8,10 @@ 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',) +#AUTHENTICATION_BACKENDS = ('myauthentication.backend.MyBackend',) # Router for database -DATABASE_ROUTERS = ['myauthentication.router.MyDatabaseRouter',] +#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. -- cgit From c5115d98867504076daacc093d09489033c6a584 Mon Sep 17 00:00:00 2001 From: prathamesh Date: Fri, 6 Jun 2014 13:07:31 +0530 Subject: minor change in settings.py --- testapp/settings.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'testapp/settings.py') diff --git a/testapp/settings.py b/testapp/settings.py index 543c0e3..cc84095 100644 --- a/testapp/settings.py +++ b/testapp/settings.py @@ -5,14 +5,6 @@ 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) @@ -31,6 +23,13 @@ SERVER_TIMEOUT = 2 # host.org/foo/exam set URL_ROOT='/foo' URL_ROOT = '' +# 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',] ADMINS = ( # ('Your Name', 'your_email@example.com'), -- cgit