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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T21:45:48+00:00 2026-06-03T21:45:48+00:00

I’m trying to install imagestore app in my project. Default models are created succefully,

  • 0

I’m trying to install imagestore app in my project. Default models are created succefully, and all other parts working properly.

But, it have a feature to extend base (abstract) models and create your own by some complicated mechanism. This is mine model:

from django.db import models 
from imagestore.models.bases.album import BaseAlbum 
class Newalbum(BaseAlbum): 
    title = models.CharField("title", max_length=128) 
    class Meta(BaseAlbum.Meta): 
        app_label = "imagestore" 
        abstract = False

Also I have a string IMAGESTORE_ALBUM_MODEL = 'art.models.Newalbum' in my settings.
When I run syncdb it tells me Backend module “art.models” does not define a “Newalbum” class. (‘module’ object has no attribute ‘Newalbum’).
But of course it defined.

And the strangeness is only begins. When I put debug statement in the place where imagestore trying to get my model it prints proper module (already imported) and proper class name (string). But! dir(mod) prints only variables appeared before “from imagestore.models.bases.album import BaseAlbum” .In above example only “models” and default underscored attributes. Why? What I don’t know about importing modules?

I already tried to install it in many awkward combinations of settings properties, versions of django (and required apps), app_label and so on. It creates tables, when I doesn’t add IMAGESTORE_ALBUM_MODEL in my settings, but this models hasn’t any BaseClass’ behaviour.
So, what I’m doing wrong?

  • 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-03T21:45:49+00:00Added an answer on June 3, 2026 at 9:45 pm

    Solved it! While stepping through the import process (I added the following to imagestore.utils.load_class)

    import pdb
    pdb.set_trace()
    

    I found that there is a circular import. Here’s the order of things (slightly simplified):

    1. load_class(IMAGESTORE_ALBUM_MODEL)
    2. from imagestore.models.bases.album import BaseAlbum
    3. BaseAlbum has an FK to IMAGESTORE_IMAGE_MODEL (head), so it gets imported with load_class
    4. load_class(IMAGESTORE_IMAGE_MODEL)
    5. from imagestore.models.bases.image import BaseImage
    6. BaseImage has an FK to IMAGESTORE_ALBUM_MODEL (album), so it gets imported with load_class
    7. When this calls __import__ IMAGESTORE_ALBUM_MODEL is already in sys.modules, though incomplete because it’s still being built. And thus the module doesn’t have an “Album” attribute yet.

    The quick solution is to move the head field to models.album.Album and remove it from BaseAlbum. After doing this I was able to get the site running again. You must use the models package in your new app (not a simple models.py), with Image and Album in separate files.

    If this isn’t clear enough, drop me a line and I’ll try to do better.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to render a haml file in a javascript response like so:
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I have a text area in my form which accepts all possible characters from
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka

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.