Ask Your Question
3

Why is my app not being added to the admin section in Django even though I used admin.site.register()?

asked 2023-07-05 15:48:31 +0000

lakamha gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2023-07-05 15:52:02 +0000

huitzilopochtli gravatar image

There might be various reasons why your app is not being added to the admin section in Django even though admin.site.register() has been used. Here are some possible reasons:

  1. The app is not included in the INSTALLED_APPS list in the settings.py file.
  2. The model is not properly defined or registered.
  3. There could be syntax errors, such as missing or extra commas, quotes, or parentheses, in the registration code.
  4. Another app might be overriding the registration of your app's models.
  5. The app's models might be conflicting with the models of another app.
  6. The admin.py file might not be placed in the right directory, or the filename might be incorrect.

To troubleshoot this issue, you can check your Django logs to look for any error messages related to the admin section or registration. You might also want to double-check your code and make sure everything is properly defined and registered.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-07-05 15:48:31 +0000

Seen: 10 times

Last updated: Jul 05 '23