591523840997051
이설현
  • 2016.5.16 15:34
  • 조회수 251
  • 답변수 2
591523840997051
이설현
  • 2016.5.16 15:34
  • 조회수 251
  • 답변수 2

저도 에러가 납니다ㅠㅠ

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
execute_from_command_line(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.migration_progress_callback)
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.ensure_schema()
File "C:\Users\ss\AppData\Local\Programs\Python\Python35-32\lib\site-packages\django\db\migrations\recorder.p
if self.Migration.meta.db_table in self.connection.introspection.table_names(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.get_table_list(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에서 이런 오류가 뜹니다 ㅠㅠ 왜이런건가요?

  • #장고를 활용한 웹사이트 만들기
  • #마이그레이션과 DB

2 답변

  • G3rlasealonpd5c2kica
    Demi
    • 2016.5.16 15:51

    검색해보니 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'), }-이설현
      2016.5.16 21:36
    • 이렇게 되어있던데 여기가 잘못된건가요?-이설현
      2016.5.16 21:36
    • "프로젝트 이름" 에 어떤 값을 넣어줘야하는건가요..ㅠㅠ-이설현
      2016.5.16 21:37
  • G3rlasealonpd5c2kica
    Demi
    • 2016.5.17 09:51

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

답변 쓰기

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