Flask Tutorial Web Development with Python 3 - Bootstrap and Jinja Templates

preview_player
Показать описание
In this Flask web development tutorial video, we introduce Bootstrap and the Jinja2 templates that we'll be using.

Bitcoin donations: 1GV7srgR4NJx4vrk7avCmmVQQrqmv87ty6
Рекомендации по теме
Комментарии
Автор

This man has been teaching me programming since I was like 14

Patrick-kyez
Автор

@sentdex The only way I can get the webpage to load is to run the __init__.py file from the command line, but it doesn't look like you have to do that for the page to load. I am hosting the site on a raspberry pi on my local network. Is there a way to load the site without having to run the __init__.py file from the command line?

cylebfd
Автор

Why don't we use this "<link rel="stylesheet" type="text/css" href="theme.css">" instead of <link href="{{url_for('static', filename=') }} rel="stylesheet">

longchu
Автор

A simple edit to main.html DOES require me to 'service apache2 restart'. Anyone else seen this? It's made clear multiple times in this series that you should not need to restart apache for a html edit, yet I can refresh all day long with no changes until I do.

timbotch
Автор

I don't see the point in using variables when you can just state the relative path

Ghost-ali
Автор

Hi there how ya doin?!

Is there a difference between using static_url_path to send files from static directory and using jinja2 {{ var }} syntax to tell Flask where the files are?

Thanks for tutorials!

EdgieMan
Автор

why you have allowed direct directory access on pythonprograming.net/static is that secure? ;
i mean anyone can see all your site data!

kaiserbhat
Автор

Hi Harrison...  First at all THANK YOU very much for this, for sharing you knowledge... Second, why in the end you put the <p></p> tag outside of the html? and without body? i underestand a little of html so that is rare to me.... Sorry for my english : D 

theviajerock
Автор

Hello sentdex. I'm getting a "TemplateNotFound" error in the apache2 log when I try to render templates in my __init__.py file. It can't seem to locate any .html files in the "templates" directory - do I need to specify the directory somewhere in wsgi?

erikv
Автор

I logged into the server via WinSCP and I found the __init__ file, but I don't have your folder structure... I don't have these folders like static, templates, venv... Did I miss something?

evilish
Автор

I'm not sure what the issue is here, but even though I associated *.py files with IDLE within WinSCP's preferences, everytime I double click a python file (e.g. the init file for our app), it spits out an empty file. However, WinSCP itself indicates the file is of the same size as that on the server and, indeed, the file exists with content (checked via 'head __init__.py') on the server, too. I've been able to avoid this problem by working with FileZilla instead, but I'd rather follow along with the tutorials as closely as possible. Any ideas how to get WinSCP to work properly anyone?

jcf
Автор

+sentdex I followed along the entire tutorial but when i paste the Digital Ocean IP into the web browser apache opens the html file from /var/www/html/index.html and not /templates/main.html as written on __init__.py. Is this normal or have I missed something?

aswinckr
Автор

Maybe use the the built-in web server for dev and then show deployment on apache later... obviously too late... now that you've built all the content... but might be worth mentioning to new viewers in the future.

wiqarc
Автор

No matter what I do, I cannot connect FileZilla to my server. Do I need to configure something on server? There is no firewall, on Mac.
Thanks

peter-paulnomary
Автор

bootstrap doesn't have fonts folder upon download anymore?

IandKProductions
Автор

I'm running this on a raspberry pi. Is it good practice to change owner for all the files and folders within the FlaskApp from root to pi?

rogerbrinkmann
Автор

What should I do to make the web server automatically restart like you do?

ДмитроПопович-рт
Автор

I have 500 internal server error, my /var/log/apache2/error.log states TEMPLATENOTFOUND : main.html but it is there.... don't know why i'm having this error

mvpsvable
Автор

Previously I followed your 7 video tutorial and everything was successful. Then I rebuilt my Linode and started following this tutorial. I'm up to this point in the tutorial and I've set everything up at least 5 times. I'm not sure what I'm doing wrong, but it's still showing the Apache2 Ubuntu Default Page (/var/www/html/index.html) even though we haven't yet referenced the index.html page within the python script Any idea why it's directly referencing the .html file instead of the .py file? Maybe some sort of remnant from when I rebuilt the Linode?

queuefive
Автор

Is anyone able to reproduce a deployment of flask application as described in the sentdex video? I am struggling with 500 Internal Server Error, more particulary with ImportError: No module named flaskapp. I searched throughout the internet (including solutions provided here in comments) with no luck finding a working solution. Am I missing something?

futew