I have upload a python file from VS core, it can be run in VS core. When I want run the same file in REPL, the above message box was appear in the con
Python
lsikoraHey! So on your left there should be a option to select different files. Here you can add a new file on the top left corner and you will have the option to name the file. Name the file `.replit like shown. When you open the file, you will have the option to type in code and here you will type, run = "blah blah blah". Replace the blah blah blah with the code you want to run. So for example, run = "main.py"`. Hope this helps!2 years ago
MrVooYou need a main.py OUTSIDE a folder for it to run. Move everything out of the folder.2 years ago
I was to run the Flask server to view the login and register html, but the displaty shown "Internal Server Error".
How to resolve it and why it happe
Python
RYANTADIPARTHIyour error is probably because you should name your folder templates instead of flaskr. And then, render it from there, with the proper file directory.3 years ago
19winterspI think the issue is that you are trying to render "index.html" (main.py:14) but that file doesn't exist.
Edit: apparently I wasn't clear enough. The file "index.html" does not exist in your template directory for the app, which is undefined. You should modify your template folder to be "flask-tutorial/flaskr/templates", by modifying main.py:4 as follows:
website = Flask(name, templatefolder="flask-tutorial/flaskr/templates")
Note that if you are trying to render "blog/index.html" as the home3 years ago
I have try the Flask application factory, however screen shown "This site can’t be reached"
I run my code as below
Application factory $ export FLASK
Python
SixBeepsMake that last command flask run -h 0.0.0.0 --p 80803 years ago
btfussProblems
A problem may be that repl doesnt support flask. Open tkinter or pygame and test. If it doesnt work, either repl isnt working, check the encoding.
Reference link:
https://stackoverflow.com/questions/30554702/cant-connect-to-flask-web-service-connection-refused
> :D hope this helps3 years ago
LohBoonScreenshot 2021-02-02 at 12.05.25 PM3 years ago
I need to build a login and signup page for flask, however the a display of internal server error.
Why? how to fixed it?
Python
KHZ@LohBoon You need to create a new folder called templates and shift all your html files to that folder. The code won't detect the templates in the login-template folder by itself. If you want to do that you can declare the templates folder to login-template like this:
app = Flask(
name,
template_folder="login-template"
)
`3 years ago
CoolJames1610I think for flask, you need to have your .html files in a folder named templates. Otherwise it doesn't work. Hope this helps3 years ago
Is the Flask come with a SQLite database in REPL.IT? If no where is the package available to download?
RYANTADIPARTHINo
nope. Doesn't come with sqlite. It comes with no databases. You can only make a few non-db projects with it. On repl.it, no db is provided.3 years ago
I have create the auth.py for login and logout view. But I am not sure where or how to access the login page?
Thank you.
Python
RYANTADIPARTHISolution
your auth url states /register. So type that URL in the browser, and you will get there.3 years ago
LuckyOreosI’m a little confused but do you mean this page - https://repl.it/ or this- https://repl.it/login?goto=%2F~ Like do you mean the repl.it’s auth page and stuff or like in this repl above....3 years ago
Ordinately I want to customizing my project template according to Django tutorial 7 writing your first Django app, however
'DIRS : [BASE_DIR / 'djang
Python
RYANTADIPARTHISolution
your error is in mysite/settings.py, your DIRS part is wrong. In django, you need to use .join(). Because you are trying to include your templates file.
'DIRS': [os.path.join(BASE_DIR, 'templates')],
i think it's something like that. Try that code.
It should work3 years ago
Coder100make sure you are dividing by numbers. Did you perhaps mean
int(a) / int(x)
where a and x are the variables in question.3 years ago
I have follow exactly the tutorial 6 in Django customise the app's look and adding a background-image. However, when i runserver, the html & css did n
Python
RYANTADIPARTHI@19wintersp nice job for deleting your solution.3 years ago
RYANTADIPARTHISolution
the reason your static folder is not working is because, in your mysite/settings.py, you haven't told django, where the settings is. Also, you might want to move your settings folder outside of polls.
So, put this code in your settings file.
STATICFILES_DIRS = [
os.path.join(BASE_DIR, 'static')
]
STATICFILES = (
os.path.join(BASE_DIR, 'static'),
)
like that.
That should work3 years ago