강의로 돌아가기
-

에러 문의 드립니다

브라우저에서 Candidates 항목을 클릭하거나, 항목을 추가하고 Save를 클릭하니 에러가 발생합니다ㅠ

OperationalError at /admin/elections/candidate/
no such table: electionscandidate
Request Method: GET
Request URL: http://localhost:8000/admin/elections/candidate/
Django Version: 1.9
Exception Type: OperationalError
Exception Value:

no such table: elections
candidate
Exception Location: C:\Python34\lib\site-packages\django\db\backends\sqlite3\base.py in execute, line 323
Python Executable: C:\Python34\python.exe
Python Version: 3.4.3
Python Path:

['C:\파이썬웹프로그래밍\mysite',
'C:\Windows\system32\python34.zip',
'C:\Python34\DLLs',
'C:\Python34\lib',
'C:\Python34',
'C:\Python34\lib\site-packages']
Server time: Fri, 20 May 2016 02:38:51 +0900

3 개의 답변
-

앞으로 에러나 코드를 입력하실 때에는 마크다운 가이드에서 안내하는 대로 코드 영역 처리를 해주세요.


마이그레이션 작업을 안하신 것 같습니다.
마이그레이션과 DB 강의를 따라해주세요

-

마이그레이션과 DB강의를 했는데도 에러가 발생합니다. 제가 파이참을 사용하고 있는데, db.sqlite3를 열어보면 다르게 열리는 것 같습니다. 혹시 이게 문제가 되는건지... 아래는 에러 메세지 입니다!

SQLite format 3   @     ,   &           ;                                                 , -       &                                                                                                                   g33utabledjango_content_typedjango_content_typeCREATE TABLE "django_content_type" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "name" varchar(100) NOT NULL, "app_label" varchar(100) NOT NULL, "model" varchar(100) NOT NULL)   :==tabledjango_content_type__olddjango_content_   <c3oindexdjango_content_type_app_label_76bd3d3b_uniqdjango_content_typeCREATE UNIQUE INDEX "django_content_type_app_label_76bd3d3b_uniq" ON "django_content_type" ("app_label", "model")P++Ytablesqlite_sequencesqlite_sequenceCREATE TABLE sqlite_sequence(name,seq)Y//atabledjango_migrationsdjango_migrationsCREATE TABLE "django_migrations" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "app" varchar(255) NOT NULL, "name" varchar(255) NOT NULL   $.   !%      
       

  d!H2                                                                                                                                                                       3
 %Asessions0001_initial2016-05-19 16:52:16.5162674 %Aelections0001_initial2016-05-19 16:52:16.489265K ]Aauth0007_alter_validators_add_error_messages2016-05-19 16:52:16.462264A
 IAauth0006_require_contenttypes_00022016-05-19 16:52:16.425262B   KAauth0005_alter_user_last_login_null2016-05-19 16:52:16.408261@ GAauth0004_alter_user_username_opts2016-05-19 16:52:16.370259C MAauth0003_alter_user_email_max_length2016-05-19 16:52:16.336257H WAauth0002_alter_permission_name_max_length2016-05-19 16:52:16.306255H %GAcontenttypes0002_remove_content_type_name2016-05-19 16:52:16.269253A GAadmin0002_logentry_remove_auto_add2016-05-19 16:52:16.2152500 %Aadmin0001_initial2016-05-19 16:52:16.160247/ %Aauth0001_initial2016-05-19 16:52:16.0942437 %%Acontenttypes0001_initial2016-05-19 16:52:16.052240
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             +django_conten3django_content_type
  auth_user+auth_permission-django_admin_log/django_migrations
       django_content_type
   [ [s                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   electionscandidateelectionscantidatesessionssession%#contenttypescontenttype
authuserauthgroup!authpermission    adminlogentry
   Z rZ                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   electionscandidate electionscantidate sessionssession %#contenttypescontenttype authuser
 authgroup !authpermission adminlogentry
   Q p]J;)hQ                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               -delete_cantidate-change_cantidate'add_cantidate)delete_session)change_session#add_session1delete_contenttype1change_contenttype+add_contenttype
#delete_user#change_useradd_user
%delete_group  %change_groupadd_group/delete_permission/change_permission)add_permission  +delete_logentry    +change_logentry    %   add_logentry
    y                                                                                                                                                                    Y//atabledjango_migrationsdjango_migrationsCREATE TABLE "django_migrations" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "app" varchar(255) NOT NULL, "name" varchar(255) NOT NULL, "applied" datetime NOT NULL)P++Ytablesqlite_sequencesqlite_sequenceCREATE TABLE sqlite_sequence(name,seq)!!ktableauth_groupauth_groupCREATE TABLE "auth_group" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "name" varchar(80) NOT NULL UNIQUE)3G! indexsqlite_autoindex_auth_group_1auth_group      99?tableauth_group_permissionsauth_group_permissionsCREATE TABLE "auth_group_permissions" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "group_id" integer NOT NULL REFERENCES "auth_group" ("id"), "permission_id" integer NOT NULL REFERENCES "auth_permission" ("id"))   =O) indexsqlite_autoindex_auth_user__old_1auth_user__old

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
    ~  ~ud ?  99?tableauth_group_permissionsauth_group_permissionsCREATE TABLE "auth_group_permissions" ("id" int--tableauth_user_groupsauth_user_groupsCREATE TABLE "auth_user_groups" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "user_id" integer NOT NULL REFERENCES "auth_user" ("id"), "group_id" integer NOT NULL REFERENCES "auth_group" ("id"))
