Check to see DATABASES is configured correctly in settings.py. An example
of it looks like:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'myproject',
'USER': 'myprojectuser',
'PASSWORD': 'password',
'HOST': 'localhost',
'PORT': '',
}
}
-Jorge
On Thu, Nov 2, 2017 at 7:50 AM, Aditya Vartak <[email protected]> wrote:
> Performing system checks...
>
> Unhandled exception in thread started by <function check_errors.<locals>.
> wrapper
> at 0x02A52AE0>
> Traceback (most recent call last):
> File "D:\anaconda\lib\site-packages\django\db\backends\base\base.py",
> line 213
> , in ensure_connection
> self.connect()
> File "D:\anaconda\lib\site-packages\django\db\backends\base\base.py",
> line 189
> , in connect
> self.connection = self.get_new_connection(conn_params)
> File "D:\anaconda\lib\site-packages\django\db\backends\mysql\base.py",
> line 27
> 4, in get_new_connection
> conn = Database.connect(**conn_params)
> File "D:\anaconda\lib\site-packages\MySQLdb\__init__.py", line 86, in
> Connect
> return Connection(*args, **kwargs)
> File "D:\anaconda\lib\site-packages\MySQLdb\connections.py", line 204,
> in __in
> it__
> super(Connection, self).__init__(*args, **kwargs2)
> _mysql_exceptions.OperationalError: (2003, "Can't connect to MySQL server
> on '12
> 7.0.0.1' (10061)")
>
> The above exception was the direct cause of the following exception:
>
> Traceback (most recent call last):
> File "D:\anaconda\lib\site-packages\django\utils\autoreload.py", line
> 228, in
> wrapper
> fn(*args, **kwargs)
> File "D:\anaconda\lib\site-packages\django\core\
> management\commands\runserver.
> py", line 125, in inner_run
> self.check(display_num_errors=True)
> File "D:\anaconda\lib\site-packages\django\core\management\base.py",
> line 359,
> in check
> include_deployment_checks=include_deployment_checks,
> File "D:\anaconda\lib\site-packages\django\core\management\base.py",
> line 346,
> in _run_checks
> return checks.run_checks(**kwargs)
> File "D:\anaconda\lib\site-packages\django\core\checks\registry.py",
> line 81,
> in run_checks
> new_errors = check(app_configs=app_configs)
> File "D:\anaconda\lib\site-packages\django\core\checks\model_checks.py",
> line
> 30, in check_all_models
> errors.extend(model.check(**kwargs))
> File "D:\anaconda\lib\site-packages\django\db\models\base.py", line 1284
> , in c
> heck
> errors.extend(cls._check_fields(**kwargs))
> File "D:\anaconda\lib\site-packages\django\db\models\base.py", line 1359
> , in _
> check_fields
> errors.extend(field.check(**kwargs))
> File "D:\anaconda\lib\site-packages\django\db\models\fields\__init__.py"
> , line
> 913, in check
> errors = super(AutoField, self).check(**kwargs)
> File "D:\anaconda\lib\site-packages\django\db\models\fields\__init__.py"
> , line
> 219, in check
> errors.extend(self._check_backend_specific_checks(**kwargs))
> File "D:\anaconda\lib\site-packages\django\db\models\fields\__init__.py"
> , line
> 322, in _check_backend_specific_checks
> return connections[db].validation.check_field(self, **kwargs)
> File "D:\anaconda\lib\site-packages\django\db\backends\
> mysql\validation.py", l
> ine 49, in check_field
> field_type = field.db_type(self.connection)
> File "D:\anaconda\lib\site-packages\django\db\models\fields\__init__.py"
> , line
> 644, in db_type
> return connection.data_types[self.get_internal_type()] % data
> File "D:\anaconda\lib\site-packages\django\utils\functional.py", line 35
> , in _
> _get__
> res = instance.__dict__[self.name] = self.func(instance)
> File "D:\anaconda\lib\site-packages\django\db\backends\mysql\base.py",
> line 17
> 4, in data_types
> if self.features.supports_microsecond_precision:
> File "D:\anaconda\lib\site-packages\django\utils\functional.py", line 35
> , in _
> _get__
> res = instance.__dict__[self.name] = self.func(instance)
> File "D:\anaconda\lib\site-packages\django\db\backends\
> mysql\features.py", lin
> e 53, in supports_microsecond_precision
> return self.connection.mysql_version >= (5, 6, 4) and Database.
> version_info
> >= (1, 2, 5)
> File "D:\anaconda\lib\site-packages\django\utils\functional.py", line 35
> , in _
> _get__
> res = instance.__dict__[self.name] = self.func(instance)
> File "D:\anaconda\lib\site-packages\django\db\backends\mysql\base.py",
> line 38
> 5, in mysql_version
> with self.temporary_connection() as cursor:
> File "D:\anaconda\lib\contextlib.py", line 82, in __enter__
> return next(self.gen)
> File "D:\anaconda\lib\site-packages\django\db\backends\base\base.py",
> line 591
> , in temporary_connection
> cursor = self.cursor()
> File "D:\anaconda\lib\site-packages\django\db\backends\base\base.py",
> line 254
> , in cursor
> return self._cursor()
> File "D:\anaconda\lib\site-packages\django\db\backends\base\base.py",
> line 229
> , in _cursor
> self.ensure_connection()
> File "D:\anaconda\lib\site-packages\django\db\backends\base\base.py",
> line 213
> , in ensure_connection
> self.connect()
> File "D:\anaconda\lib\site-packages\django\db\utils.py", line 94, in
> __exit__
> six.reraise(dj_exc_type, dj_exc_value, traceback)
> File "D:\anaconda\lib\site-packages\django\utils\six.py", line 685, in
> reraise
>
> raise value.with_traceback(tb)
> File "D:\anaconda\lib\site-packages\django\db\backends\base\base.py",
> line 213
> , in ensure_connection
> self.connect()
> File "D:\anaconda\lib\site-packages\django\db\backends\base\base.py",
> line 189
> , in connect
> self.connection = self.get_new_connection(conn_params)
> File "D:\anaconda\lib\site-packages\django\db\backends\mysql\base.py",
> line 27
> 4, in get_new_connection
> conn = Database.connect(**conn_params)
> File "D:\anaconda\lib\site-packages\MySQLdb\__init__.py", line 86, in
> Connect
> return Connection(*args, **kwargs)
> File "D:\anaconda\lib\site-packages\MySQLdb\connections.py", line 204,
> in __in
> it__
> super(Connection, self).__init__(*args, **kwargs2)
> django.db.utils.OperationalError: (2003, "Can't connect to MySQL server
> on '127.
>
> 0.0.1' (10061)")
>
>
> the above is the error i get when i type command "python manage.py
> runserver" going into outer directory of my project
> I am using Python 3.6.2 and have been following django documentation to
> set up environment.
> Any help would be appreciated .I am newbie to PYTHON DEVELOPMENT
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/48562a80-2f21-48b7-a917-8975e2812913%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/48562a80-2f21-48b7-a917-8975e2812913%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/CANfN%3DK_HyGmi5yaVtWVwQ6EEkTkaR8cUu9McpL7q%2B9Rsyk%3DuyA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.