2016-04-02 3 views
1

Django projemde django_quizGITHUB uygulamasını yüklemeye çalışıyorum. Django - TypeError: _clone() tam olarak 1 argüman alır (3 verilen)

  • pip install django-model-utils Django klasörüne GitHub'dan dosyayı klonlanmış,

    return super(InheritanceQuerySetMixin, self)._clone(klass, setup, **kwargs) 
    TypeError: _clone() takes exactly 1 argument (3 given) 
    

    yüzden

    1. python pip install Pillow yaptı: Ben "Montaj" beni oku dosyasında her şeyi yaptık ama hata yükseltir dizin (manage.py, uygulama dir vb. var).
    2. cd django_quiz
    3. python setup.py install
    4. I python manage.py runserver çalıştı ve hata ortaya süre sonra, urlpatterns (urls.py)

    içine url(r'^q/', include('quiz.urls')) ilave INSTALLED_APPS

  • için 'quiz', 'multichoice', 'true_false', 'essay' ilave edildi. Bu yüzden zaten makemigrasyon yapmayı denedim ama aynı hatalar da oldu.
    C:\Users\Milano\PycharmProjects\FutileStudio\SolutionsForLanguages_2\venv\lib\si 
    te-packages\django_model_utils-2.0.3-py2.7.egg\model_utils\managers.py:106: Remo 
    vedInDjango110Warning: 'get_all_related_objects is an unofficial API that has be 
    en deprecated. You may be able to replace it with 'get_fields()' 
        rel for rel in model._meta.get_all_related_objects() 
    
    C:\Users\Milano\PycharmProjects\FutileStudio\SolutionsForLanguages_2\venv\lib\si 
    te-packages\django_model_utils-2.0.3-py2.7.egg\model_utils\managers.py:106: Remo 
    vedInDjango110Warning: 'get_all_related_objects is an unofficial API that has be 
    en deprecated. You may be able to replace it with 'get_fields()' 
        rel for rel in model._meta.get_all_related_objects() 
    
    Unhandled exception in thread started by <function wrapper at 0x033284F0> 
    Traceback (most recent call last): 
        File "C:\Users\Milano\PycharmProjects\FutileStudio\SolutionsForLanguages_2\ven 
    v\lib\site-packages\django\utils\autoreload.py", line 226, in wrapper 
        fn(*args, **kwargs) 
        File "C:\Users\Milano\PycharmProjects\FutileStudio\SolutionsForLanguages_2\ven 
    v\lib\site-packages\django\core\management\commands\runserver.py", line 109, in 
    inner_run 
        autoreload.raise_last_exception() 
        File "C:\Users\Milano\PycharmProjects\FutileStudio\SolutionsForLanguages_2\ven 
    v\lib\site-packages\django\utils\autoreload.py", line 249, in raise_last_excepti 
    on 
        six.reraise(*_exception) 
        File "C:\Users\Milano\PycharmProjects\FutileStudio\SolutionsForLanguages_2\ven 
    v\lib\site-packages\django\utils\autoreload.py", line 226, in wrapper 
        fn(*args, **kwargs) 
        File "C:\Users\Milano\PycharmProjects\FutileStudio\SolutionsForLanguages_2\ven 
    v\lib\site-packages\django\__init__.py", line 18, in setup 
        apps.populate(settings.INSTALLED_APPS) 
        File "C:\Users\Milano\PycharmProjects\FutileStudio\SolutionsForLanguages_2\ven 
    v\lib\site-packages\django\apps\registry.py", line 115, in populate 
        app_config.ready() 
        File "C:\Users\Milano\PycharmProjects\FutileStudio\SolutionsForLanguages_2\ven 
    v\lib\site-packages\django\contrib\admin\apps.py", line 22, in ready 
        self.module.autodiscover() 
        File "C:\Users\Milano\PycharmProjects\FutileStudio\SolutionsForLanguages_2\ven 
    v\lib\site-packages\django\contrib\admin\__init__.py", line 26, in autodiscover 
        autodiscover_modules('admin', register_to=site) 
        File "C:\Users\Milano\PycharmProjects\FutileStudio\SolutionsForLanguages_2\ven 
    v\lib\site-packages\django\utils\module_loading.py", line 50, in autodiscover_mo 
    dules 
        import_module('%s.%s' % (app_config.name, module_to_search)) 
        File "c:\python27\Lib\importlib\__init__.py", line 37, in import_module 
        __import__(name) 
        File "C:\Users\Milano\PycharmProjects\FutileStudio\SolutionsForLanguages_2\ven 
    v\lib\site-packages\django_quiz_app-0.5.1-py2.7.egg\quiz\admin.py", line 16, in 
    <module> 
        class QuizAdminForm(forms.ModelForm): 
        File "C:\Users\Milano\PycharmProjects\FutileStudio\SolutionsForLanguages_2\ven 
    v\lib\site-packages\django_quiz_app-0.5.1-py2.7.egg\quiz\admin.py", line 29, in 
    QuizAdminForm 
        queryset=Question.objects.all().select_subclasses(), 
        File "C:\Users\Milano\PycharmProjects\FutileStudio\SolutionsForLanguages_2\ven 
    v\lib\site-packages\django_model_utils-2.0.3-py2.7.egg\model_utils\managers.py", 
    line 48, in select_subclasses 
        new_qs = self.select_related(*subclasses) 
        File "C:\Users\Milano\PycharmProjects\FutileStudio\SolutionsForLanguages_2\ven 
    v\lib\site-packages\django\db\models\query.py", line 852, in select_related 
        obj = self._clone() 
        File "C:\Users\Milano\PycharmProjects\FutileStudio\SolutionsForLanguages_2\ven 
    v\lib\site-packages\django_model_utils-2.0.3-py2.7.egg\model_utils\managers.py", 
    line 61, in _clone 
        return super(InheritanceQuerySetMixin, self)._clone(klass, setup, **kwargs) 
    TypeError: _clone() takes exactly 1 argument (3 given) 
    

    sorunun nerede olduğunu biliyor musunuz:

    İşte cmd satırından (runserver sonra) bütün traceback nedir?

  • cevap

    1

    Git o zaman çalışma piton göç manage.py bilgi yarışması, deneme, MultiChoice, true_false ve, için piton manage.py makemigrations çalıştırın managers.py sınıfı InheritanceQuerySetMixin, def _clone() den argümanlar klass, kurulum kaldırma ve nihayet python manage.py runserver 8000

    'u çalıştırın.