Přeskočit na obsah

Flask/Personal Diary

Z Wikiverzity

Flask/Personal_Diary – osobní diář – příklad aplikace na Flask. Licence GPL/v3

Github

[editovat]

Instalace

[editovat]

Ubuntu

[editovat]
cd Personal_Diary-master
python3 setup.py
Collecting flask
  Downloading Flask-2.3.2-py3-none-any.whl (96 kB)
     |████████████████████████████████| 96 kB 1.3 MB/s 
Collecting click>=8.1.3
  Downloading click-8.1.3-py3-none-any.whl (96 kB)
     |████████████████████████████████| 96 kB 2.2 MB/s 
Collecting blinker>=1.6.2
  Downloading blinker-1.6.2-py3-none-any.whl (13 kB)
Collecting itsdangerous>=2.1.2
  Downloading itsdangerous-2.1.2-py3-none-any.whl (15 kB)
Collecting Jinja2>=3.1.2
  Downloading Jinja2-3.1.2-py3-none-any.whl (133 kB)
     |████████████████████████████████| 133 kB 1.4 MB/s 
Collecting importlib-metadata>=3.6.0; python_version < "3.10"
  Downloading importlib_metadata-6.7.0-py3-none-any.whl (22 kB)
Collecting Werkzeug>=2.3.3
  Downloading Werkzeug-2.3.6-py3-none-any.whl (242 kB)
     |████████████████████████████████| 242 kB 2.2 MB/s 
Collecting MarkupSafe>=2.0
  Downloading MarkupSafe-2.1.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (25 kB)
Collecting zipp>=0.5
  Downloading zipp-3.15.0-py3-none-any.whl (6.8 kB)
Installing collected packages: click, blinker, itsdangerous, MarkupSafe, Jinja2, zipp, importlib-metadata, Werkzeug, flask
  WARNING: The script flask is installed in '/home/petr/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed Jinja2-3.1.2 MarkupSafe-2.1.3 Werkzeug-2.3.6 blinker-1.6.2 click-8.1.3 flask-2.3.2 importlib-metadata-6.7.0 itsdangerous-2.1.2 zipp-3.15.0
Collecting flask-wtf
  Downloading Flask_WTF-1.1.1-py3-none-any.whl (12 kB)
Requirement already satisfied: Flask in /home/petr/.local/lib/python3.8/site-packages (from flask-wtf) (2.3.2)
Requirement already satisfied: itsdangerous in /home/petr/.local/lib/python3.8/site-packages (from flask-wtf) (2.1.2)
Collecting WTForms
  Downloading WTForms-3.0.1-py3-none-any.whl (136 kB)
     |████████████████████████████████| 136 kB 1.5 MB/s 
Requirement already satisfied: importlib-metadata>=3.6.0; python_version < "3.10" in /home/petr/.local/lib/python3.8/site-packages (from Flask->flask-wtf) (6.7.0)
Requirement already satisfied: click>=8.1.3 in /home/petr/.local/lib/python3.8/site-packages (from Flask->flask-wtf) (8.1.3)
Requirement already satisfied: Werkzeug>=2.3.3 in /home/petr/.local/lib/python3.8/site-packages (from Flask->flask-wtf) (2.3.6)
Requirement already satisfied: blinker>=1.6.2 in /home/petr/.local/lib/python3.8/site-packages (from Flask->flask-wtf) (1.6.2)
Requirement already satisfied: Jinja2>=3.1.2 in /home/petr/.local/lib/python3.8/site-packages (from Flask->flask-wtf) (3.1.2)
Requirement already satisfied: MarkupSafe in /home/petr/.local/lib/python3.8/site-packages (from WTForms->flask-wtf) (2.1.3)
Requirement already satisfied: zipp>=0.5 in /home/petr/.local/lib/python3.8/site-packages (from importlib-metadata>=3.6.0; python_version < "3.10"->Flask->flask-wtf) (3.15.0)
Installing collected packages: WTForms, flask-wtf
Successfully installed WTForms-3.0.1 flask-wtf-1.1.1
Requirement already satisfied: wtforms in /home/petr/.local/lib/python3.8/site-packages (3.0.1)
Requirement already satisfied: MarkupSafe in /home/petr/.local/lib/python3.8/site-packages (from wtforms) (2.1.3)
Collecting pyaes
  Downloading pyaes-1.6.1.tar.gz (28 kB)
