From dec9b015279df235de9befa557a5972600e0deba Mon Sep 17 00:00:00 2001 From: Bo-Chun Louis Chen <louistw@uab.edu> Date: Wed, 30 May 2018 12:16:41 -0500 Subject: [PATCH] Added more detail steps in Installation section --- README.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/README.md b/README.md index f389c4e..de1cd7a 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,18 @@ This is a project implementing the blog post by Mbithe Nzomo. ### Installation +Download the project +```shell +$ git clone git@gitlab.rc.uab.edu:louistw/get_start_flask.git # or your own fork +$ cd get_start_flask +``` + +Create and activate your virtualenv +```shell +$ virtualenv venv +$ source venv/bin/activate +``` + Install packages needed via pip ```shell $ pip install -r requirement.txt @@ -44,6 +56,17 @@ $ flask db upgrade ``` In case you are using SQLite, refer to the third problem in [Known problem](#known-problems). +Create admin account +```python +$ flask shell +from app.models import Employee +from app import db +#Remember to replace ADMIN_EMAIL, ADMIN_USERNAME, ADMIN_PASSWORD with correct value +admin = Employee(email="ADMIN_EMAIL",username="ADMIN_USERNAME",password="ADMIN_PASSWORD",is_admin=True) +db.session.add(admin) +db.session.commit() +``` + Finally, you can run your app ```shell $ flask run -- GitLab