AACtableauth_user_user_permissionsauth_user_user_permissionsCREATE TABLE "auth_user_user_permissions" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "user_id" integer NOT NULL REFERENCES "auth_user" ("id"), "permission_id" integer NOT NULL REFERENCES "auth_permission" ("id"))Mg9indexauth_group_permissions_group_id_0cd325b0_uniqauth_group_permissionsCREATE UNIQUE INDEX "auth_group_permissions_group_id_0cd325b0_uniq" ON "auth_group_permissions" ("group_id", "permission_id")K9;indexauth_group_permissions_0e939a4fauth_group_permissionsCREATE INDEX "auth_group_permissions_0e939a4f" ON "auth_group_permissions" ("group_id")
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
   e e                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
 'A 


        A!pbkdf2_sha256$24000$KCep0V9bVPDg$zD7PSzNHykTrVxD1OAhoh3KSW/n9fIOt7/6nMvKFnx8=2016-05-19 17:00:28.6152332016-05-19 16:59:56.236892Nataehyung
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
!  Nataehyung
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        

                   
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            ;MA6oe3f15b079pamewf4gsbywrledm7p0yNGEyODU4MTI0OGZkZmEwMDRlNDk0MDQ0NzZmYWI4M2M1ZTdkMTNkMjp7Il9hdXRoX3VzZXJfaGFzaCI6IjU2NWYzNmViNzkyMTY4NGZhNTlmNGNmNWYzYWYwODBkMTZhZWRiNzgiLCJfYXV0aF91c2VyX2lkIjoiMSIsIl9hdXRoX3VzZXJfYmFja2VuZCI6ImRqYW5nby5jb250cmliLmF1dGguYmFja2VuZHMuTW9kZWxCYWNrZW5kIn0=2016-06-02 17:00:28.636234
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
        |                                      Mg9indexauth_group_permissions_group_id_0cd325b0_uniqauth_group_permissionsCREATE UNIQUE INDEX "auth_group_permissions_group_id_0cd325b0_uniq" ON "auth_group_permissions" ("group_id", "permission_id")K9;indexauth_group_permissions_0e939a4fauth_group_permissionsCREATE INDEX "auth_group_permissions