Building wheels for collected packages: pyaes
  Building wheel for pyaes (setup.py) ... done
  Created wheel for pyaes: filename=pyaes-1.6.1-py3-none-any.whl size=26345 sha256=332583dd08810a896d3dfa1315df5d67231fa7ed21e163beae9650611228b8a9
  Stored in directory: /home/petr/.cache/pip/wheels/aa/ca/9c/8a3c00512585c703edc457db81c066b9609d76758c74f72ac6
Successfully built pyaes
Installing collected packages: pyaes
Successfully installed pyaes-1.6.1
Requirement already satisfied: pillow in /usr/lib/python3/dist-packages (7.0.0)
Collecting datetime
  Downloading DateTime-5.1-py3-none-any.whl (52 kB)
     |████████████████████████████████| 52 kB 408 kB/s 
Collecting zope.interface
  Downloading zope.interface-6.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (249 kB)
     |████████████████████████████████| 249 kB 1.8 MB/s 
Collecting pytz
  Downloading pytz-2023.3-py2.py3-none-any.whl (502 kB)
     |████████████████████████████████| 502 kB 3.5 MB/s 
Requirement already satisfied: setuptools in /usr/lib/python3/dist-packages (from zope.interface->datetime) (45.2.0)
Installing collected packages: zope.interface, pytz, datetime
Successfully installed datetime-5.1 pytz-2023.3 zope.interface-6.0
ERROR: Could not find a version that satisfies the requirement win32com (from versions: none)
ERROR: No matching distribution found for win32com

[INFO] --> All packages are now installed
        Please create an admin password:

        Re-enter the admin password: 

        Admin Username: administrator
        Password: ******************
sh: 1: docs.html: not found
sh: 1: python: not found
  • kdyby náhodou něco chybělo (není můj případ), doinstaluje se:
pip3 install <package-name>
  • Přidám právo:
chmod u+x Run.sh
  • A spustím příkazem:
Run.sh
off
./Run.sh: řádek 2: title: příkaz nenalezen
./Run.sh: řádek 3: cls: příkaz nenalezen
Traceback (most recent call last):
  File "Run.py", line 4, in <module>
    import application
  File "/nvme0n1p7/DATAp7/www/py/flask/Personal_Diary-master/application.py", line 8, in <module>
    import win32com.client
ModuleNotFoundError: No module named 'win32com'
  • Tak nevím, co pořád mají s těmi Windows. Asi tohle:

Cross plateform support will be removed after january, 2020. Only windows operating system will be supported. however, application.py file will always be able to run on linux. We won't provide full support for any other OS than windows.

  • Takže zkusím:
python3 application.py
Traceback (most recent call last):
  File "application.py", line 8, in <module>
    import win32com.client
ModuleNotFoundError: No module named 'win32com'

Na začátku toho application.py je:

from datetime import datetime
from addeventform import EventForm
from db import DB, UsersModel, EventModel
from flask import Flask, session, redirect, flash, render_template, url_for, request
from loginform import LoginForm
from registerform import RegisterForm
from PIL import Image
import win32com.client
import webbrowser
import os

app = Flask(__name__)
app.config['SECRET_KEY'] = 'yandexlyceum_secret_key'
edit = None
read = None
db = DB()

def speak(text, rate = 1):
    speak = win32com.client.Dispatch('Sapi.SpVoice')
    speak.Volume = 100
    speak.Rate = rate
    speak.Speak(text)

Tak to se mi vůbec nelíbí, něco s těmi Windowsy si začínat. Končím.

Další aplikace

[editovat]

Tady můžu hledat další aplikace na GitHubu:

https://github.com/topics/diary-application?l=python

diary-application
Here are 14 public repositories matching this topic... 

Zkusím tedy:

thon | flask | journal | python3 | diary-application | flask-appbuilder

Zkusím pustit demo na: pynote.devsetgo.com

not found

Hledám tedy: https://github.com/topics/diary?l=python

Hazama

[editovat]

https://github.com/krrr/Hazama

Run:

./setup.py build_qt
     running build_qt
     error: lrelease not found
./hazama.py

Install:

./setup.py build_qt
./setup.py install
hazama

Takže zase nic.

Namísto toho si nainstaluju sqlitebrowser a budu to řešit tak.