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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T22:47:56+00:00 2026-05-14T22:47:56+00:00

In my Django admin, when I try to view/edit objects from one particular model

  • 0

In my Django admin, when I try to view/edit objects from one particular model class the memory usage and CPU rockets up and I have to restart the server. I can view the list of objects fine, but the problem comes when I click on one of the objects. Other models are fine. Working with the object in code (i.e. creating and displaying) is ok, the problem only arises when I try to view an object with the admin interface. The class isn’t even particularly exotic:

class Comment(models.Model):
    user = models.ForeignKey(User)
    thing = models.ForeignKey(Thing)
    date = models.DateTimeField(auto_now_add=True)
    content = models.TextField(blank=True, null=True)
    approved = models.BooleanField(default=True)

    class Meta:
        ordering = ['-date']

Any ideas? I’m stumped. The only reason I could think of might be that the thing is quite a large object (a few kb), but as I understand it, it wouldn’t get loaded until it was needed (correct?).

  • 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-14T22:47:57+00:00Added an answer on May 14, 2026 at 10:47 pm

    It’s not really a question of how big the Thing object is, but rather of how many you have in your database. That’s because for a ForeignKey, by default Django’s admin gives you a drop-down list containing all the existing items. If you’ve got lots and lots, then Django will load them all in order to populate that list. The same is true here of User.

    The best way round this is to add the offending field to the raw_id_fields in your ModelAdmin subclass. That will change the representation to a simple textfield for the id, with a pop-up lookup window.

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

Sidebar

Ask A Question

Stats

  • Questions 506k
  • Answers 507k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Any results regarding this issue? I get the same error… May 16, 2026 at 3:53 pm
  • Editorial Team
    Editorial Team added an answer According to the spec, you should not close a tag… May 16, 2026 at 3:53 pm
  • Editorial Team
    Editorial Team added an answer Right click on .aspx, choose "Convert to Web Application". Reason:… May 16, 2026 at 3:53 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

Django-admin is pluralizing a model that I have running as a proxy class. The
I need to check user authorization in every view of one of my Django
I'm building a small web project using Django that has one model ( Image
I want to overwrite the custom objects model manager to only return objects a
I have this stack trace error when I try view some data in my
I've been working with a Django app for a while, and the Django admin
I've got a Django-based site that allows users to register (but requires an admin
From django documentation: js_info_dict = { 'packages': ('your.app.package',), } urlpatterns = patterns('', (r'^jsi18n/$', 'django.views.i18n.javascript_catalog',
Using the django admin application for a date it displays Today | CalendarSymbol .
how i'll exclude a field in django admin if the users are not super

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.