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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T02:28:16+00:00 2026-06-16T02:28:16+00:00

I am having a problem with admin.autodiscover() . I just moved my site from

  • 0

I am having a problem with admin.autodiscover(). I just moved my site from the system I was building it on to the server it will stay on for production use. The system that was being used to build it is Windows 7 however the production server is Debian Squeeze 64bit.

The problem is that I am getting the error The model UserProfile is already registered. I am not having this problem with the Windows 7 computer, only once it moves to Debian it does.

admin.py

class UserProfileadmin(admin.ModelAdmin):
    list_display = ['user', 'country', 'totalflights', 'totalhours', 'hub']
    search_fields = ['user']
    list_filter = ['hub']
    def formfield_for_foreignkey(self, db_field, request, **kwargs):
         if db_field.name == 'hub':
             kwargs['queryset'] = Airports.objects.filter(hub=True)

    return super(UserProfileadmin, self).formfield_for_foreignkey(db_field, request, **kwargs)

admin.site.register(UserProfile,UserProfileadmin)
class PilotRankadmin(admin.ModelAdmin):
    list_display = ['ranktitle', 'minimumhours', 'pay']
    search_fields = ['ranktitle']

admin.site.register(PilotRank, PilotRankadmin)

class PIREPadmin(admin.ModelAdmin):
    list_display = ['user', 'flightnumber']
    search_fields = ['ranktitle']

admin.site.register(PIREP, PIREPadmin)

Any ideas? I have never had this before when working on a Windows system then moving to a Linux system for production.

  • 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-16T02:28:17+00:00Added an answer on June 16, 2026 at 2:28 am

    Can you post the error stack details…
    have you tried using admin.site.unregister(UserProfile) just before you call register ?

    edit:
    this seems to be working fine for me –

    if not admin.site._registry.has_key(UserProfile):
            admin.site.register(UserProfile)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having a problem uploading files on my production server. I'm using the django-stdimage
I'm having problem with triggering function on delete_post action. I'm building functionality where i
I am having a problem trying to pull a path name from a DB
I'm having a problem here: i'm building out a simple blog, and I'm using
I'm having the problem that I cannot get client-side validation to fire from within
I am having a problem with Apollo 1.3 running on Windows Server 2008 R2.
I've got a minor problem with a database admin page that I use to
im setting a django server, but im having problem with my static's file's: django
I am having a problem. I can't delete kategoris. Rake routes: admin_kategoris GET /admin/kategoris(.:format)
I'm having a problem while trying to call a custom Model method from my

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.