any uh we are
at the five aftermark so we are going to
dive into this class uh so I think a few
people have been here before look at
that jock Stroud jock Stroud is in the
house um I think that's one of the
interesting things with doing these
classes is even though it's virtual even
though it's online you do actually start
to remember people it's a very weird
relationship thing we have in this
modern world it's like I like oh Jack
Str I know him jack Str I don't know how
the you say his name but anyways
okay the class the introduction that we
do every single time uh silicon Dojo
authorless gatekeeper Frey and use our
Hands-On technology education that
empowers you to do whatever the hell it
is that you want to do basically the
idea of silicon Dojo is what if
technology that taught you skills was
just as available as water I've been
thinking about this a lot lately kind of
one of the things I think about I'm a
Buddhist like I'm actually a Buddhist
like my name is in a temple somewhere
when I was a kid I had Japanese ladies
try to feed me these weird tofu things
with peanut sauce on top they kept
telling me it was a
dessert anyways Buddhist bad Buddhist
don't worry I'm not going to Priti but
one of the things I always think about
like with education is kind of like uh
back in the old days with B Buddhism
like sedara under the bodai tree with
his students like think about that as an
education system you have an instructor
you have
students you have tree to keep the sun
off of
you isn't that what education really is
about and of course we need some stuff
in the modern world in order to actually
teach what we're teaching but what if we
try to instead of trying to make college
education worth
$200,000 what if we got back more to the
idea of teacher student tree that's what
I'm kind of trying to do here with
silicon Dojo uh free end user is not
actually free uh the fall life right now
for me is still chaotic as hell so I'm
not pushing this a lot but we do have a
donorbox account donorbox.org
etcg if you want to throw a couple of
dollars in because you find this to be
valuable uh that would be wonderful uh
raise hands in Zoom if you have a
question uh go down
to oh the reaction thing and raise your
hand wherever the hand raising thing is
um and then I will be able to answer
your question I do get some people that
literally raise their hands which is
adorable but does not work uh let's see
here copyright everything that I do
almost everything that I do is freely
available for you so if you go to GitHub
uh there's everything there you can
download it you can use it you can
create your own classes you can sell
your own classes based off of it uh so
that's all there for you uh Tippy tap or
die a lot of people think that uh to
become a technology professional all
they need to do is come to these classes
sit back and learn that's not what it is
to be a technology professional what a
real technology professional does is
they bang their head against the wall a
thousand times until the information
gets into their head we have projects
every time we do these classes there's
at least three Labs at the end of the
class do those labs do the work you will
not be a technology professional unless
you actually code and do stuff so that
you understand when you forget to close
single quotation marks or double
quotation marks or whatever else uh
extra help w3schools.com is absolutely
fabulous and again chat GPT is not
actually intelligent but it is really
good for helping you with coding
problems uh standardization so we use vs
code with the default settings basically
this helps with troubleshooting so a lot
of people ask can I use a different IDE
you can use whatever IDE you want you
can use a notepad if you want if you
want me to try to help you figure out
where you forgot to put the double
quotation
marks I will do my best but if you're
using notepad it's going to be a
disaster um let's see here material any
additional material you need uh just so
you know uh Eli the computer guy so if
you go to Eli the computer guy Channel
all these classes are actually recorded
and they are uploaded uh so far we've
been using Zoom to to record these
videos and so they're very bad to be
honest with you but they are here uh I
am trying to use wirecast now to
actually be able to um record the videos
so we'll see how that goes I tried to
use y cast last
class it did not go well so maybe this
class will go well who knows I don't
know uh but anyways classes are here if
you miss them and of course GitHub is
the big one you go to GitHub silicon
Dojo online classes all the material for
the classes is here uh so like today
python bottle framework you can come
here codes are here lab examples here we
have the lab of book and we have the
workbook I would highly recommend you
download and print these um so the
workbook is basically um uh the PDF of
all of the slides so you can write notes
again write notes everybody says I don't
need to write notes you do anyways uh
the notes are there um and then uh for
the lab book or the lab book is uh this
is for the labs so the three Labs at the
end it's just a little PDF
um anyways there's a PDF here I swear it
exists I would recommend that you
download it uh trolls just so you know
um we haven't had a big problem with
trolls we did have trolls in the past
for one of the classes just so you know
chat is on chat is on currently here's
how I deal with here's how I deal with
chat and trolls if trolls pop in the
chat I turn off chat for everybody and
you're done for a while
that's just the easiest way to go about
it uh and you should all be muted I just
realized ha you were
not fully muted before so now you all
are fully muted so again if you want to
say something raise a hand in zoom and
you can ask a question there you go and
I'll allow you to unmute yourself uh so
I think that's it I think that's it so
let us get into
bottle I love but also much U like one
of the big problems that I have uh being
a technology instructor is that whenever
you're going to be building anything in
technology or supporting anything in
technology everything is built on top of
each other right so uh so like when
you're trying to learn TCP IP it's like
well you got the ethernet standard and
you got TCP IP addressing and you've got
DNS and you got icmp and igmp and you
got this thing called a protocol Suite
and on top of that you got network cards
and on top of that you got an operating
system and then for the operating system
communicate with the network cart then
you have a device
drivers so one of the big problems with
new people is when I try to teach them
technology it's kind of hard because you
gotta like throw people into the middle
of this mess and just tell them yes it's
it's GNA be confusing it's gonna be a
pain in the ass at some point it'll
start to to make sense to you um and so
that's one of the issues uh so we start
talking about python right one of the
amazing things about python is python
can do damn near anything with the right
framework all right so python is the
programming language Frameworks are
basically oh all these additional
packages of functions and libraries and
all that kind of stuff that allow you to
do certain things uh build web
applications um build all kinds of
different stuff I build a desktop
application so it's something called
tenter the allows you to create
graphical desktop applications a
computer vision there's an open CV a
framework that type of thing one of the
problems that we get into is with
building web apps is if you look at a
lot of the Frameworks out there uh
they're really cool uh but also
um pretty complicated at the exact same
time uh so like d Jango if you want to
build web apps with Jang Jango is an
awesome
framework but oh my God so incred
right there's something called an or orm
there's an orm if you want to deal with
the database you got to deal with the
orm uh it's a MVC is it MVC or is it an
mvt or does that even make any sense
that's an argument anyways right there's
all this stuff you try to learn D Jango
it's all the stuff a lot of the the
Frameworks they do a lot of amazing
things incredibly powerful much better
than bottle better than bottle my God
they're pain in the ass like how do you
teach people all right so anyways uh the
thing that I like about about the bottle
framework is that it is dirt simple
there is no or or um object relationship
management when you're dealing with
databases there is no or MVC who the
hell cares like all this stuff it
doesn't matter what do you have when you
have a when you're dealing with
bottle is h a script like any of these
scripts up here but basically this is
the most simple script where you write
your
script at the end of it is a run
function uh you literally uh you
literally just run this script so you
don't have to call out you don't have to
call out from a from a command line you
know command or whatever from somewhere
else you literally just write the script
you run the script and if you do that
then you have a web
app and so why this is very useful is if
you're trying to create uh basic
dashboards so we talk about this with a
single pane of glass in the IT world
where what a single pane of glass is is
if I'm like the IT director I can walk
in I can look at a big screen and on the
screen I have all my metrics right it's
incredibly good for doing single panes
of of glass as I say um it's good for
building iot things it's good for
building dashboards it's good for
building a small rest apis that type of
thing and it's very good for creating uh
troubleshooting uh tools so basically
you can just have this on your computer
you can run it once you run it you have
this nice little uh web graphical
interface and then you can you know do
whatever it is that you need to do in
your particular
environment uh let's see here uh so what
is bottle so bottle is a web app and
what's called a micro framework and what
we mean by micro framework is it's small
it's not like Django it doesn't have
everything in the world right it's just
it is what it is it does not include a
database it does not include a SQL light
you can connect a SQL light but it
doesn't doesn't have SQL light um from
the GetGo doesn't have a lot of all that
kind of stuff uh in order install it
very simple as we've done with other
modules Python 3 space hyphen M pip
install bottle and that's it that's all
you have to do to install it uh they
have their document thing
here
open and you go uh just a look at the
documentation you click on this bottle
py. org dodev and you can go through
here and basically it'll give you almost
all the instructions you need uh for
whatever it is that you're going to be
trying to build again the big thing like
with bottle it's like with any product
in the technology world is just keep in
mind what you're building you're not
building the next Instagram with it
you're not building the next Facebook
with it you're building a dashboard
you're building a small like a rest API
thing as long as you keep that in mind
you should be fine uh let's see here uh
the basic architecture uh we're taking a
look at bottle uh so that's going to be
one of the things when you start dealing
with these uh these web app Frameworks
there's a lot of stuff involved so so
normally if you've done web development
in the past um you know you have a pat
V2 or you have engine x uh basically you
have um some kind of uh scripting
language PHP Ruby on Rails something
like that uh basically you have files
and folders and a directory structure
and that's pretty simple now the big
thing to understand is when you start
dealing with python web app Frameworks
is just the the mentality Behind These
web app Frameworks is different it's not
necessarily more complic ated is just a
different way of doing it that frankly
is more secure in many ways right so so
you have let say this is is you have
your web app here and basically from the
get-go right now we're just dealing with
bottle so what are the different
components when we're talking about this
particular uh web app right so we're
going to have python so python is our
main programming language and this is
what's going to do all of like the
backend intelligence right do you need
to comp uh communicate with a SQL
database that will be done in Python you
need to connect with a rest API that
will be done in Python if you get a
value in and then you need to do an if
else statement based off of the value
that is going to be dealt with in Python
right so all of the intelligence
anything you think about like
intelligent if else conditionals
reaching out whatever that is going to
be dealt with with a Python language uh
bottle itself right bottle all bottle
does is basically it presents the
results from python um onto uh the web
page or basically it does some kind of
web action it redirects to a different
web page it prints everything up on the
screen that type of thing basically what
bottle is going to be doing is bottle is
going to be sending information to
Python and receiving information back
from python in order to give you that
web app that you're going to be looking
at uh also within this though is you're
going to be dealing with an issue of
static files so this is an interesting
thing when you start building these kind
of modern web apps is that security is a
big deal you may not have heard that
before but security is a big deal and so
any back in the old day when you had an
Apache web server right the Apache web
server had your index files and all your
other files and then under that it also
had your image files and it had your
style your CSS files and basically all
of those files were in a directory
structure that you could take a look at
basically you could normally do
something like FTP you could simply put
FTP into your browser put in CNN.com or
whatever website you're going to and you
would actually see this beautiful little
file structure here and you can actually
open and take a look at the different
files uh without actually going through
the web browser you could open it up
with VSS code or whatever else
uh to look for things like
vulnerabilities so again one of the big
things to be thinking about uh in the
security world is something called
operational security right there's
physical security uh physical security
is uh permissions and passwords and
encryption and that type of thing
operational security is basically
keeping people from understanding what
the hell it is that you're doing
right was it security through
um security through people not knowing
there's a problem there but anyways
right so anyways one of the issues with
a pat here engine X and the old ways of
doing web app development is people
could see all of your files all of your
folders all of your scripts and try to
figure out where there's a little
vulnerability to try to attack so anyway
so what uh what these new web app uh
platforms do Frameworks do is basically
they have a static file
folder um and with this basically you
only get those static files when the web
app requests it right so uh if bottle
needs needs to deliver a CSS file right
your casc stylesheet file basically it
will request that file from the static
folder that file will be included with
what goes out to the user uh and
basically the static uh folder is is
secure you can't simply just scan
through it like you used to before if
you want to add images any of that type
of thing that will be in this static uh
folder uh so that it's accessible uh by
the web app one of the things to be
thinking about though with this static
folder again from a security standpoint
is that generally the static folder
should actually be somewhere else right
so again one of the things to be
thinking about is the architecture
systems again architecture right anyways
one of the things to be thinking about
is having different servers or systems
to do specific things right the more
every piece of functionality that you're
ser has is also a
vulnerability again so if you have an
FTP server the fact that people can
upload files to that FTP server is both
a good thing because you need the
utility but it's also a bad thing
because somebody can upload files to
that FTP server now if you can email to
a server there's vulnerabilities there
everything has a vulnerability and so
that's one of the problems with the old
servers basically you have everything on
that one box if somebody can compromise
your FTP server they might be able to
get into your web server somebody's able
to compromise your SQL Server they might
be able to get into the rest of your
server all9 yards and so one of the
things to think about that every service
is on a different server right so bottle
is on This Server SQL is on This Server
files so basically your static files are
in this server and something else is on
this different server even if somebody's
able to compromise something in one of
these servers they can't compromise
everything so anyway so one of the
things to be thinking about with uh the
static files static folders when you're
creating a web app is many times the
idea is that these are actually going to
be somewhere else again we talk about
service oriented architecture so instead
of having static files and folders
sitting on the same server as your
bottle app they may be off an AWS right
you get a storage bucket on AWS all it
does is contain files and folders and
then basically when bottle makes the
request it makes the request to AWS
instead of making a request to your
local
computer anyways it gives you a bit more
security Now depending on what you're
doing may or may not matter right if you
if you are going to be building you're
going to be using bottle and you're
actually going to deploy it up to
digital ocean all right you're creating
some kind of rest API then then worrying
about where your static files are that
might really matter to you on the other
hand if you're just building some kind
of little diagnostic system as a system
administrator so you can ping things or
whatever else you may not care where the
static files are and so you may just put
those directly onto your computer so
that's the idea with static files uh
then you have templates so templates are
interesting again a lot of people ask
Eli how many languages do I need to know
to become a technology
professional lots lots again that idea
which language do I need to learn uh so
these things called templates uh and
with the templates you have a template
language um and if we take a look at a
template
language um now where's my
TPL uh this is kind of sort of what a
template language looks like and so
basically the idea with templates with
bottle right python figures out all this
information it sends it to bottle and
then one of the things that that bottle
can do is instead of creating uh the
entire web page on the fly it can access
a template
it can send variable values to the
template and then the template can
automatically format itself uh based off
of those variable values that's been
given so that's where like with this
template so it says hello and the name
that was presented to it so uh squiggly
squiggly space name close squiggly
squiggly because that's how they do it
in this template language if you do use
Jango their template language is
slightly different uh then here they do
a percentage if so if name equals
Bob name is awesome Bob is awesome else
name is not as cool as Bob because
everybody knows Bob is the coolest and
then you end and so anyways with this uh
there's a lot of different things you
can do with these template languages uh
we're not going to do a lot of that
today that just gets long and tedious
and horrible it's a great thing to use
chat gbt for but this is one of the ways
that when you're presenting information
to to the uh end user and instead of
being a instead of Simply dynamically
sending the HTML you can send values to
a template file and then that template
file will print everything out for you
all right so anyway so that's basically
a kind of an idea of the basic
architecture of what one of these Bottle
apps would look like uh you have bottle
which is basically right the web app you
have python which is basically the
intelligence you have static files uh
which is basically all the static files
again things that we talk static files
we got CSS is a static file images are a
static file videos are a static file
that type of thing uh then we have the
templates and then finally if you are
using databases uh so again a relational
database MySQL Maria DB a SQL like got a
class on that in a couple of weeks uh
you would also then have a database to
connect for that kind of
functionality so this is the basic
architecture and hopefully this will
make more sense as we go through the
class then the next thing to ask is uh
how do you put this thing into
production so uh so all you need to run
bottle is click the go button or python
three and access it and it'll start
running but is that how you would put it
in a production uh no no that's not what
you would do to throw it up on digital
ocean there's a lot of documentation out
there it's a bit of a pain in the ass uh
anyways one of the things that I would
say I did not put here should put here
is make sure you use a virtual
environment we haven't had the class on
Virtual environments yet anyway we'll
have that class creative virtual
environment if you're going to put this
into production uh you do get an option
of the Python web servers uh so again
things that you don't really realize
when you're dealing with python is there
are a lot of different python web
servers out there uh again D Jango has a
built-in web server that you're not
supposed to use there's a web server
called gunicorn which is a python web
server and basically what the python web
server is is a is a program that's
that's specifically used uh to be
optimized in order to to allow Python
scripts to be used in web apps right
anyways that's very good the issue
though is is if you just have the python
web server on its own you can run into
some bottleneck issues with uh with
users actually trying to access your app
now again it doesn't matter it does
depend on the load of your app so if
you're used getting one person every 10
minutes who that H carees but if
actually again you're going to be
creating something like a rest app it
might really matter and so that's why
you use inine x uh in front of it
something called a reverse proxy
server see how
see how this crap gets really
complicated really fast it's like hey
yeah bottle is so simple let me just
take the next half an hour to explain
all the stuff before we get to the
simple stuff anyway so basically uh when
you're look at it it you would have
bottle right so you have your bottle you
know you have your your little little
your your script that you created here
and that's going to be your web app
right that is going to have to go
through the python web server again
probably something like gunicorn uh so
bottle can use a number of different
types of web server again depending on
your par particular environment and what
you're using you can go in there and
modify it we're not dealing with that
crap today but you can uh then past that
you need to use something most likely
called engine X engine
X is what the cool kids use nowadays
instead of aache apparently aache is for
the old people engine X is what the new
kids use uh and basically what engine X
is use used for is something called
again it's called a reverse reverse
proxy server so what a proxy server
is anyways what proxy server is is if
you have a network where multiple people
need to be able to go out and access a
resource on the internet a proxy server
allows all of your users to go through
this one server to then go out to the
internet and get an access to something
nowaday web proxies if you go back 20
years and and literally back in 2000 was
the last time I dealt with a web proxy
in this way but anyways that that's the
idea right before n again there's
something called Network address
translation n that's built into every
router nowadays anyways before that we
have these things called web proxy
servers and so multiple users can
basically access some resource going
through that one server basically what a
reverse proxy server is is so when
people are coming in from the outside
world
the reverse proxy server is able to send
to theoretically to things like multiple
servers so let's say you had your web
app running on a cluster of servers
instead of a single server as users come
in the reverse proxy server will then
route to the different servers as need
be the important thing here is basically
with with in in within within engine X
is there is a lot of functionality for
basically being able to Route traffic
make make sure set are available on that
type of thing and so basically that's
why you General you would put engine X
in front of your bottle app and that's
kind of sort of why again we are not
going to deal with that today because
we're not going to be deploying crap to
the internet and that is its own barrel
of
stupidity that I don't have the brain
power for right now but I just want you
to know it exists if you're like wow
this is easy great go learn that stuff
uh let's see here the bottle
Basics uh so basically uh when we do
this uh again we're going to be uh uh
installing the module uh bottle uh using
pip uh and then from there uh we are
then going to pull we're going to import
different functions into our script to
allow us to do whatever it is that we
want to do at the end of the script
you're always going to do run so it's a
run function you're going to say host
equals and so generally when you do host
equals you're either going to put in
local host or 127.0.0.1
that is what is called the loopback
address for your computer so
basically when you're on the web browser
instead of going out to the Internet
it's just going to go to its own
internal IP address so that it's able to
to see whatever it's going to see so
again be Local Host 127.0.0.1 you then
have the port to the port is something
called a TCP Port transmission control
protocol Port uh normally you don't see
it right so if you go to um CNN.com
let's say you're actually going to
cnn.com Port 80 uh so basically uh when
you're dealing with tcpip you have
something called IP addresses so I don't
know
2655
24.1 right so this is the IP address the
IP address on its own doesn't actually
matter for much then there's something
called a subnet mask let's say 255.0.0.0
what the subnet mask does is it tells
you what part of the IP address is the
network address and what part of the IP
address is the computer address so if
you see 255s like this basically it
means this is the network address
everything here is the uh is the
computer address so knows basically
where to Route it uh and then you have
TCP ports and so where the TCP ports are
is this is for specific Services uh so
SMTP simple mail transfer protocol Oh
Lordy a port 25 I think it's Port 25 SSH
is Port
22 um SSL is that
443 uh HTTP for web traffic is the by
default Port 80 and so since it's by
default by Port 80 you don't have to put
in CNN.com toland 80 because it always
defaults a port an 80 so you simply put
in CNN.com to go to whatever web pay or
whatever you want well the thing is um
with most of these computers again
having Port 80 open getting traffic
directed to it it's probably a no no as
far as security is concerned and so what
they default to is generally a port
880 so again whether you're using bottle
or Dango or whatever else and you set up
a web server if it doesn't default Port
80 it'll default to port 8080 porty 8080
is a know TCP port for presenting uh web
pages web apps that type of thing it is
just simply not the default um and so
when you do this so you go uh host
equals Local Host
48080 what that means is when you go to
your computer and you typy tap type in
the address you will type in
127.0.0.1
so this is the loop back address this is
the IP address for your computer and
then you will do colon 8080
and that will be the full address to get
to your web app basically as long as
it's
running um let's see here uh one of the
big things uh is when you're doing this
is do make sure your script is running
again I know nobody is as stupid as me
but I can say as a stupid Tech
professional it's amazing how how many
times I forget to run my script so if
your script is not running nothing will
show up when you go here so do make sure
your script is running also do make sure
uh if you make any uh modifications to
your script right one of the problems
you can have when you're using VSS code
it's not really a problem but like right
now right this I have a script running I
don't I have some script running here's
the thing if I realize oh there's a
problem with this script and then I go
in and I start modifying the script and
then I go back to the web page uh to
take a look at what it looks like
whatever the hell it is
uh and nothing changes right I like wait
a minute I thought I changed things well
if you don't if you don't stop your
script and then restart your script um
basically it will not work right so you
have to stop and then restart again
whenn and doubt reboot or whatever the
equivalent is uh let's see here uh so
okay let's go and we take a look look at
this so this is our first teeny tiny
little hello world script uh so as again
python this is how python is you got to
import everything you don't import it it
don't exist from bottle import run so
the Run function is what's allow us
going to actually run this script and
Route so route is the function that
basically gives you the route gives you
those little pages to go to um what
you're going to do here is you're going
to notice it says at Route and so it's
at Route forward slash so basically this
just means the root so at R root now
whenever you see an at this is something
called a
decorator so this is a function right
Define index blah blah crappy function
whatever what decorators are is their
functions that essentially you can layer
on to the function that that you're
about to call so basically what I'm
going to say here is I want all of the
fun the functionality of the route
function added to this particular
function and then that gets me something
right so the route function whatever the
hell is in there that's basically again
the route how traffic gets routed how
the page is presented all of that kind
of stuff right so uh anytime you're
going to have a page you're going to
need an app route right so if I want to
do like about I would do slash about and
there would be route about would get you
to this
whatever uh then under that you actually
need to you need to have a function for
what you want to have happen so Define
function name as you would before uh
we're not put we're not sending any
variable values into this we do colon
message equals H1 hello world slh1 and
then we're going to return message so
with this function when we return it is
going to get returned to the web browser
not to you know the command line or
whatever uh so basically if I hit run
now so as long as it's working as long
as it's working you should see something
like this listening on HTTP Local Host
colon 880 uh you can actually go here
and you should be able to hit command
and this and so now we can see so this
is my web browser right this my normal
Safari right so there's YouTube there's
GitHub whatever else uh so I don't know
if you can see it from here but Local
Host colon 8080 nothing else because
this is the road directory and we have
Hello
World yay you just made a web app um
again how this routing
works is I can do this so if I want to
contrl C let me shut this down for a
second um I can do contrl V and then I
can say about so if I want to create an
about
page I can say about and I can say in
the about page I can say I
am so
cool because I mean that's obvious right
why you want to learn from Eli the
computer guy man because he's cool
anyways uh so make make sure to save
command s so I save so we run this we go
to 8080
okay so we have hello world so this is
going to my root right and that gives me
my Hello World now all I do is I do the
forward slab and so you notice there's
no about. HTM HTM there's no about.php
it's just
about and it says I am so cool and so
basically if you're just going to simply
be creating a web page with this system
you know it's this but more complicated
add a lot more CSS
and a lot more information and you can
create your index and your about and
your contact us and all of that kind of
thing and that is through again this
very simple basically using the route so
at Route this is a decorator this is
root and so root will give us hello
world at Route at Route slab we create a
function for about and it says I am so
cool and it returns that you can then
just multiply this out to however many
pages you want in your your web uh your
website or whatever else for that that
basic
functionality is everybody following
along at this point hands if anybody's
lost uh got a thumb up or yeah okay so
thumb up we'll keep going okay so the
next thing is I do need to get better I
keep getting lost uh that's the bottle
Basics uh then we get to Dynamic routes
right so that's called a static route in
the bottle world now we get to Dynamic
routes the cool thing is with Dynamic
routes is you can actually give your
bottle web application information
directly through the URL it's kind of
like a git but not really uh basically
uh you can do slash uh and then value
and what a value is right so string so
name whatever else uh there are filters
that you can put in there so by default
the value that you're going to put in is
going to be a string so again we talk
about data types data types are strings
ins floats Bulls blobs lots of different
stuff anyways basically by default the
data type is going to be string you can
put in for INT you can't put in for
float you can't put something in for
path or filter um you know it's a GU
it's a guide It's a guide it's kind of
like tells bottle what it's supposed to
be and then bottle just does what it's
got to do because that's the thing like
when you're dealing with data types data
types are important especially with
databases making sure again garbage and
garbage out if you ask for somebody's
age and they give you Bob that's G to
cause you problems the issue with some
of these things is they'll ask for that
kind of thing and how how strict the
language is for data types is you know
it can be a bit wonky and that's how B
this uh anyways let's go to model
values um and we have this script uh so
this is pretty simple right so from
bottle import run for us to be able to
run and a route so that we have a route
that's all we need to do here then it
created two functions or basically two
routes just to kind of show you how this
works so at Route slame so we have to go
to Route slash name and then slash and I
can put in a name 10 or Bob or
Suzanne then we're going to define a
function so Define the index function
now this is important thing right we're
bringing in a variable value from that
URL and so in order for our function to
be able to use it we actually have to
input into the function so basically
name here is name here so we're going
bring in name and we put it here so
message equals F string H1 hello the
value for name and then we return it
right so if we go to slash name slash
name slash Tim it'll say hello Tim and
that'll simply get returned then to show
you how multiple values can be sent is
at Route name slash again you have these
little arrow things so these Arrow
things are important so this is what
says that this is a value that is going
right so era thing name slash and then
we do uh forward slash here we do Arrow
then age so the name of the value is
going to be age and we're going to do a
filter called for in so supposedly it's
G to be an INT who knows you're actually
got to get anyways uh then we're going
to do namore age function name is g to
be a value that comes in age is going to
be a value that comes in so you going to
say hello Tim you are 18 years old and
that is going to get returned to us so
if we go here and I run this thing uh I
go to command and um I bring this up now
notice I bring this script up so every
script is different so I'm only running
this particular script now and in this
particular script I didn't put anything
in for the root so when it goes to root
it's going to give me a not found
because it's not found because I don't
have a path right or I don't have a
route I suppose so I can go up here I
can do slash I can do name I can do
slash let say Bobby and then I hit enter
and so it says hello Bobby
right if we go and take a look at this
so we have name so slash name and the
actual name we send that name to this
function we print that name out there
and that is where we get hello Bobby
right if we go here again we want to do
more let's say Timmy and we want Timmy
to be 18 so I know you probably can't
see it but follow here so it's Local
Host col 880n name Timmy
sl8 and then it's going to say hello
Timmy you are 18 years old um I do
believe if I make this a
float oh no it failed okay it did cause
an error so you put in 18.9 it causes an
error so anyways but anyways that's uh
what you can do and basically with this
again so you can send name
name and then age we're gonna have it be
an an so anyways uh jock
stoud what's
up
so
a um I might have missed it when you
explained it
but you don't have to put the name or
the age in the actual code for it to
come up as it in the in the web browser
I'm I'm because you're making a dynamic
we're making a dynamic
y
so but you still have to put it in the
URL in a sense to get it to function
that way and that's because of the route
s asking the question right like how is
it becoming dynamic as opposed to you
don't have to put in a
script so this is a dynamic route
because you're putting in information
that is going to be sent to the function
for the function to do something
with so so slash name so slash name is
just whatever slash and then this is
saying I want a variable uh variable
name called name and so there's gonna be
a value here and then I want a variable
name called age and that value is going
to be here so I do name Tim 19 10 is
going to come here 19 is going to come
here and then that now we have name
that's going to be able to be be able to
be used in the function and age is going
to be able to be used in the
function oops don't mute
yourself while we're asking questions
make sure to keep yourself unmuted
because I have to unmute you every time
anyways does that make
sense if we go over another example I
think I'll get it it's just like you're
just making so when you put it in and
they put it is this something you're
putting in or you like your host is
putting in like when you say name AG in
well no so here let me show you so I can
do like this so route all I'm going to
do here is let's
say
message and
then
message and um then we're just going to
return message equals message that's
messy anyways that should work though
okay so let me make sure this
works this might not work
oops hello so PRS up thank God okay so
basically what we're doing here right so
this is the simplest this is actually I
don't even need that
really this is the simplest so at Route
so we right we have the root then I'm
going to create a variable name for this
this Dynamic route called message so
basically slash and then whatever I put
in here that is going to get passed to
this function as a variable name message
once it's in this function I can do
whatever with whatever I want with it I
can put it into a database I can do a
rest API call whatever it's is now a a
python variable value all I'm doing here
is I'm just simply returning it and so
basically this this is how you can pass
values with bottle through the URL
basically to the underlying uh python
functions so that you can do something
with
it so you're using
URL is making a URL like a I guess a
tunnel or two where that you can pass
information through so like you said can
go to a database and go to a website and
go to an
API
Ur yeah so like where you'll see this a
lot is something called content
Management Systems uh so if you go to
New York Times or whatever you'll see
like slash and then maybe like a uh oh
like a post ID or something like that
and so what's happening is that post ID
is being sent to the
backend programming language that
backend language is then going to the
database saying give me all the
information for this post ID bringing
that back right dynamically writing the
HTML document for you and then sending
it to you
slowly get it slowly get it thank you
yeah yeah that's all yeah again that's
the whole thing with tech again that's
one of the things with siloc cond Dojo
like one of the most important things
with this whole concept is that we're
going to be doing a lot of classes again
my life has just been chaotic for the
past month um but part of it is just the
idea is that you keep coming and then
you slowly grasp the concept of what's
going on again it's uh again I did
martial arts for years and years and
years and years
um and it's the idea of every every day
you come into class and the instructor
you're like you you go to hit something
and the start's like no this and then
you go okay and then like the next week
he's like no no this and then like they
keep doing it for like a year
and you're like and like one day you
just like hit the bat and it's just and
you're like oh that's how I hit
something right anyway that's basically
the idea with this is that uh you guys
will slowly slowly slowly build up the
information for hopefully all this makes
sense any more questions no um okay um
so that is what is called Dynamic routes
and where the hell is my
U there we go uh those are Dynamic
routes um then we can do redirects um so
redirects they're just I don't know
they're just redirects basically uh
somebody comes to your web page and then
you can redirect them somewhere else uh
so I'd say this is great for security so
we talked about this so we did the class
on rest apis before where I can take
your IP address then based off of your
IP address I can see where you're from
what country you're from what state
you're from what city you're from and so
one of the things you can do if you want
to protect your website from those darn
you know Zimbabwean
hackers um I always say Zimbabwean
because if you say Chinese they get all
mad the zimbabweans are like thank you
somebody noticed us anyways the zimb in
hackers are trying to get at your site
one of the things you could do is you
could detect obviously you grab your IP
address you can see that they're coming
from Zimbabwe and then you can simply
redirect them to
cnn.com you're like oh don't hack my
site go hack CNN.com anyways basically
just redirects you uh to another web
page uh bottle
redirect um and this is all it is right
uh so again every single function you're
going to have to import so if you're
doing something and it doesn't work most
likely you forgot to import the function
from bottle import run import route
import redirect right rout is just the
forward slash so root Define index site
equals HTTP
CNN.com and redirect to the site so
basically all that's going to happen is
when you come here it is going to
redirect you directly to cnn.com and
again this could be much more
complicated you got to have a lot of P
Python Programming in here uh so if I
run this and
then I do not know why I have this
terminal
open okay so um so I run this I go to
Local Host colon 8080 rout and that will
then take me to
cnn.com that's one of the
functionalities it exists uh again there
is not much to this and uh uh you could
use this you know if you if you have a
database of different sites so again
imagine for your company you want to
create a database um that contains
important information again um uh stack
Overflow let's say stack Overflow has
different things that might be relevant
to your particular users you could
simply come up with a whole list of the
different URLs there and then you could
have those within your your own database
somebody could do a search when they
click on something they could then just
be Auto
redirected to stack Overflow that type
of deal anyways it's a redirect not much
to say uh jock
yep if you build a website this happened
to me and someone hacks your site they
just put this little piece of code in
direct them to their website say FR you
put a like a really standard HTML
website yep can hack
your necessarily can hack your server
but just put this little piece of code
in to wherever and so it directs whoever
goes to your url it directs it to their
site without changing your url
really see the
question saying not really yeah I get it
that's that's kind of let's do that as
an after
class okay that's the yeah hackers can
get in and again they can redirect
that's why security security matters on
your servers um but that's that's a
whole different headers and all that
kind of stuff uh let's see see here um
okay so that's basically all there is to
redirect uh then post uh post is going
to be one of the most valuable things
for you again when you look at most web
apps that are valuable one of the things
that you're going to find to be kind of
humorous is that they're dirt simple
right uh when people look at programming
right they look at like the metaverse
crap they look at what apple is doing
with spatial operating systems or
whatever they're like wow wow that's
where the real money and technology is
uh let me tell you the real money and
technology is just crappy database
applications put in data pull out data
yay right something that's customized to
the users uh so anyways that's where
post is valuable uh basically it's
function or it's a utility tool whatever
uh for HTML so basically with an HTML
form uh you can use something called a
method called post and basically people
can plug information into a form they
hits the submit button and then all that
information is then sent to a script
somewhere and the values are pulled out
and then you're able to do what you want
with it right so if you're dealing with
a CRM solution a customer relationship
management solution basically somebody
uh you put in all the information that
then gets dumped into a database and
then maybe the sales agents get access
to that information and then they can
make um have conversations with people
later right if if you want to do a note
taking app so one of the labs we're
going to be doing today is a notetaking
app basically all that is is an HTML
form you plug some information into the
HTML form you hit submit that will then
be written directly to a text file
that's a data store that we're using
today uh so that you can access it later
right so basically we're talking about
post this is simply just going to be an
HTML form right uh processes HTML uh
from bottle import post you're always
going to need to do Post there is a
decorator for post and then when we want
the value and I'll show you this in the
function itself is you're going to do
request.
forms. so there's something called git
so when you're sending information over
web pages there's a post and a get post
kind of does it invisibly git does it
within the URL
itself request. forms. git gets the
value from a post request uh for
request. query.
that is for a get request I'll show you
that stuff in a second anyway so let's
go to the bottle
post bottle
post so this is a little bit longer but
not really that big a deal right
so yeah okay so uh from bottle import
run post and
request so we're going to have our
normal route so our normal route
basically what we're going to do is we
are simply going to create an HTML form
so we had an HTML class before HTML is
is dirt simple don't worry uh so at
Route basically the index Define index
function the form so we're going to
create this form so it's just an HTML
form form action equals
slpress so we're going to be sending
this to to process right so that that
has to correspond somewhere in this mess
uh so we're going to send the action to
process method equals post so you'll
notice I open this with triple single
quotation marks and close the triple
single quotation marks allows me to do
this on multiple lines I use single
quotation marks here because ins theide
I'm dealing with HTML and I have to use
double double quotation marks in here
for these different values so again you
can do double quotation marks on the
outside and single quotation marks on
the inside or single quotation marks on
the outside and double quotation marks
on the inside
one or the other can't use both at the
same kind any so form actions process
method equals post we're going to have
name input type equals text so this is
just simply the the type of information
that's coming
in and name equals name so this is going
to be the the basically the identifier
for how we get the information in the
the process script we're going to break
this breaks to a new line in HTML and
we're going to input type equals submit
so we're gonna have name and a text box
and then we're gonna have a synit button
and then we're going to close the form
then we're gonna have page so page
equals we use F string and so we do H1
web app so this could be like the header
and then we put in form so form is here
and then we're going to return the
entire page then we simply come down
here to process so whatever you put into
that form it's going to get sent to
process so here we're going to use post
so this is a decorator so the app post
decorator
uh we're going to do
slpress Define index process for the
function name equals
request. forms since this is post doget
and this is simply the identifier so we
called it name here because we called it
name here in order to get the access to
it we have to call it name down here we
can name this whatever we want this is
how we identify it and then we're simply
going to print out the the message is
then going to be message equals F string
hello whatever the name is that came in
and then we're going to return message
yay we're going to run Local Host at or
a so if we run
this I do
command so we have web app name text box
submit I plug in Bob I hit
submit hello Bop and so again could be
much more complicated again you could
take that information send it off to a
database do whatever the hell it is that
you want to do but this just shows you
all you have to do in order to use a
post is basically you create the uh the
the HTML form you send the action has to
be to whatever name you call it we then
use the at poost decorator for that name
and then in order to get access to those
values coming in it's request. forms.
game and you'll notice here right when
we sent values using Dynamic
um oh how do I call them Dynamic filters
dynamic dynamic routes there we go when
we we used Dynamic routes in order to
send values we had to put the variable
names in here so the function could
access it when we're sending posts we
don't have to do that we're simply
getting it from this the request. forms.
and then we pull the name value
does that make sense everybody on
board
cool um let's see here uh then we have
git right so git basically what this
does is you process information through
the URL right so if you go to the if
you're looking in your web browser and
you're doing things on different kind of
web applications websites especially
like uh oh Amazon that type of thing
what you'll notice is up in the URL
it'll start to add information to that
URL and that's how it's actually sending
values to the underlying web app is
through git um it's a very simple way of
being able to send information it's also
a very insecure way of doing it so
whether or not you want to do it uh from
bottle import git so we did imported
post before so for this we have to
import G basically uh when you use get
so it's a right so if you have a
hyperlink a and then at the end at the
end of the page that that you're sending
the information to you do question mark
that basically says you're going to
start sending uh values uh then you say
what the variable name is so here we're
going to say color equals red so
basically what we're going to say what
we're doing here is to the web app we're
sending the variable name of color and
the value of red to it and then we're
going to pull that
information so we use the atg decorator
and then for this so color is going to
equal request. query so before it was
form it's query. get and then the color
value coming in if we do bottle
get this is what we have uh so here uh
I'm showing you you can actually use uh
multiple decorators for the exact same
function so we have the route decorator
and we have the git decorator so we're
going to send a git value here so
anyways from bottle import Run route get
and request app route so the route for
the route is going to be this basically
it's going to print this stuff out on
the screen we're also going to use the
git decorator for the exact same route
Define index so color will equal
request. query. color so whatever value
comes in color red color green color
yellow these are hyperlinks right so
form so basically it's just form
information a hyperlink
a this is the route question mark color
equals red and we're simply going to put
red so that you see that color equals
green green color equals yellow yellow
we're going to come down here so page
equals so we're GNA say it's web app so
just going web app at the top is a title
body style so body is information for
the entire page so when you're dealing
with HML tags it's the entire page and
using CSS so style is going to equal
background color background hyphen color
colon and then whatever value has come
in so again red green yellow we're
getting that value here we're assigning
it to this variable name here and then
we're pulling it in here uh then we have
form so that form that we created this
is going to get dumped in here and we're
going to close the body we're then going
to return the page run local Local Host
port 8080 so we run
this and we do this all right so we
first do this I haven't done anything
yet so the background color is just the
default background color so we have web
app so this kind of like the header and
then this is the form red green yellow
uh if we go and we take a look at the
page
Source again we can see a question mark
color equals red red question mark color
equals green color equals yellow right
and so since we now can send the values
if I click on
red come on
now I click on red there you
go right so the background color so the
background color is the value that came
in through the git so if you can see up
here slash question color equals red and
so now the background color is red if we
click on green now the background color
color equals green background color is
green yellow again color equals yellow
background color is yellow and so that's
how you can send values um to your uh
your bottle web app using git uh and
again like I say with most of this uh it
is relatively simple and again you could
do much more complicated things
obviously going in the future uh let's
see
here uh then we have templates uh we're
not going to go a lot into templates
today because they're paning the ass
again they've actually got their own
template language when I talk about
template
language that is where we talk about
this uh so if you take a look at this
and you're going to notice it looks
different than other things that we've
done and that's because it is different
than other things we've done the other
thing to realize too is with template
languages uh the template languages are
different uh so when I use Jango Jango
has a specific template language that
isn't this it's not this bottle is using
this particular template language and so
again it's one of that's one of the big
things when you're learning technology
is um you know you can know you can know
what you want to do you can understand
the basic concept I want to do an if
statement figuring out the syntax of how
to do the if statement uh can be a pain
in
the uh so anyways uh so from a bottle
you're going to import template for the
template function you're then going to
create a views folder in your root
directory so
generally generally your root directory
is going to be your user directory right
so if we go here I click on finder I
click on Eli so Eli is my user root
directory you can have see I have a
views folder here and in that views
folder I have two template files TPL
files so basically this the views folder
for templates by default needs to be in
your root directory generally that
should be your user root directory but
depending on your computer who the hell
knows um let's see here the template
files in with. TPL uh basically they
allow you to create uh Dynamic web pages
relatively easily again you can create
very complicated things um you do return
template whatever the value is and then
if you want to send variables to the
template basically you do like name
equals name so variable name equals
whatever values that you're going to be
sending uh let me show you with these
two things okay
so here is the bottle script so from
bottle import run R and template uh the
first template that we're going to do is
simply a hello template so this is going
to a static template so the hello
template is simply this just basic good
old HTML H1 hello world P this is a
template P templates are HTML files that
you can add variable values to right uh
so basically if I run
this and we go
here the route was
hello and so this is simply the template
that I get so this can be a lot easier
too again one of the things you have to
be thinking about whenever you're
designing your web applications is where
do you want to write out all the
information right do you want all of the
information to be in that single like
web app file the the bottle file that
you're creating or would you like that
information to be in things like the
template files that's one of the things
you have to think about uh but anyways
so this way you can create this whole
little HTML document and it's its own
file separate from that main file that
we've been creating again basically
hello world this is a template whatever
basically simple
stuff uh we can come down here uh and we
can send um variable names uh to a
template uh so we're going to have that
that Dynamic route that we're talking
about before so Pat route we're going to
do slash hello hyen
VAR slash name right so whatever your
name is we're going to Define hellcore
VAR the name is going come in then we're
going to return a template hello VAR
template name equals name so
basically this is the variable name that
we're going to access in the template
and this is the information we're
sending that variable name so it's
important to understand here you can
send um you can send dictionaries you
can send lists you can use send sets you
can send multiple uh variables uh to to
your template we're just using name here
so so basically name is going to come in
name is going to go here name is going
to go here and then name is going to get
accessed on the template if we take a
look at this particular template again
this is where we have that template
language hello hello squiggly squiggle
name so basically that that variable
name so the value will be here and then
close the H1 if name equals
Bob H1 name value is awesome Bob is
awesome
else name is not as cool as Bob which
everybody understands and then you have
to do n this is a pain in the ass uh so
all the templ languages I've seen maybe
there's some out there that don't have
it you actually have to end the code
blocks if you don't put an end of some
type here everything goes to hell so you
open the code block with the if and you
got to close it with the end again we're
not going to go a lot this is about all
we're going into today because it's
disaster to get into
but just if things aren't working right
for you make sure you close the code
block uh so we go back and we do
this
okay uh hello VAR template um so okay so
slash
hello underscore VAR underscore
template slash
Timmy oops no that was wrong uh hello
bar oh get too smart for your own good
uh okay so hello corv
Timmy hello oh not underscore oh golly
been a long day hello hyen
VAR
Timmy there we go thank God
hello Timmy Timmy is not as cool as Bob
which is OB if I go here and
instead I put in
Bob hello Bob Bob is awesome and so that
kind of processing is happening at the
template and the Curious Thing here too
is we go to page Source what you'll
notice is none of that template
information is being sent to the end
user again that's one of things you have
to be thinking about is with security
like when you're dealing with CSS when
you're dealing with JavaScript a lot of
things all the all the information all
the data gets sent to the web browser
and the web browser actually processes
it which means if somebody does open
source they can see all of the
information on the back end uh so one of
the nice things like with these template
files and all of this is this web
browser is only receiving the
information that we're actually sending
to
it uh
um okay
everybody basically understand template
files we're getting close to the end
don't
worry so those are template files um and
then we have static files and so static
files are complete pan in the ass these
web apps because again you don't have a
normal file and folder structure like
you do with Apache or engine X again if
you have Apache or you have engine X and
you would embed a um an h a a an image
image you know a JPEG or a PNG you just
literally embed it that's it uh with
static files uh in Bottle or any of
these other python web app Frameworks uh
you actually have to to write a little
bit of code so that's able to present uh
those files uh to the user uh any static
files such as images or css stylesheets
so that's gonna be an important thing
again you don't think about stylesheets
but stylesheets are files and so if you
don't ship them off to the end user your
thing's going to be ugly as hell so
you're going to need to to use static
files for that uh for security file
server should be separate from the web
server again should be this is one of
the big things to be thinking about as
far as security is concerned one of the
things that I hate is brand new college
graduates that come out and start
yipping about security all the time one
of the things you have to be thinking
about what security is again you have to
be thinking about the actual use case if
I am simply building some kind of
administrative tool on my system to do
something my security considerations are
a hell of a lot lower than if I have you
know a rest API that you know I'm going
to get 10,000 visitors per hour right
those are two different security
scenarios so the static uh files should
be somewhere else again use some common
sense with this you do have to be
careful about file and folder
permissions again we start talking about
that Tech stack uh
if if you have the folder or the files
locked down using NTFS permissions in
Windows or Linux permissions on a Linux
box right if if nobody has access to the
file they're not going to get access to
the file if it's locked down from the
operating system level hopefully by
default this should be accessible
especially from your particular computer
but that is something to think about
like that's that's one of the issues
where you know you get into the problem
of it works on my computer so I build my
app and I'm sitting like at the server
and everything pops up fine I'm like the
app works fine and then my users the app
doesn't work if you get get that
issue well then it means the code's
working Python's working bottle's
working right because when you're at
your server and you pull up the app
everything works perfectly that means
the script is working perfectly if your
users are not getting the CSS they're
not getting the images they're not
getting those static files generally
what that means is that there's a
permissions issue so that when the
server tries to present those files to
the end users it's not allowed to at the
operating system level and that's a
problem that you're running
into uh when you do this again if it's
going to be on your system you create a
static folder again in your rout
directory Again by default standard you
can put it other places but that's a
different class uh so you'll notice
again Eli is is my root directory I have
a static folder and in my static folder
I don't know if you can see that
actually yeah I can I have a PNG image
uh so that I can present that and I have
a stylesheet for the lab that we're
going to be doing and so that is in my
static
folder um so we go to bottle static to
show you how this
works
stack okay again pretty simple here uh
so from bottle and Port Run route and
static file so again there's a function
for static files route again we're
simply doing the root directory uh file
equals so file that we're going to be
embedding here is a image.png that will
be for an image uh we're going to do the
page so link uh relative so this is
where we do the style sheet so link well
Styles sheet type text CSS ref
this is just word wrap so ref equals SL
static so it's going to be the static
folder SL style.css so it's going to be
the style.css file in the static folder
we open the body uh H1 static file so
just has a picture of static file uh ing
style equals height uh 300 pixels width
equals Auto SRC equals SL static so the
static folder and then whatever the file
name is so this is where if you're
processing through and you're going to
do an image gallery you would do a loop
to create all of these and then P this
is an embedded uh picture we close the
body we return the entire page now on
top of that though where we've created
this static this static path right it's
a dynamic path again because we've got
the uh the image name there so we do
here is we do at Route so it's a route
slash
static uh we do file Name colon path so
that filter I was talking about before
filter again an in float it's a string
filter we're going to do a filter for
path so the file name we're going to
create a function called send static so
this can be whatever you want it to be
the file name is gonna be put into here
we're going to print um the file name
out that's just going to print out on
the screen so I know what's happening
and then we're going to return static
file so that static file function
function the file name that came in and
then we basically have to say where the
root of it is so uh period SL static
slash so that's the root and so that's
what should present this image to us if
we just take a look at the stylesheet
just you can see what the stylist sheet
is body the background color is bisque
just to give you a color uh and H1 the
color is red so everything in the H1 tag
will be red uh so if everything works
out right uh static file should be red
it should be a bisque background color
and we have should have a 300 pixel by
an auto uh picture come up uh so we do
this we run
this and we go there we go we get bis in
the background we get static file
because that's a CSS we get our nice
little you know Orcs And Space Marines
and bunnies I just love this picture
personally and then this is an embedded
image so the reason we can have the CSS
and the reason we can have this image
here is because we set up that static
file and basically all it is is you
create a static folder in your root
directory then you do an at Route static
file Name colon path you create your
function you name your function the
important thing is that the file name
comes in and then you do return so this
is the static file function that we
imported up here and and we simply do
whatever the file name is and then root
so basically root will be where that
static folder is so period SL static
slash then hopefully it should work out
for me and
that is a lot of information that's a
lot of information uh so that's a class
so before we get to the
labs um Andy Fontaine just showed
up W Andy Fontaine is an hour and a half
late as Andy comes in and says what did
I miss a lot you missed a lot anyways
that's the basic idea of what we're
dealing with bottle again we're going to
actually be using bottle a lot for the
projects going forward because this
allows us again to be able to create
apps that look more like what you're
going to think apps should look like and
the other nice thing about this is you
can actually create apps you can
actually create tools that really will
be valuable for you in the real world
even again if they're are little
simplistic are there any
questions on what we've talked about
today and then we'll get to the labs
I'll tell you what the labs are
jock
yes we're applying a lot this is just my
interpretation of the of the language
we're creating a lot of this on
a on a computer can these be applied to
to mobile as well or is that something
totally different because when we say
apps I'm always thinking like apps on
your phone lot of the functionality
we're doing here will it transfer to a
mobile application or is that totally
different and I just need to learn this
first and then move on to something like
that so this is a web application so
again this Local Host again a whole
different world if you understand what
DNS is right so if you have an internet
uh accessible IP address
anything with a web browser will be able
to access this at that IP address so if
you had DNS so if I want to do like
crappy
app.com and point it to this and this is
running then you could pull this up on
your smartphone so you can use this on
your smart this this is this is web web
app right and that's where there's
something called responsive uh
development what response development is
is where you actually design the app
based off of the screen size that's its
own world different world uh so yes so
can you use this on a mobile device yes
are you talking about an actual IOS app
or Android app so what we call a native
app no this is not a native app there's
a different framework I mean I wouldn't
use Python for creating native apps but
you can we might teach it because it
works sort of but that that's a
different framework so this is simply
for web
browsers thank you
any other questions before we get into
the
labs you need to make CSS files that are
responsive for mobile so it looks good
on a phone
screen oh you
need everybody likes to say what you
need to do
it what resources do I have tell me what
resources I have will tell you what I
need to do anyways yes but there is
something called responsive web design
again very big topic not getting it
today that's
that's another issue uh okay so if there
are any other questions uh we will take
a look at the lab so basically we have a
simple lab today uh so the most simple
lab you can just do this one and then
walk away and be like I built a built a
simple app basically it's a hello world
it's just you get it running you make
sure that it works and you go away uh
then we have a a note taking app uh so
basically with this note taking app what
we're going to do is we're going to
create an HTML form that HTML form is
for note taking you're going to submit
the information it's going to be sent to
a CSV file so we're going to use a text
file as that was it's called our data
store uh and then what we're also going
to do is we're going to pull uh the
records out of that CSV file and print
them onto the screen and then we have a
ping lab that's what I was kind of
showing you in the beginning of the
class uh basically what you're going to
do is you're going to put in uh what
host you want to Ping CNN.com
192.168.1.1 whatever uh and then how
often so however however many seconds
you want to do the Ping uh and then that
will be used uh for Network testing uh
purposes um I do like Network testing
you will notice in my classes we're
going to do a crap done ton of network
testing apps and the reason I like
Network testing apps is because it's one
of the easiest things that you can do
that has actual U ility and you get
Dynamic information from right that's
one of the problems you get into like
when you're doing programming so you're
doing IFL statements how do you how do
you get Dynamic data coming in in a
realistic fashion it can be hard right
because if systems are doing what the
hell they're supposed to
do right so anyways the nice thing about
uh doing networking type apps is that
again whether it's whether it's latency
right Network stuff just always does
weird crap just on its own and so it's
good stuff to test off of so that's why
we're always going to be doing a lot of
network testy type apps okay so lab.
simple uh so this is our simple lab uh
so let me just run it let me run it so
you can see how simple this lab
is here is our Simple app y create a web
app web page this is my very simple web
page geek's first web app and basic
basically the value of this is you just
make sure you vaguely understand what
the hell is going so anyways uh again so
you have to install the bottle module on
your system Python 3 space hyphen M uh
space pip space install space bottle
basically inst installing so from bottle
you're going import run and import route
at Route rout Define the index page
again triple quotation marks just so we
can put this on multiple lines H1 web
page P this is a very simple web page we
close the three quotation marks we're
going to return the web page we're going
to run it at the local host at Port 880
and there you go uh so you can use this
to play around again if you're still
trying to figure out the whole route
thing create multiple routes create an
about route create a contact route plug
different information in there so that's
that one uh the next one is our note
taking app which is slightly more
complicated so let me run
this we're going to go to Local Host at
Port 880
again cause an
error oh access where is not associated
with a
value oh what's going on line
30 data. HTML
for record try
accept the that should have
worked God damn it
try try with
open oh wait a
minute hold
on anyway you're getting beta classes
you're getting beta
classes there we go uh I made a mistake
there with the accept
um but just you know so we talked about
try except before just so you understand
what's going on here so what we're going
to try to do is you're going to try to
open notey app. txt file as read and
we're going to do a lot of stuff now the
first time you run this script this file
isn't going to exist yet or there might
be another issue so anyways so we do an
accept down here where dataor HTML
equals nothing so we're going to
basically do an F string here where we
concatenate the form with the HTML so
we're have form at the top and all the
notes down below and so if for some
reason it can't open up the note. txt
file that this value should be blank I
goofed up should be data
underscore recording in
progress
oops hello
oh where did I drop
off I do hate spec Spectrum spectrum is
an interesting thing you're
back you're back yes yes three minutes
ago God damn
it okay
so I had a problem I had an issue I
fixed it uh the issue was using this a
try accept statement so we just go over
this real quick again so what what try
try accept does in the python world is
when you try to do an action uh let's
say make it rest API call send the
command to the OS open a file right one
of the things you have to think about is
what happens if it fails right and so
anyways so with this particular script
uh it's a notetaking app so with the top
of it uh you're just going to have a
little HTML form to add a
note uh and then below that we're going
to have all the previous notes but one
of the things I think about is what
happens the first time you run this
script the first time you run this
script if you try to open this file it's
not going to exist because you've never
run the script before so anyways so try
basically to open this particular file
and do stuff with it and then except if
you can't open this file then the data.
HTML this variable we're going to use in
the future just basically make it blank
so that we can keep going along so this
kind of like why you do a try accept
statement uh so anyways let me run this
thing I can see how it
works note taking app okay so we have no
notes so let's say a title for a note
and a note let's see uh class
note just show try
except
statements and then I can hit submit all
right so put the note here and then it
automatically comes here class notes now
let's say I want to add a new note I say
new
note this is a new note and I hit
submit and so uh this is also doing
chronologically so the newest one is
first old one so on and so forth so if I
do another
one
submit is there that's actually
important right so anyways so this is
showing you so this this is a full FL
again Local Host 8080 this is an actual
web app that is actually running you
could use this for a crappy ass Journal
script or whatever else uh Jack what's
up you're not you're creating new notes
every time but you're not rewriting
because you have the r there on the
original note like you have so say for
instance you want to add to new note
you're not you have to constantly just
create new notes you're not rewriting
one of those note
sections let me explain the code I'll
explain the code then you'll understand
we all got that part yet okay yep okay
so so this is basically this right but
one of the things I do want you to
notice here is this right so I said CSV
file and when I say CSV file means comma
separated value file so basically we're
we're inputting records onto each line
right so we're going to read through
each line of this text file and each
line is going basically going to be a
value for an index right index zero will
be the first line Second Line right so
those are the entire record and then we
talk about CSV file what a CSV file is
is that then each value in the record is
separated by
commas one of the things you have to
think about is most of the time your
systems are going to crash not because
of Zimbabwe and hackers but because
users do something you're not expecting
and so if you actually use comma
separated values you use commas as a
separator and you're doing something
like a notetaking app where somebody
might put commas in just on their own
what happens basically here there's
supposed to be two values there's
supposed to be a title value and a note
value title separator of some sort value
so you actually do comma title comma
uh what note what happens if people put
multiple commas into that note instead
of having two index values index zero
and index one that's already easy to
deal with you might have 10 index values
and it becomes a disaster so anyway the
separator we actually use in here
although we call it a CSV I just use the
two bars because nobody puts two bars
into anything hopefully but anyways uh
let me just kind of show you how that
works
okay so from bottle import Run route
request redirect and post starts to get
a little
long uh route route for root Define
index so we're going to have the form
new note break form action slpress
method equals post title so it's a text
box and the name is going to be title
break note it's going to be a text box
box and the name is going to be note you
might want to make that a text area
again that's just HTML forms uh then
we're going to do an input type equal
submit for the submit button uh and then
we're going to do slash form um and
that's going to close the form so this
is going to be the form
itself then we're going to come down
here to our little TR state so we're
going to do is we're going to try to
open the noten app. txt file in the mode
of read so that we can get all of those
those records all those note records s
from so with open right as file data
equals file. read lines so if you do
read it'll read everything in as a
string and that's a mess if you do read
lines basically what that does is it
turns every uh line in that file into a
value for the index index zero index one
index two for a list so data is now
going to be a list with all these in
there uh dataor HTML is going to
equal blank so we're going to create
this uh so that we can basically
create data HTML is gon to end up being
this information right
here okay so for record in data so for
each index in data value equals record
dosit uh bar bar
anyways the thing over the backslash
basically that's just a separator
right anyways uh data HTML F string so
we're gonna do strong so this gonna be
for the title so strong means bold so
value zero will be the title make that
strong value one is going to be the rest
of the note right so the record comes in
so the record comes in is the line title
is at the end IND zero note is at index
one
title note then at the end of it we're
going to add whatever has been in data
HTML before so when we first run this
it'll be blank and then basically as we
Loop through we're going to build up
that data do dataor HTML variable value
with all of this HTML in there HR is for
the line the line that goes across is
HR if uh for some reason basically file
cannot be open dataor HTML is simply
going to be blank page equals form so
the form that we created with all of
those records
underneath so the form here we're going
to send this to
process and now this is where we have
the post for process so we use the post
decorator for process route Define
process title equals request. forms
doget tile so the title name is a post
so we use forms no equals request forms.
getet note right so with open notey app.
txta for a pend this adds to the end as
file file. right F string so the value
for title barbar bar the value for Note
slash next line so it's going put the
title with the with bar bar with the
note and then it'll go to the next line
and then once it has written to here
it's appended we are then going to
redirect back to the original uh file
original route and so that is what's
going to bring us back here so we can
put a new node in we hit submit that
information is send mitted to that
process script that process script
processes it sends it into this this
text file and then redirects back here
if we go and we take a look at the text
file now again we go to Eli uh again
this will this will be written to your
default your root directory by default
um we can simply open this with Visual
Studio code and you can start to get the
idea right so class Note bar bar so
that's a separator just show triep
statements slash in for next line new
node barar this is a new note next
line bar bar comma comma null next line
right and so this is kind of one of
those things you need to be thinking
about is like with separators and all
that is making sure again if you
actually do comma separated
values it might turn into a damn
disaster when you actually go try to
process the information kind of one of
those things uh to
ponder uh let's see here um and then the
final
one is the lab
ping lab ping where is my lab ping
there's my La ping
okay so with this we're going to use um
the OS
module too so we're actually going to be
U using our operating system to actually
be able to Ping and that's one of the
things to be thinking about again when
we start building um these uh these
python projects the big thing with
python is you can access all of these
different resources you can use Python
you can use bottle you can access apis
you can access the operating system so
we're going to basically be using the
operating system in order to run the pin
command uh so from bottle import run and
round pretty simple and then we're going
to import OS
rout group directory host so this is
going to be who we're going to Ping
we're going P ping CNN.com or we're
going to Ping fox.com you can ping Fox I
don't care uh right that goes in there
192.168.1.1 anything that's pingable
essentially and then we're going to have
uh in interval so how often should this
ping occur every 10 seconds every 600
seconds every 3 seconds and that's
supposed to be an integer so Define
index host value comes in interval comes
in command equals F string ping space uh
hyphen c space one and then whoever
you're paying so if you're using um when
uh if you're using Linux or if you're
using Mac make sure you have to do a
ping count it does not automatically
stop in Windows it should ping four
times and then stop in Linux and Mac if
you do the Ping command it'll keep going
until you tell it to stop so you have to
tell it to stop here anyway response
equals os. poop so OS module the P open
function command and read so we're going
to send this command and then we're
going to read the response the results
back to
response we're then going to go here
we're then going to basically uh take a
look at the response that we're going to
get so if one packet's received in
response so for the the Mac World you'll
get one packets received if it actually
works and the ubun in Ubuntu World
you'll get one receiv received so
basically you're looking for some set of
words that correlate to whatever the
hell it is that you're looking for uh so
if we get one package received color
equals green else color equals red uh
page F string So Meta HTTP equiv refresh
so this is an HTML um meta tag to
automatically refresh at a certain
interval and so content equals and this
is going to be what that interval value
is so 3 seconds 5 Seconds 500 seconds H1
ping app H3
style background color and the color and
the host so basically in A3 we're make
the background color either green or red
based off of whether or not the Ping is
coming back properly and then we're
going to say what the host value is and
then we're going to use pre- tags for
what the responses the response that
we're actually getting back we put that
out here and then we're going to return
the page what this is going to look like
when we run
it so I come here and again I can do
slash
foxnews.com because people think I'm
biased towards CNN all the time and then
we'll ping it every three seconds so
Local Host call 8 foxnews.com
three and so we can see the Ping app Fox
News is green because it's coming back
one Mississippi 2 Mississippi 3 so there
we go and we can see it's updating you
see this is the latency and so we can
see every 3 seconds the L that the
latency is changing uh so that we know
that we're actually getting s some
Dynamic information here so again if you
want to do some extra credit work you
can try to figure out how to uh parse
off of something like this um and then
you know change colors or do something
so anyways this is just a way again to
kind of give you something a little
Dynamic here to show you how this kind
of uh bottle web app framework might
actually create something useful for you
uh if you're doing troubleshooting the
nice part about this too is again even
though this this looks like a web app
this is simply running on your computer
so you could have a crappy again you
could have some
crappy you know 14-year-old computer uh
that's sitting beside the server as
you're doing troubleshooting you could
have a script like this running and it's
just Auto doing its thing and when you
do things properly and you get the
network up and running it gives you
green and when you pull WR plug it gives
you Red and again it might be some kind
of a thing that you can use just to get
a better idea of what your environment
looks like
um there you go there you
go two hours of class so those are the
labs and that is the class do we have
any questions from
anybody
yck I got to guess some more questions
from other people than jock jock can't
be the only one what's
up when you do the post this to the
YouTube to go over like the first part
again because I'm still having trouble
with the IP address in 880 I'm starting
trying to understand that so that'll be
one thing other question about SL and
using iOS so I wait till everyone else
ask that question and I'll come back and
ask that and it deals with
shells okay yeah let's uh give it one
second then
anybody else have a qu uh on Windows
ping C well yeah on Windows here here
Windows look I got my mcse I used to be
a Windows Fanboy I want to be crystal
clear here I was a Windows fan boy all
the way up until Windows 8 and when
Balmer told me to suck it I went to Mac
uh but anyways yeah so I'm I'm doing
these classes just so you know um I'm
primarily focused again I've got Mac
primarily focused on Mac and
Linux um trying to make things work on
Windows most likely for the windows
users the windows portions of these
classes uh will get better uh as we go
now
Windows look Windows is Windows Windows
is just windows so anyways yeah
so a lot of this stuff um yeah just I
hate to say if you're on a Windows
machine some of the stuff may not work
properly uh again I'm trying again it's
one of those things one of those
things I hear you I understand it's a
problem oh we'll get to it we'll get to
it so uh so yeah I know I know that kind
of frustrates some windows users but
it's just true I mean it's like if
you're gonna Pro honestly honestly if
you're gonna learn a program and not
even a Mac not even a Mac I gotta tell
you Ubuntu is just a champ like like the
issue you got to worry about is it's a
whole Tech stack thing cuz again when we
talk about this right you have python
you have bottle but then you have the
operating system and then you have
drivers and hardware and all that kind
of stuff the nice part about Max is that
most of the stuff really does just work
if you want open CV so computer vision
is g to work ama's GNA work all this
stuff is basically GNA work pretty
easily um the is you get to is with
Ubuntu is Ubuntu generally works very
well from from Simply a coding
standpoint Ubuntu is actually probably a
superior operating system even to Mac
the issue is you get the device drivers
surprise free operating system device
drivers aren't always perfect so that
gets to be about quirky uh and then the
issue you get into
Windows Windows is just windows I don't
know what anybody wants me to say it's
Windows uh you got security
going on you got oh it's just a mess
just a mess so anyway um so yeah that's
where yeah for all the windows users I I
will try it'll get better maybe kind of
I don't know I'm giving you free
education can you afford a
Mac how can I test which OS I am on in
Python you look at your
computer actually no you don't look at
your computer you look at the glares
people are giving you about the computer
you use right if people look at your
computer and they don't care you're
probably using Windows if they look at
your computer and they're interested
then you're using a buun to they're
looking at your computer they give you a
sneer then you're using Mac
um uh I mean you should know I I mean
there is the OS there's um in Python so
again if you don't if you really don't
know there's the OS version
um python check OS version there is
actually for
uh get the OS name and version in
Python platform. system os. name let's
see what an os. name is uh oops so go
here control
n uh import OS
name
equals.
name
print
name contr
s
name with that on my
desktop close
that string object is not callable
read string object is not
callable oh okay um yeah but I I don't
know it gives you
posix good question for chat
GPT like can you do it I'm sure you can
um You probably send a command like cuz
P basically when you see posix basically
it's it's a Unix Unix uh it's not Unix
it's a Unix like it's generally Unix
like operating system so yes can you yes
yeah I don't know Google it Google
it um NT is for Windows oh there you go
the which
Windows um
and except it should be a dataor HTML
instead of data in the lab file yes you
are correct that was the mistake I made
and I will modify it you're back
now okay cool okay Jack where you at uh
what's your question Jack uh so we got
actually have stuff to do day so we have
like another 10 15 minutes and then I
got a book and then I'll see you all in
like two weeks or
whatever U my question is real quick it
was so I ran so again I'm doing the labs
at our lecture and sometimes to do late
so I was doing our HTML lab and
specifically we doing with CSV files and
I and when you do it with the Mac it
puts it in the pages and that's where
store till we call it and you said put
it into the
going so I tried to run it
and when I was running out P Max said I
was doing I've actually got to work but
it said the default like default
interactive shell is now
zsh what exactly is a shell that I'm
trying to figure out the macus or I've
heard this term before not you things
like so I'm trying to understand like
when it says a shell like
yeah I'm just trying to figure out like
is that something thing or is it like so
so this this this is the shell so any
shell is however you're interacting with
a system so even with Windows you used
to be able to swap out so the graphical
shell used to be able to swap those out
um so like in the Linux world uh what
there's plasma there's KDE there's gnome
there used to be unity and that's the
the graphical user interface that's a
different shell right so even with this
ugly ass thing even with the command
line there's actually different shells
for this so Mac I guess uses
zsh I don't really pay enough attention
to it to Really Care uh so so yeah so
this this is yeah so you can see zsh up
here so zsh is this and basically within
the shell you're going to get like tools
like LS hyphen L that's a that's a sh
that's a tool within that's that
accessible within the shell um so
different shells give you different
functionality
um I just use whatever the hell the
default is so that's that's all it
is okay that helps a lot understand now
we can install different shells in Mac
or I'm guessing there specific shells
for specific operating systems uh well
so so when you get in the Linux World
Lin Linux is all about and that's where
we talk about distributions right so
there's something called Fork so when
you get to Linux you have Linux and the
kernel and all that and then you have
the the major Forks so you have Debian
and Red Hat Linux or major like major
the major and that's where big things
are different how you install
applications is different like red hat
is a yum or something uh ubun or Debian
is app to get anyways there there's big
differences and those are the forks
and then beyond that do you then get
into the dros so like in the Red Hat
World you have red hat which is like the
Enterprise distribution you have sent OS
which IBM just killed it used to be the
O it used to be a great distribution but
it Now sucks and you have Fedora so what
that is is that uses the ma the the
basically the major code base of the Red
Hat
World they just adjust certain things
like like specific tools will be
slightly different but it's mainly the
same again when you go into the Debian
world so Ubuntu is a Debian operating
system uh Debian drro uh you get you get
Ubuntu and kbuntu all the the bunos out
there those are different dros um you
get a what Arch Linux is that Debian you
get a whole bunch of different things
right so anyways with the dros that's
where people go in and they decide to
really really tweak things so again like
when you start talking about shells
again what there there's plasma is it
plasma KDE
gnome uh again I think Unity die Unity
was ubuntu's thing I think they finally
killed him with gnome but that's you can
go in and you can change different
shells and so like back in the day the
cool kids if you go back 20 years ago
there would be different command line
shells and those command line shells
allowed you to do different things
especially when doing administrative
tasks and that kind of thing um again I
don't know you all can argue with the
chat section I just I just use whatever
the the default is anymore um so
that's where like the the only way I
would say you would normally touch a
shell
nowadays is if you're looking at like
low resource uh utilization So like
um Ubuntu uses gnome three I think it is
uh and that gives you a lot of the the
the you know gives the graphical stuff
but that requires CPU time that requires
Ram in order to do so if you have a
computer that only has like 512 Megs of
RAM and a really like a 12y old um
Celeron Processor it may not be able to
deal with the normal Ubuntu shell the
normal gnome shell so that's where you
might go with KDE which is a lot smaller
so it's like a very idiotically specific
use case um normally you don't screw
with it I would
say okay thank you for the explanation
appreciate it
yep lenux uses bash yeah I guess so Mac
uses
yes yeah so lenx so we go to lenux and
you go to the command line again I don't
I mean I know it I don't even care so's
something bash bash is called Born Again
shell
yep Linux is or Mac is zsh I guess
there's differences I guess there's
differences I can't tell you the last
time I cared
though is this local work simple to
deploy or are there more things to know
uh again goes out of that whole what do
you mean by deploy if you're going to
deploy this onto digital ocean there's a
lot more uh again when you do this so
when you're running this
now I mean it should be accessible to
your local area network again from a
security standpoint you gota be careful
about that too um anyways so if I run a
bottle app it should be accessible local
area network so so I could I could again
and that's where that's where you have
to think about like what deploy means
right so if you simply want like some
kind of administrative tool just so you
can monitor what the hell is going on
again you grab a 12y Old Mac you build
your little script you have this running
and then you can access it from any
computer on the land and again as long
as you don't do anything stupid it
should be fine uh if you're actually
going to be deploying this though
deploying it again to something like
digital ocean so you could use bottle
again for like your own API so imagine
again we talked about service oriented
architecture s SOA and witha there's
something called microservices
architecture which is kind of SOA is
generally the idea is you're using other
people's services microservices is more
the idea that you're actually creating
services inhouse so let's say you wanted
to create a rest API for other
departments in your
company I don't know what right so let's
say there's there's multiple departments
in your company that that
need some type of information uh let's
say
utilization utilization right so um how
many people are in facil so let's say
you have you know multiple
buildings and so you want to know you
want to have one system that tracks what
is the tempature inside the buildings
what is the humidity inside the building
uh what is the current use how many
people are inside the building let's say
you just want a whole bunch of
information right and you got store that
into a database you have that for many
different uh different uh different uh
buildings right and then let's say your
your facilities your facilities people
want to know what the temp is and want
to know what the electricity consumption
is uh and your HR people uh let's say
they want to know how many employees are
in the building um and let's say your
marketing people they want to know how
many like people are actually in the
building so anyways let's say you use
bottle you basically what you're going
to do is you're going to scrape some
type of database system that you have
that's collecting all of this
information and then you want to create
a very simple rest API so the the IT
people for facilities can get
information and HR people can get
information and these other people so
again low again low usage you're not
getting thousands of people an hour
relatively low security oh my God what
if the hackers know what the temperature
of your building is who the cares
anyways that kind of thing then like you
could use bottle to to create a rest API
to do that if you're going to do
that that is where you have to do a
effect right so again this gets to the
whole thing of things I still haven't
taught you so there's something called
VV we will teach you at some point it's
called virtual environments basically
what you do so we talk about
virtualization basically trying to
compartmentalize things so what a
virtual environment does is it basically
silos your python script so all of your
different modules you can install into
this one virtual environment you can
then run that P Pyon script in that
virtual environment and then it gets the
resources of that virtual environment so
again if you're going to be putting
python into anything considered
production the first thing that you do
is you would set it up for a virtual
environment the next thing again
depending on load and a whole bunch of
other stuff is there's actually a web
Ser so python uh has numerous web
servers um there's a lot there's like 10
gunicorn there's something called
gunicorn Gorn I don't know is that the
most popular it's the one I hear about
most anyway so what the web server does
is it actually it's kind of what
presents again bottle and all that
information to the end user right that
that web server actually has to do that
and so the thing to think about there is
again there's there's something like 10
different viable web server options you
can go into the bottle configuration to
change which web server you're going to
use um and so that's one thing to have
consideration for and then the next
thing again if you're going to employ
deploy this is
generally you would use engine X so
engine X is a web server so you'll hear
about Apache engine X I don't know is
IIs still around I don't know if it's
still around anyways normally engine X
or Apachi they actually provide the the
websites themselves but one of the
things that engine X can do is again
something called a reverse proxy Ser so
users come into engine X and then engine
X can then wrap
traffic appropriately to a cluster of
servers or other things the big thing
the big thing with engine X though even
if you've only got one box even if you
only got one little crappy ass digital
ocean server is there's a lot of
functionality in engine X to make sure
that the connections are stable when
information gets cached and everything
works properly so generally you want to
put inex in front of your bottle app and
so
more or
less you got to do the rest of this mess
to put something into production uh
there's a lot of documentation on it
again if you go to if you want to use
digital ocean digital Ocean's pretty
simple with it they have this all
written
out yeah that's kind of how you turn
that in
production and again you got to think
about again security concern what are
your security concerns what are um the
load again with bottle bottle's great
for doing we're doing you know if I was
G to have real traffic going to it I'm
not sure I'd use bottle so things to
think
about you can even use Powershell on
Linux
yay let's use Powershell on Linux that
sounds
fun will we cover environment variables
yeah as soon as I have the brain power I
have to turn everything into classes and
I have to turn everything in the classes
classes somebody might actually show up
for so I'm trying to figure that one out
I mean environment variables are
pretty environment variables just to do
are simple the problem with environment
variables is teaching it in the class
and making sure it works for most of you
people that's where it gets to be a bit
of a pain in the ass so uh so yes we
will I will most likely do a class on
Virtual environments and environment
variables and pip we still really
haven't even done a class on pip at this
point so I don't know I'm trying to
trying to wrap this into like an hourong
class that we might be able to do
something useful with um so yes will we
do environment variables absolutely when
I don't know
thank you this was awesome good deal
cool well I'll be probably be running in
a few minutes too uh so yeah we're gonna
have our next class I don't know not
this Friday I think it's next Friday is
it I think on a sequel light uh so
that's a Rel database that is really
really easy kind of like bottle it's
really easy to deploy and Implement uh
so that class is coming up uh and then
again my goal is so
hopefully by the time we do the SQL
light class um my outside of frame world
will be a lot simpler
hopefully anyways and then my goal is to
really start rocking rolling with these
and start doing a lot more classes also
for anybody that's like missed classes
uh the goal is to also start repeating I
think I think I think we're probably
going to try to do like a three-month
cycle maybe um and so as we get about
three months out we'll do like the next
cycle and we we might try to do it at
like a different time frame so I've been
doing it 2 o'clock because it works for
me uh I am thinking about starting to do
like maybe like 10 o'clock in the
morning like doing some 10 o'clock in
the morning class is my time Eastern
time and then maybe some like six
o'clock at night classes and maybe with
that you know start to be able to get
more more people on different schedules
uh so that's hopefully GNA be coming up
in the
fall and uh yeah so okay it is
4:10 and I do gotta go if there's no
questions any questions from anybody
left five four
three okay folks I will see you next
Friday today