From the course: Building a Paid Membership Site with Django

The starter project walkthrough

From the course: Building a Paid Membership Site with Django

Start my 1-month free trial

The starter project walkthrough

- [Instructor] Let's start by getting our starter project - [Instructor] Let's start by getting our starter project up and running. Now the first thing that you'll want to do Now the first thing that you'll want to do is put it somewhere on your computer. is put it somewhere on your computer. I went ahead and put mine on the desktop, I went ahead and put mine on the desktop, wherever it is that you'd like to have your project, wherever it is that you'd like to have your project, make sure you can get to it in your terminal make sure you can get to it in your terminal and see the folder that we're working with, and see the folder that we're working with, it's called Nick Fitness, and before we go ahead it's called Nick Fitness, and before we go ahead and move into it, we need to set up a virtual environment. and move into it, we need to set up a virtual environment. To make sure you have virtual environment installed, To make sure you have virtual environment installed, do pip3 install virtualenv, and once you have that do pip3 install virtualenv, and once you have that you can say virtual environment, and create one, you can say virtual environment, and create one, I'm going to call mine venv, short for virtual environment. I'm going to call mine venv, short for virtual environment. Once that's up and running, we want to activate Once that's up and running, we want to activate that virtual environment. that virtual environment. So I'm going to say source venv/bin/activate. So I'm going to say source venv/bin/activate. Now you can see on the left, I have in parenthesis venv, Now you can see on the left, I have in parenthesis venv, this means I'm inside of my virtual environment, this means I'm inside of my virtual environment, and once I'm there, I want to install the two packages and once I'm there, I want to install the two packages that we're going to need for this project. that we're going to need for this project. So pip install, I want django, and I also want stripe. So pip install, I want django, and I also want stripe. Once that's finished, let's go ahead Once that's finished, let's go ahead and move into our Nick Fitness directory, and move into our Nick Fitness directory, and once there, there's a few different commands and once there, there's a few different commands that we have to run. that we have to run. The first one is we want to migrate our database, The first one is we want to migrate our database, so do a Python manage.py, and let's migrate. so do a Python manage.py, and let's migrate. Once that's done, I have some example data Once that's done, I have some example data for us to load into our database, for us to load into our database, so just do load data space plans.json. so just do load data space plans.json. Go ahead and hit enter on that, Go ahead and hit enter on that, then finally we want to run our server, then finally we want to run our server, and with that in place, let's go ahead and with that in place, let's go ahead and check out what our site looks like. and check out what our site looks like. So we'll start first at our homepage here. So we'll start first at our homepage here. You can see this is our fitness website. You can see this is our fitness website. We have all these cool different articles here. We have all these cool different articles here. So if you click on the very first one, So if you click on the very first one, you should be able to see the text in here, you should be able to see the text in here, this is just a bunch of gibberish. this is just a bunch of gibberish. But some of the articles, actually the rest, But some of the articles, actually the rest, if you click on them, they are a premium article, if you click on them, they are a premium article, meaning that we can't access them meaning that we can't access them unless we have a paid subscription, unless we have a paid subscription, and so they forward us to this payment screen. and so they forward us to this payment screen. This is the same button as if you hit premium, This is the same button as if you hit premium, it sends us to /join. it sends us to /join. Now this has a fully functional user authentication system, Now this has a fully functional user authentication system, so if we'd like to sign up for this site, so if we'd like to sign up for this site, we can create a username like John, we can create a username like John, we'll give John a little test email here, we'll give John a little test email here, and we'll make a password for John, and we'll make a password for John, I'm going to use django1234. I'm going to use django1234. We'll go ahead and sign up John, We'll go ahead and sign up John, that makes it so John is now logged in, that makes it so John is now logged in, and you can see the different features and you can see the different features that John has, and we can log out of John, that John has, and we can log out of John, and we can also log back into John and we can also log back into John if we go ahead and put back in the appropriate credentials. if we go ahead and put back in the appropriate credentials. So there you have it, those are the basics So there you have it, those are the basics of what our project is right now. of what our project is right now. We need to get to the point where once a user We need to get to the point where once a user creates an account, they'll be able to then pay creates an account, they'll be able to then pay for a membership so they can access for a membership so they can access these premium articles. these premium articles.

Contents