diff --git a/README.md b/README.md index f389c4eb5dbf2e116026205eb08a2b4c7c562422..de1cd7a752723e7aba8b1b59a0545ce22472bf0f 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