Server App issues [Heroku]

Hello Drone Deploy Community

I got an issue with the Server App setup ( described at this link :

I’m a user of heroku , if think it s fine , API Key from Google are ok.

But when i load the app in the browser , i got a 404 ERROR

i think it’s the tornado module can’t GET , my console ask me this error :
WARNING:tornado.access:404 GET / (::1) 0.75ms

I think the issue is from the CORS ( HTTP control access) but i have no ideo how to fix it.

Anyone has managed to setup this server ?

thanks for help .

the python code :

import os

import requests
import tornado.ioloop
import tornado.web

GEOCODE_FMT = ‘{address}&key={key}

class GeocodeHandler(tornado.web.RequestHandler):
“”“Proxy a call to the Google Maps geocode API”""

def set_default_headers(self):
    # allow cross-origin requests to be made from your app on DroneDeploy to your web server
    self.set_header("Access-Control-Allow-Origin", "")
    self.set_header("Access-Control-Allow-Headers", "x-requested-with")
    # add more allowed methods when adding more handlers (POST, PUT, etc.)
    self.set_header("Access-Control-Allow-Methods", "GET, OPTIONS")
def get(self):
    api_key = os.environ.get("**mykey**")
    address = self.get_query_argument("address")
    url = GEOCODE_FMT.format(address=address, key=api_key)
    # fetch results of the geocode from Google
    response = requests.get(url)
    # send the results back to the client
def options(self):
    # no body

def main():
application = tornado.web.Application([
(r"/geocode/", GeocodeHandler)
port = int(os.environ.get(“PORT”, 5000))

if name == “main”:

Any help are welcome , thank you


Hi @john_sinien one of our engineers says that your tornado routes aren’t being picked up by heroku.

$ curl -v -X OPTIONS ",San+Francisco,CA" -H "Origin:"
*   Trying
* Connected to ( port 443 (#0)
* TLS 1.2 connection using TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
* Server certificate: *
* Server certificate: DigiCert SHA2 High Assurance Server CA
* Server certificate: DigiCert High Assurance EV Root CA
> OPTIONS /geocode/address=1+Market+St,San+Francisco,CA HTTP/1.1
> Host:
> User-Agent: curl/7.51.0
> Accept: */*
> Origin:
< HTTP/1.1 404 Not Found
< Connection: keep-alive
< Server: TornadoServer/4.4.2
< Content-Type: text/html; charset=UTF-8
< Content-Length: 69
< Date: Mon, 27 Mar 2017 22:25:47 GMT
< Via: 1.1 vegur
* Curl_http_done: called premature == 0
* Connection #0 to host left intact
<html><title>404: Not Found</title><body>404: Not Found</body></html>

Hello Manu,

thanks for helping.
I try to found how to routes this … but it seems i didn’t manage to fix it.

Any idea ?

Hi @john_sinien,

Maybe not the answer you were looking for but here is how you can get that information with Javascript.

  1. Get your mapbox API Key here

  2. Replace <YOUR_API_KEY_HERE> with the above api key and run this code in your chrome console.

function getReadableAddressFromLatLng(latLng){
  return fetch(`${latLng.lng},${}.json?access_token=<YOUR_API_KEY_HERE>`)
      return res.json();
      return geoLocation.features[0] && geoLocation.features[0].place_name

function getLatLngFromAddress(address){
  return fetch(`${address}.json?access_token=<YOUR_API_KEY_HERE>`)
      return res.json();
      var location = geoLocation.features[0];
      return location && ({lat:[1], lng:[0]})

getReadableAddressFromLatLng({lat: 37.773972, lng: -122.431297})
    console.log(locationName); // 712 Oak St, San Francisco, California 94117, United States

getLatLngFromAddress('712 Oak St, San Francisco, California 94117, United States')
    console.log(latLng); //  {lat: 37.774147, lng: -122.431287}

Hope that helps,

Hi Daniel ,

The MapBox script you gave me work fine in my JsConsole. But how i can implement it in order to communicate with the Drone Deploy APi ?

Hi @john_sinien,

Here is the source code for an app market app using the above functionality.

You can test the above app by installing it and going to a map you’ve created.

Let me know if that answers your question. If you tell me more about your intended app, I might be able to help further.


Hi Daniel ,

thanks for your help; and this source code.

i’m confuse now.

How i can install this server on a Map i created ? you mean a flight plan ? Sorry about this question.
Believe me i try to found the answer before asking.

I’m working on two project : on for detecting nest of hornets and another for mapping… the Sky.

Hi @john_sinien,

Have you looked at Cogniac? It’s a brand new app on the market that allows for object detection of anything.

For example if you want to automatically detect hornet nests. You’ll need to export a few maps containing hornet nests to cogniac via their integration. And then you will label the nest and then you’ll be able to automatically detect nests in the future.

Give it a try.

If you train a model you should be able to work with their API to publish a standalone app to share your hornet detection app.

Would be interested in hearing more about your second idea.


Hello ,

thanks for help and reply.

I’m still workin’ on the App. i will make a description soon.