├── flaskr.db ├── babel.cfg ├── translations └── de │ └── LC_MESSAGES │ ├── messages.mo │ └── messages.po ├── schema.sql ├── requirements.txt ├── config.py ├── templates ├── login.html ├── show_entries.html └── layout.html ├── .gitignore ├── static └── style.css ├── LICENSE ├── README.md ├── test_flaskr.py └── flaskr.py /flaskr.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phrase/flask-demo-application/HEAD/flaskr.db -------------------------------------------------------------------------------- /babel.cfg: -------------------------------------------------------------------------------- 1 | [python: **.py] 2 | [jinja2: **/templates/**.html] 3 | extensions=jinja2.ext.autoescape,jinja2.ext.with_ 4 | -------------------------------------------------------------------------------- /translations/de/LC_MESSAGES/messages.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phrase/flask-demo-application/HEAD/translations/de/LC_MESSAGES/messages.mo -------------------------------------------------------------------------------- /schema.sql: -------------------------------------------------------------------------------- 1 | drop table if exists entries; 2 | create table entries ( 3 | id integer primary key autoincrement, 4 | title text not null, 5 | 'text' text not null 6 | ); 7 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | Babel==2.10.3 2 | click==8.1.3 3 | Flask==2.2.2 4 | Flask-Babel==2.0.0 5 | Flask-Phrase==1.1.0 6 | importlib-metadata==4.12.0 7 | itsdangerous==2.1.2 8 | Jinja2==3.1.2 9 | MarkupSafe==2.1.1 10 | pytz==2022.2.1 11 | Werkzeug==2.2.2 12 | zipp==3.8.1 13 | -------------------------------------------------------------------------------- /config.py: -------------------------------------------------------------------------------- 1 | # Flask App config 2 | DATABASE='./flaskr.db' 3 | DEBUG=True 4 | SECRET_KEY='development key' 5 | USERNAME='admin' 6 | PASSWORD='default' 7 | 8 | # Babel config 9 | LANGUAGES = { 10 | 'en': 'English', 11 | 'de': 'Deutsch' 12 | } 13 | 14 | # Phrase config 15 | PHRASEAPP_ENABLED = False 16 | PHRASEAPP_PREFIX = '{{__' 17 | PHRASEAPP_SUFFIX = '__}}' 18 | -------------------------------------------------------------------------------- /templates/login.html: -------------------------------------------------------------------------------- 1 | {% extends "layout.html" %} 2 | {% block body %} 3 |
{{ gettext('Error') }}: {{ error }}{% endif %} 5 |
14 | {% endblock %} 15 | -------------------------------------------------------------------------------- /templates/show_entries.html: -------------------------------------------------------------------------------- 1 | {% extends "layout.html" %} 2 | {% block body %} 3 | {% if session.logged_in %} 4 | 13 | {% endif %} 14 |