Editing¶
+Editing the Website¶
+-
+
Google Document with Visual Examples: +https://docs.google.com/document/d/1Fg3sQPRXZgesOMI_l_D5dPP1pmXHFjZq-uUedpzqics/edit?usp=sharing
+
From e02312bf3e9a177f5b60f21af71377203a56227a Mon Sep 17 00:00:00 2001 From: Audrey <59182366+nguyenaudrey@users.noreply.github.com> Date: Thu, 27 May 2021 17:02:11 -0700 Subject: [PATCH] Prepped documentation for web hosting --- app/routes.py | 1 + docs/{build/html => }/.buildinfo | 0 docs/.nojekyll | 0 docs/{build/html => }/Editing.html | 0 docs/{build/html => }/Setup.html | 0 docs/{build/html => }/Sphinx.html | 0 docs/{build/html => }/Troubleshooting.html | 0 docs/{build/html => }/User_Management.html | 0 .../{build/html => }/_sources/Editing.rst.txt | 0 docs/{build/html => }/_sources/Sphinx.rst.txt | 0 .../_sources/User_Management.rst.txt | 0 docs/{build/html => }/_sources/index.rst.txt | 0 docs/{build/html => }/_sources/setup.rst.txt | 0 .../_sources/troubleshooting.rst.txt | 0 docs/{build/html => }/_static/alabaster.css | 0 docs/{build/html => }/_static/basic.css | 0 docs/{build/html => }/_static/custom.css | 0 docs/{build/html => }/_static/doctools.js | 0 .../_static/documentation_options.js | 0 docs/{build/html => }/_static/file.png | Bin docs/{build/html => }/_static/jquery-3.5.1.js | 0 docs/{build/html => }/_static/jquery.js | 0 .../{build/html => }/_static/language_data.js | 0 docs/{build/html => }/_static/minus.png | Bin docs/{build/html => }/_static/plus.png | Bin docs/{build/html => }/_static/pygments.css | 0 docs/{build/html => }/_static/searchtools.js | 0 .../html => }/_static/underscore-1.12.0.js | 0 docs/{build/html => }/_static/underscore.js | 0 docs/{build/html => }/genindex.html | 0 docs/{build/html => }/index.html | 0 docs/{build/html => }/objects.inv | 0 docs/{build/html => }/search.html | 0 docs/{build/html => }/searchindex.js | 0 {docs => documentation}/Makefile | 0 .../build/doctrees/Editing.doctree | Bin .../build/doctrees/Sphinx.doctree | Bin .../build/doctrees/User_Management.doctree | Bin .../build/doctrees/environment.pickle | Bin .../build/doctrees/index.doctree | Bin .../build/doctrees/setup.doctree | Bin .../build/doctrees/troubleshooting.doctree | Bin documentation/build/html/.buildinfo | 4 + documentation/build/html/Editing.html | 122 + documentation/build/html/Setup.html | 438 + documentation/build/html/Sphinx.html | 122 + documentation/build/html/Troubleshooting.html | 187 + documentation/build/html/User_Management.html | 183 + .../build/html/_sources/Editing.rst.txt | 0 .../build/html/_sources/Sphinx.rst.txt | 0 .../html/_sources/User_Management.rst.txt | 0 .../build/html/_sources/index.rst.txt | 0 .../build/html/_sources/setup.rst.txt | 0 .../html/_sources/troubleshooting.rst.txt | 0 .../build/html/_static/alabaster.css | 701 + documentation/build/html/_static/basic.css | 861 ++ documentation/build/html/_static/custom.css | 1 + documentation/build/html/_static/doctools.js | 321 + .../html/_static/documentation_options.js | 12 + documentation/build/html/_static/file.png | Bin 0 -> 286 bytes .../build/html/_static/jquery-3.5.1.js | 10872 ++++++++++++++++ documentation/build/html/_static/jquery.js | 2 + .../build/html/_static/language_data.js | 297 + documentation/build/html/_static/minus.png | Bin 0 -> 90 bytes documentation/build/html/_static/plus.png | Bin 0 -> 90 bytes documentation/build/html/_static/pygments.css | 82 + .../build/html/_static/searchtools.js | 522 + .../build/html/_static/underscore-1.12.0.js | 2027 +++ .../build/html/_static/underscore.js | 6 + documentation/build/html/genindex.html | 108 + documentation/build/html/index.html | 142 + documentation/build/html/objects.inv | 9 + documentation/build/html/search.html | 126 + documentation/build/html/searchindex.js | 1 + {docs => documentation}/make.bat | 0 documentation/source/Editing.rst | 8 + documentation/source/Setup.rst | 285 + documentation/source/Sphinx.rst | 11 + documentation/source/Troubleshooting.rst | 70 + documentation/source/User_Management.rst | 53 + {docs => documentation}/source/conf.py | 0 documentation/source/index.rst | 24 + 82 files changed, 17598 insertions(+) rename docs/{build/html => }/.buildinfo (100%) create mode 100644 docs/.nojekyll rename docs/{build/html => }/Editing.html (100%) rename docs/{build/html => }/Setup.html (100%) rename docs/{build/html => }/Sphinx.html (100%) rename docs/{build/html => }/Troubleshooting.html (100%) rename docs/{build/html => }/User_Management.html (100%) rename docs/{build/html => }/_sources/Editing.rst.txt (100%) rename docs/{build/html => }/_sources/Sphinx.rst.txt (100%) rename docs/{build/html => }/_sources/User_Management.rst.txt (100%) rename docs/{build/html => }/_sources/index.rst.txt (100%) rename docs/{build/html => }/_sources/setup.rst.txt (100%) rename docs/{build/html => }/_sources/troubleshooting.rst.txt (100%) rename docs/{build/html => }/_static/alabaster.css (100%) rename docs/{build/html => }/_static/basic.css (100%) rename docs/{build/html => }/_static/custom.css (100%) rename docs/{build/html => }/_static/doctools.js (100%) rename docs/{build/html => }/_static/documentation_options.js (100%) rename docs/{build/html => }/_static/file.png (100%) rename docs/{build/html => }/_static/jquery-3.5.1.js (100%) rename docs/{build/html => }/_static/jquery.js (100%) rename docs/{build/html => }/_static/language_data.js (100%) rename docs/{build/html => }/_static/minus.png (100%) rename docs/{build/html => }/_static/plus.png (100%) rename docs/{build/html => }/_static/pygments.css (100%) rename docs/{build/html => }/_static/searchtools.js (100%) rename docs/{build/html => }/_static/underscore-1.12.0.js (100%) rename docs/{build/html => }/_static/underscore.js (100%) rename docs/{build/html => }/genindex.html (100%) rename docs/{build/html => }/index.html (100%) rename docs/{build/html => }/objects.inv (100%) rename docs/{build/html => }/search.html (100%) rename docs/{build/html => }/searchindex.js (100%) rename {docs => documentation}/Makefile (100%) rename {docs => documentation}/build/doctrees/Editing.doctree (100%) rename {docs => documentation}/build/doctrees/Sphinx.doctree (100%) rename {docs => documentation}/build/doctrees/User_Management.doctree (100%) rename {docs => documentation}/build/doctrees/environment.pickle (100%) rename {docs => documentation}/build/doctrees/index.doctree (100%) rename {docs => documentation}/build/doctrees/setup.doctree (100%) rename {docs => documentation}/build/doctrees/troubleshooting.doctree (100%) create mode 100644 documentation/build/html/.buildinfo create mode 100644 documentation/build/html/Editing.html create mode 100644 documentation/build/html/Setup.html create mode 100644 documentation/build/html/Sphinx.html create mode 100644 documentation/build/html/Troubleshooting.html create mode 100644 documentation/build/html/User_Management.html rename docs/source/Editing.rst => documentation/build/html/_sources/Editing.rst.txt (100%) rename docs/source/Sphinx.rst => documentation/build/html/_sources/Sphinx.rst.txt (100%) rename docs/source/User_Management.rst => documentation/build/html/_sources/User_Management.rst.txt (100%) rename docs/source/index.rst => documentation/build/html/_sources/index.rst.txt (100%) rename docs/source/Setup.rst => documentation/build/html/_sources/setup.rst.txt (100%) rename docs/source/Troubleshooting.rst => documentation/build/html/_sources/troubleshooting.rst.txt (100%) create mode 100644 documentation/build/html/_static/alabaster.css create mode 100644 documentation/build/html/_static/basic.css create mode 100644 documentation/build/html/_static/custom.css create mode 100644 documentation/build/html/_static/doctools.js create mode 100644 documentation/build/html/_static/documentation_options.js create mode 100644 documentation/build/html/_static/file.png create mode 100644 documentation/build/html/_static/jquery-3.5.1.js create mode 100644 documentation/build/html/_static/jquery.js create mode 100644 documentation/build/html/_static/language_data.js create mode 100644 documentation/build/html/_static/minus.png create mode 100644 documentation/build/html/_static/plus.png create mode 100644 documentation/build/html/_static/pygments.css create mode 100644 documentation/build/html/_static/searchtools.js create mode 100644 documentation/build/html/_static/underscore-1.12.0.js create mode 100644 documentation/build/html/_static/underscore.js create mode 100644 documentation/build/html/genindex.html create mode 100644 documentation/build/html/index.html create mode 100644 documentation/build/html/objects.inv create mode 100644 documentation/build/html/search.html create mode 100644 documentation/build/html/searchindex.js rename {docs => documentation}/make.bat (100%) create mode 100644 documentation/source/Editing.rst create mode 100644 documentation/source/Setup.rst create mode 100644 documentation/source/Sphinx.rst create mode 100644 documentation/source/Troubleshooting.rst create mode 100644 documentation/source/User_Management.rst rename {docs => documentation}/source/conf.py (100%) create mode 100644 documentation/source/index.rst diff --git a/app/routes.py b/app/routes.py index db6d7193..cdfa6e6a 100644 --- a/app/routes.py +++ b/app/routes.py @@ -1,6 +1,7 @@ # TITLE: Routes # CONTRIBUTORS: Kathleen Guinee, Audrey Nguyen # DESCRIPTION: Contains the website routes +# IF YOU WANT TO LOCK A PAGE TO LOGGED IN USERS ONLY, USE @login_required UNDER ROUTE DECLARATION AND ABOVE ROUTE DEFINITION import pymysql import os diff --git a/docs/build/html/.buildinfo b/docs/.buildinfo similarity index 100% rename from docs/build/html/.buildinfo rename to docs/.buildinfo diff --git a/docs/.nojekyll b/docs/.nojekyll new file mode 100644 index 00000000..e69de29b diff --git a/docs/build/html/Editing.html b/docs/Editing.html similarity index 100% rename from docs/build/html/Editing.html rename to docs/Editing.html diff --git a/docs/build/html/Setup.html b/docs/Setup.html similarity index 100% rename from docs/build/html/Setup.html rename to docs/Setup.html diff --git a/docs/build/html/Sphinx.html b/docs/Sphinx.html similarity index 100% rename from docs/build/html/Sphinx.html rename to docs/Sphinx.html diff --git a/docs/build/html/Troubleshooting.html b/docs/Troubleshooting.html similarity index 100% rename from docs/build/html/Troubleshooting.html rename to docs/Troubleshooting.html diff --git a/docs/build/html/User_Management.html b/docs/User_Management.html similarity index 100% rename from docs/build/html/User_Management.html rename to docs/User_Management.html diff --git a/docs/build/html/_sources/Editing.rst.txt b/docs/_sources/Editing.rst.txt similarity index 100% rename from docs/build/html/_sources/Editing.rst.txt rename to docs/_sources/Editing.rst.txt diff --git a/docs/build/html/_sources/Sphinx.rst.txt b/docs/_sources/Sphinx.rst.txt similarity index 100% rename from docs/build/html/_sources/Sphinx.rst.txt rename to docs/_sources/Sphinx.rst.txt diff --git a/docs/build/html/_sources/User_Management.rst.txt b/docs/_sources/User_Management.rst.txt similarity index 100% rename from docs/build/html/_sources/User_Management.rst.txt rename to docs/_sources/User_Management.rst.txt diff --git a/docs/build/html/_sources/index.rst.txt b/docs/_sources/index.rst.txt similarity index 100% rename from docs/build/html/_sources/index.rst.txt rename to docs/_sources/index.rst.txt diff --git a/docs/build/html/_sources/setup.rst.txt b/docs/_sources/setup.rst.txt similarity index 100% rename from docs/build/html/_sources/setup.rst.txt rename to docs/_sources/setup.rst.txt diff --git a/docs/build/html/_sources/troubleshooting.rst.txt b/docs/_sources/troubleshooting.rst.txt similarity index 100% rename from docs/build/html/_sources/troubleshooting.rst.txt rename to docs/_sources/troubleshooting.rst.txt diff --git a/docs/build/html/_static/alabaster.css b/docs/_static/alabaster.css similarity index 100% rename from docs/build/html/_static/alabaster.css rename to docs/_static/alabaster.css diff --git a/docs/build/html/_static/basic.css b/docs/_static/basic.css similarity index 100% rename from docs/build/html/_static/basic.css rename to docs/_static/basic.css diff --git a/docs/build/html/_static/custom.css b/docs/_static/custom.css similarity index 100% rename from docs/build/html/_static/custom.css rename to docs/_static/custom.css diff --git a/docs/build/html/_static/doctools.js b/docs/_static/doctools.js similarity index 100% rename from docs/build/html/_static/doctools.js rename to docs/_static/doctools.js diff --git a/docs/build/html/_static/documentation_options.js b/docs/_static/documentation_options.js similarity index 100% rename from docs/build/html/_static/documentation_options.js rename to docs/_static/documentation_options.js diff --git a/docs/build/html/_static/file.png b/docs/_static/file.png similarity index 100% rename from docs/build/html/_static/file.png rename to docs/_static/file.png diff --git a/docs/build/html/_static/jquery-3.5.1.js b/docs/_static/jquery-3.5.1.js similarity index 100% rename from docs/build/html/_static/jquery-3.5.1.js rename to docs/_static/jquery-3.5.1.js diff --git a/docs/build/html/_static/jquery.js b/docs/_static/jquery.js similarity index 100% rename from docs/build/html/_static/jquery.js rename to docs/_static/jquery.js diff --git a/docs/build/html/_static/language_data.js b/docs/_static/language_data.js similarity index 100% rename from docs/build/html/_static/language_data.js rename to docs/_static/language_data.js diff --git a/docs/build/html/_static/minus.png b/docs/_static/minus.png similarity index 100% rename from docs/build/html/_static/minus.png rename to docs/_static/minus.png diff --git a/docs/build/html/_static/plus.png b/docs/_static/plus.png similarity index 100% rename from docs/build/html/_static/plus.png rename to docs/_static/plus.png diff --git a/docs/build/html/_static/pygments.css b/docs/_static/pygments.css similarity index 100% rename from docs/build/html/_static/pygments.css rename to docs/_static/pygments.css diff --git a/docs/build/html/_static/searchtools.js b/docs/_static/searchtools.js similarity index 100% rename from docs/build/html/_static/searchtools.js rename to docs/_static/searchtools.js diff --git a/docs/build/html/_static/underscore-1.12.0.js b/docs/_static/underscore-1.12.0.js similarity index 100% rename from docs/build/html/_static/underscore-1.12.0.js rename to docs/_static/underscore-1.12.0.js diff --git a/docs/build/html/_static/underscore.js b/docs/_static/underscore.js similarity index 100% rename from docs/build/html/_static/underscore.js rename to docs/_static/underscore.js diff --git a/docs/build/html/genindex.html b/docs/genindex.html similarity index 100% rename from docs/build/html/genindex.html rename to docs/genindex.html diff --git a/docs/build/html/index.html b/docs/index.html similarity index 100% rename from docs/build/html/index.html rename to docs/index.html diff --git a/docs/build/html/objects.inv b/docs/objects.inv similarity index 100% rename from docs/build/html/objects.inv rename to docs/objects.inv diff --git a/docs/build/html/search.html b/docs/search.html similarity index 100% rename from docs/build/html/search.html rename to docs/search.html diff --git a/docs/build/html/searchindex.js b/docs/searchindex.js similarity index 100% rename from docs/build/html/searchindex.js rename to docs/searchindex.js diff --git a/docs/Makefile b/documentation/Makefile similarity index 100% rename from docs/Makefile rename to documentation/Makefile diff --git a/docs/build/doctrees/Editing.doctree b/documentation/build/doctrees/Editing.doctree similarity index 100% rename from docs/build/doctrees/Editing.doctree rename to documentation/build/doctrees/Editing.doctree diff --git a/docs/build/doctrees/Sphinx.doctree b/documentation/build/doctrees/Sphinx.doctree similarity index 100% rename from docs/build/doctrees/Sphinx.doctree rename to documentation/build/doctrees/Sphinx.doctree diff --git a/docs/build/doctrees/User_Management.doctree b/documentation/build/doctrees/User_Management.doctree similarity index 100% rename from docs/build/doctrees/User_Management.doctree rename to documentation/build/doctrees/User_Management.doctree diff --git a/docs/build/doctrees/environment.pickle b/documentation/build/doctrees/environment.pickle similarity index 100% rename from docs/build/doctrees/environment.pickle rename to documentation/build/doctrees/environment.pickle diff --git a/docs/build/doctrees/index.doctree b/documentation/build/doctrees/index.doctree similarity index 100% rename from docs/build/doctrees/index.doctree rename to documentation/build/doctrees/index.doctree diff --git a/docs/build/doctrees/setup.doctree b/documentation/build/doctrees/setup.doctree similarity index 100% rename from docs/build/doctrees/setup.doctree rename to documentation/build/doctrees/setup.doctree diff --git a/docs/build/doctrees/troubleshooting.doctree b/documentation/build/doctrees/troubleshooting.doctree similarity index 100% rename from docs/build/doctrees/troubleshooting.doctree rename to documentation/build/doctrees/troubleshooting.doctree diff --git a/documentation/build/html/.buildinfo b/documentation/build/html/.buildinfo new file mode 100644 index 00000000..085a331e --- /dev/null +++ b/documentation/build/html/.buildinfo @@ -0,0 +1,4 @@ +# Sphinx build info version 1 +# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. +config: 4dc2415b54b258b35d504b7408633d2a +tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/documentation/build/html/Editing.html b/documentation/build/html/Editing.html new file mode 100644 index 00000000..4954e5ed --- /dev/null +++ b/documentation/build/html/Editing.html @@ -0,0 +1,122 @@ + + + + +
+ + +Google Document with Visual Examples: +https://docs.google.com/document/d/1Fg3sQPRXZgesOMI_l_D5dPP1pmXHFjZq-uUedpzqics/edit?usp=sharing
Install MySQL https://dev.mysql.com/downloads/installer/ (install +the second option useing all default options)
Install visual studio code https://code.visualstudio.com/ (or +whatever your preferred IDE is)
Install Git if you don’t already have it: +https://git-scm.com/download/win
Clone this repository
+Open the command prompt
cd to whatever folder you want to have the project in
git clone https://<YOUR_GITHUB_USERNAME>@github.com/paolaUWB/QuasarResearchWebsite.git
Check to see if all of the files were cloned
+dir
You should see a new “QuasarResearchWebsite” directory
Open project in visual studio code
+Open visual studio code
File -> Open folder and then navigate to the +QuasarResearchWebsite folder that you just cloned
Set up flask environment:
+Open a new terminal in visual studio
In the terminal python3 -m venv flaskEnv
(this will take a
+couple of seconds to run)
WINDOWS ONLY: flaskEnv/Scripts/activate
You should now see
+something like:
+(flaskEnv) PS C:\Users\guine\Desktop\test\QuasarResearchWebsite>
You may recieve an error message stating “running scripts is +disabled on this system”
To fix this open Windows PowerShell with administration +privileges
+To open, search “PowerShell” in the Windows Start menu and +select “Run as administrator” from the context menu
Enter ‘set-executionpolicy remotesigned’ to PowerShell
When asked “Do you want to change the execution policy?”, +respond with ‘Y’ for yes
MAC ONLY: source venv/bin/activate
You should now see
+something like:
+(flaskEnv) PS C:\Users\guine\Desktop\test\QuasarResearchWebsite>
pip install flask
pip install PyMySQL
pip install Flask-WTF
pip install python-dotenv
pip install flask-sqlalchemy
pip install flask-migrate
pip install flask-login
pip install email-validator
For more instructions on using python environments in visual +studio, see +https://code.visualstudio.com/docs/python/environments
Add the secret environment variables:
+Create a new file in QuasarResearchWebsite/app/ and name it .env
Add your secrets to the file with the following:
+SECRET_KEY=<WHATEVER YOU WANT>
+MYSQL_DATABASE_PASSWORD=<YOUR MYSQL DB/ROOT PASSWORD>
+
Add the path for downloads
+Create a new directory in QuasarResearchWebsite/app/ and name it +tmp
Create a new file in QuasarResearchWebsite/app/tmp and name it +quasars.csv
Setup the MySQL database:
+In the VSCode command line, start mysql with
+& cmd.exe /c "mysql -u root -p --verbose --local-infile=1 < app/quasarDB_win.sql"
,
+and enter your password for root user
python app/updateDatabase_win.py
(this will update the paths
+to the images in the database)
Now check to see if things are working. In the visual studio
+terminal type flask run
If everything is working you should see something like:
+(flaskEnv) PS C:\Users\guine\Desktop\test\QuasarResearchWebsite> flask run
+* Environment: production WARNING: This is a development server. Do not use it in a production deployment.
+Use a production WSGI server instead.
+* Debug mode: off
+* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)``
+
Follow the link on the last line to see if it runs. Your default +internet browser should open to the home page of the website.
Check that the images are loading correctly by going to the “Data +Access” page, clicking on a row and seeing if the image shows up.
Voila! Hopefully it is working :)
Setup Instructions: +https://www.sphinx-doc.org/en/master/usage/installation.html
Tutorial: +https://docs.readthedocs.io/en/stable/intro/getting-started-with-sphinx.html
Basic MySQL Administration: +https://itconnect.uw.edu/connect/web-publishing/shared-hosting/using-mysql-on-shared-uw-hosting/basic-mysql-administration/
Troubleshooting Steps: +https://itconnect.uw.edu/connect/web-publishing/shared-hosting/troubleshooting/
If the Data Access page doesn’t work (E.g. “Internal Server Error”, +data not displaying, etc.) 1. Go to init.py 1. Change the port +number in the method connect_db() to have your port number
To update and access most recent files enter git pull
into the
+terminal when you are in your QuasarResearchWebsite folder
To push your most recent files to the master branch 1. Enter
+git status
to list out files that have been added/changed. the
+names of the files should be red 1. Add files that are unecessary to
+the project to .gitignore 1. Enter git status
To list out files
+again to check if those files were removed. 1. Enter git add .
To
+the terminal. 1. Enter git status
to the terminal. The names of
+the files should now be green. 1. Enter git commit -m "message"
.
+You can change the message to anything you want but it should be
+somewhat descriptive. 1. Enter git `push to the terminal. 1. If this
+is your first time doing so you should type in “git push
+–set-upstream origin YourBranch”. Change “YourBranch” to the actual
+name of the branch. 1. Go to the Github repository to merge your
+request
If you recieve the error message: “running scripts is disabled on this system”
+1. Open Windows PowerShell with administration privileges
+1. To open, search “PowerShell” in the Windows Start menu and select “Run as administrator” from the context menu
+1. Enter set-executionpolicy remotesigned
to PowerShell
+1. When asked “Do you want to change the execution policy?”, respond with Y
for yes
+1. For more information visit: https://www.faqforge.com/windows/windows-powershell-running-scripts-is-disabled-on-this-system/
To add the mysql exe file to the path 1. type “path” into the windows
+search bar and click “edit the system environment variables” 1. click
+on environment variables 1. click on path, then edit, then new 1.
+then add the paths C:\Program Files\MySQL\MySQL Shell 8.0\bin\
+and C:\Program Files\MySQL\MySQL Server 8.0\bin\
to the list 1.
+click ok/apply 1. restart your computer
If you recieve the error mesage: module not found
Type python -m pip list
into VS Code’s terminal
This will list all installed packages
If the package you need is not in the list, enter
+pip install [package name]
to the terminal
For example, if you need to install PyMySql, enter
+pip install PyMySQL
to the terminal
Setting the virtual enviroment in VS Code
+type “path” into the windows search bar and click “edit the +system environment variables”
Use CTRL + SHIFT + P
click on “Python: select interpreter”
Select the path that has flaskEnv/Scripts/ in the path name
To learn more check this page: +https://code.visualstudio.com/docs/python/environments
1. The user database and login system follows these +two tutorials
+++
To view all users 1. flask shell
+1. See list of all usernames
++1. users = User.query.all() +1. users
+
1. users = User.query.all() +1.
++++
+- ::
- +
+
+- for u in users:
- +
… print(u.id, u.username) +…
+
1. flask shell +1. u = User(username=’INSERT USERNAME HERE’, email=’INSERT EMAIL HERE’) +1. u.set_password(‘INSERT PASSWORD HERE’) +1. db.session.add(u) +1. db.session.commit()
+flask shell
users = User.query.all()
for u in users: +… db.session.delete(u) +…
+db.session.commit()
To delete a specific user
+flask shell
Find the id of the user you want to delete.
u = User.query.get(INSERT ID HERE)
db.session.delete(u)
db.session.commit()
' + _('Hide Search Matches') + '
') + .appendTo($('#searchbox')); + } + }, + + /** + * init the domain index toggle buttons + */ + initIndexTable : function() { + var togglers = $('img.toggler').click(function() { + var src = $(this).attr('src'); + var idnum = $(this).attr('id').substr(7); + $('tr.cg-' + idnum).toggle(); + if (src.substr(-9) === 'minus.png') + $(this).attr('src', src.substr(0, src.length-9) + 'plus.png'); + else + $(this).attr('src', src.substr(0, src.length-8) + 'minus.png'); + }).css('display', ''); + if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) { + togglers.click(); + } + }, + + /** + * helper function to hide the search marks again + */ + hideSearchWords : function() { + $('#searchbox .highlight-link').fadeOut(300); + $('span.highlighted').removeClass('highlighted'); + }, + + /** + * make the url absolute + */ + makeURL : function(relativeURL) { + return DOCUMENTATION_OPTIONS.URL_ROOT + '/' + relativeURL; + }, + + /** + * get the current relative url + */ + getCurrentURL : function() { + var path = document.location.pathname; + var parts = path.split(/\//); + $.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() { + if (this === '..') + parts.pop(); + }); + var url = parts.join('/'); + return path.substring(url.lastIndexOf('/') + 1, path.length - 1); + }, + + initOnKeyListeners: function() { + $(document).keydown(function(event) { + var activeElementType = document.activeElement.tagName; + // don't navigate when in search box, textarea, dropdown or button + if (activeElementType !== 'TEXTAREA' && activeElementType !== 'INPUT' && activeElementType !== 'SELECT' + && activeElementType !== 'BUTTON' && !event.altKey && !event.ctrlKey && !event.metaKey + && !event.shiftKey) { + switch (event.keyCode) { + case 37: // left + var prevHref = $('link[rel="prev"]').prop('href'); + if (prevHref) { + window.location.href = prevHref; + return false; + } + case 39: // right + var nextHref = $('link[rel="next"]').prop('href'); + if (nextHref) { + window.location.href = nextHref; + return false; + } + } + } + }); + } +}; + +// quick alias for translations +_ = Documentation.gettext; + +$(document).ready(function() { + Documentation.init(); +}); diff --git a/documentation/build/html/_static/documentation_options.js b/documentation/build/html/_static/documentation_options.js new file mode 100644 index 00000000..23fc755e --- /dev/null +++ b/documentation/build/html/_static/documentation_options.js @@ -0,0 +1,12 @@ +var DOCUMENTATION_OPTIONS = { + URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'), + VERSION: '0.0.1', + LANGUAGE: 'None', + COLLAPSE_INDEX: false, + BUILDER: 'html', + FILE_SUFFIX: '.html', + LINK_SUFFIX: '.html', + HAS_SOURCE: true, + SOURCELINK_SUFFIX: '.txt', + NAVIGATION_WITH_KEYS: false +}; \ No newline at end of file diff --git a/documentation/build/html/_static/file.png b/documentation/build/html/_static/file.png new file mode 100644 index 0000000000000000000000000000000000000000..a858a410e4faa62ce324d814e4b816fff83a6fb3 GIT binary patch literal 286 zcmV+(0pb3MP)