Re: login using an external database

32 views
Skip to first unread message

Satinderpal Singh

unread,
Nov 9, 2012, 8:33:18 AM11/9/12
to django...@googlegroups.com
On Fri, Nov 9, 2012 at 6:02 PM, Lucas Nunes ''Ruivinhoshow''
<ruivin...@hotmail.com> wrote:
> hi, i'm brazilian (sorry for dude engl.. xD ). I want to login an user using
> the tables that exists in other db...
What do you mean by other db,
> i'll need the tables named 'matricula' and 'password', and so i log on
> this user in my app...
If you want to join the two application databases, use the following query.
from django.appName import TableName

--
Satinderpal Singh
http://satindergoraya.blogspot.in/
http://satindergoraya91.blogspot.in/

Lucas Nunes ''Ruivinhoshow''

unread,
Nov 9, 2012, 8:51:14 AM11/9/12
to django...@googlegroups.com
i mean  db = database
 
uhmm... but the second app isn't in django.  it was built in php I think... or it doesn't matter?
 
the important is:  I have access to a database that is part of another application and want to use the login fields from there to log into my system .. a database for two apps
 

Satinderpal Singh

unread,
Nov 9, 2012, 9:13:17 AM11/9/12
to django...@googlegroups.com
I don't know exactly, but this may help you:
Describe the two databases in the settings file like:

DATABASES = {
'default': {
'NAME': 'app_data',
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'USER': 'postgres_user',
'PASSWORD': 's3krit'
},
'users': {
'NAME': 'user_data',
'ENGINE': 'django.db.backends.mysql',
'USER': 'mysql_user',
'PASSWORD': 'priv4te'
Reply all
Reply to author
Forward
0 new messages