Spaces:
No application file
No application file
Download auth.py from dramit80/ASHRAMSCHOOL2026: direct link, hf CLI and curl.
- Browser
- Download file 641 Bytes
-
https://huggingface.co/spaces/dramit80/ASHRAMSCHOOL2026/resolve/main/auth.py
- Command line
-
hf download hf://spaces/dramit80/ASHRAMSCHOOL2026/auth.py
-
curl -L -o auth.py https://huggingface.co/spaces/dramit80/ASHRAMSCHOOL2026/resolve/main/auth.py
641 Bytes
| import sqlite3 | |
| def authenticate_user(username, password, user_type): | |
| conn = sqlite3.connect('school_data.db') | |
| cursor = conn.cursor() | |
| cursor.execute(''' | |
| SELECT * FROM users | |
| WHERE username = ? AND password = ? AND user_type = ? | |
| ''', (username, password, user_type)) | |
| user = cursor.fetchone() | |
| conn.close() | |
| if user: | |
| return f"✅ लॉगिन यशस्वी! स्वागत आहे, {username}" | |
| else: | |
| return "❌ लॉगिन अयशस्वी! कृपया तपासा वापरकर्तानाव आणि पासवर्ड" |