官术网_书友最值得收藏!

Setting up our project and a Git repository

We could simply edit our Hello World application to add the desired functionality, but it's cleaner to start a new project. We'll create a new Git repository, a new Python file, a new .wsgi file, and a new Apache configuration file. We'll do this for each of the projects in the book, which means that all three of the projects as well as the original Hello World application will be accessible from our web server.

Setting up is very similar to what we did for our Hello World application in Chapter 1, Hello, World! but we'll briefly go through the steps again as we don't have to repeat a lot of the configuration and installation, as follows:

  1. Log in to your GitHub or BitBucket account and create a new repository called headlines. Take note of the URL you're given for this blank repository.
  2. On your local machine, create a new directory called headlines in your home directory or wherever you put the firstapp directory.
  3. Create a new file in this directory called headlines.py.
  4. In your terminal, change the directory to the headlines directory and initialize the Git repository by executing the following commands:
    cd headlines
    git init
    git remote add origin <your headlines git URL>
    git add headlines.py
    git commit -m "initial commit"
    git push –u origin master
    

Now, we're almost ready to push code to our new repository; we just need to write it first.

主站蜘蛛池模板: 涡阳县| 内黄县| 凉城县| 吉林省| 罗甸县| 河津市| 黄平县| 湘阴县| 长沙县| 宁波市| 邓州市| 淮安市| 丹阳市| 临洮县| 陇南市| 万山特区| 宜州市| 庄浪县| 墨脱县| 江阴市| 昌都县| 云浮市| 阿坝县| 龙游县| 平山县| 永嘉县| 上思县| 安徽省| 黔南| 彝良县| 翁源县| 渑池县| 卢氏县| 平陆县| 邯郸县| 上高县| 东安县| 肇州县| 潜江市| 会理县| 安远县|