Building data-driven web apps with Pyramid and SQLAlchemy Transcripts
Chapter: Deployment
Lecture: Setting up our code

Login or purchase this course to watch this video and the rest of the course contents.
0:00 Now we have our code that we want to run
0:01 over here on GitHub, right?
0:02 If we got source, 15, final deploy
0:06 I haven't shown you this running
0:07 but this is the final thing that we do want to run here.
0:11 So what we're going to do is we're going to clone this repo
0:18 so SSH back to our server
0:22 go to the apps, I want to say Git clone that.
0:25 I want to be very careful about the directory
0:28 that I'm going to put it in.
0:29 Going to clone it into app_repo
0:31 just so the file names are a little bit shorter.
0:34 Like that. This is public, so it doesn't ask us what's our
0:39 username and password but if you were cloning your private app
0:43 which very likely you would be it would need you to log in
0:47 but that caching stuff would mean
0:48 just the once until you reboot.
0:50 Okay, so this looks good.
0:53 If we go to app, source, Chapter 15.
1:00 Here you can see our files
1:02 here's our servers stuff
1:03 which we're going to need in a little bit
1:04 here's our production.ini that we're going to need and so on.
1:07 So we've gotten our files onto the server.
1:10 We have our virtual environment active.
1:13 'Member, what we're going to need to do
1:15 is we need to say Python, and be careful
1:18 you want to make sure it's the virtual environment one
1:20 that means it's Python 3.
1:23 Good. We want to remember to do python setup.py develop
1:35 Think we should be able to run this
1:36 let's see really quick here.
1:37 So we should be able to say pserve development.ini.
1:43 And look at that, it's listening.
1:44 If we go log in in another terminal window
1:49 now we have HTTP, that's the httpy command
1:54 and you hit that, and what do we get?
1:57 Boom, that looks a whole lot like our little
1:59 boot-strappy site that we wrote.
2:01 Pretty darn cool, I would say.
2:04 Now, be careful, it does have the debug toolbar
2:06 that's because we ran the debug command over here
2:10 the development command
2:11 and we're not going to do that on uWSGI.
2:13 Okay, so it looks like we got this
2:14 all setup and working, more or less.