- 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:
- 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. - On your local machine, create a new directory called
headlines
in your home directory or wherever you put thefirstapp
directory. - Create a new file in this directory called
headlines.py
. - 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.
推薦閱讀
- Learning Java Functional Programming
- Getting Started with React
- 深入淺出WPF
- R語言數(shù)據(jù)可視化之美:專業(yè)圖表繪制指南
- 程序員面試算法寶典
- Java開發(fā)入行真功夫
- 劍指MySQL:架構(gòu)、調(diào)優(yōu)與運維
- HTML5從入門到精通(第4版)
- RealSenseTM互動開發(fā)實戰(zhàn)
- INSTANT Yii 1.1 Application Development Starter
- AutoCAD 2009實訓指導
- C++程序設計教程(第2版)
- 分布式架構(gòu)原理與實踐
- Building Business Websites with Squarespace 7(Second Edition)
- Learning Redux