simple-flask-app
Purpose
The purpose of this project is to improve on my current Python skills. I will be using pip
as my package manager, a virtual environment builder virtualenv
, and the microframework Flask.
Disclaimer
The installation of packages and modules done here worked on my own system. There is no guarantee that these steps and fixes will work for your system. As with any new software, make sure you understand the commands you intend to execute before pressing ENTER
. Proceed with caution!
Setup
Below are the steps I followed to set up this project. The steps may differ for you.
Assuming you have pip3
, if you have not set up virtualenv
and virtualenvwrapper
you should do the pre-install!
Pre-Install
you may need to use sudo
to run these commands successfully
pip install virtualenv
pip install virtualenvwrapper
mkdir ~/.virtualenvs
- Open or
touch .bashrc
then open.bashrc
- Include in your
.bashrc
export WORKON_HOME=~/.virtualenvs
/usr/local/bin/virtualenvwrapper.sh
- Save then close and re-open terminal.
Install
git clone REPO_URL
cd
into folder- Check the PYTHON3_PATH for python3
which python3
- Create virtual environment with your custom unique VIRTUALENV_NAME name or use py_env if you haven't before
mkvirtualenv --python=PYTHON3_PATH VIRTUALENV_NAME
- Check that virtual environment has been created
ls -l ~/.virtualenvs/
- Activate the virtual environment
workon VIRTUALENV_NAME || py_env
pip install -r requirements.txt
python run.py
- Open your browser to
localhost:5000
- TA DA!
Errors
In my limited experience, installing things Python-related has a 50/50 chance of returning an error. Here are the issues I have come across in this project:
Can't install virtualenvwrapper
Installing virtualenvwrapper throws a traceback error involving six-1.4.1
. This seems to be a problem with your computer if you are running OSX. To solve this:
sudo pip install pbr
sudo pip install --no-deps stevedore
sudo pip install --no-deps virtualenvwrapper