Skip to main content

Django Admin File Wiget for Zappa based admin panels

Project description

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

[![pypi-version]][pypi]

Django Admin File Wiget for [django-zappa](https://github.com/Miserlou/django-zappa) based admin panels

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
git clone https://github.com/anush0247/zappa-file-widget
cd zappa-file-widget/example
mkvirtualenv zappa_file_widget
pip install -r requirements.txt
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:

* https://github.com/audreyr/cookiecutter
* https://github.com/pydanny/cookiecutter-djangopackage


[pypi-version]: https://img.shields.io/pypi/v/zappa-file-widget.svg
[pypi]: https://pypi.python.org/pypi/zappa-file-widget




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.1.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zappa_file_widget-0.1.1-py2.py3-none-any.whl (5.0 kB view details)

Uploaded Python 2Python 3

File details

Details for the file zappa-file-widget-0.1.1.tar.gz.

File metadata

File hashes

Hashes for zappa-file-widget-0.1.1.tar.gz
Algorithm Hash digest
SHA256 8cbce862502e2fdd9060fd06f74107e3a8093136bdc8f4b21b69de4afcc17da3
MD5 9fcc466f32c4dd2edd098ecf4066aeaa
BLAKE2b-256 20382ba55879cc751f690013d727b5598ff759fb0efbe99ac2db2de7ca9b78f4

See more details on using hashes here.

File details

Details for the file zappa_file_widget-0.1.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for zappa_file_widget-0.1.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 6a20799a129bb63c267c1c3e31ce2dcf1d523d8e09d65d7338a982d3378240b6
MD5 d37a6fed227cf01c0a6c9dfcc9982882
BLAKE2b-256 1b1068f1d4c052d93524d885f1bcde19116bb598b5ec9f94145ea9b6d554781e

See more details on using hashes here.

Supported by

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