I'm new with django 1.10 using mysql (5.6.17) (WAMP 2.5) and Python 3.5 under Windows 8.1
I configured fine the mysql connector, I made my models, made makemigrations myapp
and migrate myapp
, using manage.py terminal with Pycharm.
When I try to acces in admin web page, I have this message (trabajo is my app inside my project: programa)
Exception Value:
(1146, "Table 'programa.django_session' doesn't exist")
In my settings.py file have:
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',
]
The apps block:
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'trabajo',
]
To connect the database:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME' : 'programa',
'USER' : 'myownuser',
'PASSWORD' : 'myownpassword',
'HOST' : '',
'PORT' : '',
}
}
Why have this error in the admin page? What can I do to solve this?
Thanks in advance. Any help is welcome!! ;-)
Gustavo.
if all you did was "migrate myapp", then you only created the tables for your app. I think a plain "migrate" will create all the tables for Django and it's contributed modules.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With