Coder Social home page Coder Social logo

django-caravaggio-rest-api's Introduction

Caravaggio

API project template based on Django 2.1 (and higher), and DRF 3.8 (and higher).

Technologies:

  • Django REST Framework (DRF)
  • DRF Cache support (for rdb and cassandra models)
  • DRF Throttle support by ViewSet and request action (retrieve, list, create, update, etc.)
  • DRF Token Authentication (no username needed, Bearer token)
  • PostgreSQL backend for miscellaneous models (User, Token, etc.)
  • DSE Cassandra backend for business models
  • Configuration of Cassandra-DRF serializers
  • Support for JSONField in Cassandra (Text field)
  • Support for pre/post callbacks in CassandraModel (DRF cache clean actions)
  • DRF-Haystack-DSE support to support fast searches (DSE-Solr) with model examples
  • Command to synchronize the DSE tables with the needed search indexes
  • Swagger view of the API documentation
  • Google App Engine Flexible (Custom) support
  • PGBouncer Connection Pool supported in the Docker image

Run the tests

To run the tests we only need to run the following instruction:

$ python manage.py test --testrunner=caravaggio_rest_api.testrunner.TestRunner

The output will be something like:

Creating test database for alias 'default'...
Creating test database for alias 'cassandra'...
Creating keyspace test_apian [CONNECTION cassandra] ..
Syncing davinci_crawling.example.models.BovespaCompany
Syncing davinci_crawling.example.models.BovespaCompanyFile
Syncing davinci_crawling.example.models.BovespaAccount
System check identified no issues (0 silenced).
...
...

Avoid the destruction of the database after the tests have finished and the indexes synchronization:

$ python manage.py test --testrunner=caravaggio_rest_api.testrunner.TestRunner --keepdb --keep-indexes

Install GDAL for Spatial queries

In Sierra/Mojave MAC OSX:

$ sudo chown -R $(whoami) $(brew --prefix)/*
$ sudo install -d -o $(whoami) -g admin /usr/local/Frameworks
$ brew install gdal

Install Libev for Cassandra/DSE driver compilation

In Sierra/Mojave MAC OSX:

$ brew install libev

RESTFul Searches

Available operations:

    'content': u'%s',
    'contains': u'*%s*',
    'endswith': u'*%s',
    'startswith': u'%s*',
    'exact': u'%s',
    'gt': u'{%s TO *}',
    'gte': u'[%s TO *]',
    'lt': u'{* TO %s}',
    'lte': u'[* TO %s]',
    'fuzzy': u'%s~',		
    'in': u'("%s"... OR ... "%s")'
    'range': u'[%s TO %s]'

Boosting term:

boost=alpha_2,5

Geo Spatial searches:

km=10&from=-123.25022,44.59641

django-caravaggio-rest-api's People

Contributors

brunohenriquy avatar xalperte avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.