django-foundation-filefield-widget

A form widget to style file inputs in a foundation fashion.


License
MIT
Install
pip install django-foundation-filefield-widget==0.0.4

Documentation

Django foundation filefield widget

This module provides a form widget to style file inputs in a foundation fashion.

Installation

Install with pip:

pip install django-foundation-filefield-widget

Add foundation_filefield_widget app to your INSTALLED_APPS

INSTALLED_APPS = (
    ...
    'foundation_filefield_widget',
)

Use the widget in your forms :

from django import forms
from foundation_filefield_widget.widgets import FoundationFileInput, FoundationImageInput

class MyForm(forms.Form):
    my_file = forms.FileField(widget=FoundationFileInput)
    my_image = forms.FileField(widget=FoundationImageInput)

Don't forget to include the media part of your form in your templates.

If you want to easily define forms you should look into crispy-forms And if you want to define forms styled with Foundation you should also check crispy-forms-foundation