This commit is contained in:
Kilton937342 2022-08-02 14:14:55 +02:00
parent 074c918f1c
commit 40a3cff4d3
2 changed files with 4 additions and 9 deletions

View File

@ -419,14 +419,11 @@ def pdfGen(request):
template = get_template('test.tex')
latex = template.render(context)
print('LATEX', latex)
with tempfile.TemporaryDirectory() as tempdir:
direct = tempdir
with open(os.path.join(direct, 'tmp.tex'), 'x', encoding='utf-8') as f:
f.write(latex)
with open(os.path.join(direct, 'tmp.tex'), 'r', encoding='utf-8') as f:
print('FILE', f.read())
command = f'xelatex -interaction=batchmode tmp.tex'
try:
subprocess.run(command, shell=True,

View File

@ -13,14 +13,12 @@ export const WebsocketProvider = ({ children }) => {
const [isConnected, setConnected] = useState(false);
const router = useRouter();
const connect = (url) => {
if (isBrowser) {
if (isBrowser) {
var url = url.startsWith('/')? url: '/' + url
console.log(
`ws://${process.env.NEXT_PUBLIC_HOSTNAME}:${process.env.NEXT_PUBLIC_PORT}${url}`
);
ws.current = new ReconnectingWebSocket(
`ws://${process.env.NEXT_PUBLIC_HOSTNAME}:${process.env.NEXT_PUBLIC_PORT}${url}`
`ws://${process.env.NEXT_PUBLIC_HOST}${url}`
);
ws.current.onopen = () => {