Esempio n. 1
0
    def upload_video_file(self, video_file_name, extension, video):

        video.file_blob_path = settings.PROJECT_VIDEOS_BASE_DIR + \
                               str(self.project.id) + "/" + str(video.id)

        data_tools = Data_tools().data_tools
        data_tools.upload_to_cloud_storage(temp_local_path=video_file_name,
                                           blob_path=video.file_blob_path,
                                           content_type="video/" +
                                           str(extension[1:]),
                                           timeout=60 * 10)

        video.file_signed_url = data_tools.build_secure_url(
            video.file_blob_path, 2592000)
Esempio n. 2
0
	# This routes to vue js
	if app.debug is False and request.method == 'GET':
		return render_template("index.html")

	print("Post request not found:", path)

	return Response("Not found.", status=405, mimetype='application/json')


app.secret_key = settings.SECRET_KEY

from shared.helpers.security import limiter
limiter.init_app(app) # so we don't have to import app varible into limiter file

from shared.data_tools_core import Data_tools
data_tools = Data_tools().data_tools

print("Startup in", time.time() - start_time)

# Debug
if __name__ == '__main__':

	limiter.enabled = False
	settings.NAME_EQUALS_MAIN = True

	app.run(host='0.0.0.0', port=8080, debug=True)
	# CAUTION . app.run() is BLOCKING 
	# code below app.run will not execute!!! 

else:
Esempio n. 3
0
 def get_pre_labeled_data_cloud_url(self):
     data_tools = Data_tools().data_tools
     url = data_tools.build_secure_url(self.data_temp_dir)
     return url