"I'm new to using Django 1.10 with MySQL (5.6.17) (WAMP 2.5) and Python 3.5 on Windows 8.1.
I successfully configured the MySQL connector, created my models, and ran 'makemigrations myapp' and 'migrate myapp' using the PyCharm manage.py terminal.
However, when I try to access the admin web page, I receive the following error message: 'Exception Value:' (trabajo is my app within my programa project)."
在我的settings.py文件中有以下内容:
应用程序阻塞:
连接数据库的方法如下:
管理员页面为什么会出现这个错误?我该怎么办才能解决它呢?
提前感谢您的帮助!任何帮助都受欢迎!!;-)
Gustavo.
I successfully configured the MySQL connector, created my models, and ran 'makemigrations myapp' and 'migrate myapp' using the PyCharm manage.py terminal.
However, when I try to access the admin web page, I receive the following error message: 'Exception Value:' (trabajo is my app within my programa project)."
(1146, "Table 'programa.django_session' doesn't exist")
在我的settings.py文件中有以下内容:
MIDDLEWARE_CLASSES = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]
应用程序阻塞:
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'trabajo',
]
连接数据库的方法如下:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME' : 'programa',
'USER' : 'myownuser',
'PASSWORD' : 'myownpassword',
'HOST' : '',
'PORT' : '',
}
}
管理员页面为什么会出现这个错误?我该怎么办才能解决它呢?
提前感谢您的帮助!任何帮助都受欢迎!!;-)
Gustavo.
makemigrations
和migrate
,现在可以正常工作了! - Gustux