Giter Club home page Giter Club logo

django-fusion-table's Introduction

Django Fusion Tables

About this project

A simple project which handles locations in Google Maps while manipulating data in database and Google Fusion Tables. It basically:

  • Validates if your location is valid (not a wood/mountain/ocean area)
  • Save lat, lon and addres both to database as Google Fusion Tables

But you also can: reset both data, lists data from database, view your locations in maps retrieved from Fusion Tables.

Warning This project uses some ES6 stuff. It don't uses Angular/React/Webpack/Babel to avoid over-engineering and keep it simple.

djgmaps module

Main django module, contains base urls.py and settings.py.

fusiontables module

It centers every logic and handling to Google Fusion Tables (as name suggests). This module is highly reusable, can be set in any other Django project. Following Solid principles, you will find there:

  • GoogleAuthFactory - Used to build Google Authentication stuff, like url, credentials and service. (can be found in factories.py)
  • Permissions - Checks if a user can manipulate data (Already did a login, Google Auth Session not expired) (can be found in permissions.py)
  • FusionTableService - Handles requests/queries to Google Fusion Tables. (can be found in services.py)
  • views.py - Only one view that redirects to Google OAuth URL.
  • decorators.py - You may find really cool stuff over there. It makes easy to inject new behaviors in some requests.

Module dependencies & requirements

It requires:

  • djangorestframework
  • google-api-python-client
  • client_secrets.json file
  • CREDENTIALS_KEY and TABLE_ID set in settings.py

locations app

This app implements models and uses service from above module. Note how it's higly decoupled from it. You will find only a bind with decorators and permissions in views.py which handles requests to default module and uses service provided by fusiontables.

Scripts

It uses jQuery, bootstrap, and a simple third party file that extends jQuery to allows $.delete. You will find also:

gmaps.js

Handle Google Maps stuff like:

  • Start map
  • Bind fusion table to it
  • Handle map click
  • Validates address

locations.js

Handle API stuff like:

  • Save location
  • Retrieve locations
  • Display locations in table
  • Reset locations
  • Display error message

Run it (Windows)

git clone https://github.com/guilatrova/django-fusion-table.git          
virtualenv .ve
.ve\scripts\activate
pip install -r requirements.txt
python manage.py migrate
python manage.py runserver

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.