2012-12-10 8 views
0

Comment installez-vous painttstore pour django? Paintstore est obtenu à partir de http://pypi.python.org/pypi/django-paintstore. Je l'ai installé en utilisant la commandeComment installer paintstore pour django

python setup.py install 
l'installation

est allé bien, je pense, au moins pas d'erreur, mais quand je fais

python manage.py sql appname 

il dit

Traceback (most recent call last): 
File "manage.py", line 10, in <module> execute_from_command_line(sys.argv) 
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 443, in execute_from_command_line utility.execute() 
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 382, in execute self.fetch_command(subcommand).run_from_argv(self.argv) 
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 196, in run_from_argv self.execute(*args, **options.__dict__) 
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 231, in execute self.validate() 
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 266, in validate num_errors = get_validation_errors(s, app) 
File "/usr/local/lib/python2.7/dist-packages/django/core/management/validation.py", line 30, in get_validation_errors for (app_name, error) in get_app_errors().items(): 
File "/usr/local/lib/python2.7/dist-packages/django/db/models/loading.py", line 158, in get_app_errors self._populate() 
File "/usr/local/lib/python2.7/dist-packages/django/db/models/loading.py", line 64, in _populate self.load_app(app_name, True) 
File "/usr/local/lib/python2.7/dist-packages/django/db/models/loading.py", line 88, in load_app models = import_module('.models', app_name) 
File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", line 35, in import_module __import__(name) 
File "/ProjectDir/ProjectName/app/models.py", line 7, in <module> 
class Bag(models.Model): 
File "/ProjectDir/ProjectName/app/models.py", line 10, in Bag Color = models.ColorPickerField() 
AttributeError: 'module' object has no attribute 'ColorPickerField' 

J'ai essayé de copier le contenu de Le dossier paintstore à l'intérieur de django-paintstore-0.1.2 (vous obtenez celui-ci lors de l'extraction du fichier django-paintstore-0.1.2.tar.gz) mais en vain. Le README est d'aucune aide le cas échéant pour seulement dire

Install the app with your preferred Python packaging utility 

J'ai ajouté paintstore à INSTALLED_APPS aussi et je ne pas oublier de les importer en utilisant

from paintstore.fields import ColorPickerField 

Merci à l'avance pour aider. Btw Cela ne me dérange pas si vous suggérez autre chose pour le ColorPickerField tant qu'il est aussi bon ou meilleur que celui-ci, mais s'il vous plaît dites-moi comment l'installer pour fonctionner correctement.

+0

Pouvez-vous montrer la ligne où vous créez le champ? – LtWorf

Répondre

1

C'est un peu différent de l'utilisation des modèles django. Ce n'est pas models.ColorPickerField. Ce devrait être juste ColorPickerField.

Questions connexes