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 7708921
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T00:44:05+00:00 2026-06-01T00:44:05+00:00

I have the following subclass: class UserProfile(User): user = models.OneToOneField(User, parent_link=True) And an UserProfileAdmin:

  • 0

I have the following subclass:

class UserProfile(User):
    user = models.OneToOneField(User, parent_link=True)

And an UserProfileAdmin:

class UserProfileAdmin(admin.ModelAdmin):
    # stuff
admin.site.register(UserProfile, UserProfileAdmin)

This admin displays a change password link /admin/customer/userprofile/1548/password/ under the password field. But i get the following error:

invalid literal for int() with base 10: '1548/password'

I want to use the same change password form as in auth.User and after change is made i want to be redirected to UserProfileAdmin. How can i do that?

  • 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-01T00:44:06+00:00Added an answer on June 1, 2026 at 12:44 am

    It is the expected behavior because:

    /admin/customer/userprofile/1548/password/
    

    Wants to display the change form for userprofile with id ‘1548/password’.

    Extending the User class is not the way to store extra data per user. Read the documentation on Storing additional information about users for instruction on how to do it the right way.

    That said, you can if you want this url to open the admin change password page, you can do a redirect as such:

    # put **before** include(admin.site.urls)
    url(r'/admin/customer/userprofile/(?P<id>\d+)/password/$', 'views.redirect_to_password'),
    

    And in views.py:

    from django import shortcuts
    
    def redirect_to_password(request, id):
        return shortcuts.redirect('/admin/auth/user/%s/password/' % id)
    

    If you also want to redirect the /admin/auth/user/1234 to /admin/customer/userprofile/1234, then you could add this:

    url(r'/admin/auth/user/(?P<id>\d+)/$', 'views.redirect_to_customer_changeform'),
    

    Would work with a similar view:

    from django import shortcuts
    
    def redirect_to_customer_changeform(request, id):
        return shortcuts.redirect('/admin/customer/userprofile/%s/' % id)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Lets say I have the following code: public class Base { // Some stuff
I have the following class subclass of FilterInputStream with only one method overrided. However
I have the following model in django: class Node(models.Model): name = models.CharField(max_length=255) And this
While attempting my first sub-class in Objective-C I have come across the following warning
I have following situation: I have loged user, standard authentication with DB table $authAdapter
I have following classes. class A { public: void fun(); } class B: public
Let's say I have the following headers: @interface SuperClass : NSObject @interface SubClass :
Suppose I have the following class heirarchy: class A() class B(a:A) class C(b:B) class
I have the following code in a UIViewController subclass: MyViewController *viewController = [[MyViewController alloc]
I have following code: class EntityBase (object) : __entity__ = None def __init__ (self)

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.