Browse Source

Making docs

https
jakobsn 6 years ago
parent
commit
6512808580
4 changed files with 19 additions and 8 deletions
  1. +12
    -7
      README.md
  2. BIN
      app_structure.png
  3. +1
    -0
      src/app/views/app.py
  4. +6
    -1
      src/app/views/index.py

+ 12
- 7
README.md View File

@@ -6,7 +6,7 @@ Web Server image: https://github.com/tiangolo/uwsgi-nginx-docker
webpy framework: http://webpy.org/ webpy framework: http://webpy.org/




### prerequisites:
### Prerequisites:
docker https://www.docker.com/ docker https://www.docker.com/


### Build & Run ### Build & Run
@@ -19,15 +19,20 @@ $ docker-compose up --build


### Deploy locally ### Deploy locally


Install:
Prerequisites:
mysql mysql
python3
src/app/requirements.txt 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 <user> -p
Insert mysql queries
"CREATE database db;" "CREATE database db;"
"USE 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 Edit src/app/models/database.py to point at local server
python3 src/app/main.py
Run app
$ python3 src/app/main.py

BIN
app_structure.png View File

Before After
Width: 521  |  Height: 371  |  Size: 24KB

+ 1
- 0
src/app/views/app.py View File

@@ -10,6 +10,7 @@ from views.open_projects import Open_projects
from views.project import Project from views.project import Project
from views.index import Index from views.index import Index



# Define application routes # Define application routes
urls = ( urls = (
'/', 'Index', '/', 'Index',


+ 6
- 1
src/app/views/index.py View File

@@ -7,8 +7,13 @@ render = web.template.render('templates/')


class Index: class Index:
# Get main page
def GET(self): def GET(self):
"""
Get main page using the projects input variable to
determine which projects to show.

:return: index page
"""
session = web.ctx.session session = web.ctx.session
nav = get_nav_bar(session) nav = get_nav_bar(session)
data = web.input(projects=None) data = web.input(projects=None)


Loading…
Cancel
Save