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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T20:56:03+00:00 2026-05-11T20:56:03+00:00

I am getting this error when running ./manage.py migrate app_name While loading migration ‘whatever.0001_initial’:

  • 0

I am getting this error when running “./manage.py migrate app_name”

While loading migration 'whatever.0001_initial':
Traceback (most recent call last):
 File "manage.py", line 14, in <module> execute_manager(settings)

...tons of other stuff..

   raise KeyError("The model '%s' from the app '%s' is not available in this migration." % (model, app))
KeyError: "The model 'appuser' from the app 'whatever' is not available in this migration."

I am sure that model “appuser” is both in application models.py and in 0001_initial.py

AppUser model from models.py:

class AppUser(models.Model):
    person = models.OneToOneField('Person')
    user = models.ForeignKey(User, unique=True)
    class Meta:
        permissions = (
            ('is_one', 'one'),
            ('is_two', 'two')
        )
    def __unicode__(self):
        return self.person.__unicode__()

AppUser model from 0001_initial.py:

    # Adding model 'AppUser'
    db.create_table('app_appuser', (
        ('person', models.OneToOneField(orm.Person)),
        ('id', models.AutoField(primary_key=True)),
        ('user', models.ForeignKey(orm['auth.User'], unique=True)),
    ))
    db.send_create_signal('app', ['AppUser'])
    ...
    'app.appuser': {
        'Meta': {'permissions': "(('is_one','one'),('is_two','two'))"},
        'id': ('models.AutoField', [], {'primary_key': 'True'}),
        'person': ('models.OneToOneField', ["'Person'"], {}),
        'user': ('models.ForeignKey', ['User'], {'unique': 'True'})
    },

I am trying to run it on empty database (ie. no “app_*” tables) like that:

manage.py migrate app

This seem to be happening only on python 2.5 on Mac OS, no probs with Ubuntu/python 2.6

Question – how to fix?

Thanks!

  • 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-11T20:56:04+00:00Added an answer on May 11, 2026 at 8:56 pm

    The problem seemed to be with the order of models in the 0001_initial.py file. There was a class which derived from AppUser. When I re-created the migration on Mac OS with

    manage.py startmigration app --initial
    

    and compared that to one generated on Ubuntu the order of models was different. So when I changed the order to match the one on Mac OS, everything worked fine.

    This problem seems to exist only in 0.5 version of south and is supposedly fixed on trunk.

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

Sidebar

Ask A Question

Stats

  • Questions 172k
  • Answers 172k
  • 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 Assuming your DLL project has something like this in .\Properties\Settings.Designer.cs:… May 12, 2026 at 2:24 pm
  • Editorial Team
    Editorial Team added an answer You have to save the batch file with OEM encoding.… May 12, 2026 at 2:24 pm
  • Editorial Team
    Editorial Team added an answer It seems like django isn't installed to the site-packages directory,… May 12, 2026 at 2:24 pm

Related Questions

I am getting this error when running ./manage.py migrate app_name While loading migration 'whatever.0001_initial':
I am getting a strange runtime error from my code: Found interface [SomeInterface] but
I am calling an executable in C#. When the executable runs, it writes out
I'm trying to install this PHP module from NYTimes ( http://code.nytimes.com/projects/xslcache ) I unfortunately
I am getting this error when trying to run internet information services on a

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.