Problème de configuration MySQL sur Django

Problème de configuration MySQL sur Django - Python - Programmation

Marsh Posté le 15-12-2009 à 17:27:32    

Bonjour,
 
J'ai installé le framework Django, j'ai paramétré le fichier settings.py pour qu'il puisse utiliser ma base SQL :
 
 

Code :
  1. # Django settings for bcgw project.
  2. DEBUG = True
  3. TEMPLATE_DEBUG = DEBUG
  4. ADMINS = (
  5.     # ('Your Name', 'your_email@domain.com'),
  6. )
  7. MANAGERS = ADMINS
  8. DATABASE_ENGINE = 'mysql'           # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
  9. DATABASE_NAME = 'bcgw'             # Or path to database file if using sqlite3.
  10. DATABASE_USER = 'admin'             # Not used with sqlite3.
  11. DATABASE_PASSWORD = 'xxxxx'         # Not used with sqlite3.
  12. DATABASE_HOST = ''             # Set to empty string for localhost. Not used with sqlite3.
  13. DATABASE_PORT = ''             # Set to empty string for default. Not used with sqlite3.


 
Et lorsque je lance la commande
 

Code :
  1. python manage.py runserver


 
j'ai ce message d'erreur :
 

Code :
  1. Validating models...
  2. Unhandled exception in thread started by <function inner_run at 0x2a994a0320>
  3. Traceback (most recent call last):
  4.   File "/usr/local/lib/python2.5/site-packages/django/core/management/commands/runserver.py", line 48, in inner_run
  5.     self.validate(display_num_errors=True)
  6.   File "/usr/local/lib/python2.5/site-packages/django/core/management/base.py", line 249, in validate
  7.     num_errors = get_validation_errors(s, app)
  8.   File "/usr/local/lib/python2.5/site-packages/django/core/management/validation.py", line 22, in get_validation_errors
  9.     from django.db import models, connection
  10.   File "/usr/local/lib/python2.5/site-packages/django/db/__init__.py", line 41, in <module>
  11.     backend = load_backend(settings.DATABASE_ENGINE)
  12.   File "/usr/local/lib/python2.5/site-packages/django/db/__init__.py", line 17, in load_backend
  13.     return import_module('.base', 'django.db.backends.%s' % backend_name)
  14.   File "/usr/local/lib/python2.5/site-packages/django/utils/importlib.py", line 35, in import_module
  15.     __import__(name)
  16.   File "/usr/local/lib/python2.5/site-packages/django/db/backends/mysql/base.py", line 13, in <module>
  17.     raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
  18. django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: /root/.python-eggs/MySQL_python-1.2.3c1-py2.6-linux-i686.egg-tmp/_mysql.so: cannot open shared object file: No such file or directory


 
Je suis sous RedHat EL 4
 
Avez-vous une idée de la solution ?
 
Merci   :)

Reply

Marsh Posté le 15-12-2009 à 17:27:32   

Reply

Marsh Posté le 15-12-2009 à 18:07:00    

En fait j'ai ma petite idée, en recherchant sur le net j'ai vu qu'il fallait installé MySQL-python-1.2.3c1. Mais lorsque je lance la commande

Code :
  1. python setup.py build

j'ai plein d'erreurs. En voici un bout :
 

Code :
  1. _mysql.c: At top level:
  2. _mysql.c:2487: error: syntax error before '*' token
  3. _mysql.c:2490: warning: function declaration isn't a prototype
  4. _mysql.c: In function `_mysql_ConnectionObject_setattr':
  5. _mysql.c:2491: error: `v' undeclared (first use in this function)
  6. _mysql.c:2502: error: `name' undeclared (first use in this function)
  7. _mysql.c:2503: error: `self' undeclared (first use in this function)
  8. _mysql.c: At top level:
  9. _mysql.c:2512: error: syntax error before '*' token
  10. _mysql.c:2515: warning: function declaration isn't a prototype
  11. _mysql.c: In function `_mysql_ResultObject_setattr':
  12. _mysql.c:2516: error: `v' undeclared (first use in this function)
  13. _mysql.c:2527: error: `name' undeclared (first use in this function)
  14. _mysql.c:2528: error: `self' undeclared (first use in this function)
  15. error: command 'gcc' failed with exit status 1

Reply

Marsh Posté le 18-12-2009 à 10:00:42    

tu peux pas le faire avec easy_install ?


---------------
Everybody can succeed, all you need is to believe
Reply

Marsh Posté le 18-12-2009 à 11:03:45    

j'ai essayé mais ça marche pas ... En plus je n'ai pas la possibilité d'avoir Internet sur le PC (pour des raison de sécurité l'entreprise où je bosse l'a interdit). Mais ce n'est pas grave, du coup je ne vais pas utiliser Django. Merci bien quand même !!

Reply

Sujets relatifs:

Leave a Replay

Make sure you enter the(*)required information where indicate.HTML code is not allowed