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.
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
Built Distribution
Close
Hashes for zappa_file_widget-0.1.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a20799a129bb63c267c1c3e31ce2dcf1d523d8e09d65d7338a982d3378240b6 |
|
MD5 | d37a6fed227cf01c0a6c9dfcc9982882 |
|
BLAKE2b-256 | 1b1068f1d4c052d93524d885f1bcde19116bb598b5ec9f94145ea9b6d554781e |