Package: django-eremaea2
django-eremaea2django-eremaea2 is a simpleDjangoapplication to store and manage webcam image snapshots.
The application is built on top ofdjango-rest-frameworkand provides REST API to access the files.There are three kind of resources available through REST API interface.
Acollectionis a collection ofsnapshots.
Asnapshotis image file in essence.
For anysnapshotthere is aretention policyassociated with to specify how long store the file.InstallationThe 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 yoursettings.py:INSTALLED_APPS = (
     #...
    'rest_framework',
    'eremaea',
)Into yoururls.pyyou have to add the following:urlpatterns = patterns('',
    #...
    url(r'^eremaea/', include('eremaea.urls')),
)ConfigurationThe whole configuration is stored into the project database, there is not separate dedicated config file.TheRetentionPolicymodel has two parameters: a lookup fieldnameanddurationthat specifies time-to-live for associated objects.
To perform actual cleanup a POST request to the endpointhttp://example.com/eremaea/retention_policies/{name}/purgeis required.
TheCollectionmodel has two parameters: a lookup fieldnameanddefault_retention_policy.
TheSnapshotmodel has the following field: associatedcollectionandretention_policy,fileobject, and auto-nowdate.
New images are uploaded by POST request to the endpointhttp://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-frameworkweb browsable interface, and REST API itself.Authentication and permissionsYou may utilise all possible options provided bydjango-rest-framework. SeeTutorialfor reference.CachingYou may utilise all caching mechanisms provided byDjangoframework. SeeDjango's cache framework.FeedbackIf you have any questions, issues, or pull-requests, you are welcome to use GitHub infrastructure.LicenseCopyright (c) 2016, Matwey V. KornilovAll rights reserved.Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.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.