Thanks. Be there, let me try. > On Aug 17, 2018, at 12:06 PM, mazz ahmed <mazzahm...@gmail.com> wrote: > > > > DATABASES = { > 'default': { > 'ENGINE': 'django.db.backends.mysql', > 'NAME': CONFIG.DB_NAME, > 'USER': CONFIG.DB_USER_NAME, > 'PASSWORD': CONFIG.DB_PASSWORD, > 'HOST': CONFIG.DB_HOST, > 'PORT': CONFIG.DB_PORT, > 'OPTIONS': { > 'init_command': "SET sql_mode='STRICT_TRANS_TABLES'", > }, > 'TEST': { > 'CHARSET': 'utf8', > } > }, > } > > > On Fri, Aug 17, 2018 at 11:33 AM, Vikrant Gupta <wikigupt...@gmail.com > <mailto:wikigupt...@gmail.com>> wrote: > I configured it already… > See here. > > DATABASES = { > 'default': { > 'ENGINE': 'django.db.backends.mysql', > 'NAME': os.path.join(BASE_DIR, 'Django_TestingDB'), > 'USER':'root', > 'PASSWORD’:’blahblahblah', > 'PORT':'3306', > 'HOST':'127.0.0.1', > } > } > > >> On Aug 17, 2018, at 12:01 PM, mazz ahmed <mazzahm...@gmail.com >> <mailto:mazzahm...@gmail.com>> wrote: >> >> if you are using sqlite3 then it will automatically do for you otherwise >> configure db >> >> On Fri, Aug 17, 2018 at 11:30 AM, mazz ahmed <mazzahm...@gmail.com >> <mailto:mazzahm...@gmail.com>> wrote: >> it is related to your database configure in the setting.py >> >> On Fri, Aug 17, 2018 at 11:28 AM, Vikrant Gupta <wikigupt...@gmail.com >> <mailto:wikigupt...@gmail.com>> wrote: >> I tried it. Showing following error… >> >> >> Python manage.py migrate >> >> Traceback (most recent call last): >> File "manage.py", line 15, in <module> >> execute_from_command_line(sys.argv) >> File "/Library/Frameworks/Python.fr >> <http://python.fr/>amework/Versions/3.7/lib/python3.7/site-packages/django/core/management/__init__.py", >> line 381, in execute_from_command_line >> utility.execute() >> File "/Library/Frameworks/Python.fr >> <http://python.fr/>amework/Versions/3.7/lib/python3.7/site-packages/django/core/management/__init__.py", >> line 357, in execute >> django.setup() >> File "/Library/Frameworks/Python.fr >> <http://python.fr/>amework/Versions/3.7/lib/python3.7/site-packages/django/__init__.py", >> line 24, in setup >> apps.populate(settings.INSTALLED_APPS) >> File "/Library/Frameworks/Python.fr >> <http://python.fr/>amework/Versions/3.7/lib/python3.7/site-packages/django/apps/registry.py", >> line 112, in populate >> app_config.import_models() >> File "/Library/Frameworks/Python.fr >> <http://python.fr/>amework/Versions/3.7/lib/python3.7/site-packages/django/apps/config.py", >> line 198, in import_models >> self.models_module = import_module(models_module_name) >> File "/Library/Frameworks/Python.fr >> <http://python.fr/>amework/Versions/3.7/lib/python3.7/importlib/__init__.py", >> line 127, in import_module >> return _bootstrap._gcd_import(name[level:], package, level) >> File "<frozen importlib._bootstrap>", line 1006, in _gcd_import >> File "<frozen importlib._bootstrap>", line 983, in _find_and_load >> File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked >> File "<frozen importlib._bootstrap>", line 677, in _load_unlocked >> File "<frozen importlib._bootstrap_external>", line 728, in exec_module >> File "<frozen importlib._bootstrap>", line 219, in >> _call_with_frames_removed >> File "/Library/Frameworks/Python.fr >> <http://python.fr/>amework/Versions/3.7/lib/python3.7/site-packages/django/contrib/auth/models.py", >> line 2, in <module> >> from django.contrib.auth.base_user import AbstractBaseUser, >> BaseUserManager >> File "/Library/Frameworks/Python.fr >> <http://python.fr/>amework/Versions/3.7/lib/python3.7/site-packages/django/contrib/auth/base_user.py", >> line 47, in <module> >> class AbstractBaseUser(models.Model): >> File "/Library/Frameworks/Python.fr >> <http://python.fr/>amework/Versions/3.7/lib/python3.7/site-packages/django/db/models/base.py", >> line 101, in __new__ >> new_class.add_to_class('_meta', Options(meta, app_label)) >> File "/Library/Frameworks/Python.fr >> <http://python.fr/>amework/Versions/3.7/lib/python3.7/site-packages/django/db/models/base.py", >> line 304, in add_to_class >> value.contribute_to_class(cls, name) >> File "/Library/Frameworks/Python.fr >> <http://python.fr/>amework/Versions/3.7/lib/python3.7/site-packages/django/db/models/options.py", >> line 203, in contribute_to_class >> self.db_table = truncate_name(self.db_table, >> connection.ops.max_name_length()) >> File "/Library/Frameworks/Python.fr >> <http://python.fr/>amework/Versions/3.7/lib/python3.7/site-packages/django/db/__init__.py", >> line 33, in __getattr__ >> return getattr(connections[DEFAULT_DB_ALIAS], item) >> File "/Library/Frameworks/Python.fr >> <http://python.fr/>amework/Versions/3.7/lib/python3.7/site-packages/django/db/utils.py", >> line 202, in __getitem__ >> backend = load_backend(db['ENGINE']) >> File "/Library/Frameworks/Python.fr >> <http://python.fr/>amework/Versions/3.7/lib/python3.7/site-packages/django/db/utils.py", >> line 110, in load_backend >> return import_module('%s.base' % backend_name) >> File "/Library/Frameworks/Python.fr >> <http://python.fr/>amework/Versions/3.7/lib/python3.7/importlib/__init__.py", >> line 127, in import_module >> return _bootstrap._gcd_import(name[level:], package, level) >> File "/Library/Frameworks/Python.fr >> <http://python.fr/>amework/Versions/3.7/lib/python3.7/site-packages/django/db/backends/mysql/base.py", >> line 20, in <module> >> ) from err >> django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module. >> Did you install mysqlclient? >> (venv) VikrantuptasMBP:New_Django vikrantgupta$ python manage.py migrate >> Traceback (most recent call last): >> File "/Library/Frameworks/Python.fr >> <http://python.fr/>amework/Versions/3.7/lib/python3.7/site-packages/django/db/backends/base/base.py", >> line 216, in ensure_connection >> self.connect() >> File "/Library/Frameworks/Python.fr >> <http://python.fr/>amework/Versions/3.7/lib/python3.7/site-packages/django/db/backends/base/base.py", >> line 194, in connect >> self.connection = self.get_new_connection(conn_params) >> File "/Library/Frameworks/Python.fr >> <http://python.fr/>amework/Versions/3.7/lib/python3.7/site-packages/django/db/backends/mysql/base.py", >> line 227, in get_new_connection >> return Database.connect(**conn_params) >> File "/Library/Frameworks/Python.fr >> <http://python.fr/>amework/Versions/3.7/lib/python3.7/site-packages/pymysql/__init__.py", >> line 94, in Connect >> return Connection(*args, **kwargs) >> File "/Library/Frameworks/Python.fr >> <http://python.fr/>amework/Versions/3.7/lib/python3.7/site-packages/pymysql/connections.py", >> line 327, in __init__ >> self.connect() >> File "/Library/Frameworks/Python.fr >> <http://python.fr/>amework/Versions/3.7/lib/python3.7/site-packages/pymysql/connections.py", >> line 598, in connect >> self._request_authentication() >> File "/Library/Frameworks/Python.fr >> <http://python.fr/>amework/Versions/3.7/lib/python3.7/site-packages/pymysql/connections.py", >> line 873, in _request_authentication >> auth_packet = _auth.caching_sha2_password_auth(self, auth_packet) >> File "/Library/Frameworks/Python.fr >> <http://python.fr/>amework/Versions/3.7/lib/python3.7/site-packages/pymysql/_auth.py", >> line 226, in caching_sha2_password_auth >> pkt = conn._read_packet() >> File "/Library/Frameworks/Python.fr >> <http://python.fr/>amework/Versions/3.7/lib/python3.7/site-packages/pymysql/connections.py", >> line 683, in _read_packet >> packet.check_error() >> File "/Library/Frameworks/Python.fr >> <http://python.fr/>amework/Versions/3.7/lib/python3.7/site-packages/pymysql/protocol.py", >> line 220, in check_error >> err.raise_mysql_exception(self._data) >> File "/Library/Frameworks/Python.fr >> <http://python.fr/>amework/Versions/3.7/lib/python3.7/site-packages/pymysql/err.py", >> line 109, in raise_mysql_exception >> raise errorclass(errno, errval) >> pymysql.err.InternalError: (1049, "Unknown database >> '/users/vikrantgupta/pycharmprojects/new_django/django_testingdb'") >> >> The above exception was the direct cause of the following exception: >> >> Traceback (most recent call last): >> File "manage.py", line 15, in <module> >> execute_from_command_line(sys.argv) >> File "/Library/Frameworks/Python.fr >> <http://python.fr/>amework/Versions/3.7/lib/python3.7/site-packages/django/core/management/__init__.py", >> line 381, in execute_from_command_line >> utility.execute() >> File "/Library/Frameworks/Python.fr >> <http://python.fr/>amework/Versions/3.7/lib/python3.7/site-packages/django/core/management/__init__.py", >> line 375, in execute >> self.fetch_command(subcommand).run_from_argv(self.argv) >> File "/Library/Frameworks/Python.fr >> <http://python.fr/>amework/Versions/3.7/lib/python3.7/site-packages/django/core/management/base.py", >> line 316, in run_from_argv >> self.execute(*args, **cmd_options) >> File "/Library/Frameworks/Python.fr >> <http://python.fr/>amework/Versions/3.7/lib/python3.7/site-packages/django/core/management/base.py", >> line 350, in execute >> self.check() >> File "/Library/Frameworks/Python.fr >> <http://python.fr/>amework/Versions/3.7/lib/python3.7/site-packages/django/core/management/base.py", >> line 379, in check >> include_deployment_checks=include_deployment_checks, >> File "/Library/Frameworks/Python.fr >> <http://python.fr/>amework/Versions/3.7/lib/python3.7/site-packages/django/core/management/commands/migrate.py", >> line 59, in _run_checks >> issues = run_checks(tags=[Tags.database]) >> File "/Library/Frameworks/Python.fr >> <http://python.fr/>amework/Versions/3.7/lib/python3.7/site-packages/django/core/checks/registry.py", >> line 71, in run_checks >> new_errors = check(app_configs=app_configs) >> File "/Library/Frameworks/Python.fr >> <http://python.fr/>amework/Versions/3.7/lib/python3.7/site-packages/django/core/checks/database.py", >> line 10, in check_database_backends >> issues.extend(conn.validation.check(**kwargs)) >> File "/Library/Frameworks/Python.fr >> <http://python.fr/>amework/Versions/3.7/lib/python3.7/site-packages/django/db/backends/mysql/validation.py", >> line 9, in check >> issues.extend(self._check_sql_mode(**kwargs)) >> File "/Library/Frameworks/Python.fr >> <http://python.fr/>amework/Versions/3.7/lib/python3.7/site-packages/django/db/backends/mysql/validation.py", >> line 13, in _check_sql_mode >> with self.connection.cursor() as cursor: >> File "/Library/Frameworks/Python.fr >> <http://python.fr/>amework/Versions/3.7/lib/python3.7/site-packages/django/db/backends/base/base.py", >> line 255, in cursor >> return self._cursor() >> File "/Library/Frameworks/Python.fr >> <http://python.fr/>amework/Versions/3.7/lib/python3.7/site-packages/django/db/backends/base/base.py", >> line 232, in _cursor >> self.ensure_connection() >> File "/Library/Frameworks/Python.fr >> <http://python.fr/>amework/Versions/3.7/lib/python3.7/site-packages/django/db/backends/base/base.py", >> line 216, in ensure_connection >> self.connect() >> File "/Library/Frameworks/Python.fr >> <http://python.fr/>amework/Versions/3.7/lib/python3.7/site-packages/django/db/utils.py", >> line 89, in __exit__ >> raise dj_exc_value.with_traceback(traceback) from exc_value >> File "/Library/Frameworks/Python.fr >> <http://python.fr/>amework/Versions/3.7/lib/python3.7/site-packages/django/db/backends/base/base.py", >> line 216, in ensure_connection >> self.connect() >> File "/Library/Frameworks/Python.fr >> <http://python.fr/>amework/Versions/3.7/lib/python3.7/site-packages/django/db/backends/base/base.py", >> line 194, in connect >> self.connection = self.get_new_connection(conn_params) >> File "/Library/Frameworks/Python.fr >> <http://python.fr/>amework/Versions/3.7/lib/python3.7/site-packages/django/db/backends/mysql/base.py", >> line 227, in get_new_connection >> return Database.connect(**conn_params) >> File "/Library/Frameworks/Python.fr >> <http://python.fr/>amework/Versions/3.7/lib/python3.7/site-packages/pymysql/__init__.py", >> line 94, in Connect >> return Connection(*args, **kwargs) >> File "/Library/Frameworks/Python.fr >> <http://python.fr/>amework/Versions/3.7/lib/python3.7/site-packages/pymysql/connections.py", >> line 327, in __init__ >> self.connect() >> File "/Library/Frameworks/Python.fr >> <http://python.fr/>amework/Versions/3.7/lib/python3.7/site-packages/pymysql/connections.py", >> line 598, in connect >> self._request_authentication() >> File "/Library/Frameworks/Python.fr >> <http://python.fr/>amework/Versions/3.7/lib/python3.7/site-packages/pymysql/connections.py", >> line 873, in _request_authentication >> auth_packet = _auth.caching_sha2_password_auth(self, auth_packet) >> File "/Library/Frameworks/Python.fr >> <http://python.fr/>amework/Versions/3.7/lib/python3.7/site-packages/pymysql/_auth.py", >> line 226, in caching_sha2_password_auth >> pkt = conn._read_packet() >> File "/Library/Frameworks/Python.fr >> <http://python.fr/>amework/Versions/3.7/lib/python3.7/site-packages/pymysql/connections.py", >> line 683, in _read_packet >> packet.check_error() >> File "/Library/Frameworks/Python.fr >> <http://python.fr/>amework/Versions/3.7/lib/python3.7/site-packages/pymysql/protocol.py", >> line 220, in check_error >> err.raise_mysql_exception(self._data) >> File "/Library/Frameworks/Python.fr >> <http://python.fr/>amework/Versions/3.7/lib/python3.7/site-packages/pymysql/err.py", >> line 109, in raise_mysql_exception >> raise errorclass(errno, errval) >> django.db.utils.InternalError: (1049, "Unknown database >> '/users/vikrantgupta/pycharmprojects/new_django/django_testingdb'") >> (venv) VikrantuptasMBP:New_Django vikrantgupta$ >> >> >>> On Aug 17, 2018, at 11:54 AM, mazz ahmed <mazzahm...@gmail.com >>> <mailto:mazzahm...@gmail.com>> wrote: >>> >>> remove your "Newtest.apps.Newtestconfig" and see what happens >>> >>> >>> On Fri, Aug 17, 2018 at 11:16 AM, Vikrant Gupta >>> <vikrantgupta.v...@gmail.com <mailto:vikrantgupta.v...@gmail.com>> wrote: >>> sick of this error... what to do? >>> >>> antuptasMBP:New_Django vikrantgupta$ python manage.py migrate >>> Traceback (most recent call last): >>> File "manage.py", line 15, in <module> >>> execute_from_command_line(sys.argv) >>> File "/Library/Frameworks/Python.fr >>> <http://python.fr/>amework/Versions/3.7/lib/python3.7/site-packages/django/core/management/__init__.py", >>> line 381, in execute_from_command_line >>> utility.execute() >>> File "/Library/Frameworks/Python.fr >>> <http://python.fr/>amework/Versions/3.7/lib/python3.7/site-packages/django/core/management/__init__.py", >>> line 357, in execute >>> django.setup() >>> File "/Library/Frameworks/Python.fr >>> <http://python.fr/>amework/Versions/3.7/lib/python3.7/site-packages/django/__init__.py", >>> line 24, in setup >>> apps.populate(settings.INSTALLED_APPS) >>> File "/Library/Frameworks/Python.fr >>> <http://python.fr/>amework/Versions/3.7/lib/python3.7/site-packages/django/apps/registry.py", >>> line 93, in populate >>> "duplicates: %s" % app_config.label) >>> django.core.exceptions.ImproperlyConfigured: Application labels aren't >>> unique, duplicates: Newtest >>> >>> setting.py code for INSTALLED_apps is >>> >>> INSTALLED_APPS = [ >>> 'django.contrib.auth', >>> 'django.contrib.contenttypes', >>> 'django.contrib.sessions', >>> 'django.contrib.messages', >>> 'django.contrib.staticfiles', >>> 'Newtest.apps.NewtestConfig', >>> 'Newtest', >>> ] >>> >>> >>> Apps.py code , and >>> How can I solve it? >>> >>> from django.apps import AppConfig >>> >>> >>> class NewtestConfig(AppConfig): >>> name = 'Newtest' >>> >>> -- >>> 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 django-users+unsubscr...@googlegroups.com >>> <mailto:django-users+unsubscr...@googlegroups.com>. >>> To post to this group, send email to django-users@googlegroups.com >>> <mailto:django-users@googlegroups.com>. >>> Visit this group at https://groups.google.com/group/django-users >>> <https://groups.google.com/group/django-users>. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/django-users/8a4c0484-6929-45d7-bbaa-a5a074ef4433%40googlegroups.com >>> >>> <https://groups.google.com/d/msgid/django-users/8a4c0484-6929-45d7-bbaa-a5a074ef4433%40googlegroups.com?utm_medium=email&utm_source=footer>. >>> For more options, visit https://groups.google.com/d/optout >>> <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 django-users+unsubscr...@googlegroups.com >>> <mailto:django-users+unsubscr...@googlegroups.com>. >>> To post to this group, send email to django-users@googlegroups.com >>> <mailto:django-users@googlegroups.com>. >>> Visit this group at https://groups.google.com/group/django-users >>> <https://groups.google.com/group/django-users>. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/django-users/CABuXbh-G0TqFvyz8Y2bkjff%2B4E24Riww0OAjg68mHkvFYFpPDQ%40mail.gmail.com >>> >>> <https://groups.google.com/d/msgid/django-users/CABuXbh-G0TqFvyz8Y2bkjff%2B4E24Riww0OAjg68mHkvFYFpPDQ%40mail.gmail.com?utm_medium=email&utm_source=footer>. >>> For more options, visit https://groups.google.com/d/optout >>> <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 django-users+unsubscr...@googlegroups.com >> <mailto:django-users+unsubscr...@googlegroups.com>. >> To post to this group, send email to django-users@googlegroups.com >> <mailto:django-users@googlegroups.com>. >> Visit this group at https://groups.google.com/group/django-users >> <https://groups.google.com/group/django-users>. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/django-users/E9F01D77-9143-4CFC-A84B-D5CF7090F984%40gmail.com >> >> <https://groups.google.com/d/msgid/django-users/E9F01D77-9143-4CFC-A84B-D5CF7090F984%40gmail.com?utm_medium=email&utm_source=footer>. >> >> For more options, visit https://groups.google.com/d/optout >> <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 django-users+unsubscr...@googlegroups.com >> <mailto:django-users+unsubscr...@googlegroups.com>. >> To post to this group, send email to django-users@googlegroups.com >> <mailto:django-users@googlegroups.com>. >> Visit this group at https://groups.google.com/group/django-users >> <https://groups.google.com/group/django-users>. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/django-users/CABuXbh_WQcMt47c%3DkQNp55RXcHRWLrTdoagPJxaEPefkA3Nj9w%40mail.gmail.com >> >> <https://groups.google.com/d/msgid/django-users/CABuXbh_WQcMt47c%3DkQNp55RXcHRWLrTdoagPJxaEPefkA3Nj9w%40mail.gmail.com?utm_medium=email&utm_source=footer>. >> For more options, visit https://groups.google.com/d/optout >> <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 django-users+unsubscr...@googlegroups.com > <mailto:django-users+unsubscr...@googlegroups.com>. > To post to this group, send email to django-users@googlegroups.com > <mailto:django-users@googlegroups.com>. > Visit this group at https://groups.google.com/group/django-users > <https://groups.google.com/group/django-users>. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/19098556-23C1-417A-B379-6C3302A5327B%40gmail.com > > <https://groups.google.com/d/msgid/django-users/19098556-23C1-417A-B379-6C3302A5327B%40gmail.com?utm_medium=email&utm_source=footer>. > > For more options, visit https://groups.google.com/d/optout > <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 django-users+unsubscr...@googlegroups.com > <mailto:django-users+unsubscr...@googlegroups.com>. > To post to this group, send email to django-users@googlegroups.com > <mailto:django-users@googlegroups.com>. > Visit this group at https://groups.google.com/group/django-users > <https://groups.google.com/group/django-users>. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/CABuXbh-Bp9E4s2WEeG3aRwvZtjdDnWMz8SdGztPmLzceTAMksQ%40mail.gmail.com > > <https://groups.google.com/d/msgid/django-users/CABuXbh-Bp9E4s2WEeG3aRwvZtjdDnWMz8SdGztPmLzceTAMksQ%40mail.gmail.com?utm_medium=email&utm_source=footer>. > For more options, visit https://groups.google.com/d/optout > <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 django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. 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/CF584130-E8D3-4482-8E7D-D5C1121EB406%40gmail.com. For more options, visit https://groups.google.com/d/optout.