Skip to content

Commit c20f51b

Browse files
committed
make django real.
2 parents d976fd5 + d6e0e73 commit c20f51b

File tree

231 files changed

+6842
-7553
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

231 files changed

+6842
-7553
lines changed

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,9 @@
44
!.gitignore
55
__pycache__
66
config.py
7+
settings.py
78
*_secret.py
8-
venv/
9+
/media/
10+
/old/
11+
/static/
12+
/venv/

SECURITY.md

Lines changed: 0 additions & 6 deletions
This file was deleted.

TODO.md

Lines changed: 0 additions & 6 deletions
This file was deleted.

__init__.py

Lines changed: 0 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +0,0 @@
1-
"""
2-
ishar_web
3-
https://isharmud.com/
4-
https://github.com/IsharMud/ishar-web
5-
"""
6-
from urllib.parse import urlparse
7-
8-
from flask import Flask
9-
10-
from error_pages import error_pages_bp
11-
from login import login_bp, login_manager
12-
from sentry import sentry_sdk
13-
from database import db_session
14-
from admin import admin_bp
15-
from challenges import challenges_bp
16-
from help import help_bp
17-
from leaders import leaders_bp, leaderboard_bp
18-
from patches import patches_bp
19-
from portal import portal_bp
20-
from sysinfo import sysinfo_bp
21-
from welcome import welcome_bp
22-
23-
from models.globalevent import GlobalEvent
24-
from models.season import Season
25-
26-
27-
# Flask
28-
app = Flask(__name__)
29-
app.config.from_pyfile('config.py')
30-
31-
# Error pages/handlers
32-
app.register_blueprint(error_pages_bp)
33-
34-
# Flask-Login
35-
login_manager.init_app(app)
36-
37-
# Flask Blueprints/pages
38-
app.register_blueprint(admin_bp)
39-
app.register_blueprint(challenges_bp)
40-
app.register_blueprint(help_bp)
41-
app.register_blueprint(leaders_bp)
42-
app.register_blueprint(leaderboard_bp)
43-
app.register_blueprint(login_bp)
44-
app.register_blueprint(patches_bp)
45-
app.register_blueprint(portal_bp)
46-
app.register_blueprint(sysinfo_bp)
47-
app.register_blueprint(welcome_bp)
48-
49-
50-
@app.context_processor
51-
def injects():
52-
"""Add context processor for certain variables on all pages"""
53-
sentry_dsn = app.config['SENTRY_DSN']
54-
sentry_uri = urlparse(sentry_dsn)
55-
return {
56-
'current_season': Season.query.filter_by(
57-
is_active=1
58-
).order_by(
59-
-Season.season_id
60-
).first(),
61-
'global_event_count': GlobalEvent.query.count(),
62-
'sentry_dsn': sentry_dsn,
63-
'sentry_user': sentry_uri.username,
64-
'sentry_event_id': sentry_sdk.last_event_id()
65-
}
66-
67-
68-
@app.teardown_appcontext
69-
def shutdown_session(exception=None):
70-
"""Remove database session at request teardown,
71-
and capture any exceptions"""
72-
if exception:
73-
sentry_sdk.capture_exception(exception)
74-
db_session.remove()
75-
76-
77-
if __name__ == '__main__':
78-
app.run()

admin/__init__.py

Lines changed: 0 additions & 41 deletions
This file was deleted.

admin/accounts.py

Lines changed: 0 additions & 104 deletions
This file was deleted.

admin/events.py

Lines changed: 0 additions & 114 deletions
This file was deleted.

0 commit comments

Comments
 (0)