cannot import name 'reder_template' from 'flask' [closed] - python

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 8 months ago.
Improve this question
How to fix this error :
cannot import name 'reder_template' from 'flask' (/usr/local/lib/python3.9/site-packages/flask/init.py)
from flask import Flask, request, reder_template, redirect
import os
import sqlite3
currentlocation = os.path.dirname(os.path.abspath(__file__))
myapp = Flask(__name__)
#myapp.route("/")
def homepage():
return render_template("homepage.html")

The problem is a typo, you have imported reder_template instead of render_template from flask.

Related

How do i fix this flask sqlalchemy problem? [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 13 hours ago.
Improve this question
So basically, im trying to make a website using flask, however, when i type: from flask import SQLAlchemy, it gives me this error message:
File "C:\Users\PycharmProjects\pythonProject4\website_init_.py",
line 2, in
from flask import sqlalchemy ImportError: cannot import name 'SQLAlchemy' from 'flask'
(C:\Users\PycharmProjects\pythonProject4\venv\Lib\site-packages\flask_init_.py)
Anyone know how to solve it?
The correct way to import SQLAlchemy is
from flask_sqlalchemy import SQLAlchemy
source

Why is it showing the syntax error if I have installed python3 and Kivy? [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 2 years ago.
Improve this question
Im watching this tutorial on YouTube , how to make a POS software using python and kivy . After running this code
import kivy.app import app
from kivy.uix.boxlayout import boxlayout
class SinginWindow(BoxLayout):
pass
class SigninApp(App):
def build(self):
return signinWindow()
if __name__=="__main__":
sa = SigninApp()
sa.run()
I get the following error
import kivy.app import app
^
SyntaxError: invalid syntax
you are typing import twice, it should be from kivy.app import app

ImportError: cannot import name 'HttpResponce' from 'django.http' [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 4 years ago.
Improve this question
So, I'm trying to create a web, and I use django. My code is next:
from django.http import HttpResponce
def index(request):
return HttpResponce('Hello World!!!')
I don't understand why it workes in another projects and doesn't work now.
You misspelled response as responce

Flask - 404 URL was not found [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 5 years ago.
Improve this question
When I run my code I get a 404 error.
I tried to add
app.config['SERVER_NAME'] = '127.0.0.1:500-'
but it didn't help.
This is such a basic Flask app, I don't understand what the problem could be.
I have another flask project that works perfect, but for some reason,
the routes aren't working.
Anyone have an idea what could possibly be going wrong?
Here's my code.
from flask import Flask
app = Flask(__name__)
app.route('/')
def index():
return ""
if __name__ == '__main__':
app.run(debug=True)
You forgot to use # for the decorator. Below should work
from flask import Flask
app = Flask(__name__)
#app.route('/')
def index():
return ""
if __name__ == '__main__':
app.run(debug=True)

How to resolve Import Error? [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 8 years ago.
Improve this question
I did this :
import calender
But gives me this error :
ImportError: No module named calender
What should I do?
You have a typo in the name, it's calendar, not calender:
import calendar

Categories

Resources