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

  • 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.

主站蜘蛛池模板: 年辖:市辖区| 泰宁县| 敦煌市| 林口县| 家居| 司法| 陆川县| 通江县| 乳山市| 涞源县| 恩平市| 盘锦市| 通海县| 邓州市| 兴仁县| 宁国市| 根河市| 通江县| 抚宁县| 大英县| 启东市| 合水县| 枣强县| 郁南县| 新晃| 呼玛县| 聂荣县| 霍林郭勒市| 保定市| 饶阳县| 高淳县| 慈溪市| 丹东市| 乐清市| 杭州市| 德清县| 武夷山市| 尖扎县| 沙河市| 本溪| 共和县|