Forums

I need help with settings and runserver

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

Hi catafest,

Are you just getting started with Django? If so, we've got a tutorial that covers starting Django on PythonAnywhere:

http://tutorial.pythonanywhere.com/django

I think that if you follow the tutorial, maybe using an app called test002, that will get you up and running the quickest!