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

  • Home
  • SEARCH
  • 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 8152579
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T15:45:13+00:00 2026-06-06T15:45:13+00:00

I would like to create a profile page for every account created. Once created

  • 0

I would like to create a profile page for every account created. Once created the user profile can be accessed like

http://example.com/username

But before creation I should validate that the url is already available and not taken by existing url patterns. For ex: There will be a page like

http://example.com/about

Now “about” is not a valid user. But it is a valid url pattern. I should be able to prevent a user creation with a name ‘about’. For that I need to check the url patterns in addition to check whether a user with that name already exists. How to do this?

An easy way out would be to have a url pattern like the following for the profile page:
http://example.com/user/username

But I’ve a strong requirement to have profile page like the following
http://example.com/username

  • 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-06-06T15:45:14+00:00Added an answer on June 6, 2026 at 3:45 pm

    You can simply try to resolve the address to a view:

    from django.core.urlresolvers import resolve
    from myapp.views import user_profile_view
    
    try:
        my_view = resolve("/%s/" % user_name)
        if my_view == user_profile_view:
            # We match the user_profile_view, so that's OK.
        else:
            # oops, we have another view that is mapped on that URL
        # you already have something mapped on this address
    except:
        # app doesn't have such path
    

    EDIT:

    you can also make the check in a different way:

    def user_profile_view(request, user_name):
        # some code here
    
    user_profile_view.name = "User Profile View"
    

    and then the check above could be:

    if getattr(my_view, "name", None) == "User Profile View":
        ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to create a new page in Elgg where I can put
Usually if I wanted to create a page /user/profile i would create the function
I am creating a profile page, and I would like to create a followers
I have a profile page like so: https://i.stack.imgur.com/Rx4kg.png . In management I would like
I would like to create a profile after an user signs up for my
I would like to create a registration page which takes user information and generates
I would like to create a user interface like the iGoogle or facebook profiles
I would like to access profiles table from my Profile model which belongs_to :user
I have a Rails app where people have a profile page - http://prettylongdomainname.com/profile_username To
i would like create a array of structure which have a dynamic array :

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.