diff --git a/README.md b/README.md index 36a67f0..d52be16 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Web Server image: https://github.com/tiangolo/uwsgi-nginx-docker webpy framework: http://webpy.org/ -### prerequisites: +### Prerequisites: docker https://www.docker.com/ ### Build & Run @@ -19,15 +19,20 @@ $ docker-compose up --build ### Deploy locally -Install: +Prerequisites: mysql +python3 src/app/requirements.txt -Run: -Launch mysql at port 3306 -Execute mysql queries +# Run Datatbase: +Launch mysql at default port (3306) +$ systemctl start mysqld +Log in to database +$ mysql -u -p +Insert mysql queries "CREATE database db;" "USE db;" -Populate mysql by posting mysql/sql/init.sql into mysql +Then populate databse by posting mysql/sql/init.sql into mysql Edit src/app/models/database.py to point at local server -python3 src/app/main.py +Run app +$ python3 src/app/main.py diff --git a/app_structure.png b/app_structure.png new file mode 100644 index 0000000..2cc8f58 Binary files /dev/null and b/app_structure.png differ diff --git a/src/app/views/app.py b/src/app/views/app.py index a64ca28..f1cb555 100644 --- a/src/app/views/app.py +++ b/src/app/views/app.py @@ -10,6 +10,7 @@ from views.open_projects import Open_projects from views.project import Project from views.index import Index + # Define application routes urls = ( '/', 'Index', diff --git a/src/app/views/index.py b/src/app/views/index.py index 8745533..dd91673 100644 --- a/src/app/views/index.py +++ b/src/app/views/index.py @@ -7,8 +7,13 @@ render = web.template.render('templates/') class Index: - # Get main page def GET(self): + """ + Get main page using the projects input variable to + determine which projects to show. + + :return: index page + """ session = web.ctx.session nav = get_nav_bar(session) data = web.input(projects=None)