2
respostas

Erro python manage.py migrate

Erro ao executar o migrate minha versão do python é a 2.7.9

C:\Users\vinio\OneDrive\Área de Trabalho\python\novo>python manage.py migrate Traceback (most recent call last): File "manage.py", line 10, in executefromcommandline(sys.argv) File "C:\Python27\lib\site-packages\django\core\management_init.py", line 385, in execute_from_command_line utility.execute() File "C:\Python27\lib\site-packages\django\core\management\init.py", line 377, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "C:\Python27\lib\site-packages\django\core\management\base.py", line 288, in run_from_argv self.execute(args, *options.dict) File "C:\Python27\lib\site-packages\django\core\management\base.py", line 338, in execute output = self.handle(args, *options) File "C:\Python27\lib\site-packages\django\core\management\commands\migrate.py", line 63, in handle executor = MigrationExecutor(connection, self.migration_progress_callback) File "C:\Python27\lib\site-packages\django\db\migrations\executor.py", line 17, in init self.loader = MigrationLoader(self.connection) File "C:\Python27\lib\site-packages\django\db\migrations\loader.py", line 49, in init self.build_graph() File "C:\Python27\lib\site-packages\django\db\migrations\loader.py", line 184, in build_graph self.applied_migrations = recorder.applied_migrations() File "C:\Python27\lib\site-packages\django\db\migrations\recorder.py", line 59, in applied_migrations self.ensure_schema() File "C:\Python27\lib\site-packages\django\db\migrations\recorder.py", line 49, in ensure_schema if self.Migration._meta.db_table in self.connection.introspection.get_table_list(self.connection.cursor()): File "C:\Python27\lib\site-packages\django\db\backends\init.py", line 165, in cursor cursor = self.make_debug_cursor(self._cursor()) File "C:\Python27\lib\site-packages\django\db\backends\init.py", line 138, in _cursor self.ensure_connection() File "C:\Python27\lib\site-packages\django\db\backends\init.py", line 133, in ensure_connection self.connect() File "C:\Python27\lib\site-packages\django\db\utils.py", line 94, in exit six.reraise(dj_exc_type, dj_exc_value, traceback) File "C:\Python27\lib\site-packages\django\db\backends\init.py", line 133, in ensure_connection self.connect() File "C:\Python27\lib\site-packages\django\db\backends__init.py", line 122, in connect self.connection = self.get_new_connection(conn_params) File "C:\Python27\lib\site-packages\django\db\backends\sqlite3\base.py", line 374, in get_new_connection conn = Database.connect(**conn_params) django.db.utils.OperationalError: unable to open database file

2 respostas

Vinicius,

Qual o exercício ou o código que vc usou?

O erro ocorreu na 1 ª aula de django, instalei o python e instalei o django com pip install django==1.7.4 o django foi instalado dei o comando django-admin.py startproject novo e entrei no diretorio novo e dei o comando python manage.py migrate e apareceu a mensagem de erro

C:\Users\vinio\OneDrive\Área de Trabalho\python\novo>python manage.py migrate Traceback (most recent call last): File "manage.py", line 10, in executefromcommandline(sys.argv) File "C:\Python27\lib\site-packages\django\core\management_init.py", line 385, in execute_from_command_line utility.execute() File "C:\Python27\lib\site-packages\django\core\management\init.py", line 377, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "C:\Python27\lib\site-packages\django\core\management\base.py", line 288, in run_from_argv self.execute(args, options.dict) File "C:\Python27\lib\site-packages\django\core\management\base.py", line 338, in execute output = self.handle(args, options) File "C:\Python27\lib\site-packages\django\core\management\commands\migrate.py", line 63, in handle executor = MigrationExecutor(connection, self.migration_progress_callback) File "C:\Python27\lib\site-packages\django\db\migrations\executor.py", line 17, in init self.loader = MigrationLoader(self.connection) File "C:\Python27\lib\site-packages\django\db\migrations\loader.py", line 49, in init self.build_graph() File "C:\Python27\lib\site-packages\django\db\migrations\loader.py", line 184, in build_graph self.applied_migrations = recorder.applied_migrations() File "C:\Python27\lib\site-packages\django\db\migrations\recorder.py", line 59, in applied_migrations self.ensure_schema() File "C:\Python27\lib\site-packages\django\db\migrations\recorder.py", line 49, in ensure_schema if self.Migration._meta.db_table in self.connection.introspection.get_table_list(self.connection.cursor()): File "C:\Python27\lib\site-packages\django\db\backends\init.py", line 165, in cursor cursor = self.make_debug_cursor(self._cursor()) File "C:\Python27\lib\site-packages\django\db\backends\init.py", line 138, in _cursor self.ensure_connection() File "C:\Python27\lib\site-packages\django\db\backends\init.py", line 133, in ensure_connection self.connect() File "C:\Python27\lib\site-packages\django\db\utils.py", line 94, in exit six.reraise(dj_exc_type, dj_exc_value, traceback) File "C:\Python27\lib\site-packages\django\db\backends\init.py", line 133, in ensure_connection self.connect() File "C:\Python27\lib\site-packages\django\db\backends__init.py", line 122, in connect self.connection = self.get_new_connection(conn_params) File "C:\Python27\lib\site-packages\django\db\backends\sqlite3\base.py", line 374, in get_new_connection conn = Database.connect(**conn_params) django.db.utils.OperationalError: unable to open database file