my-cloud-devops-consulting 1.1.202504111659__py3-none-any.whl → 1.1.202504122212__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- app.py +5 -2
- my_cloud_devops_consulting-1.1.202504122212.dist-info/METADATA +59 -0
- my_cloud_devops_consulting-1.1.202504122212.dist-info/RECORD +5 -0
- my_cloud_devops_consulting-1.1.202504111659.dist-info/METADATA +0 -47
- my_cloud_devops_consulting-1.1.202504111659.dist-info/RECORD +0 -5
- {my_cloud_devops_consulting-1.1.202504111659.dist-info → my_cloud_devops_consulting-1.1.202504122212.dist-info}/WHEEL +0 -0
- {my_cloud_devops_consulting-1.1.202504111659.dist-info → my_cloud_devops_consulting-1.1.202504122212.dist-info}/top_level.txt +0 -0
app.py
CHANGED
@@ -3,13 +3,16 @@ from pymongo import MongoClient
|
|
3
3
|
from werkzeug.security import generate_password_hash, check_password_hash
|
4
4
|
from urllib.parse import quote_plus
|
5
5
|
from bson.objectid import ObjectId
|
6
|
-
|
7
6
|
import os
|
8
7
|
from flask_login import LoginManager,login_user,UserMixin,login_required,logout_user,current_user
|
9
8
|
from settings import SECRET_KEY,MONGO_URI, EMAIL_USER, MONGO_PASSWORD, MONGO_USERNAME
|
10
9
|
from utils import send_email, get_videos
|
10
|
+
|
11
|
+
|
12
|
+
|
11
13
|
app = Flask(__name__)
|
12
|
-
app.secret_key = SECRET_KEY # Secure your secret key with an environment variable
|
14
|
+
app.secret_key = SECRET_KEY # Secure your secret key with an environment variable
|
15
|
+
### app.secret_key = SECRET_KEY isn’t an import at all—it’s just an assignment
|
13
16
|
login_manager = LoginManager()
|
14
17
|
|
15
18
|
login_manager.init_app(app)
|
@@ -0,0 +1,59 @@
|
|
1
|
+
Metadata-Version: 2.1
|
2
|
+
Name: my-cloud-devops-consulting
|
3
|
+
Version: 1.1.202504122212
|
4
|
+
Summary: This is my consulting website for Cloud & DevOps services.
|
5
|
+
Home-page: https://github.com/Betrand1999/project-root
|
6
|
+
Author: Betrand Mutagha
|
7
|
+
Author-email: mmutagha@gmail.com
|
8
|
+
License: UNKNOWN
|
9
|
+
Platform: UNKNOWN
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
11
|
+
Classifier: Programming Language :: Python :: 3.10
|
12
|
+
Classifier: License :: OSI Approved :: MIT License
|
13
|
+
Classifier: Operating System :: OS Independent
|
14
|
+
Requires-Python: >=3.6
|
15
|
+
Description-Content-Type: text/markdown
|
16
|
+
Requires-Dist: Flask>=2.0
|
17
|
+
Requires-Dist: pymongo
|
18
|
+
Requires-Dist: werkzeug
|
19
|
+
Requires-Dist: requests
|
20
|
+
|
21
|
+
## 📦 Import‑to‑Usage Cheat‑Sheet
|
22
|
+
|
23
|
+
Think of the import block as a toolbox: once a name is imported, you can grab it anywhere below that point in the file.
|
24
|
+
This table shows exactly which “tool” is used where in **`app.py`**.
|
25
|
+
|
26
|
+
| Import | Purpose | Where it’s used in `app.py` |
|
27
|
+
|--------|---------|-----------------------------|
|
28
|
+
| **Flask** | Create the web‑app object | `app = Flask(__name__)` |
|
29
|
+
| **render_template** | Render Jinja2 templates | `home`, `login`, `register`, `services`, `contact_form`, `private_videos` |
|
30
|
+
| **request** | Access form data & headers | `login()`, `register()`, `contact_form()` |
|
31
|
+
| **redirect** / **url_for** | Navigate between routes | After login/logout/register; after contact‑form submit |
|
32
|
+
| **session** | Signed cookie for per‑user data | `home()` (`if 'username' in session:`) |
|
33
|
+
| **flash** | One‑shot success/error messages | `register()`, `contact_form()`, `logout()` |
|
34
|
+
| **jsonify** | Return JSON API responses | `login()` (`return jsonify({...})`) |
|
35
|
+
| **MongoClient** | Connect to MongoDB Atlas | `client = MongoClient(decoded_mongo_url)` → all DB calls |
|
36
|
+
| **generate_password_hash** / **check_password_hash** | Secure password hashing & verification | Hash in `register()`, verify in `login()` |
|
37
|
+
| **quote_plus** | URL‑encode credentials in the Mongo URI | Building `decoded_mongo_url` |
|
38
|
+
| **ObjectId** | Convert string → MongoDB primary key | `User.get()` (`ObjectId(user_id)`) |
|
39
|
+
| **os** | Env‑vars & file‑paths (future‑proof) | e.g. `os.getenv()`—not shown yet but reserved |
|
40
|
+
| **LoginManager** | Central auth manager | `login_manager = LoginManager()` & `login_manager.init_app(app)` |
|
41
|
+
| **login_user** | Log a user in | Inside `login()` |
|
42
|
+
| **login_required** | Protect private routes | Decorator on `/logout` (and optionally `/videos`) |
|
43
|
+
| **logout_user** | Log a user out | `logout()` |
|
44
|
+
| **current_user** | Proxy to the logged‑in user | Checks in `login()`, `/videos`, `/logout` |
|
45
|
+
| **UserMixin** | Adds default methods to `User` class | Inherits inside your `User` model |
|
46
|
+
| **SECRET_KEY** | Signs sessions & CSRF tokens | `app.secret_key = SECRET_KEY` |
|
47
|
+
| **MONGO_USERNAME / MONGO_PASSWORD** | Credentials for MongoDB | Interpolated into `decoded_mongo_url` |
|
48
|
+
|
49
|
+
| **MONGO_URI** | (Optional) pre‑built connection string | *Not used* in this file, but kept for flexibility |
|
50
|
+
|
51
|
+
| **EMAIL_USER** | “From” address for outgoing mail | Passed to `send_email()` in `contact_form()` |
|
52
|
+
|
53
|
+
| **send_email** | Helper that sends email via SMTP/API | Two calls in `contact_form()` |
|
54
|
+
|
55
|
+
| **get_videos** | Fetches private‑video metadata | Used in `private_videos()` |
|
56
|
+
|
57
|
+
> **Tip:** Linters like *flake8* will warn you if an import never gets referenced (`F401 unused import`). That’s an easy way to keep the toolbox clean.
|
58
|
+
|
59
|
+
|
@@ -0,0 +1,5 @@
|
|
1
|
+
app.py,sha256=xneaQxVPu56-hZZ3hfxvUIKdbqvktexYKmDLyOA-Tic,5382
|
2
|
+
my_cloud_devops_consulting-1.1.202504122212.dist-info/METADATA,sha256=e0wB7c0_CNwYhlOmoc6N7uktsB3ZuN2dexbdM9zZyrk,3463
|
3
|
+
my_cloud_devops_consulting-1.1.202504122212.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
4
|
+
my_cloud_devops_consulting-1.1.202504122212.dist-info/top_level.txt,sha256=io9g7LCbfmTG1SFKgEOGXmCFB9uMP2H5lerm0HiHWQE,4
|
5
|
+
my_cloud_devops_consulting-1.1.202504122212.dist-info/RECORD,,
|
@@ -1,47 +0,0 @@
|
|
1
|
-
Metadata-Version: 2.1
|
2
|
-
Name: my-cloud-devops-consulting
|
3
|
-
Version: 1.1.202504111659
|
4
|
-
Summary: This is my consulting website for Cloud & DevOps services.
|
5
|
-
Home-page: https://github.com/Betrand1999/project-root
|
6
|
-
Author: Betrand Mutagha
|
7
|
-
Author-email: mmutagha@gmail.com
|
8
|
-
License: UNKNOWN
|
9
|
-
Platform: UNKNOWN
|
10
|
-
Classifier: Programming Language :: Python :: 3
|
11
|
-
Classifier: Programming Language :: Python :: 3.10
|
12
|
-
Classifier: License :: OSI Approved :: MIT License
|
13
|
-
Classifier: Operating System :: OS Independent
|
14
|
-
Requires-Python: >=3.6
|
15
|
-
Description-Content-Type: text/markdown
|
16
|
-
Requires-Dist: Flask>=2.0
|
17
|
-
Requires-Dist: pymongo
|
18
|
-
Requires-Dist: werkzeug
|
19
|
-
Requires-Dist: requests
|
20
|
-
|
21
|
-
sudo systemctl restart sshd
|
22
|
-
3.235.142.37:8443 # rancher
|
23
|
-
|
24
|
-
sudo docker run --privileged -d \
|
25
|
-
--restart=always \
|
26
|
-
-p 8081:80 -p 8443:443 \
|
27
|
-
rancher/rancher
|
28
|
-
|
29
|
-
# docker volume prune -f
|
30
|
-
# untainn the node
|
31
|
-
kubectl taint nodes local-node node.kubernetes.io/disk-pressure:NoSchedule-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
/etc/apache2/sites-available/000-default.conf
|
36
|
-
sudo systemctl restart apache2
|
37
|
-
update docker file for container port
|
38
|
-
update your python app port
|
39
|
-
|
40
|
-
|
41
|
-
#
|
42
|
-
docker rmi -f $(docker images betrand1997/my-static-websites -q)
|
43
|
-
|
44
|
-
./svc.sh start
|
45
|
-
|
46
|
-
|
47
|
-
|
@@ -1,5 +0,0 @@
|
|
1
|
-
app.py,sha256=4jBVjZMMv9yjeO6_CvOeg7Xz0ZjXs3NcNHOznj6WKAU,5294
|
2
|
-
my_cloud_devops_consulting-1.1.202504111659.dist-info/METADATA,sha256=0qKX2ugvg-LHuk3AK52q1izP7QGPwzx95jRwv80Bd08,1168
|
3
|
-
my_cloud_devops_consulting-1.1.202504111659.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
4
|
-
my_cloud_devops_consulting-1.1.202504111659.dist-info/top_level.txt,sha256=io9g7LCbfmTG1SFKgEOGXmCFB9uMP2H5lerm0HiHWQE,4
|
5
|
-
my_cloud_devops_consulting-1.1.202504111659.dist-info/RECORD,,
|
File without changes
|