Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Preview
Start a free Courses trial
to watch this video
We’ll host a terminal-based Python project on replit.com.
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
Welcome back.
0:00
In this video, we'll go over
hosting terminal-based projects for
0:01
free using replit.com.
0:06
You can publish your GitHub
repositories directly to Replit,
0:08
allowing you to share a link for others to
visit and run your terminal-based projects
0:12
in a web browser without installing
Python locally on their machine.
0:17
Let's check out replit.com in the browser.
0:22
One great benefit of Replit
is they offer a free tier.
0:26
Let's sign up for it.
0:30
Let's use the Continue with
GitHub button to sign up.
0:32
Awesome, as we were already logged
into GitHub in the browser,
0:38
we just need to click on
Authorize Replit to sync our accounts.
0:42
Let's choose the beginner and
for school options.
0:49
And the Python template, of course,
all right, use template.
0:54
Let's skip this part of the onboarding.
1:04
Let's try a simple print statement.
1:09
Neat.
1:13
They offer AI code completion.
1:14
I'll just dismiss that for now.
1:16
Let's click Run to view
the output in the console.
1:21
Great, hello world,
printed to the console.
1:25
Now that we know it works, let's go
ahead and delete this sample Repl.
1:28
Time to to create a new Repl.
1:40
Let's import from GitHub directly.
1:43
We have the option to allow access to all
Repls or only selected, I'll allow all.
1:53
I'll select my number guessing game Repl.
2:04
It will just take a few seconds for
it to import the Repl.
2:06
By default, Replit looks for
a main.py file in the root of your Repl.
2:20
Let's go ahead and
close the main.py and read me files.
2:25
As I don't have a main.py file in my Repl,
2:29
we need to tell replay
how to run the project.
2:32
In this case, it will be exactly
how I would run it locally
2:35
by typing python3guessing_game.py.
2:40
Luckily, this is a one time thing,
it will save the run command.
2:44
Now, we can run it.
2:49
Let's test the functionality,
Wonderful, it works.
2:50
It's It's time to publish it so
that it will be publicly accessible.
3:01
I'll add a short description.
3:04
And click Next.
3:10
Let's add a Python tag, and
click Next through the rest.
3:12
Time to publish it.
3:21
Perfect, let's copy this link to use in
our portfolio and switch back to VS Code.
3:25
Let's paste the link into the href
value for the live site button and
3:31
save the file.
3:34
Time to fire the server
backup to test the link.
3:43
Wonderful, it worked.
4:00
The only downside with Replit
is to view someone else's Repl,
4:02
you need to create an account,
then Fork their Repl.
4:06
I'll just be forking my own public Repl
to simulate what a visitor will see.
4:11
In the final video, we'll go over hosting
the portfolio itself on renderer.com.
4:23
I'll see you there.
4:28
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up