Templates vs. coded HTML

I have a web-app consisting of some html forms for maintaining some tables (SQlite, with CherryPy for web-server stuff). First I did it entirely 'the Python way', and generated html strings via....

Getting started with Cherrypy and Jinja2

This is my first time delving into web development in python. My only other experience is PHP, and I never used a framework before, so I'm finding this very intimidating and confusing. I'm...

404 error CSS file not found in chrome dev tools

I've spent an hour and a half reading other posts about this issue and still haven't solved it. I believe the file is in the right place and the file path reference is the appropriate one. I'm...

How to import jinja2.ext.loopcontrols to Flask correctly?

I have read in Flask documentation that I should import the "jinja2.ext.loopcontrols" extension in order to use the range tag. I'm trying to do so by: app =...

How to set a variable from inside a for loop that can be accessed from outside the for loop [Jinja]

When a user clicks a link, I want Jinja to set a variable called {{ contact_clicked }} that is equal to {{ contact }}. I could do <a href="/?{% contact_clicked = contact %}">.....</a>. However,...

jinja2: get first item in list whether list exists or not

For the first line below, the jinja2 template renders whether x exists or not. However, in the second line, the template only renders if x is an existing list. If it isn't I get an error (assume...

jinja2: track previous value in for loop

in a jinja2 for loop, how can I keep track of what the previous value of a variable was (for purposes of displaying breaks between "groups")? The obvious and straight-forward answer of: {% set...

How to generate json using Jinja2 Template Engine

I am trying to generate a json file from a .xlsx file. so far I was able to get data from the file but I am not sure how to put them on json using jinja2. There is a problem in template structure....

ImportError: No module named 'config.settings'; 'config' is not a package

I'm trying to get my cookiecutter-django app running under Apache with mod_wsgi installed via pip. python3 manager.py runserver works. But after running it in Apache, I got an error saying Module...

Flask blueprint architecture issues

I'm new with using flask so I'm doing a lot of research to find out what the best way to structure my application. I've been following app factories and using blueprints, but I'm having trouble...

How can I fix "500 : Internal Server Error" on jupyter notebook due to 'tornado.web' not having attribute 'asynchronous'?

Jupiter notebook is not opening notebooks and shows a "500 : Internal Server Error" instead. What I did was activate an environment I need and launching Jupyter. Please find below what I did and...

Using variables in the Jinja2 template in ansible Playbook

Any idea of how we can use dynamic variables inside the Jinja2 Template. Below is the data from my Jinja2...

Python Flask as Windows Service

I am trying to get a Flask app to run as a Service in Windows. I have already tried to implement a solution as suggested here and here without success. I have a simple folder with just two...

Jinja2 template in Python 3 renders bytes with "b" prefix and quotes

I'm converting a flask app from python 2 to 3, Jinja2 now renders bytes with trailing b and single quotes, e.g. b'a123' while I need them rendered as a123. This happens with all urlsafe strings...

error H13 on heroku on an dash application

import requests from bs4 import BeautifulSoup import pandas as pd import dash import dash_core_components as dcc import dash_html_components as html import...

Can't use 'zip' from jinja2

I am trying to run this code in my HTML: <tbody> {% for name, npcBuy in zip(farmingMerchantName, farmingMerchantPrices) %} <tr> <td>{{ name }}</td> <td>temp</td> ...

H10 Error in Flask App when deployed on heroku

My app is working perfectly on local host but I am getting the following error when I deployed my flask app on heroku 2020-07-01T09:56:02.982007+00:00 heroku[router]: at=error code=H10 desc="App...

Python Pyinstaller Matplotlibrc

Dear python experts in the world wide web, I really wish to get helped in this problem I have with pyinstaller. I wish to convert a python script to an executable so that i can distribute to my...

How to update RSS Feed every 5 seconds in Python using Flask

I did a lot of research and nothing relevant worked. Basically I am trying to scrape RSS Feed and populate the data in a table format on a webpage created using Python Flask. I have scraped the...

changing the remote tmp path in ansible.cfg (Windows client)

Good day everyone, I am having some issues any task on a Windows machine i ran the following: ansible -m ping Windows -u ansible -kK -vvv 192.168.140.147 | UNREACHABLE! => { "changed":...

I have a ModuleNotFoundError: No module named 'Crypto'

Please need help When I try to run myfile.py it says, ModuleNotFoundError: No module named 'Crypto' ,but I already have the path for 'conda' and 'anaconda3' in my environment variables, I also...

cannot run pyinstaller executable of a flask server. ValueError: Can't find a dictionary for language 'ru'

I'm trying to put a simple flask server into executable by using pyinstaller -F server.py command When running the exe file, I obtain the following error: Traceback (most recent call last): File...

How can I convert big python project to exe file?

I have a Python Qt GUI which is using these modules: "Numpy, scipy, matplotlib-base, netcdf4, cartopy, xarray, pytest, gdal, cycler, dateutil, kiwisolver, pillow, pyparsing, tk, PyQt5, pycairo,...

Elastic Apm python agent connection problem

I have a very basic Django APM agent setup: ELASTIC_APM = { # Set required service name. Allowed characters: # a-z, A-Z, 0-9, -, _, and space 'SERVICE_NAME': 'bourse', # Set custom APM Server URL...

AWS Glue 2.0, local pyspark development, testing confusion

I'm new to Glue jobs and I'm looking to try to use Glue 2.0 to run PySpark jobs (python 3) that require the following python libraries as defined in my requirements.txt. I'm sort of at a loss on...

Install packages in requierements.txt in Python using Flask

I'm using requirements to install all of my project's packages. But, for some packages, I can't find the right version or if I need to place it in requirements.txt and I need help to deploy it...

PythonVirtualenvOperator using airflow module fails to execute with AttributeError: module 'airflow' has no attribute 'utils'

I have Airflow deployed in virtual env and in case I try to execute PythonVirtualenvOperator with import of the Airflow module (to get Variables for example) it gives me the AttributeError. Guess...

How can I add custom filter FastApi Jinja2 template?

How can I use custom filter Jinja2 template in FastApi? I could find adding custom filter in Jinja2 but not specified in FastApi , and other answer from stackoverflow and tried that answer but I...

Bokeh/panel won't render in-line with Jupyter Lab

I'm trying to visualize Bokeh plots and panels with a Bokeh backend in a notebook in JupyterLab. Things were running fine until I updated. Current packages and versions are below I have tried the...

Poetry | AttributeError 'Link' object has no attribute 'name'

I want to install packages from poetry.lock file; using poetry install. However, the majority of packages throw the exact same error, indicating a shared fundamental problem. What is causing this?...