# django-eremaea2
[![Build Status](https://travis-ci.org/matwey/django-eremaea2.svg?branch=master)](https://travis-ci.org/matwey/django-eremaea2)
[![PyPI version](https://badge.fury.io/py/django-eremaea2.svg)](https://badge.fury.io/py/django-eremaea2)
django-eremaea2 is a simple [Django] application to store and manage webcam image snapshots.
The application is built on top of [django-rest-framework] and provides REST API to access the files.
There are three kind of resources available through REST API interface.
A *collection* is a collection of *snapshots*.
A *snapshot* is image file in essence.
For any *snapshot* there is a *retention policy* associated with to specify how long store the file.
## Installation
The following prerequisites are required to operate django-eremaea2:
* [django-rest-framework] - powerful and flexible toolkit that makes it easy to build Web APIs.
* [dj-inmemorystorage] - a non-persistent in-memory data storage backend for Django (required for testing).
To use django-eremaea2 in your django project, include the following code into your ```settings.py```:
```
INSTALLED_APPS = (
#...
'rest_framework',
'eremaea',
)
```
Into your ```urls.py``` you have to add the following:
```
urlpatterns = patterns('',
#...
url(r'^eremaea/', include('eremaea.urls')),
)
```
## Configuration
The whole configuration is stored into the project database, there is not separate dedicated config file.
The ```RetentionPolicy``` model has two parameters: a lookup field ```name``` and ```duration``` that specifies time-to-live for associated objects.
To perform actual cleanup a POST request to the endpoint ```http://example.com/eremaea/retention_policies/{name}/purge``` is required.
The ```Collection``` model has two parameters: a lookup field ```name``` and ```default_retention_policy```.
The ```Snapshot``` model has the following field: associated ```collection``` and ```retention_policy```, ```file``` object, and auto-now ```date```.
New images are uploaded by POST request to the endpoint ```http://example.com/eremaea/snapshots/?collection=collection_name&retention_policy=retention_policy_name```.
The latest query parameter is optional one.
The other ways to configure the application are Django fixtures, Django admin interface, [django-rest-framework] web browsable interface, and REST API itself.
## Authentication and permissions
You may utilise all possible options provided by [django-rest-framework]. See [Tutorial](http://www.django-rest-framework.org/tutorial/4-authentication-and-permissions/) for reference.
## Caching
You may utilise all caching mechanisms provided by [Django] framework. See [Django's cache framework](https://docs.djangoproject.com/en/dev/topics/cache/).
## Feedback
If you have any questions, issues, or pull-requests, you are welcome to use GitHub infrastructure.
## License
Copyright (c) 2016, Matwey V. Kornilov
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
[Django]:https://www.djangoproject.com/
[django-rest-framework]:http://www.django-rest-framework.org
[dj-inmemorystorage]:https://pypi.python.org/pypi/dj-inmemorystorage
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
django-eremaea2-2.0.14.1.tar.gz (39个子文件)
django-eremaea2-2.0.14.1
MANIFEST.in 173B
PKG-INFO 6KB
django_eremaea2.egg-info
PKG-INFO 6KB
requires.txt 42B
SOURCES.txt 825B
entry_points.txt 81B
top_level.txt 8B
dependency_links.txt 1B
eremaea
serializers.py 2KB
models.py 3KB
conf.py 333B
__init__.py 0B
migrations
__init__.py 0B
0001_initial.py 2KB
ctl
client.py 1KB
__init__.py 0B
file.py 2KB
commandline.py 2KB
views.py 3KB
urls.py 404B
tests
collection.py 3KB
conf.py 359B
retention.py 4KB
test_all.py 391B
__init__.py 0B
ctl
client.py 3KB
__init__.py 0B
file.py 2KB
test_settings.py 1KB
snapshot.py 6KB
urls.py 97B
eremaea-purge@.service 170B
LICENSE 1KB
eremaea-pull@.service 310B
runtests.py 349B
setup.cfg 38B
eremaea-purge@.timer 163B
setup.py 1KB
README.md 4KB
共 39 条
- 1
资源评论
挣扎的蓝藻
- 粉丝: 12w+
- 资源: 15万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功