Hi. I make one app with
django-admin.py startapp test001_app
the :
python manage.py syncdb
_mysql_exceptions.OperationalError: (2002, "Can't connect to local MySQL server through socket '/var/run/mysql' (2)")
I make all settings but Is not show with
python manage.py runserver
Also the settings.py is set :
'default': {
'ENGINE': 'mysql', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
'NAME': '', # Or path to database file if using sqlite3.
'USER': 'test', # Not used with sqlite3.
'PASSWORD': 'test', # Not used with sqlite3.
'HOST': '/var/run/mysql', # Set to empty string for localhost. Not used with sqlite3.
'PORT': '', # Set to empty string for default. Not used with sqlite3.
}
...
ROOT_URLCONF = 'test001.urls'
...
TEMPLATE_DIRS = (
os.path.join(os.path.dirname(__file__),'templates'),
...
INSTALLED_APPS = ( ...
'test001.test001_app',
...
If i use
$ django-admin.py shell
Error: Could not import settings 'test001.settings' (Is it on sys.path?): No module named test001.settings
$ django-admin.py syncdb
raise ImportError("Could not import settings '%s' (Is it on sys.path?): %s" % (self.SETTINGS_MODULE, e)) ImportError: Could not import settings 'test001.settings' (Is it on sys.path?): No module named test001.settings