Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6580449
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:01:51+00:00 2026-05-25T16:01:51+00:00

I currently have a login page that sends all authenticated users to a main

  • 0

I currently have a login page that sends all authenticated users to a main page. How do I configure my code such that one group of users are sent to a specific url (custom main page), and other groups are sent to other urls?

The grouping of users would be done according the company they work for. Each group of company’s employees would be directed to an area of the site where they could see records from their company, but not others.

The existing login view is very simple:

def login_page(request):
username = request.POST['username']
password = request.POST['password']
user = authenticate(username=username, password=password)
if user is not None:
    if user.is_active:
        login(request, user)
        return HttpResponseRedirect("main_page.html")
    else:
        return HttpResponseRedirect('/')
else:
    return HttpResponseRedirect('/')
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T16:01:52+00:00Added an answer on May 25, 2026 at 4:01 pm

    A relatively simple way to do it would be to create a field in the user profile to indicate that the user is a part of the special group of users you want to redirect to the special page.

    Then, upon logging in, check for the flag in the user’s profile and redirect accordingly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently I have a custom form login page in Spring Security 3 that sends
I have a login page (login.aspx) that is currently indexed in google when somebody
Basically, I currently have login/ in urls.py redirect to the django.contrib.auth.views.login and that seems
I currently have a site where different users can login, and depending on their
I currently have a login link on my application that looks something like this:
I am a beginner of asp.net..I currently have a login page with forgot password
Currently, we have a site where almost all the pages fall into some page
I have a private site that requires login for all pages. When a user
OK, I have a login screen that sends username and password to a PHP
Currently, in my settings module I have this: LOGIN_URL = '/login' If I ever

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.