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

  • Flask By Example
  • Gareth Dwyer
  • 241字
  • 2021-07-09 20:06:53

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.

主站蜘蛛池模板: 留坝县| 黄山市| 塔城市| 潞城市| 大方县| 织金县| 舒城县| 长汀县| 徐水县| 南江县| 芜湖市| 潞城市| 泗阳县| 广汉市| 安康市| 巴东县| 兰坪| 上高县| 泾阳县| 乡城县| 疏附县| 斗六市| 昔阳县| 双桥区| 罗平县| 加查县| 静宁县| 漯河市| 玉屏| 大荔县| 潢川县| 安西县| 上虞市| 凤冈县| 湟源县| 凤阳县| 大关县| 利辛县| 白银市| 永嘉县| 衡阳县|