A basic mockup of what a flask app should look like, this is basically a hodgepog of different sources on how to structure flask operations
- Make sure have python, you can test this by typing
python
in your command line, if bash doesn't recognize it as a valid command, you'll want to download it
1.1 In the event you do not have python, I'd recommend downloading and installing it through homebrew, then typing brew install python
if you're on a Mac, or just use sudo apt-get install python
if you're on a nix box.
-
Clone this repository, this is as easy as typing
git clone https://github.com/varunmved/how-to-flask.git
. Then simply typegit init
and you have a git repo setup, wohoo!!! -
Once you have this cloned, you'll want to set up `pip~~. Pip is a way to install and manage python packages. You'll use external packages so you have to code less and to be more productive.
3.1 To install pip if you don't have it on your machine, just type sudo easy_install pip
.
-
Now that you have pip, let's install
virtualenv
, a tool to create virtual enviroments to manage a project. Typepip install virutalenv
. -
Now that
virtualenv
is installed, we'll want to create a virtualenv instance. We do this by typingvirtualenv venv
which will create a virtual enviorment inside of the venv folder. We'll then want to activate that instance by typingsource venv/bin/activate
. Now you'll notice a(venv)
before your shell information inside of bash. -
Now we need to install the required packages, to do this run
pip install -r requirements.xt
. This will install all the pacakges defined inrequirements.txt
. -
As you scale your projects with more external code, you can just type
pip install (package name)
and it'll be installed. To overwrite the existing requirements.txt just typepip freeze > requirements.txt
. -
You'll notice a
.gitignore
file at the root of the directory. The purpose of this file is to ignore files you don't want to be commited on git, as well as yourvenv/
folder which can get really large! -
I'll have more instructions on what each file does in detail below in the README, but for now, happy hacking!