2017-02-15 135 views
1

我想使遷移的game.charactersDjango的makemigrations不起作用

INSTALLED_APPS = [ 
    'django.contrib.admin', 
    'django.contrib.auth', 
    'django.contrib.contenttypes', 
    'django.contrib.sessions', 
    'django.contrib.messages', 
    'django.contrib.staticfiles', 

    'rest_framework', 
    'django_summernote', 

    'lucifer', 
    'users', 
    'posts', 

    'game', 
    'game.characters', 
] 

我用命令

python lucifer/manage.py makemigrations users posts game game.characters 
python lucifer/manage.py migrate 

App 'game.characters' could not be found. Is it in INSTALLED_APPS?

我不明白爲什麼?

這裏是我的game.characters

from django.db import models 
from django.conf import settings 
from game.quests.models import Quest 


class Character(models.Model): 

    user = models.ForeignKey(
     settings.AUTH_USER_MODEL, 
     ) 

    nickname = models.CharField(
     max_length=8, 
     ) 

    level = models.IntegerField(
     default=1, 
     ) 

    JOB_CHOICE = (
     ('killer', '나이트'), 
     ('gunshoter', '야만전사'), 
     ('monster', '팔라딘'), 
     ) 

    job = models.CharField(
     max_length=4, 
     choices=JOB_CHOICE, 
     null=True, 
     blank=True, 
     ) 

├── Makefile 
├── README.md 
├── lucifer 
│   ├── db.sqlite3 
│   ├── game 
│   │   ├── __init__.py 
│   │   └── characters 
│   │      ├── __init__.py 
│   │      └── models 
│   │       ├── __init__.py 
│   │       └── character.py 
│   ├── lucifer 
│   │   ├── __init__.py 
│   │   ├── settings 
│   │   │   ├── __init__.py 
│   │   │   ├── development.py 
│   │   │   ├── partials 
│   │   │   │   ├── __init__.py 
│   │   │   │   ├── base.py 
│   │   │   │   ├── database.py 
│   │   │   │   ├── static.py 
│   │   │   │   └── summernote.py 
│   │   │   └── production.py 
│   │   ├── templates 
│   │   ├── urls.py 
│   │   ├── views 
│   │   │   ├── __init__.py 
│   │   │   ├── __pycache__ 
│   │   │   └── home.py 
│   │   └── wsgi.py 
│   ├── manage.py 

回答

2

makemigrations命令採用app label,這是characters,不game.characters

python lucifer/manage.py makemigrations characters 
+0

Fantasic!謝謝@Alasdair! –