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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T11:22:07+00:00 2026-05-13T11:22:07+00:00

I’m really confused by some errors I’m getting as I’m trying to put an

  • 0

I’m really confused by some errors I’m getting as I’m trying to put an App into production. Everything works fine on the development machine, but I can’t syncdb or enter the Django shell on the Production server.
I’m getting an error when forum.models.py is attempts to import forum.managers.py because the models aren’t in the namespace yet.

I think it could be a PYTHONPATH issue, but it has a weird Chicken or Egg aspect to it. I don’t understand why TagManager is not in the NameSpace.
TagManager is imported via:
from forum.managers import *
Which is executed before the the TagManager class is called.

$ python2.5 manage.py syncdb
Traceback (most recent call last):
File “manage.py”, line 11, in
execute_manager(settings)
File “/home/app_name/webapps/app_name/lib/python2.5/django/core/management/init.py”, line 362, in execute_manager
utility.execute()
File “/home/app_name/webapps/app_name/lib/python2.5/django/core/management/init.py”, line 303, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File “/home/app_name/webapps/app_name/lib/python2.5/django/core/management/base.py”, line 195, in run_from_argv
self.execute(*args, **options.dict)
File “/home/app_name/webapps/app_name/lib/python2.5/django/core/management/base.py”, line 221, in execute
self.validate()
File “/home/app_name/webapps/app_name/lib/python2.5/django/core/management/base.py”, line 249, in validate
num_errors = get_validation_errors(s, app)
File “/home/app_name/webapps/app_name/lib/python2.5/django/core/management/validation.py”, line 28, in get_validation_errors
for (app_name, error) in get_app_errors().items():
File “/home/app_name/webapps/app_name/lib/python2.5/django/db/models/loading.py”, line 131, in get_app_errors
self._populate()
File “/home/app_name/webapps/app_name/lib/python2.5/django/db/models/loading.py”, line 58, in _populate
self.load_app(app_name, True)
File “/home/app_name/webapps/app_name/lib/python2.5/django/db/models/loading.py”, line 74, in load_app
models = import_module(‘.models’, app_name)
File “/home/app_name/webapps/app_name/lib/python2.5/django/utils/importlib.py”, line 35, in import_module
import(name)
File “/home/app_name/webapps/app_name/django_app/../django_app/forum/models.py”, line 18, in
from forum.managers import *
File “/home/app_name/webapps/app_name/django_app/forum/managers.py”, line 6, in
from forum.models import *
File “/home/app_name/webapps/app_name/django_app/../django_app/forum/models.py”, line 43, in
class Tag(models.Model):
File “/home/app_name/webapps/app_name/django_app/../django_app/forum/models.py”, line 53, in Tag
objects = TagManager()
NameError: name ‘TagManager’ is not defined

Python 2.5.4 (r254:67916, Aug  5 2009, 12:42:40)   
[GCC 4.1.2 20080704 (Red Hat 4.1.2-44)] on linux2  
Type "help", "copyright", "credits" or "license" for more information.  
>>> import os  
>>> os.environ['DJANGO_SETTINGS_MODULE'] = 'django_app.settings'  
>>>   
>>> import sys  
>>> import pprint  
>>> pprint.pprint(sys.path)  
['',  
 '/home/app_name/webapps/app_name/lib/python2.5',  
 '/home/app_name/lib/python2.5/markdown2-1.0.1.16-py2.5.egg',  
 '/home/app_name/lib/python2.5/html5lib-0.11.1-py2.5.egg',  
 '/home/app_name/lib/python2.5',  
 '/usr/local/lib/python25.zip',  
 '/usr/local/lib/python2.5',  
 '/usr/local/lib/python2.5/plat-linux2',  
 '/usr/local/lib/python2.5/lib-tk',  
 '/usr/local/lib/python2.5/lib-dynload',  
 '/usr/local/lib/python2.5/site-packages',  
 '/usr/local/lib/python2.5/site-packages/PIL']  
>>> sys.path = ['/home/app_name/webapps/app_name/django_app','/home/app_name/webapps/app_name','/home/app_name/webapps/app_name/lib/python2.5'] + sys.path  
>>> pprint.pprint(sys.path)['/home/app_name/webapps/app_name/django_app',  
 '/home/app_name/webapps/app_name',  
 '/home/app_name/webapps/app_name/lib/python2.5',  
 '',  
 '/home/app_name/webapps/app_name/lib/python2.5',  
 '/home/app_name/lib/python2.5/markdown2-1.0.1.16-py2.5.egg',  
 '/home/app_name/lib/python2.5/html5lib-0.11.1-py2.5.egg',  
 '/home/app_name/lib/python2.5',  
 '/usr/local/lib/python25.zip',  
 '/usr/local/lib/python2.5',  
 '/usr/local/lib/python2.5/plat-linux2',  
 '/usr/local/lib/python2.5/lib-tk',  
 '/usr/local/lib/python2.5/lib-dynload',  
 '/usr/local/lib/python2.5/site-packages',  
 '/usr/local/lib/python2.5/site-packages/PIL']  
>>> from forum.managers import *  
Traceback (most recent call last):  
  File "<stdin>", line 1, in <module>  
  File "/home/app_name/webapps/app_name/django_app/forum/managers.py", line 6, in <module>  
    from forum.models import *  
  File "/home/app_name/webapps/app_name/django_app/../django_app/forum/models.py", line 43, in <module>  
    class Tag(models.Model):  
  File "/home/app_name/webapps/app_name/django_app/../django_app/forum/models.py", line 53, in Tag  
    objects = TagManager()  
NameError: name 'TagManager' is not defined  
>>> from forum.models import *  
>>> from forum.managers import *  
>>> objects = TagManager()  
>>> objects  
<forum.managers.TagManager object at 0x9b9fdac>  
>>>   
  • 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-13T11:22:07+00:00Added an answer on May 13, 2026 at 11:22 am

    Your problem is you do:

    from forum.managers import * (at line 18 models.py)
    from forum.models import * (at line 6 managers.py)

    How can that ever work? Try flattening this out (do the imports by hand copying and pasting into a new file) and you’ll see why, by the time it executes the line “objects = TagManager()” it cannot possibly have executed the part of the managers module where TagManager is defined, unless it was defined before line 18.

    Some general tips:

    1. Avoid the * imports whenever possible (it makes python programs harder to read if nothing else)
    2. If you have circular imports like that, try to break them up. Often in one module you can move the import into a function call, or you can refactor some elements into a third module that both can import from. You can also try moving the import lower in the module, which sometimes works.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 270k
  • Answers 270k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

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

    • 7 Answers
  • Editorial Team

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

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Technically, yes, you can do that... practically, I'd be a… May 13, 2026 at 1:28 pm
  • Editorial Team
    Editorial Team added an answer I don't think you'll be able to get them in… May 13, 2026 at 1:28 pm
  • Editorial Team
    Editorial Team added an answer So HttpServletRequest is an interface. Interfaces declare methods for actual… May 13, 2026 at 1:28 pm

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I want use html5's new tag to play a wav file (currently only supported
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I've got a string that has curly quotes in it. I'd like to replace
In order to apply a triggered animation to all ToolTip s in my app,

Trending Tags

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

Top Members

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.