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

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.

主站蜘蛛池模板: 明光市| 孟津县| 新郑市| 株洲市| 迁西县| 锡林郭勒盟| 达州市| 合作市| 鄂托克旗| 响水县| 工布江达县| 葫芦岛市| 鄂托克前旗| 南和县| 棋牌| 通道| 九龙城区| 特克斯县| 阿尔山市| 瑞昌市| 镇雄县| 永仁县| 湘潭市| 鄄城县| 宁安市| 于田县| 商洛市| 会东县| 建平县| 普兰县| 巫山县| 海盐县| 万山特区| 莱西市| 山东| 弥勒县| 博野县| 兴山县| 防城港市| 四平市| 肇庆市|