dashwood.net -

Ryan Stefan's Micro Blog

Fixed Apache Log Directory Error

Nov 142018
sudo mkdir /var/log/apache2/
sudo touch /var/log/apache2/{access,error,other_vhosts_access,suexec}.log
sudo chown -R root:adm /var/log/apache2/
sudo chmod -R 750 /var/log/apache2

Spent hours getting the plotly graph working with flask and sized properly. I don't have the energy to even go into it, but here's a picture:


Here's the core code:

import json
import plotly

import pandas as pd
import numpy as np

def graph_data():
	# graph data/settings dict

    graphJSON = json.dumps(graphs, cls = plotly.utils.PlotlyJSONEncoder)
    return graphJSON


from graphs import graph_data

graph_data = graph_data()

def product(asin):
	return render_template('amazon-product-tests.html', product=product, graph_data=Markup(graph_data))

# jinja
<div id="trust-score-graph"></div>

# Javascript
var graphs = {{graph_data}};

            graphs[0].layout,{"showLink": false, "responsive": true,"staticPlot": true});


Added comments enabled by default to personal blog: comments_enabled in xml in content/private/comments.xml