Skip to main content

Django Admin File Wiget for Zappa based admin panels

Project description

=============================
Django Zappa File Widget
=============================

.. image:: https://badge.fury.io/py/zappa-file-widget.png
:target: https://badge.fury.io/py/zappa-file-widget

.. image:: https://travis-ci.org/anush0247/zappa-file-widget.png?branch=master
:target: https://travis-ci.org/anush0247/zappa-file-widget

Django Admin File Wiget for Zappa based admin panels

Documentation
-------------

The full documentation is at https://zappa-file-widget.readthedocs.org.

Quickstart
----------

Install Django Zappa File Widget::

pip install zappa-file-widget

Then use it in a project::

``settings.py``

```py

INSTALLED_APPS += "zappa_file_widget"

```

``models.py``

```python

from django.db import models


class Order(models.Model):
attachment = models.FileField(upload_to="media/")
ordered_by = models.CharField(max_length=20)

def __unicode__(self):
return unicode(self.attachment)


```

``admin.py``

```python

from django import forms
from django.contrib import admin

from zappa_file_widget.file_widget import FileWidget
from django_custom_admin.models import Order


class OrderForm(forms.ModelForm):
class Meta:
widgets = {
'attachment': FileWidget(),
}


class OrderAdmin(admin.ModelAdmin):
form = OrderForm


admin.site.register(Order, OrderAdmin)

```

```sh
python manage.py migrate
python manage.py createsuperuser
python manage.py runserver
```


Point your browser at : [http://127.0.0.1:8000/admin/example/order/](http://127.0.0.1:8000/admin/example/order/)


Credits
---------

Tools used in rendering this package:

* Cookiecutter_
* `cookiecutter-djangopackage`_

.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _`cookiecutter-djangopackage`: https://github.com/pydanny/cookiecutter-djangopackage




History
-------

0.1.0 (2016-08-26)
++++++++++++++++++

* First release on PyPI.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zappa-file-widget-0.1.0.tar.gz (5.7 kB view hashes)

Uploaded Source

Built Distribution

zappa_file_widget-0.1.0-py2.py3-none-any.whl (5.0 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page