2016-08-16 9 views
0

私がテーブルauthtoken_tokenを理解することから、makemigrationsmigrateの後にDjango Rest Framework authtokenを設定しようとしています。私はsettings.pyにrest_frameworkを追加しました:Django Rest Frameworkがテーブルを作成していませんauthtoken_token

INSTALLED_APPS = [ 
    'django.contrib.admin', 
    'django.contrib.auth', 
    'django.contrib.contenttypes', 
    'django.contrib.sessions', 
    'django.contrib.messages', 
    'django.contrib.staticfiles', 
    'Site', 
    'rest_framework', 
    'rest_framework.authtoken', 
    'MySQLdb' 
] 

REST_FRAMEWORK = { 
    # Use Django's standard `django.contrib.auth` permissions, 
    # or allow read-only access for unauthenticated users. 
    'DEFAULT_PERMISSION_CLASSES': [ 
     'rest_framework.permissions.IsAdminUser' 
    ], 
    'DEFAULT_AUTHENTICATION_CLASSES': (
     'rest_framework.authentication.BasicAuthentication', 
     'rest_framework.authentication.SessionAuthentication', 
     'rest_framework.authentication.TokenAuthentication', 
    ), 
} 

移行は、出力をコマンド:誰もが、テーブル情報を作成されていない理由を任意のアイデアを持っている場合

'[email protected] > makemigrations Site 
"C:\Program Files (x86)\JetBrains\PyCharm 2016.2\bin\runnerw.exe" C:\Python27\python.exe "C:\Program Files (x86)\JetBrains\PyCharm 2016.2\helpers\pycharm\django_manage.py" makemigrations Site "C:/Users/Eric Franzen/PycharmProjects/MySite" 
No changes detected in app 'Site' 

Process finished with exit code 0 
[email protected] > migrate Site 
"C:\Program Files (x86)\JetBrains\PyCharm 2016.2\bin\runnerw.exe" C:\Python27\python.exe "C:\Program Files (x86)\JetBrains\PyCharm 2016.2\helpers\pycharm\django_manage.py" migrate Site "C:/Users/Eric Franzen/PycharmProjects/MySite" 
Operations to perform: 
    Apply all migrations: Site 
Running migrations: 
    No migrations to apply. 

プロセスの終了コードを0' を終えいただければ幸いです!

+0

これは私には正常に見える、あなたはあなたがテーブルが確実に作成されていないことを/リフレッシュされていることを/正しいデータベースを見ていることを確認していますか? 詳細をお知らせください。両方のコマンドの出力は何ですか? –

+0

テーブルが作成されておらず、移行する必要もありません。移行コマンドの実行時に変更は検出されません。 – enrique2334

+0

その場合、実行した2つの管理コマンドの出力を提供してください。 –

答えて

2

固定migrate authtokenを実行しているこの

関連する問題