Upload 6 files
Browse files
.flaskenv
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
FLASK_APP=main.py
|
2 |
+
FLASK_DEBUG=1
|
app.db
ADDED
Binary file (20.5 kB). View file
|
|
babel.cfg
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
[python: app/**.py]
|
2 |
+
[jinja2: app/templates/**.html]
|
config.py
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import os
|
2 |
+
from dotenv import load_dotenv
|
3 |
+
|
4 |
+
basedir = os.path.abspath(os.path.dirname(__file__))
|
5 |
+
load_dotenv(os.path.join(basedir, '.env'))
|
6 |
+
|
7 |
+
|
8 |
+
class Config:
|
9 |
+
SECRET_KEY = os.environ.get('SECRET_KEY') or 'you-will-never-guess'
|
10 |
+
SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL') or \
|
11 |
+
'sqlite:///' + os.path.join(basedir, 'app.db')
|
12 |
+
MAIL_SERVER = os.environ.get('MAIL_SERVER')
|
13 |
+
MAIL_PORT = int(os.environ.get('MAIL_PORT') or 25)
|
14 |
+
MAIL_USE_TLS = os.environ.get('MAIL_USE_TLS') is not None
|
15 |
+
MAIL_USERNAME = os.environ.get('MAIL_USERNAME')
|
16 |
+
MAIL_PASSWORD = os.environ.get('MAIL_PASSWORD')
|
17 |
+
ADMINS = ['your-email@example.com']
|
18 |
+
LANGUAGES = ['en', 'es']
|
19 |
+
MS_TRANSLATOR_KEY = os.environ.get('MS_TRANSLATOR_KEY')
|
20 |
+
POSTS_PER_PAGE = 25
|
main.py
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import sqlalchemy as sa
|
2 |
+
import sqlalchemy.orm as so
|
3 |
+
from app import create_app, db
|
4 |
+
from app.models import User, Post
|
5 |
+
|
6 |
+
app = create_app()
|
7 |
+
|
8 |
+
|
9 |
+
@app.shell_context_processor
|
10 |
+
def make_shell_context():
|
11 |
+
return {'sa': sa, 'so': so, 'db': db, 'User': User, 'Post': Post}
|
12 |
+
|
13 |
+
# For local system & cloud
|
14 |
+
if __name__ == "__main__":
|
15 |
+
app.run(port=5015)
|
requirements.txt
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
aiosmtpd==1.4.4.post2
|
2 |
+
alembic==1.12.1
|
3 |
+
atpublic==4.0
|
4 |
+
attrs==23.1.0
|
5 |
+
Babel==2.13.1
|
6 |
+
blinker==1.7.0
|
7 |
+
certifi==2023.11.17
|
8 |
+
charset-normalizer==3.3.2
|
9 |
+
click==8.1.7
|
10 |
+
dnspython==2.4.2
|
11 |
+
email-validator==2.1.0.post1
|
12 |
+
Flask==3.0.0
|
13 |
+
flask-babel==4.0.0
|
14 |
+
Flask-Login==0.6.3
|
15 |
+
Flask-Mail==0.9.1
|
16 |
+
Flask-Migrate==4.0.5
|
17 |
+
Flask-Moment==1.0.5
|
18 |
+
Flask-SQLAlchemy==3.1.1
|
19 |
+
Flask-WTF==1.2.1
|
20 |
+
greenlet==3.0.1
|
21 |
+
idna==3.4
|
22 |
+
itsdangerous==2.1.2
|
23 |
+
Jinja2==3.1.2
|
24 |
+
langdetect==1.0.9
|
25 |
+
Mako==1.3.0
|
26 |
+
MarkupSafe==2.1.3
|
27 |
+
packaging==23.2
|
28 |
+
PyJWT==2.8.0
|
29 |
+
python-dotenv==1.0.0
|
30 |
+
pytz==2023.3.post1
|
31 |
+
requests==2.31.0
|
32 |
+
setuptools==68.2.2
|
33 |
+
six==1.16.0
|
34 |
+
SQLAlchemy==2.0.23
|
35 |
+
typing_extensions==4.8.0
|
36 |
+
urllib3==2.1.0
|
37 |
+
Werkzeug==3.0.1
|
38 |
+
WTForms==3.1.1
|