Django: Error: Unknown command: 'makemigrations'

前端 未结 7 1666
夕颜
夕颜 2021-02-03 23:06

I am trying to follow the Django tutorial and I faced the following error when I enter python manage.py makemigrations polls

Unknown co         


        
7条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-03 23:30

    First time I add following piece of code into project_name\settings.py file.

                      `INSTALLED_APPS = [
            'django.contrib.admin',
            'django.contrib.auth',
            'django.contrib.contenttypes',
            'django.contrib.sessions',
            'django.contrib.messages',
            'django.contrib.staticfiles',
            #Django REST Framework
            'rest_framework',
            #Games application
            'games.apps.GamesConfig',
                      ]`
    

    After save it, when run following code I got error.

                     `python manage.py makemigrations games`
    

    Then I check the settings.py file I realize that there are two INSTALLED_APPS and second one has not followings. When I added these the code worked.

           `#Django REST Framework
           'rest_framework',
            #Games application
           'games.apps.GamesConfig',`
    

提交回复
热议问题