I ran into the same error. Using files in formwizard requires configuring 
File Storage, according to docs 
https://docs.djangoproject.com/en/dev/ref/contrib/formtools/form-wizard/#handling-files

initializing file_storage fixed it for me.  

from django.core.files.storage import FileSystemStorage
>
> class AppWizard(SessionWizardView):
>    * file_storage = 
> FileSystemStorage(location=os.path.join(settings.MEDIA_ROOT))*


On Sunday, March 11, 2012 7:27:33 AM UTC-5, danoro wrote:
>
> [ACTION] 
>
> Subclass NamedUrlSessionWizardView and instantiate it with a set of 
> forms one of them containing a FileField 
>
> class CommonWizardView(NamedUrlSessionWizardView): 
>     pass 
>
> class FamilyWizardView(CommonWizardView): 
>     pass 
>
> [RESULT] 
>
> File "/accounts/urls.py", line 66, in <module> 
>
> family_wizard = FamilyWizardView.as_view(named_family_forms, 
> url_name='family_step', done_step_name='family_wizard') 
>
> File "python2.7/site-packages/django_formwizard-1.0-py2.7.egg/ 
> formwizard/views.py", line 109, in as_view 
>
> initkwargs = cls.get_initkwargs(*args, **kwargs) 
>
> File "python2.7/site-packages/django_formwizard-1.0-py2.7.egg/ 
> formwizard/views.py", line 583, in get_initkwargs 
>
> initkwargs = super(NamedUrlWizardView, cls).get_initkwargs(*args, 
> **kwargs) 
>
> File "python2.7/site-packages/django_formwizard-1.0-py2.7.egg/ 
> formwizard/views.py", line 166, in get_initkwargs 
>
> raise NoFileStorageConfigured 
>
>
> TemplateSyntaxError: Caught NoFileStorageConfigured while rendering 
>
> [CAUSE] 
>
> class WizardView(TemplateView): 
>     @classmethod 
>     def get_initkwargs(cls, form_list, initial_dict=None, 
>             instance_dict=None, condition_dict=None, *args, **kwargs): 
>         """ 
>         Creates a dict with all needed parameters for the form wizard 
> instances. 
>         """ 
>         .... 
>             # check if any form contains a FileField, if yes, we need 
> a 
>             # file_storage added to the wizardview (by subclassing). 
>             for field in form.base_fields.itervalues(): 
>                 if (isinstance(field, forms.FileField) and 
>                         not hasattr(cls, 'file_storage')): 
>                     raise NoFileStorageConfigured 
>
> [RESOLUTION] 
>
> subclassing is not enough.  I inherited from both 
> NamedUrlSessionWizardView and FileSystemStorage, as shown below, but I 
> keep getting this error. 
>
> class FamilyWizardView(CommonWizardView, FileSystemStorage): 
>     pass 
>
> I noticed an instance variable in formwizard called storage_name but 
> it is used for child clasess Session and Cookie WizardViews. Si it's 
> no relevant 
>
> please, could you shed some light  ?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/94746ca1-af64-4849-962b-410638f8d57d%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to