Building Data-Driven Web Apps with Pyramid and SQLAlchemy Transcripts
Chapter: Your first Pyramid site
Lecture: Demo: Creating the starter project PyCharm
Login or
purchase this course
to watch this video and the rest of the course contents.
0:00
Over here in PyCharm, let's go create the same
0:03
type of app that we did on the command line interface
0:05
but this time using PyCharm.
0:08
Here you can see we don't have any recent projects
0:10
it's just basically bare.
0:11
So we'll say "Create a New Project"
0:13
and let's use Pyramid, okay great.
0:16
It says we're going to create a new virtual environment
0:19
and it's going to create it in the folder, doing exactly
0:23
exactly what we did, so we don't have to expand that out.
0:28
And we want to set the location
0:29
so let's go and say this is on desktop
0:33
just call this "PyPI Web" or something like that, okay.
0:38
And we can also, this is important
0:39
come down here to more settings.
0:41
Remember there are the different templates?
0:43
There they are again, and this is going to use
0:45
basically the same thing.
0:47
And let's go and switch that to Chameleon from Jinja2.
0:51
Okay so we're ready, we're going to do
0:53
all the stuff of running the Cookiecutter:
0:55
it's going to install Pyramid
0:58
it's going to run the right template for us
1:01
create the virtual environment, activate it
1:02
all those things, ready? Go.
1:05
They're just creating the virtual environment.
1:07
Now it's installing Pyramid.
1:12
So if we look over here, we've got our PyPI Web
1:16
and everything is pretty much up and running.
1:19
I'm not sure it's going to totally work yet, notice
1:22
it's doing some indexing down here, give it just a moment.
1:26
PyCharm knows that this project is not
1:29
installed into the virtual environment.
1:31
You can see if you just click on this terminal and all
1:32
which virtual environment it is
1:34
you can ask again which or where Python
1:37
and it's this new one that we just created
1:40
and it knows in here that this is not set up.
1:42
So it knows we need to run python setup.py develop
1:46
or I can just click that, and it's doing it for us.
1:50
See up here above it also says these packages are required
1:53
but that setup action actually installed those packages
1:57
so it kind of solves two problems at once.
2:00
Alright, now how do we go run our app?
2:02
We don't have to type pserve develop, we just press this.
2:06
and let's click it and see what happened, are we ready?
2:09
Ta-da, same thing.
2:11
Our starter template has been used to create a new
2:12
Pyramid project, this time we just called it PyPI Web
2:16
it was generated not by Cookiecutter, but by PyCharm.
2:20
Really cool, pretty much exactly the same thing
2:22
but a whole lot simpler.
2:24
All we had to do was click Create New Project, Pyramid
2:27
give it a name, and then click, it will go ahead
2:30
and set up this package to be run and edited.