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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T21:18:43+00:00 2026-06-15T21:18:43+00:00

I’m getting started with Django. I can’t get the admin to work (it used

  • 0

I’m getting started with Django. I can’t get the admin to work (it used to work, I’m not sure what update made it break…).

As soon as I register a model in the admin, the website crashes with this error on any URL:

'module' object is not iterable

In the trace it happens to bug on this:

/Library/Python/2.7/site-packages/django/contrib/admin/sites.py in register
        for model in model_or_iterable: 

admin_class 
<class 'django.contrib.admin.options.ModelAdmin'>
options 
{}
model_or_iterable   
<module 'model.Branch' from '...../farmpower/src/model/Branch.pyc'>
self    
<django.contrib.admin.sites.AdminSite object at 0x1098196d0>

I’ve tried with different models, in that example, with Branch (code in admin.py):

from django.contrib import admin
from models import *

admin.site.register(Branch)

models.py:

import Page, Promotion, Branch, Contact

Branch.py

from django.db import models
from django.utils.translation import ugettext_lazy as _

class Branch(models.Model):
    name = models.CharField

[…]

class Meta:
    app_label = "model"
    db_table  = "cms_branch"

def __unicode__(self):
    return self.name

Thank you for your help !

  • 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-15T21:18:44+00:00Added an answer on June 15, 2026 at 9:18 pm

    There are several things in your code that are not very neat. One of them might lead to the error you’re seeing, though I don’t know which one of ’em is it.

    • You use relative imports (from models import ...). It is more robust do do an absolute import like from yourapp.models import ...).

    • You use a “star import”: from models import *. You don’t really know what you’re importing exactly in the file where you’re doing this. Also automatic code checkers (like pyflakes) cannot check whether you’re missing imports anymore.

    • You mention models.yml as the filename. That’s not a .py extension, so python doesn’t do a thing with that one.

    • The app name you set in the Meta on your models is model. Note that “models” and “model” are quite django-internal names. So having an app called “model” with a “models.py” could easily go wrong. Why is the app not yourapp or something like that?

    Here are some ways in which it could go wrong:

    Star import: perhaps you’ve imported a different admin in models.py? Which overwrites, through the star import, the one in admin.py?

    The models.yml: if that really is the name, what does from models import * return? With a non-existing models.py? Try to import Branch explicitly: from models import Branch and see if it fails.

    App name: if your app is really called “model”, a relative import from models import * could perhaps get you the top-level “model” module instead of the “model.models” that you mean in case you mis-type something.

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

Sidebar

Related Questions

I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I'm not entirely sure how I managed to jack this up. http://pretty-senshi.com If you
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I used javascript for loading a picture on my website depending on which small
I have a jquery bug and I've been looking for hours now, I can't
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
Does anyone know how can I replace this 2 symbol below from the string
I need a function that will clean a strings' special characters. I do NOT
Is it possible to replace javascript w/ HTML if JavaScript is not enabled on

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.