cannot launch runserver

36 views
Skip to first unread message

th.gr...@free.fr

unread,
Feb 8, 2015, 7:06:11 AM2/8/15
to django...@googlegroups.com
hello

i have installed   "django 1.7 and python3.4"
i have installed   "libapache2-mod-wsgi-py3"

my settings.py is :

ALLOWED_HOSTS = []


# Application definition

INSTALLED_APPS = (
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
)

MIDDLEWARE_CLASSES = (
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
)

ROOT_URLCONF = 'WebSite.urls'

WSGI_APPLICATION = 'WebSite.wsgi.application'


# Database
# https://docs.djangoproject.com/en/1.7/ref/settings/#databases

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'systemes_reseaux',
        'USER' : 'root',
        'PASSWORD' : 'xxxxxxx',
        'HOST' : '127.0.0.1',
    }
}

# Internationalization
# https://docs.djangoproject.com/en/1.7/topics/i18n/

LANGUAGE_CODE = 'fr-fr'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.7/howto/static-files/

STATIC_URL = '/static/'




the result of the command python3.4 manage.py runserver  is :

/opt/WebSite# python3.4 manage.py runserver
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/django/db/backends/mysql/base.py", line 14, in <module>
    import MySQLdb as Database
ImportError: No module named 'MySQLdb'


Why this problem??
thanks for help

Brett Hutley

unread,
Feb 8, 2015, 7:12:06 AM2/8/15
to django...@googlegroups.com
You are using MySQL as your database backend. Check your MySQL installation works OK, and then install the Python MySQL package:

"pip install MySQL-python" should do the trick.

Cheers, Brett
> --
> 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...@googlegroups.com.
> To post to this group, send email to django...@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/29478ca8-c248-4aa4-99ec-8a86117f40bb%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages