Re: Trying to find something in multiple databases... Confused...
Right -- different tables in the same database, of course... Thanks.
L.
On Monday, June 18, 2012, Daniel Roseman wrote:
On Monday, 18 June 2012 08:40:53 UTC+1, Laurence MacNeill wrote:Ok, I'm a total django noob here, so I am probably doing this wrong... But here goes...
When someone comes to my django app's root (index), I need to verify their user-name (which is stored in a Linux environment variable). Based on where (or if) I find their user-name, I want to send them to one of three different pages -- if I don't find them in any database, I want to add them to a given database, then send them to a page.
So here's what I have in my views.py file:
def index(request)
current_username = os.environ['REMOTE_USER']So Melvyn has answered your question, but a quick note on terminology: what you've got there are separate *database tables*, or separate *Django models* -- not separate databases. Multiple databases is a whole different question, which you really don't want to get into as a newbie (or, indeed, at all if possible).--DR.--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/jSuHg6H4amoJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home