강의로 돌아가기
-

저도 에러가 납니다ㅠㅠ

PS C:\code\mysite> python manage.py migrate
Traceback (most recent call last):
File C:\Users\ss\AppData\Local\Programs\Python\Python35-32\lib\site-packages\django\db\backends\utils.py, l
return self.cursor.execute(sql)
File "C:\Users\ss\AppData\Local\Programs\Python\Python35-32\lib\site-packages\django\db\backends\sqlite3\base
return Database.Cursor.execute(self, query)
sqlite3.DatabaseError: file is encrypted or is not a database

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File manage.py, line 10, in
executefromcommandline(sys.argv)
File "C:\Users\ss\AppData\Local\Programs\Python\Python35-32\lib\site-packages\django\core\management_
init__
utility.execute()
File C:\Users\ss\AppData\Local\Programs\Python\Python35-32\lib\site-packages\django\core\management\__init__
self.fetch_command(subcommand).run_from_argv(self.argv)
File
C:\Users\ss\AppData\Local\Programs\Python\Python35-32\lib\site-packages\django\core\management\base.py
self.execute(*args, **cmd_options)
File
C:\Users\ss\AppData\Local\Programs\Python\Python35-32\lib\site-packages\django\core\management\base.py
output = self.handle(*args, **options)
File
C:\Users\ss\AppData\Local\Programs\Python\Python35-32\lib\site-packages\django\core\management\commands
executor = MigrationExecutor(connection, self.migrationprogresscallback)
File C:\Users\ss\AppData\Local\Programs\Python\Python35-32\lib\site-packages\django\db\migrations\executor.p
self.loader = MigrationLoader(self.connection)
File
C:\Users\ss\AppData\Local\Programs\Python\Python35-32\lib\site-packages\django\db\migrations\loader.py
self.build_graph()
File
C:\Users\ss\AppData\Local\Programs\Python\Python35-32\lib\site-packages\django\db\migrations\loader.py
self.applied_migrations = recorder.applied_migrations()
File
C:\Users\ss\AppData\Local\Programs\Python\Python35-32\lib\site-packages\django\db\migrations\recorder.p
self.ensureschema()
File "C:\Users\ss\AppData\Local\Programs\Python\Python35-32\lib\site-packages\django\db\migrations\recorder.p
if self.Migration.
meta.dbtable in self.connection.introspection.tablenames(self.connection.cursor()):
File C:\Users\ss\AppData\Local\Programs\Python\Python35-32\lib\site-packages\django\db\backends\base\introsp
return get_names(cursor)
File
C:\Users\ss\AppData\Local\Programs\Python\Python35-32\lib\site-packages\django\db\backends\base\introsp
return sorted(ti.name for ti in self.gettablelist(cursor)
File C:\Users\ss\AppData\Local\Programs\Python\Python35-32\lib\site-packages\django\db\backends\sqlite3\intr
ORDER BY name
")
File
C:\Users\ss\AppData\Local\Programs\Python\Python35-32\lib\site-packages\django\db\backends\utils.py, l
return super(CursorDebugWrapper, self).execute(sql, params)
File
C:\Users\ss\AppData\Local\Programs\Python\Python35-32\lib\site-packages\django\db\backends\utils.py, l
return self.cursor.execute(sql, params)
File
C:\Users\ss\AppData\Local\Programs\Python\Python35-32\lib\site-packages\django\db\utils.py, line 95, i
six.reraise(dj_exc_type, dj_exc_value, traceback)
File
C:\Users\ss\AppData\Local\Programs\Python\Python35-32\lib\site-packages\django\utils\six.py, line 685,
raise value.with_traceback(tb)
File
C:\Users\ss\AppData\Local\Programs\Python\Python35-32\lib\site-packages\django\db\backends\utils.py, l
return self.cursor.execute(sql)
File
C:\Users\ss\AppData\Local\Programs\Python\Python35-32\lib\site-packages\django\db\backends\sqlite3\base
return Database.Cursor.execute(self, query)
django.db.utils.DatabaseError: file is encrypted or is not a database

powershell에서 이런 오류가 뜹니다 ㅠㅠ 왜이런건가요?

2 개의 답변
-

검색해보니 DatabaseNAME이 프로젝트 이름과 같은 경우 이런 문제가 생길 수 있다고 합니다.
아직 강의 초반이니 프로젝트를 다른 이름으로 새로 만드시거나, 다음과 같이 settings.py에 NAME을 지정해주세요.

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': "프로젝트 이름"
        ...
    }
}
  • -
    DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), } - 2017.08.18 11:24
  • -
    이렇게 되어있던데 여기가 잘못된건가요? - 2017.08.18 11:24
  • -
    "프로젝트 이름" 에 어떤 값을 넣어줘야하는건가요..ㅠㅠ - 2017.08.18 11:24
-

#C\Code\mysite\mysite\settings.py settings.py에 경로가 이렇다면, 프로젝트 이름에는 mysite를 넣어주면 됩니다.

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