Gurender Bedi
Gurender Bedi

Reputation: 21

Python 3 - Django 1.7 on Win 8 - MySQL connect issue

I am trying to connect MySQL through Django.

I have Python 3 Django 1.7 OS: Windows 8

MySQL 5.6.12

I have installed MySQL driver from http://dev.mysql.com/downloads/connector/python/ This one - mysql-connector-python-1.1.4-py3.3

Created new project using: django-admin.py startproject

Created new db: mysite

changed db settings in settings file like this

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'mysite',
        'USER': 'username',
        'PASSWORD': 'password',
        'HOST': '127.0.0.1',
        'PORT': '3306',
    }
}

when I run python manage.py migrate

I am getting this error: File "D:\Python33\lib\site-packages\django\apps\registry.py", line 115, in check_ready raise RuntimeError("App registry isn't ready yet.") RuntimeError: App registry isn't ready yet.

Please help me or give me some pointers?

Upvotes: 1

Views: 1427

Answers (4)

youm huang
youm huang

Reputation: 1

i do it like that: down:

https://github.com/PyMySQL/PyMySQL/

stup it in __init__.py you must insert this:

import pymysql
pymysql.install_as_MySQLdb()

ok flish!

Upvotes: 0

Gurender Bedi
Gurender Bedi

Reputation: 21

OK, now this is working, had to do lots of things but the thing that worked is:

Installed Python2.7 and changed the path to use it in lace of Python 33

I think the issue was Python 33 was for 64 bit and 2.7 installed as 32 bit and ran the exe file from here http://www.lfd.uci.edu/~gohlke/pythonlibs/#mysql-python

which let me use it MySQL which was installed with WAMP server.

did lots of things so I might have missed some, but Python 3.3 is still broken

Upvotes: 1

christian
christian

Reputation: 2653

Have you checked the release docs for django 1.7? http://django.readthedocs.org/en/latest/releases/1.7.html#backwards-incompatible-changes-in-1-7

It states that you will get that error if:

  • you start using models before everything has loaded (ie. you have code somewhere at the module level that uses models). This is how I came across this problem.

  • You have a standalone python script that uses django (instead of a management command). This is an easy fix - just add 'django.setup()' to the script.

EDIT: I forgot to mention - there's also a good chance that the above changes have messed with other INSTALLED_APPS. For instance, django-tastypie is now broken with the latest development version of django. There's a good chance south is broken too.

Upvotes: 2

Rodrigo Guedes
Rodrigo Guedes

Reputation: 1175

You have to include the missing app in "INSTALLED_APPS" (settings.py).

Upvotes: 0

Related Questions