· 7 years ago · Jan 16, 2019, 07:26 PM
1Traceback (most recent call last):
2 File "manage.py", line 10, in <module>
3 execute_from_command_line(sys.argv)
4 File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/django/core/management/__init__.py", line 443, in execute_from_command_line
5 utility.execute()
6 File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/django/core/management/__init__.py", line 382, in execute
7 self.fetch_command(subcommand).run_from_argv(self.argv)
8 File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/django/core/management/base.py", line 196, in run_from_argv
9 self.execute(*args, **options.__dict__)
10 File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/django/core/management/base.py", line 231, in execute
11 self.validate()
12 File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/django/core/management/base.py", line 266, in validate
13 num_errors = get_validation_errors(s, app)
14 File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/django/core/management/validation.py", line 103, in get_validation_errors
15 connection.validation.validate_field(e, opts, f)
16 File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/django/db/backends/mysql/validation.py", line 14, in validate_field
17 db_version = self.connection.get_server_version()
18 File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/django/db/backends/mysql/base.py", line 415, in get_server_version
19 self.cursor().close()
20 File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/django/db/backends/__init__.py", line 306, in cursor
21 cursor = self.make_debug_cursor(self._cursor())
22 File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/django/db/backends/mysql/base.py", line 387, in _cursor
23 self.connection = Database.connect(**kwargs)
24 File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/MySQLdb/__init__.py", line 81, in Connect
25 return Connection(*args, **kwargs)
26 File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/MySQLdb/connections.py", line 187, in __init__
27 super(Connection, self).__init__(*args, **kwargs2)
28_mysql_exceptions.OperationalError: (2002, "Can't connect to local MySQL server through socket '/opt/local/var/run/mysql5/mysqld.sock' (13)")
29
30# Django settings for mysite project.
31 DEBUG = True
32 TEMPLATE_DEBUG = DEBUG
33
34ADMINS = (
35 # ('Your Name', 'your_email@example.com'),
36)
37
38MANAGERS = ADMINS
39
40DATABASES = {
41 'default': {
42 'ENGINE': 'django.db.backends.mysql',
43 'NAME': '',
44 'USER': 'localhost',
45 'PASSWORD': '',
46 'HOST': '',
47 'PORT': '',
48 }
49}
50
51 TIME_ZONE = 'America/Chicago'
52
53 LANGUAGE_CODE = 'en-us'
54
55 SITE_ID = 1
56
57 USE_I18N = True
58
59 USE_L10N = True
60
61 USE_TZ = True
62
63 MEDIA_ROOT = ''
64
65 MEDIA_URL = ''
66
67 STATIC_ROOT = ''
68
69 STATIC_URL = '/static/'
70
71 STATICFILES_DIRS = (
72 )
73
74 STATICFILES_FINDERS = (
75 'django.contrib.staticfiles.finders.FileSystemFinder',
76 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
77 )
78
79
80SECRET_KEY = 'wke73b4pm&s-g(ra*to+ykxe*3@0h=nrnt(v&3kf)fx=co*72@'
81
82TEMPLATE_LOADERS = (
83 'django.template.loaders.filesystem.Loader',
84 'django.template.loaders.app_directories.Loader',
85)
86
87MIDDLEWARE_CLASSES = (
88 'django.middleware.common.CommonMiddleware',
89 'django.contrib.sessions.middleware.SessionMiddleware',
90 'django.middleware.csrf.CsrfViewMiddleware',
91 'django.contrib.auth.middleware.AuthenticationMiddleware',
92 'django.contrib.messages.middleware.MessageMiddleware',
93)
94
95ROOT_URLCONF = 'mysite.urls'
96
97WSGI_APPLICATION = 'mysite.wsgi.application'
98
99TEMPLATE_DIRS = (
100)
101
102INSTALLED_APPS = (
103 'django.contrib.auth',
104 'django.contrib.contenttypes',
105 'django.contrib.sessions',
106 'django.contrib.sites',
107 'django.contrib.messages',
108 'django.contrib.staticfiles',
109)
110
111
112LOGGING = {
113 'version': 1,
114 'disable_existing_loggers': False,
115 'filters': {
116 'require_debug_false': {
117 '()': 'django.utils.log.RequireDebugFalse'
118 }
119 },
120 'handlers': {
121 'mail_admins': {
122 'level': 'ERROR',
123 'filters': ['require_debug_false'],
124 'class': 'django.utils.log.AdminEmailHandler'
125 }
126 },
127 'loggers': {
128 'django.request': {
129 'handlers': ['mail_admins'],
130 'level': 'ERROR',
131 'propagate': True,
132 },
133 }
134}
135
136Traceback (most recent call last):
137 File "manage.py", line 10, in <module>
138 execute_from_command_line(sys.argv)
139 File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/django/core/management/__init__.py", line 443, in execute_from_command_line
140 utility.execute()
141 File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/django/core/management/__init__.py", line 382, in execute
142 self.fetch_command(subcommand).run_from_argv(self.argv)
143 File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/django/core/management/base.py", line 196, in run_from_argv
144 self.execute(*args, **options.__dict__)
145 File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/django/core/management/base.py", line 232, in execute
146 output = self.handle(*args, **options)
147 File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/django/core/management/base.py", line 371, in handle
148 return self.handle_noargs(**options)
149 File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/django/core/management/commands/syncdb.py", line 60, in handle_noargs
150 tables = connection.introspection.table_names()
151 File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/django/db/backends/__init__.py", line 896, in table_names
152 return self.get_table_list(cursor)
153 File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/django/db/backends/mysql/introspection.py", line 33, in get_table_list
154 cursor.execute("SHOW TABLES")
155 File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/django/db/backends/util.py", line 40, in execute
156 return self.cursor.execute(sql, params)
157 File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/django/db/backends/mysql/base.py", line 114, in execute
158 return self.cursor.execute(query, args)
159 File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/MySQLdb/cursors.py", line 174, in execute
160 self.errorhandler(self, exc, value)
161 File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
162 raise errorclass, errorvalue
163django.db.utils.DatabaseError: (1046, 'No database selected')