Category : flask

I’m trying to install Flask-SimpleLDAP on a Windows machine so I can use Active Directory for authentication for a Dash app I have created. I’m following this article – https://towardsdatascience.com/a-simple-way-to-integrate-dash-with-ldap-4d5d059ee3a6 The install is failing when it tries to build the wheel for "python-ldap", with the errors: Building wheel for python-ldap (setup.py) … error ERROR: Command ..

Read more

I’m building a website using Flask and I’m running into an issue where after creating an account the website doesn’t redirect me to the homepage. main.py from flask import Flask, render_template, url_for, flash, redirect from forms import RegistrationForm, LoginForm app = Flask(__name__) posts = [ { ‘author’: ‘Corey’, ‘title’: ‘blg post’, ‘content’: ‘first post’, ‘date_posted’: ..

Read more

When I run this code, from flask_wtf import FlaskForm I get an error, File "<frozen importlib._bootstrap>", line 1007, in _find_and_load File "<frozen importlib._bootstrap>", line 984, in _find_and_load_unlocked ModuleNotFoundError: No module named ‘flask_wtf’ I’ve installed the flask-wtf package through CMD, pip install flask-wtf and it gave me the confirmation that the package has been successfully installed ..

Read more

How to run flask app automatically during windows boot? I have a simple python app @app.route("/") def hello(): # Login Service logging.debug("hello world") return "Hello World!" if __name__ == "__main__": app.run() python app.py runs a web app on http://localhost:5000 I want to start the same automatically during the windows boot. I am new to python ..

Read more

I am creating a Flask app, and I’m just starting trying to mix flask and javascript, my script is suuuuper easy: <!DOCTYPE html> <html> <body> <button id=”mybtn”>click me to start</button> <p>click the button to start the count</p> <p id=”demo”></p> <script> document.getElementById(“mybtn”).addEventListener(“click”, startTimer); var t = 0; function startTimer(){ var myVar = setInterval(myTimer, 5000); } function ..

Read more

I’m having a issue about how python comunicate with another applications in windows, in this case is AUTOCAD. I have a simple script to write a line on autocad, and send a ok message. import pyautocad from pyautocad.types import aDouble acad.prompt(‘ok’) points = aDouble(0,0,1,1,2,2) acad.model.AddPolyline(points) It works fine when i execute this script. But i ..

Read more

PS C:UsersAdminDesktopwebserver> ScriptsActivate.ps1 (webserver) PS C:UsersAdminDesktopwebserver> $env:FLASK_APP = "server.py" (webserver) PS C:UsersAdminDesktopwebserver> set FLASK_ENV=development (webserver) PS C:UsersAdminDesktopwebserver> flask run Serving Flask app ‘server.py’ (lazy loading) Environment: production WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead. Debug mode: offenter code here Running on http://127.0.0.1:5000/ ..

Read more