0

i am using aptana for creating a website using django. I have installed mysql but not able to link the database when i run this command *Python2.7 manage.py runserver* i get a message that Python2.7 not recognized and when i run this command Python manage.py runserver i get a error message

C:\Users\George\Documents\Aptana Studio 3 Workspace\Firstwebsite>python manage.py runserver

Validating models...

Unhandled exception in thread started by <bound method Command.inner_run of <dja
ngo.contrib.staticfiles.management.commands.runserver.Command object at 0x028E5C
70>>
Traceback (most recent call last):

File "C:\Python27\lib\site-packages\django\core\management\commands\runserver.py", line     
92, in inner_runself.validate(display_num_errors=True)

`File "C:\Python27\lib\site-packages\django\core\management\base.py", line 280, in     
validate  num_errors = get_validation_errors(s, app)`



File "C:\Python27\lib\site-packages\django\core\management\validation.py", line 28, in   
get_validation_errors  from django.db import models, connection



File "C:\Python27\lib\site-packages\django\db\__init__.py", line 40, in <module>   
backend = load_backend(connection.settings_dict['ENGINE'])



File "C:\Python27\lib\site-packages\django\db\__init__.py", line 34, in __getattr__   
return getattr(connections[DEFAULT_DB_ALIAS], item)



File "C:\Python27\lib\site-packages\django\db\utils.py", line 93, in __getitem__  
backend = load_backend(db['ENGINE'])



File "C:\Python27\lib\site-packages\django\db\utils.py", line 27, in load_backend    
return import_module('.base', backend_name)



File "C:\Python27\lib\site-packages\django\utils\importlib.py", line 35, in  
import_module__import__(name)


File "C:\Python27\lib\site-packages\django\db\backends\mysql\base.py", line 17, in 
<module>
raise ImproperlyConfigured("Error loading MySQLdb module: %s" % 
e)django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No module  
named MySQLdb 

I am using Django 1.5 and python 2.7 and aptana 3 I am confused whether i am tying this commands in the correct directory. any help !!!

karthikr
  • 97,368
  • 26
  • 197
  • 188
user2413621
  • 2,916
  • 7
  • 24
  • 28

2 Answers2

3

Did you install MySQLdb? which is a system library. A quick search on google shows a couple sites you can download this from

One of which is (link pulled from here), another post that addresses this:

http://www.lfd.uci.edu/~gohlke/pythonlibs/#mysql-python

http://sourceforge.net/projects/mysql-python/files/mysql-python/

Community
  • 1
  • 1
dm03514
  • 54,664
  • 18
  • 108
  • 145
1

We would need to see your settings.py file to do more in depth review.

On the surface, it seems like you have not linked it to a database in the settings file. Here is a link that will help you get it installed:

http://decoding.wordpress.com/2012/01/23/how-to-setup-django-and-mysql-python-on-mac-os-x-lion/

(At least on a MAC/Unix. Windows is a different story)

After that, I would just follow any guide on linking the two.

(Some Generic one from a blog)

http://nisthaonweb.com/blog/2012/02/setting-up-django-with-mysql-with-and-without-mamp/

JcKelley
  • 1,954
  • 1
  • 15
  • 30