Guest User

Untitled

a guest
Apr 9th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 45.15 KB | None | 0 0
  1. Last login: Mon Apr 9 11:26:43 on console
  2. ➜ ~ git:(master) ✗ ssh -t aalw001@doc.gold.ac.uk myserver ssh 168
  3. aalw001@doc.gold.ac.uk's password:
  4. aalw001@myserver's password:
  5.  
  6. Permission denied, please try again.
  7. aalw001@myserver's password:
  8. Permission denied, please try again.
  9. aalw001@myserver's password:
  10. Welcome to Ubuntu 16.04.3 LTS (GNU/Linux 4.4.0-93-generic x86_64)
  11.  
  12. * Documentation: https://help.ubuntu.com
  13. * Management: https://landscape.canonical.com
  14. * Support: https://ubuntu.com/advantage
  15. aalw001@doc168:~$ cd dnw/term-2-lab/lab-exercises/term-2-labs/myOwn/
  16. aalw001@doc168:~/dnw/term-2-lab/lab-exercises/term-2-labs/myOwn$ ls
  17. app.py databse.db nohup.out __pycache__ static templates vs_url_for.py
  18. aalw001@doc168:~/dnw/term-2-lab/lab-exercises/term-2-labs/myOwn$ git commit -am
  19. error: switch `m' requires a value
  20. usage: git commit [<options>] [--] <pathspec>...
  21.  
  22. -q, --quiet suppress summary after successful commit
  23. -v, --verbose show diff in commit message template
  24.  
  25. Commit message options
  26. -F, --file <file> read message from file
  27. --author <author> override author for commit
  28. --date <date> override date for commit
  29. -m, --message <message>
  30. commit message
  31. -c, --reedit-message <commit>
  32. reuse and edit message from specified commit
  33. -C, --reuse-message <commit>
  34. reuse message from specified commit
  35. --fixup <commit> use autosquash formatted message to fixup specified commit
  36. --squash <commit> use autosquash formatted message to squash specified commit
  37. --reset-author the commit is authored by me now (used with -C/-c/--amend)
  38. -s, --signoff add Signed-off-by:
  39. -t, --template <file>
  40. use specified template file
  41. -e, --edit force edit of commit
  42. --cleanup <default> how to strip spaces and #comments from message
  43. --status include status in commit message template
  44. -S, --gpg-sign[=<key-id>]
  45. GPG sign commit
  46.  
  47. Commit contents options
  48. -a, --all commit all changed files
  49. -i, --include add specified files to index for commit
  50. --interactive interactively add files
  51. -p, --patch interactively add changes
  52. -o, --only commit only specified files
  53. -n, --no-verify bypass pre-commit hook
  54. --dry-run show what would be committed
  55. --short show status concisely
  56. --branch show branch information
  57. --porcelain machine-readable output
  58. --long show status in long format (default)
  59. -z, --null terminate entries with NUL
  60. --amend amend previous commit
  61. --no-post-rewrite bypass post-rewrite hook
  62. -u, --untracked-files[=<mode>]
  63. show untracked files, optional modes: all, normal, no. (Default: all)
  64.  
  65. aalw001@doc168:~/dnw/term-2-lab/lab-exercises/term-2-labs/myOwn$ git commit -am "shows users"
  66. [master 5163fab] shows users
  67. 5 files changed, 134 insertions(+), 11 deletions(-)
  68. aalw001@doc168:~/dnw/term-2-lab/lab-exercises/term-2-labs/myOwn$ git push git@gitlab.doc.gold.ac.uk:aalw001/term-2-labs.git
  69. Enter passphrase for key '/home/aalw001/.ssh/id_rsa':
  70. To git@gitlab.doc.gold.ac.uk:aalw001/term-2-labs.git
  71. ! [rejected] master -> master (fetch first)
  72. error: failed to push some refs to 'git@gitlab.doc.gold.ac.uk:aalw001/term-2-labs.git'
  73. hint: Updates were rejected because the remote contains work that you do
  74. hint: not have locally. This is usually caused by another repository pushing
  75. hint: to the same ref. You may want to first integrate the remote changes
  76. hint: (e.g., 'git pull ...') before pushing again.
  77. hint: See the 'Note about fast-forwards' in 'git push --help' for details.
  78. aalw001@doc168:~/dnw/term-2-lab/lab-exercises/term-2-labs/myOwn$ git pull
  79. Enter passphrase for key '/home/aalw001/.ssh/id_rsa':
  80. remote: Counting objects: 1652, done.
  81. remote: Compressing objects: 100% (706/706), done.
  82. remote: Total 1652 (delta 710), reused 1645 (delta 708)
  83. Receiving objects: 100% (1652/1652), 449.74 KiB | 0 bytes/s, done.
  84. Resolving deltas: 100% (710/710), completed with 8 local objects.
  85. From gitlab.doc.gold.ac.uk:aalw001/term-2-labs
  86. d26b24f..9c3f491 master -> origin/master
  87. Merge made by the 'recursive' strategy.
  88. README.md | 12 +++
  89. lab-12/decorator_1.py | 20 ++++
  90. lab-12/decorator_timer.py | 27 ++++++
  91. lab-12/headline.py | 24 +++++
  92. lab-12/headlines.py | 15 +++
  93. lab-12/headlines_if.py | 22 +++++
  94. lab-12/hello_world.py | 9 ++
  95. lab-12/hello_world_with_templates.py | 10 ++
  96. lab-12/home.html | 11 +++
  97. lab-12/if_name_test.py | 3 +
  98. lab-12/macros.py | 21 +++++
  99. lab-12/random_headline.py | 25 +++++
  100. lab-12/random_letters.py | 20 ++++
  101. lab-12/show_time.py | 17 ++++
  102. lab-12/show_time_with_filter.py | 22 +++++
  103. lab-12/templates/base.html | 33 +++++++
  104. lab-12/templates/headlines.html | 15 +++
  105. lab-12/templates/headlines_if.html | 17 ++++
  106. lab-12/templates/hello_world.html | 11 +++
  107. lab-12/templates/macros.html | 9 ++
  108. lab-12/templates/macros_base.html | 44 +++++++++
  109. lab-12/templates/macros_page.html | 11 +++
  110. lab-12/templates/show_time_with_filter.html | 11 +++
  111. lab-12/url_for.py | 17 ++++
  112. lab-12/url_for_using_vs_url_for.py | 18 ++++
  113. lab-12/username.py | 16 ++++
  114. lab-12/vs_url_for.py | 10 ++
  115. lab-12/whats_my_name.py | 2 +
  116. lab-13/file_upload.py | 4 +
  117. lab-13/get_headlines.py | 4 +
  118. lab-13/mock_login.py | 8 ++
  119. lab-13/mock_login_wtforms.py | 4 +
  120. lab-14/mytwits_mysql_1.py | 5 +
  121. lab-14/mytwits_mysql_4.py | 5 +
  122. lab-14/vs_url_for.py | 4 +
  123. lab-15/dbhelper.py | 56 +++++++++++
  124. lab-15/dbhelper.pyc | Bin 0 -> 3019 bytes
  125. lab-15/dbhelper_10.py | 61 ++++++++++++
  126. lab-15/dbhelper_10.pyc | Bin 0 -> 3544 bytes
  127. lab-15/dbhelper_7.py | 56 +++++++++++
  128. lab-15/dbhelper_7.pyc | Bin 0 -> 3037 bytes
  129. lab-15/dbhelper_8.py | 50 ++++++++++
  130. lab-15/dbhelper_8.pyc | Bin 0 -> 3066 bytes
  131. lab-15/dbhelper_9.py | 56 +++++++++++
  132. lab-15/dbhelper_9.pyc | Bin 0 -> 3394 bytes
  133. lab-15/dbhelper_flasklogin.py | 56 +++++++++++
  134. lab-15/dump.sql | 82 +++++++++++++++++
  135. lab-15/forms.py | 24 +++++
  136. lab-15/forms.pyc | Bin 0 -> 1650 bytes
  137. lab-15/forms_10.py | 24 +++++
  138. lab-15/forms_10.pyc | Bin 0 -> 1662 bytes
  139. lab-15/forms_7.py | 24 +++++
  140. lab-15/forms_7.pyc | Bin 0 -> 1658 bytes
  141. lab-15/forms_8.py | 24 +++++
  142. lab-15/forms_8.pyc | Bin 0 -> 1658 bytes
  143. lab-15/forms_9.py | 24 +++++
  144. lab-15/forms_9.pyc | Bin 0 -> 1658 bytes
  145. lab-15/forms_flasklogin.py | 24 +++++
  146. lab-15/get_headlines_cookies.py | 39 ++++++++
  147. lab-15/mytwits_mysql_10.py | 89 ++++++++++++++++++
  148. lab-15/mytwits_mysql_6.py | 105 +++++++++++++++++++++
  149. lab-15/mytwits_mysql_7.py | 71 ++++++++++++++
  150. lab-15/mytwits_mysql_8.py | 79 ++++++++++++++++
  151. lab-15/mytwits_mysql_9.py | 89 ++++++++++++++++++
  152. lab-15/mytwits_mysql_flasklogin.py | 90 ++++++++++++++++++
  153. lab-15/temp.py | 70 ++++++++++++++
  154. lab-15/temp_dbhelper.py | 56 +++++++++++
  155. lab-15/temp_dbhelper.pyc | Bin 0 -> 3064 bytes
  156. lab-15/templates/add_twit_mysql_10.html | 32 +++++++
  157. lab-15/templates/add_twit_mysql_6.html | 32 +++++++
  158. lab-15/templates/add_twit_mysql_7.html | 32 +++++++
  159. lab-15/templates/add_twit_mysql_8.html | 32 +++++++
  160. lab-15/templates/add_twit_mysql_9.html | 32 +++++++
  161. lab-15/templates/add_twit_mysql_flasklogin.html | 32 +++++++
  162. lab-15/templates/base.html | 43 +++++++++
  163. lab-15/templates/base_10.html | 43 +++++++++
  164. lab-15/templates/base_8.html | 43 +++++++++
  165. lab-15/templates/base_9.html | 43 +++++++++
  166. lab-15/templates/base_flasklogin.html | 43 +++++++++
  167. lab-15/templates/edit_twit_mysql_10.html | 35 +++++++
  168. lab-15/templates/edit_twit_mysql_6.html | 35 +++++++
  169. lab-15/templates/edit_twit_mysql_7.html | 35 +++++++
  170. lab-15/templates/edit_twit_mysql_8.html | 35 +++++++
  171. lab-15/templates/edit_twit_mysql_9.html | 35 +++++++
  172. lab-15/templates/edit_twit_mysql_flasklogin.html | 35 +++++++
  173. lab-15/templates/get_headlines.html | 20 ++++
  174. lab-15/templates/login.html | 60 ++++++++++++
  175. lab-15/templates/login_10.html | 57 ++++++++++++
  176. lab-15/templates/login_8.html | 57 ++++++++++++
  177. lab-15/templates/login_9.html | 57 ++++++++++++
  178. lab-15/templates/login_flasklogin.html | 57 ++++++++++++
  179. lab-15/templates/mytwits_mysql_10.html | 15 +++
  180. lab-15/templates/mytwits_mysql_6.html | 15 +++
  181. lab-15/templates/mytwits_mysql_7.html | 15 +++
  182. lab-15/templates/mytwits_mysql_8.html | 15 +++
  183. lab-15/templates/mytwits_mysql_9.html | 15 +++
  184. lab-15/templates/mytwits_mysql_flasklogin.html | 15 +++
  185. lab-15/user.py | 28 ++++++
  186. lab-15/user.pyc | Bin 0 -> 1840 bytes
  187. lab-15/vs_url_for.py | 10 ++
  188. lab-15/vs_url_for.pyc | Bin 0 -> 504 bytes
  189. lab-17/step-1/dbhelper.py | 69 ++++++++++++++
  190. lab-17/step-1/dbhelper.pyc | Bin 0 -> 4074 bytes
  191. lab-17/step-1/forms.py | 24 +++++
  192. lab-17/step-1/forms.pyc | Bin 0 -> 1678 bytes
  193. lab-17/step-1/mytwits_mysql.py | 100 ++++++++++++++++++++
  194. lab-17/step-1/templates/add_twit_mysql.html | 32 +++++++
  195. lab-17/step-1/templates/base.html | 39 ++++++++
  196. lab-17/step-1/templates/edit_twit_mysql.html | 35 +++++++
  197. lab-17/step-1/templates/login.html | 57 ++++++++++++
  198. lab-17/step-1/templates/mytwits_mysql.html | 15 +++
  199. lab-17/step-1/user.py | 28 ++++++
  200. lab-17/step-1/user.pyc | Bin 0 -> 1903 bytes
  201. lab-17/step-1/vs_url_for.py | 11 +++
  202. lab-17/step-1/vs_url_for.pyc | Bin 0 -> 510 bytes
  203. lab-17/step-2/dbhelper.py | 73 +++++++++++++++
  204. lab-17/step-2/dbhelper.pyc | Bin 0 -> 4160 bytes
  205. lab-17/step-2/forms.py | 24 +++++
  206. lab-17/step-2/forms.pyc | Bin 0 -> 1678 bytes
  207. lab-17/step-2/mytwits_mysql.py | 148 +++++++++++++++++++++++++++++
  208. lab-17/step-2/mytwits_mysql_template.py | 109 ++++++++++++++++++++++
  209. lab-17/step-2/templates/add_twit_mysql.html | 32 +++++++
  210. lab-17/step-2/templates/base.html | 39 ++++++++
  211. lab-17/step-2/templates/edit_twit_mysql.html | 35 +++++++
  212. lab-17/step-2/templates/login.html | 57 ++++++++++++
  213. lab-17/step-2/templates/mytwits_mysql.html | 15 +++
  214. lab-17/step-2/user.py | 28 ++++++
  215. lab-17/step-2/user.pyc | Bin 0 -> 1903 bytes
  216. lab-17/step-2/vs_url_for.py | 11 +++
  217. lab-17/step-2/vs_url_for.pyc | Bin 0 -> 510 bytes
  218. lab-18/forms.py | 24 +++++
  219. lab-18/models.py | 46 +++++++++
  220. lab-18/mytwits_mysql.py | 153 ++++++++++++++++++++++++++++++
  221. lab-18/passwordhelper.py | 13 +++
  222. lab-18/templates/add_twit_mysql.html | 32 +++++++
  223. lab-18/templates/base.html | 47 ++++++++++
  224. lab-18/templates/edit_twit_mysql.html | 35 +++++++
  225. lab-18/templates/login.html | 57 ++++++++++++
  226. lab-18/templates/mytwits_mysql.html | 16 ++++
  227. lab-18/templates/timeline.html | 16 ++++
  228. lab-18/user.py | 29 ++++++
  229. lab-18/vs_url_for.py | 10 ++
  230. lab-20/step-0/dbhelper.py | 73 +++++++++++++++
  231. lab-20/step-0/dbhelper.pyc | Bin 0 -> 4160 bytes
  232. lab-20/step-0/forms.py | 24 +++++
  233. lab-20/step-0/forms.pyc | Bin 0 -> 1678 bytes
  234. lab-20/step-0/mytwits_mysql.py | 92 ++++++++++++++++++
  235. lab-20/step-0/templates/add_twit_mysql.html | 32 +++++++
  236. lab-20/step-0/templates/base.html | 46 +++++++++
  237. lab-20/step-0/templates/edit_twit_mysql.html | 35 +++++++
  238. lab-20/step-0/templates/login.html | 57 ++++++++++++
  239. lab-20/step-0/templates/mytwits_mysql.html | 15 +++
  240. lab-20/step-0/user.py | 28 ++++++
  241. lab-20/step-0/user.pyc | Bin 0 -> 1918 bytes
  242. lab-20/step-0/vs_url_for.py | 11 +++
  243. lab-20/step-0/vs_url_for.pyc | Bin 0 -> 510 bytes
  244. lab-20/step-1/dbhelper.py | 75 +++++++++++++++
  245. lab-20/step-1/dbhelper.pyc | Bin 0 -> 4176 bytes
  246. lab-20/step-1/forms.py | 24 +++++
  247. lab-20/step-1/forms.pyc | Bin 0 -> 1678 bytes
  248. lab-20/step-1/mytwits_mysql.py | 54 +++++++++++
  249. lab-20/step-1/templates/add_twit_mysql.html | 32 +++++++
  250. lab-20/step-1/templates/base.html | 46 +++++++++
  251. lab-20/step-1/templates/edit_twit_mysql.html | 35 +++++++
  252. lab-20/step-1/templates/login.html | 57 ++++++++++++
  253. lab-20/step-1/templates/mytwits_mysql.html | 15 +++
  254. lab-20/step-1/twits_blueprint.py | 54 +++++++++++
  255. lab-20/step-1/twits_blueprint.pyc | Bin 0 -> 2655 bytes
  256. lab-20/step-1/user.py | 28 ++++++
  257. lab-20/step-1/user.pyc | Bin 0 -> 1924 bytes
  258. lab-20/step-1/vs_url_for.py | 11 +++
  259. lab-20/step-1/vs_url_for.pyc | Bin 0 -> 510 bytes
  260. lab-20/step-2/dbhelper.py | 75 +++++++++++++++
  261. lab-20/step-2/dbhelper.pyc | Bin 0 -> 3879 bytes
  262. lab-20/step-2/forms.py | 24 +++++
  263. lab-20/step-2/forms.pyc | Bin 0 -> 1702 bytes
  264. lab-20/step-2/login_blueprint.py | 53 +++++++++++
  265. lab-20/step-2/login_blueprint.pyc | Bin 0 -> 2306 bytes
  266. lab-20/step-2/mytwits_mysql.py | 14 +++
  267. lab-20/step-2/templates/add_twit_mysql.html | 32 +++++++
  268. lab-20/step-2/templates/base.html | 45 +++++++++
  269. lab-20/step-2/templates/edit_twit_mysql.html | 35 +++++++
  270. lab-20/step-2/templates/login.html | 57 ++++++++++++
  271. lab-20/step-2/templates/mytwits_mysql.html | 15 +++
  272. lab-20/step-2/twits_blueprint.py | 54 +++++++++++
  273. lab-20/step-2/twits_blueprint.pyc | Bin 0 -> 2520 bytes
  274. lab-20/step-2/user.py | 28 ++++++
  275. lab-20/step-2/user.pyc | Bin 0 -> 1681 bytes
  276. lab-20/step-2/vs_url_for.py | 11 +++
  277. lab-20/step-2/vs_url_for.pyc | Bin 0 -> 522 bytes
  278. lab-20/step-3/dbhelper.py | 75 +++++++++++++++
  279. lab-20/step-3/forms.py | 24 +++++
  280. lab-20/step-3/login/__init__.py | 0
  281. lab-20/step-3/login/login_blueprint.py | 53 +++++++++++
  282. lab-20/step-3/login/templates/login/login.html | 57 ++++++++++++
  283. lab-20/step-3/mytwits_mysql.py | 13 +++
  284. lab-20/step-3/templates/add_twit_mysql.html | 32 +++++++
  285. lab-20/step-3/templates/base.html | 45 +++++++++
  286. lab-20/step-3/templates/edit_twit_mysql.html | 35 +++++++
  287. lab-20/step-3/templates/mytwits_mysql.html | 15 +++
  288. lab-20/step-3/twits_blueprint.py | 54 +++++++++++
  289. lab-20/step-3/user.py | 28 ++++++
  290. lab-20/step-3/vs_url_for.py | 11 +++
  291. lab-3/sql/Account_Inserts.sql | 51 ++++++++++
  292. lab-3/sql/FluckGiven_Inserts.sql | 40 ++++++++
  293. lab-3/sql/Flucks_Schema.sql | 39 ++++++++
  294. lab-3/sql/MediaServe_Inserts.sql | 101 ++++++++++++++++++++
  295. lab-3/sql/Media_Inserts.sql | 21 +++++
  296. lab-5/README.md | 19 ++++
  297. lab-5/cgi-bin/splash.py | 20 ++++
  298. lab-5/cgi-bin/splash2.py | 42 +++++++++
  299. lab-5/cgi-bin/splash2_fixed.py | 44 +++++++++
  300. lab-5/dump/catflucks/accounts.bson | Bin 0 -> 11369 bytes
  301. lab-5/dump/catflucks/accounts.metadata.json | 1 +
  302. lab-5/dump/catflucks/flucks.bson | Bin 0 -> 4350 bytes
  303. lab-5/dump/catflucks/flucks.metadata.json | 1 +
  304. lab-5/dump/catflucks/images.bson | Bin 0 -> 4375 bytes
  305. lab-5/dump/catflucks/images.metadata.json | 1 +
  306. lab-5/dump/catflucks/system.indexes.bson | Bin 0 -> 215 bytes
  307. lab-5/index.html | 11 +++
  308. lab-5/simpleServer.py | 26 ++++++
  309. lab-5/verySimpleServer.py | 24 +++++
  310. lab-6/cgi-bin/serve_cat.py | 50 ++++++++++
  311. lab-6/cgi-bin/serve_fluckable_cat.py | 74 +++++++++++++++
  312. lab-6/cgi-bin/utils.py | 30 ++++++
  313. lab-6/dump/catflucks/accounts.bson | Bin 0 -> 11357 bytes
  314. lab-6/dump/catflucks/accounts.metadata.json | 1 +
  315. lab-6/dump/catflucks/flucks.bson | Bin 0 -> 5150 bytes
  316. lab-6/dump/catflucks/flucks.metadata.json | 1 +
  317. lab-6/dump/catflucks/images.bson | Bin 0 -> 4375 bytes
  318. lab-6/dump/catflucks/images.metadata.json | 1 +
  319. lab-6/dump/catflucks/system.indexes.bson | Bin 0 -> 215 bytes
  320. lab-6/mysql_connector.ipynb | 244 ++++++++++++++++++++++++++++++++++++++++++++++++
  321. lab-6/simpleServer.py | 26 ++++++
  322. lab-7/README.md | 15 +++
  323. lab-7/cgi-bin/config.py | 16 ++++
  324. lab-7/cgi-bin/splash.py | 72 +++++++++++++++
  325. lab-7/cgi-bin/utils.py | 59 ++++++++++++
  326. lab-7/simpleServer.py | 26 ++++++
  327. lab-7/templates/cat_stats.html | 1 +
  328. lab-7/templates/footer.html | 1 +
  329. lab-7/templates/form_fluck.html | 5 +
  330. lab-7/templates/header.html | 9 ++
  331. lab-7/templates/serve_cat.html | 2 +
  332. lab-8/README.md | 18 ++++
  333. lab-8/cgi-bin/config.py | 16 ++++
  334. lab-8/cgi-bin/login.py | 61 ++++++++++++
  335. lab-8/cgi-bin/splash.py | 75 +++++++++++++++
  336. lab-8/cgi-bin/utils.py | 59 ++++++++++++
  337. lab-8/simpleServer.py | 26 ++++++
  338. lab-8/templates/cat_stats.html | 1 +
  339. lab-8/templates/footer.html | 1 +
  340. lab-8/templates/form_fluck.html | 5 +
  341. lab-8/templates/header.html | 9 ++
  342. lab-8/templates/login.html | 10 ++
  343. lab-8/templates/serve_cat.html | 2 +
  344. lab-9/README.md | 44 +++++++++
  345. lab-9/cgi-bin/components.py | 256 +++++++++++++++++++++++++++++++++++++++++++++++++++
  346. lab-9/cgi-bin/config.py | 16 ++++
  347. lab-9/cgi-bin/register.py | 49 ++++++++++
  348. lab-9/cgi-bin/splash.py | 96 +++++++++++++++++++
  349. lab-9/cgi-bin/tests.py | 36 ++++++++
  350. lab-9/cgi-bin/utils.py | 59 ++++++++++++
  351. lab-9/css/style.css | 50 ++++++++++
  352. lab-9/dump/catflucks/accounts.bson | Bin 0 -> 12005 bytes
  353. lab-9/dump/catflucks/accounts.metadata.json | 1 +
  354. lab-9/dump/catflucks/flucks.bson | Bin 0 -> 28850 bytes
  355. lab-9/dump/catflucks/flucks.metadata.json | 1 +
  356. lab-9/dump/catflucks/images.bson | Bin 0 -> 4519 bytes
  357. lab-9/dump/catflucks/images.metadata.json | 1 +
  358. lab-9/simpleServer.py | 26 ++++++
  359. lab-9/templates/cat_stats.html | 4 +
  360. lab-9/templates/footer.html | 2 +
  361. lab-9/templates/form_fluck.html | 9 ++
  362. lab-9/templates/header.html | 11 +++
  363. lab-9/templates/latest_fluck.html | 5 +
  364. lab-9/templates/login.html | 14 +++
  365. lab-9/templates/most_flucked.html | 5 +
  366. lab-9/templates/register.html | 30 ++++++
  367. lab-9/templates/serve_cat.html | 4 +
  368. lab-exercises | 2 +-
  369. term-2-lab/lab-exercises/term-2-labs | 2 +-
  370. 282 files changed, 8074 insertions(+), 2 deletions(-)
  371. mode change 100644 => 100755 README.md
  372. create mode 100644 lab-12/decorator_1.py
  373. create mode 100644 lab-12/decorator_timer.py
  374. create mode 100644 lab-12/headline.py
  375. create mode 100644 lab-12/headlines.py
  376. create mode 100644 lab-12/headlines_if.py
  377. create mode 100644 lab-12/hello_world.py
  378. create mode 100644 lab-12/hello_world_with_templates.py
  379. create mode 100644 lab-12/home.html
  380. create mode 100644 lab-12/if_name_test.py
  381. create mode 100644 lab-12/macros.py
  382. create mode 100644 lab-12/random_headline.py
  383. create mode 100644 lab-12/random_letters.py
  384. create mode 100644 lab-12/show_time.py
  385. create mode 100644 lab-12/show_time_with_filter.py
  386. create mode 100644 lab-12/templates/base.html
  387. create mode 100644 lab-12/templates/headlines.html
  388. create mode 100644 lab-12/templates/headlines_if.html
  389. create mode 100644 lab-12/templates/hello_world.html
  390. create mode 100644 lab-12/templates/macros.html
  391. create mode 100644 lab-12/templates/macros_base.html
  392. create mode 100644 lab-12/templates/macros_page.html
  393. create mode 100644 lab-12/templates/show_time_with_filter.html
  394. create mode 100644 lab-12/url_for.py
  395. create mode 100644 lab-12/url_for_using_vs_url_for.py
  396. create mode 100644 lab-12/username.py
  397. create mode 100644 lab-12/vs_url_for.py
  398. create mode 100644 lab-12/whats_my_name.py
  399. create mode 100644 lab-15/dbhelper.py
  400. create mode 100644 lab-15/dbhelper.pyc
  401. create mode 100644 lab-15/dbhelper_10.py
  402. create mode 100644 lab-15/dbhelper_10.pyc
  403. create mode 100644 lab-15/dbhelper_7.py
  404. create mode 100644 lab-15/dbhelper_7.pyc
  405. create mode 100644 lab-15/dbhelper_8.py
  406. create mode 100644 lab-15/dbhelper_8.pyc
  407. create mode 100644 lab-15/dbhelper_9.py
  408. create mode 100644 lab-15/dbhelper_9.pyc
  409. create mode 100644 lab-15/dbhelper_flasklogin.py
  410. create mode 100644 lab-15/dump.sql
  411. create mode 100644 lab-15/forms.py
  412. create mode 100644 lab-15/forms.pyc
  413. create mode 100644 lab-15/forms_10.py
  414. create mode 100644 lab-15/forms_10.pyc
  415. create mode 100644 lab-15/forms_7.py
  416. create mode 100644 lab-15/forms_7.pyc
  417. create mode 100644 lab-15/forms_8.py
  418. create mode 100644 lab-15/forms_8.pyc
  419. create mode 100644 lab-15/forms_9.py
  420. create mode 100644 lab-15/forms_9.pyc
  421. create mode 100644 lab-15/forms_flasklogin.py
  422. create mode 100644 lab-15/get_headlines_cookies.py
  423. create mode 100644 lab-15/mytwits_mysql_10.py
  424. create mode 100644 lab-15/mytwits_mysql_6.py
  425. create mode 100644 lab-15/mytwits_mysql_7.py
  426. create mode 100644 lab-15/mytwits_mysql_8.py
  427. create mode 100644 lab-15/mytwits_mysql_9.py
  428. create mode 100644 lab-15/mytwits_mysql_flasklogin.py
  429. create mode 100644 lab-15/temp.py
  430. create mode 100644 lab-15/temp_dbhelper.py
  431. create mode 100644 lab-15/temp_dbhelper.pyc
  432. create mode 100644 lab-15/templates/add_twit_mysql_10.html
  433. create mode 100644 lab-15/templates/add_twit_mysql_6.html
  434. create mode 100644 lab-15/templates/add_twit_mysql_7.html
  435. create mode 100644 lab-15/templates/add_twit_mysql_8.html
  436. create mode 100644 lab-15/templates/add_twit_mysql_9.html
  437. create mode 100644 lab-15/templates/add_twit_mysql_flasklogin.html
  438. create mode 100644 lab-15/templates/base.html
  439. create mode 100644 lab-15/templates/base_10.html
  440. create mode 100644 lab-15/templates/base_8.html
  441. create mode 100644 lab-15/templates/base_9.html
  442. create mode 100644 lab-15/templates/base_flasklogin.html
  443. create mode 100644 lab-15/templates/edit_twit_mysql_10.html
  444. create mode 100644 lab-15/templates/edit_twit_mysql_6.html
  445. create mode 100644 lab-15/templates/edit_twit_mysql_7.html
  446. create mode 100644 lab-15/templates/edit_twit_mysql_8.html
  447. create mode 100644 lab-15/templates/edit_twit_mysql_9.html
  448. create mode 100644 lab-15/templates/edit_twit_mysql_flasklogin.html
  449. create mode 100644 lab-15/templates/get_headlines.html
  450. create mode 100644 lab-15/templates/login_10.html
  451. create mode 100644 lab-15/templates/login_8.html
  452. create mode 100644 lab-15/templates/login_9.html
  453. create mode 100644 lab-15/templates/login_flasklogin.html
  454. create mode 100644 lab-15/templates/mytwits_mysql_10.html
  455. create mode 100644 lab-15/templates/mytwits_mysql_6.html
  456. create mode 100644 lab-15/templates/mytwits_mysql_7.html
  457. create mode 100644 lab-15/templates/mytwits_mysql_8.html
  458. create mode 100644 lab-15/templates/mytwits_mysql_9.html
  459. create mode 100644 lab-15/templates/mytwits_mysql_flasklogin.html
  460. create mode 100644 lab-15/user.py
  461. create mode 100644 lab-15/user.pyc
  462. create mode 100644 lab-15/vs_url_for.py
  463. create mode 100644 lab-15/vs_url_for.pyc
  464. create mode 100644 lab-17/step-1/dbhelper.py
  465. create mode 100644 lab-17/step-1/dbhelper.pyc
  466. create mode 100644 lab-17/step-1/forms.py
  467. create mode 100644 lab-17/step-1/forms.pyc
  468. create mode 100644 lab-17/step-1/mytwits_mysql.py
  469. create mode 100644 lab-17/step-1/templates/add_twit_mysql.html
  470. create mode 100644 lab-17/step-1/templates/base.html
  471. create mode 100644 lab-17/step-1/templates/edit_twit_mysql.html
  472. create mode 100644 lab-17/step-1/templates/login.html
  473. create mode 100644 lab-17/step-1/templates/mytwits_mysql.html
  474. create mode 100644 lab-17/step-1/user.py
  475. create mode 100644 lab-17/step-1/user.pyc
  476. create mode 100644 lab-17/step-1/vs_url_for.py
  477. create mode 100644 lab-17/step-1/vs_url_for.pyc
  478. create mode 100644 lab-17/step-2/dbhelper.py
  479. create mode 100644 lab-17/step-2/dbhelper.pyc
  480. create mode 100644 lab-17/step-2/forms.py
  481. create mode 100644 lab-17/step-2/forms.pyc
  482. create mode 100644 lab-17/step-2/mytwits_mysql.py
  483. create mode 100644 lab-17/step-2/mytwits_mysql_template.py
  484. create mode 100644 lab-17/step-2/templates/add_twit_mysql.html
  485. create mode 100644 lab-17/step-2/templates/base.html
  486. create mode 100644 lab-17/step-2/templates/edit_twit_mysql.html
  487. create mode 100644 lab-17/step-2/templates/login.html
  488. create mode 100644 lab-17/step-2/templates/mytwits_mysql.html
  489. create mode 100644 lab-17/step-2/user.py
  490. create mode 100644 lab-17/step-2/user.pyc
  491. create mode 100644 lab-17/step-2/vs_url_for.py
  492. create mode 100644 lab-17/step-2/vs_url_for.pyc
  493. create mode 100644 lab-18/forms.py
  494. create mode 100644 lab-18/models.py
  495. create mode 100644 lab-18/mytwits_mysql.py
  496. create mode 100644 lab-18/passwordhelper.py
  497. create mode 100644 lab-18/templates/add_twit_mysql.html
  498. create mode 100644 lab-18/templates/base.html
  499. create mode 100644 lab-18/templates/edit_twit_mysql.html
  500. create mode 100644 lab-18/templates/login.html
  501. create mode 100644 lab-18/templates/mytwits_mysql.html
  502. create mode 100644 lab-18/templates/timeline.html
  503. create mode 100644 lab-18/user.py
  504. create mode 100644 lab-18/vs_url_for.py
  505. create mode 100644 lab-20/step-0/dbhelper.py
  506. create mode 100644 lab-20/step-0/dbhelper.pyc
  507. create mode 100644 lab-20/step-0/forms.py
  508. create mode 100644 lab-20/step-0/forms.pyc
  509. create mode 100644 lab-20/step-0/mytwits_mysql.py
  510. create mode 100644 lab-20/step-0/templates/add_twit_mysql.html
  511. create mode 100644 lab-20/step-0/templates/base.html
  512. create mode 100644 lab-20/step-0/templates/edit_twit_mysql.html
  513. create mode 100644 lab-20/step-0/templates/login.html
  514. create mode 100644 lab-20/step-0/templates/mytwits_mysql.html
  515. create mode 100644 lab-20/step-0/user.py
  516. create mode 100644 lab-20/step-0/user.pyc
  517. create mode 100644 lab-20/step-0/vs_url_for.py
  518. create mode 100644 lab-20/step-0/vs_url_for.pyc
  519. create mode 100644 lab-20/step-1/dbhelper.py
  520. create mode 100644 lab-20/step-1/dbhelper.pyc
  521. create mode 100644 lab-20/step-1/forms.py
  522. create mode 100644 lab-20/step-1/forms.pyc
  523. create mode 100644 lab-20/step-1/mytwits_mysql.py
  524. create mode 100644 lab-20/step-1/templates/add_twit_mysql.html
  525. create mode 100644 lab-20/step-1/templates/base.html
  526. create mode 100644 lab-20/step-1/templates/edit_twit_mysql.html
  527. create mode 100644 lab-20/step-1/templates/login.html
  528. create mode 100644 lab-20/step-1/templates/mytwits_mysql.html
  529. create mode 100644 lab-20/step-1/twits_blueprint.py
  530. create mode 100644 lab-20/step-1/twits_blueprint.pyc
  531. create mode 100644 lab-20/step-1/user.py
  532. create mode 100644 lab-20/step-1/user.pyc
  533. create mode 100644 lab-20/step-1/vs_url_for.py
  534. create mode 100644 lab-20/step-1/vs_url_for.pyc
  535. create mode 100644 lab-20/step-2/dbhelper.py
  536. create mode 100644 lab-20/step-2/dbhelper.pyc
  537. create mode 100644 lab-20/step-2/forms.py
  538. create mode 100644 lab-20/step-2/forms.pyc
  539. create mode 100644 lab-20/step-2/login_blueprint.py
  540. create mode 100644 lab-20/step-2/login_blueprint.pyc
  541. create mode 100644 lab-20/step-2/mytwits_mysql.py
  542. create mode 100644 lab-20/step-2/templates/add_twit_mysql.html
  543. create mode 100644 lab-20/step-2/templates/base.html
  544. create mode 100644 lab-20/step-2/templates/edit_twit_mysql.html
  545. create mode 100644 lab-20/step-2/templates/login.html
  546. create mode 100644 lab-20/step-2/templates/mytwits_mysql.html
  547. create mode 100644 lab-20/step-2/twits_blueprint.py
  548. create mode 100644 lab-20/step-2/twits_blueprint.pyc
  549. create mode 100644 lab-20/step-2/user.py
  550. create mode 100644 lab-20/step-2/user.pyc
  551. create mode 100644 lab-20/step-2/vs_url_for.py
  552. create mode 100644 lab-20/step-2/vs_url_for.pyc
  553. create mode 100644 lab-20/step-3/dbhelper.py
  554. create mode 100644 lab-20/step-3/forms.py
  555. create mode 100644 lab-20/step-3/login/__init__.py
  556. create mode 100644 lab-20/step-3/login/login_blueprint.py
  557. create mode 100644 lab-20/step-3/login/templates/login/login.html
  558. create mode 100644 lab-20/step-3/mytwits_mysql.py
  559. create mode 100644 lab-20/step-3/templates/add_twit_mysql.html
  560. create mode 100644 lab-20/step-3/templates/base.html
  561. create mode 100644 lab-20/step-3/templates/edit_twit_mysql.html
  562. create mode 100644 lab-20/step-3/templates/mytwits_mysql.html
  563. create mode 100644 lab-20/step-3/twits_blueprint.py
  564. create mode 100644 lab-20/step-3/user.py
  565. create mode 100644 lab-20/step-3/vs_url_for.py
  566. create mode 100644 lab-3/sql/Account_Inserts.sql
  567. create mode 100644 lab-3/sql/FluckGiven_Inserts.sql
  568. create mode 100644 lab-3/sql/Flucks_Schema.sql
  569. create mode 100644 lab-3/sql/MediaServe_Inserts.sql
  570. create mode 100644 lab-3/sql/Media_Inserts.sql
  571. create mode 100644 lab-5/README.md
  572. create mode 100755 lab-5/cgi-bin/splash.py
  573. create mode 100755 lab-5/cgi-bin/splash2.py
  574. create mode 100755 lab-5/cgi-bin/splash2_fixed.py
  575. create mode 100644 lab-5/dump/catflucks/accounts.bson
  576. create mode 100644 lab-5/dump/catflucks/accounts.metadata.json
  577. create mode 100644 lab-5/dump/catflucks/flucks.bson
  578. create mode 100644 lab-5/dump/catflucks/flucks.metadata.json
  579. create mode 100644 lab-5/dump/catflucks/images.bson
  580. create mode 100644 lab-5/dump/catflucks/images.metadata.json
  581. create mode 100644 lab-5/dump/catflucks/system.indexes.bson
  582. create mode 100755 lab-5/index.html
  583. create mode 100755 lab-5/simpleServer.py
  584. create mode 100755 lab-5/verySimpleServer.py
  585. create mode 100755 lab-6/cgi-bin/serve_cat.py
  586. create mode 100755 lab-6/cgi-bin/serve_fluckable_cat.py
  587. create mode 100755 lab-6/cgi-bin/utils.py
  588. create mode 100644 lab-6/dump/catflucks/accounts.bson
  589. create mode 100644 lab-6/dump/catflucks/accounts.metadata.json
  590. create mode 100644 lab-6/dump/catflucks/flucks.bson
  591. create mode 100644 lab-6/dump/catflucks/flucks.metadata.json
  592. create mode 100644 lab-6/dump/catflucks/images.bson
  593. create mode 100644 lab-6/dump/catflucks/images.metadata.json
  594. create mode 100644 lab-6/dump/catflucks/system.indexes.bson
  595. create mode 100644 lab-6/mysql_connector.ipynb
  596. create mode 100755 lab-6/simpleServer.py
  597. create mode 100644 lab-7/README.md
  598. create mode 100755 lab-7/cgi-bin/config.py
  599. create mode 100755 lab-7/cgi-bin/splash.py
  600. create mode 100755 lab-7/cgi-bin/utils.py
  601. create mode 100755 lab-7/simpleServer.py
  602. create mode 100644 lab-7/templates/cat_stats.html
  603. create mode 100755 lab-7/templates/footer.html
  604. create mode 100755 lab-7/templates/form_fluck.html
  605. create mode 100755 lab-7/templates/header.html
  606. create mode 100755 lab-7/templates/serve_cat.html
  607. create mode 100644 lab-8/README.md
  608. create mode 100755 lab-8/cgi-bin/config.py
  609. create mode 100755 lab-8/cgi-bin/login.py
  610. create mode 100755 lab-8/cgi-bin/splash.py
  611. create mode 100755 lab-8/cgi-bin/utils.py
  612. create mode 100755 lab-8/simpleServer.py
  613. create mode 100644 lab-8/templates/cat_stats.html
  614. create mode 100755 lab-8/templates/footer.html
  615. create mode 100755 lab-8/templates/form_fluck.html
  616. create mode 100755 lab-8/templates/header.html
  617. create mode 100644 lab-8/templates/login.html
  618. create mode 100755 lab-8/templates/serve_cat.html
  619. create mode 100644 lab-9/README.md
  620. create mode 100755 lab-9/cgi-bin/components.py
  621. create mode 100755 lab-9/cgi-bin/config.py
  622. create mode 100755 lab-9/cgi-bin/register.py
  623. create mode 100755 lab-9/cgi-bin/splash.py
  624. create mode 100755 lab-9/cgi-bin/tests.py
  625. create mode 100755 lab-9/cgi-bin/utils.py
  626. create mode 100644 lab-9/css/style.css
  627. create mode 100644 lab-9/dump/catflucks/accounts.bson
  628. create mode 100644 lab-9/dump/catflucks/accounts.metadata.json
  629. create mode 100644 lab-9/dump/catflucks/flucks.bson
  630. create mode 100644 lab-9/dump/catflucks/flucks.metadata.json
  631. create mode 100644 lab-9/dump/catflucks/images.bson
  632. create mode 100644 lab-9/dump/catflucks/images.metadata.json
  633. create mode 100755 lab-9/simpleServer.py
  634. create mode 100644 lab-9/templates/cat_stats.html
  635. create mode 100755 lab-9/templates/footer.html
  636. create mode 100755 lab-9/templates/form_fluck.html
  637. create mode 100755 lab-9/templates/header.html
  638. create mode 100755 lab-9/templates/latest_fluck.html
  639. create mode 100644 lab-9/templates/login.html
  640. create mode 100755 lab-9/templates/most_flucked.html
  641. create mode 100644 lab-9/templates/register.html
  642. create mode 100755 lab-9/templates/serve_cat.html
  643. aalw001@doc168:~/dnw/term-2-lab/lab-exercises/term-2-labs/myOwn$ git commit -am "shows users"
  644. On branch master
  645. Your branch is ahead of 'origin/master' by 2 commits.
  646. (use "git push" to publish your local commits)
  647. Untracked files:
  648. nohup.out
  649. templates/nohup.out
  650. templates/orders.html
  651. ../nohup.out
  652.  
  653. nothing added to commit but untracked files present
  654. aalw001@doc168:~/dnw/term-2-lab/lab-exercises/term-2-labs/myOwn$ git add *
  655. aalw001@doc168:~/dnw/term-2-lab/lab-exercises/term-2-labs/myOwn$ git push git@gitlab.doc.gold.ac.uk:aalw001/term-2-labs.git
  656. Enter passphrase for key '/home/aalw001/.ssh/id_rsa':
  657. Counting objects: 12, done.
  658. Compressing objects: 100% (12/12), done.
  659. Writing objects: 100% (12/12), 2.84 KiB | 0 bytes/s, done.
  660. Total 12 (delta 6), reused 0 (delta 0)
  661. To git@gitlab.doc.gold.ac.uk:aalw001/term-2-labs.git
  662. 9c3f491..be709b7 master -> master
  663. aalw001@doc168:~/dnw/term-2-lab/lab-exercises/term-2-labs/myOwn$ ls
  664. app.py databse.db nohup.out __pycache__ static templates vs_url_for.py
  665. aalw001@doc168:~/dnw/term-2-lab/lab-exercises/term-2-labs/myOwn$ cd templates/
  666. aalw001@doc168:~/dnw/term-2-lab/lab-exercises/term-2-labs/myOwn/templates$ ls
  667. index.html login.html nohup.out orders.html signup.html
  668. aalw001@doc168:~/dnw/term-2-lab/lab-exercises/term-2-labs/myOwn/templates$ git add orders.html
  669. aalw001@doc168:~/dnw/term-2-lab/lab-exercises/term-2-labs/myOwn/templates$ git commit -am "order html"
  670. [master 0244189] order html
  671. 3 files changed, 163 insertions(+)
  672. create mode 100644 myOwn/nohup.out
  673. create mode 100644 myOwn/templates/nohup.out
  674. create mode 100644 myOwn/templates/orders.html
  675. aalw001@doc168:~/dnw/term-2-lab/lab-exercises/term-2-labs/myOwn/templates$ git push git@gitlab.doc.gold.ac.uk:aalw001/term-2-labs.git
  676. Enter passphrase for key '/home/aalw001/.ssh/id_rsa':
  677. Counting objects: 7, done.
  678. Compressing objects: 100% (7/7), done.
  679. Writing objects: 100% (7/7), 1.85 KiB | 0 bytes/s, done.
  680. Total 7 (delta 2), reused 0 (delta 0)
  681. To git@gitlab.doc.gold.ac.uk:aalw001/term-2-labs.git
  682. be709b7..0244189 master -> master
  683. aalw001@doc168:~/dnw/term-2-lab/lab-exercises/term-2-labs/myOwn/templates$ cd ..
  684. aalw001@doc168:~/dnw/term-2-lab/lab-exercises/term-2-labs/myOwn$ ls
  685. app.py databse.db nohup.out __pycache__ static templates vs_url_for.py
  686. aalw001@doc168:~/dnw/term-2-lab/lab-exercises/term-2-labs/myOwn$ vim app.py
  687. aalw001@doc168:~/dnw/term-2-lab/lab-exercises/term-2-labs/myOwn$ cd templates/
  688. aalw001@doc168:~/dnw/term-2-lab/lab-exercises/term-2-labs/myOwn/templates$ vim orders.html
  689. aalw001@doc168:~/dnw/term-2-lab/lab-exercises/term-2-labs/myOwn/templates$ vim total.html
  690. aalw001@doc168:~/dnw/term-2-lab/lab-exercises/term-2-labs/myOwn/templates$ cd ..
  691. aalw001@doc168:~/dnw/term-2-lab/lab-exercises/term-2-labs/myOwn$ vim app.py
  692. aalw001@doc168:~/dnw/term-2-lab/lab-exercises/term-2-labs/myOwn$ mysql -u root -p
  693. Enter password:
  694. ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
  695. aalw001@doc168:~/dnw/term-2-lab/lab-exercises/term-2-labs/myOwn$ mysql -u root -p
  696. Enter password:
  697. Welcome to the MySQL monitor. Commands end with ; or \g.
  698. Your MySQL connection id is 192
  699. Server version: 5.7.21-0ubuntu0.16.04.1 (Ubuntu)
  700.  
  701. Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
  702.  
  703. Oracle is a registered trademark of Oracle Corporation and/or its
  704. affiliates. Other names may be trademarks of their respective
  705. owners.
  706.  
  707. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
  708.  
  709. mysql> use my_app
  710. Reading table information for completion of table and column names
  711. You can turn off this feature to get a quicker startup with -A
  712.  
  713. Database changed
  714. mysql> show tables
  715. -> ;
  716. +------------------+
  717. | Tables_in_my_app |
  718. +------------------+
  719. | orders |
  720. | users |
  721. +------------------+
  722. 2 rows in set (0.00 sec)
  723.  
  724. mysql> exit
  725. Bye
  726. aalw001@doc168:~/dnw/term-2-lab/lab-exercises/term-2-labs/myOwn$ vim app.py
  727. aalw001@doc168:~/dnw/term-2-lab/lab-exercises/term-2-labs/myOwn$ mysql -u root -p
  728. Enter password:
  729. Welcome to the MySQL monitor. Commands end with ; or \g.
  730. Your MySQL connection id is 193
  731. Server version: 5.7.21-0ubuntu0.16.04.1 (Ubuntu)
  732.  
  733. Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
  734.  
  735. Oracle is a registered trademark of Oracle Corporation and/or its
  736. affiliates. Other names may be trademarks of their respective
  737. owners.
  738.  
  739. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
  740.  
  741. mysql> use my_app
  742. Reading table information for completion of table and column names
  743. You can turn off this feature to get a quicker startup with -A
  744.  
  745. Database changed
  746. mysql> show tables;
  747. +------------------+
  748. | Tables_in_my_app |
  749. +------------------+
  750. | orders |
  751. | users |
  752. +------------------+
  753. 2 rows in set (0.00 sec)
  754.  
  755. mysql> select * from orders;
  756. +---------+-------+--------+
  757. | orderID | text | userID |
  758. +---------+-------+--------+
  759. | 1 | shoes | 1 |
  760. +---------+-------+--------+
  761. 1 row in set (0.00 sec)
  762.  
  763. mysql> exit
  764. Bye
  765. aalw001@doc168:~/dnw/term-2-lab/lab-exercises/term-2-labs/myOwn$ vim app.py
  766. aalw001@doc168:~/dnw/term-2-lab/lab-exercises/term-2-labs/myOwn$ cd templates/
  767. aalw001@doc168:~/dnw/term-2-lab/lab-exercises/term-2-labs/myOwn/templates$ vim index.html
  768. aalw001@doc168:~/dnw/term-2-lab/lab-exercises/term-2-labs/myOwn/templates$ vim total.html
  769. aalw001@doc168:~/dnw/term-2-lab/lab-exercises/term-2-labs/myOwn/templates$ cd ..
  770. aalw001@doc168:~/dnw/term-2-lab/lab-exercises/term-2-labs/myOwn$ vim app.py
  771. aalw001@doc168:~/dnw/term-2-lab/lab-exercises/term-2-labs/myOwn$ vim app.py
  772. aalw001@doc168:~/dnw/term-2-lab/lab-exercises/term-2-labs/myOwn$ mysql -u root -p
  773. Enter password:
  774. Welcome to the MySQL monitor. Commands end with ; or \g.
  775. Your MySQL connection id is 196
  776. Server version: 5.7.21-0ubuntu0.16.04.1 (Ubuntu)
  777.  
  778. Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
  779.  
  780. Oracle is a registered trademark of Oracle Corporation and/or its
  781. affiliates. Other names may be trademarks of their respective
  782. owners.
  783.  
  784. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
  785.  
  786. mysql> show my_app
  787. -> ;
  788. ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'my_app' at line 1
  789. mysql> use my_app
  790. Reading table information for completion of table and column names
  791. You can turn off this feature to get a quicker startup with -A
  792.  
  793. Database changed
  794. mysql> show tables;
  795. +------------------+
  796. | Tables_in_my_app |
  797. +------------------+
  798. | orders |
  799. | users |
  800. +------------------+
  801. 2 rows in set (0.00 sec)
  802.  
  803. mysql> grant select on orders to 'admin'@'localhost';
  804. Query OK, 0 rows affected (0.00 sec)
  805.  
  806. mysql> grant insert on orders to 'admin'@'localhost';
  807. Query OK, 0 rows affected (0.00 sec)
  808.  
  809. mysql> exit
  810. Bye
  811. aalw001@doc168:~/dnw/term-2-lab/lab-exercises/term-2-labs/myOwn$ cd templates/
  812. aalw001@doc168:~/dnw/term-2-lab/lab-exercises/term-2-labs/myOwn/templates$ ls
  813. index.html login.html nohup.out orders.html signup.html total.html
  814. aalw001@doc168:~/dnw/term-2-lab/lab-exercises/term-2-labs/myOwn/templates$ vim orders.html
  815.  
  816. {% extends "bootstrap/base.html" %}
  817. {% import "bootstrap/wtf.html" as wtf %}
  818.  
  819. {% block title %}
  820. Orders
  821. {% endblock %}
  822.  
  823. {% block styles %}
  824. {{super()}}
  825. <link rel="stylesheet" href="{{url_for('.static', filename='signin.css')}}">
  826. <link rel="stylesheet" href="{{url_for('.static', filename='bootstrap.css')}}">
  827.  
  828. {% endblock %}
  829.  
  830. {% block content %}
  831. <nav class="navbar navbar-inverse navbar-fixed-top">
  832. <div class="container">
  833. <div class="navbar-header">
  834. <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
  835. <span class="sr-only">Toggle navigation</span>
  836. <span class="icon-bar"></span>
  837. <span class="icon-bar"></span>
  838. <span class="icon-bar"></span>
  839. </button>
  840. <a class="navbar-brand" href="#">Ahmed's App</a>
  841. </div>
  842. <div id="navbar" class="collapse navbar-collapse">
  843. <ul class="nav navbar-nav">
  844. <li><a href="#">Home</a></li>
  845. <li><a href="{{ url_for('login') }}">Login</a></li>
  846. <li><a href="{{ url_for('signup') }}">Sign Up</a></li>
  847. </ul>
  848. </div><!--/.nav-collapse -->
  849. </div>
  850. </nav>
  851.  
  852. <div class="container">
  853. <h1>List of all Users</h1>
  854. <table class="table">
  855. <thead>
  856. <tr>
  857. <th scope="col">#</th>
  858. <th scope="col">First</th>
  859. <th scope="col">Last</th>
  860. <th scope="col">Email</th>
  861. </tr>
  862. </thead>
  863. <tbody>
  864.  
  865. {% for orders in form %}
  866. <tr>
  867. <th scope="row">{{orders.id}}</th>
  868. <th scope="row">{{orders.text}}</th>
  869. <th scope="row">{{orders.userID}}</th>
  870. </tr>
  871. {% endfor %}
  872.  
  873.  
  874. </tbody>
  875.  
  876.  
  877. </div> <!-- /container -->
  878. {% endblock %}
Add Comment
Please, Sign In to add comment