AACtableauth_user_user_permissionsauth_user_user_permissionsCREATE TABLE "auth_user_user_permissions" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "user_id" integer NOT NULL REFERENCES "auth_user" ("id"), "permission_id" integer NOT NULL REFERENCES "auth_permission" ("id"))Mg9indexauth_group_permissions_group_id_0cd325b0_uniqauth_group_permissionsCREATE UNIQUE INDEX "auth_group_permissions_group_id_0cd325b0_uniq" ON "auth_group_permissions" ("group_id", "permission_id")K9;indexauth_group_permissions_0e939a4fauth_group_permissionsCREATE INDEX "auth_group_permissions_0e939a4f" ON "#M  6oe3f15b079pamewf4gsbywrledm7p0y
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
         qxU         ZK9Eindexauth_group_permissions_8373b171auth_group_permissionsCREATE INDEX "auth_group_permissions_8373b171" ON "auth_group_permissions" ("permission_id")-Y-aindexauth_user_groups_user_id_94350c0c_uniqauth_user_groupsCREATE UNIQUE INDEX "auth_user_groups_user_id_94350c0c_uniq" ON "auth_user_groups" ("user_id", "group_id") ?-!indexauth_user_groups_e8701ad4auth_user_groupsCREATE INDEX "auth_user_groups_e8701ad4" ON "auth_user_groups" ("user_id")?-#indexauth_user_groups_0e939a4fauth_user_groupsCREATE INDEX "auth_user_groups_0e939a4f" ON "auth_user_groups" ("group_id")ZmAindexauth_user_user_permissions_user_id_14a6b632_uniqauth_user_user_permissionsCREATE UNIQUE INDEX "auth_user_user_permissions_user_id_14a6b632_uniq" ON "auth_user_user_permissions" ("user_id", "permission_id")(SAIindexauth_user_user_permissions_e8701ad4auth_user_user_permissionsCREATE INDEX "auth_user_user_permissions_e8701ad4" ON "auth_user_user_permissions" ("user_id")
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
      H} C                                                 #++Etableauth_permissionauth_permission#CREATE TABLE "auth_permission" ("id" i.SAUindexauth_user_user_permissions_8373b171auth_user_user_permissionsCREATE INDEX "auth_user_user_permissions_8373b171" ON "auth_user_user_permissions" ("permission_id")'--tabledjango_admin_logdjango_admin_log"CREATE TABLE "django_admin_log" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "object_id" text NULL, "object_repr" varchar(200) NOT NULL, "action_flag" smallint unsigned NOT NULL, "change_message" text NOT NULL, "content_type_id" integer NULL REFERENCES "django_content_type" ("id"), "user_id" integer NOT NULL REFERENCES "auth_user" ("id"), "action_time" datetime NOT NULL)?-1indexdjango_admin_log_417f1b1cdjango_admin_logCREATE INDEX "django_admin_log_417f1b1c" ON "django_admin_log" ("content_type_id") ?-!indexdjango_admin_log_e8701ad4django_admin_logCREATE INDEX "django_admin_log_e8701ad4" ON "django_admin_log" ("user_id")
         y          &I!339tabledjango_content_typedjango_content_typeCREATE TABLE "django_content_type" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "app_label" varchar(100) NOT NULL, "model" varchar(100) NOT NULL)<"c3oindexdjango_content_type_app_label_76bd3d3b_uniqdjango_content_typeCREATE UNIQUE INDEX "django_content_type_app_label_76bd3d3b_uniq" ON "django_content_type" ("app_label", "model")#++Etableauth_permissionauth_permission#CREATE TABLE "auth_permission" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "content_type_id" integer NOT NULL REFERENCES "django_content_type" ("id"), "codename" varchar(100) NOT NULL, "name" varchar(255) NOT NULL)A$g+}indexauth_permission_content_type_id_01ab375a_uniqauth_permissionCREATE UNIQUE INDEX "auth_permission_content_type_id_01ab375a_uniq" ON "auth_permission" ("content_type_id", "codename")%=+-indexauth_permission_417f1b1cauth_permissionCREATE INDEX "auth_permission_417f1b1c" ON "auth_permission" ("content_type_id")
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
     `2`>g?                                                                                                                                                 * -5delete_cantidateCan delete cantidate* -5change_cantidateCan change cantidate$ '/add_cantidateCan add cantidate& )1delete_sessionCan delete session& )1change_sessionCan change session  #+add_sessionCan add session/ 1;delete_contenttypeCan delete content type/ 1;change_contenttypeCan change content type)
 +5add_contenttypeCan add content type  #+delete_userCan delete user  #+change_userCan change user
 %add_userCan add user"  %-delete_groupCan delete group" %-change_groupCan change group 'add_groupCan add group, /7delete_permissionCan delete permission, /7change_permissionCan change permission& )1add_permissionCan add permission(     +5delete_logentryCan delete log entry(    +5change_logentryCan change log entry"    %/add_logentryCan add log entry
   ! ! +                          6/))'tabledjango_sessiondjango_sessionCREATE TABLE "django_session" ("session_key" varchar(40) NOT NULL PRIMARY KEY, "session_data" text NOT NULL, "expire_date" datetime NOT NULL);0O) indexsqlite_autoindex_django_session_1django_session',tableauth_userauth_userCREATE TABLE "auth_user" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "password" varchar(128) NOT NULL, "last_login" datetime NULL, "is_superuser" bool NOT NULL, "first_name" varchar(30) NOT NULL, "last_name" varchar(30) NOT NULL, "email" varchar(254) NOT NULL, "is_staff" bool NOT NULL, "is_active" bool NOT NULL, "date_joined" datetime NOT NULL, "username" varchar(30) NOT NULL UNIQUE)1-E indexsqlite_autoindex_auth_user_1auth_user
.33%tableelections_cantidateelections_cantidateCREATE TABLE "elections_cantidate" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "name" varchar(10) NOT NULL, "introduction" text NOT NULL, "area" varchar(15) NOT NULL, "part_number" integer NOT NULL)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            A  2016-06-02 17:00:28.636234
    E
OperationalError at /admin/elections/candidate/
no such table: elections_candidate
Request Method: GET
Request URL:    http://localhost:8000/admin/elections/candidate/
Django Version: 1.9
Exception Type: OperationalError
Exception Value:    
no such table: elections_candidate
Exception Location: C:\Python34\lib\site-packages\django\db\backends\sqlite3\base.py in execute, line 323
Python Executable:  C:\Python34\python.exe
Python Version: 3.4.3
Python Path:    
['C:\\파이썬웹프로그래밍\\mysite',
 'C:\\Windows\\system32\\python34.zip',
 'C:\\Python34\\DLLs',
 'C:\\Python34\\lib',
 'C:\\Python34',
 'C:\\Python34\\lib\\site-packages']
Server time:    Fri, 20 May 2016 13:56:15 +0900
  • -
    sql을 보니까 `cantidate`라고 되어 있는데요. `t`->`d`로 바꿔야 하지 않을까요?
    -―2017.08.18 11:24
  • -
    정확히는 알 수 없지만, 중간에 DB가 꼬인것 같습니다.
    -―2017.08.18 11:24
-

아.. 감사합니다~^

답변 쓰기
이 입력폼은 마크다운 문법을 지원합니다. 마크다운 가이드 를 참고하세요.