diff --git a/.gitignore b/.gitignore index f0e7a5e..ebf22b4 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,6 @@ mastodon-status/* venv/ __pycache__/ - +settings.py +__init__.py +db.sqlite3 diff --git a/.main.py.swp b/.main.py.swp deleted file mode 100644 index ad67f38..0000000 Binary files a/.main.py.swp and /dev/null differ diff --git a/index.html b/index.html deleted file mode 100755 index 9a84e1a..0000000 --- a/index.html +++ /dev/null @@ -1,102 +0,0 @@ - - - - - - - -
-		
-          __                                          __                      __      
----------/\ \__                                      /\ \                    /\ \__   
----------\ \ ,_\  __  __  __  _   ___    ___   _ __  \_\ \        ___      __\ \ ,_\  
-----------\ \ \/ /\ \/\ \/\ \/'\ /'___\ / __`\/\`'__\/'_` \      /'_ `\  /'__`\ \ \/  
------------\ \ \_\ \ \_\ \/>  <//\ \__//\ \L\ \ \ \//\ \L\ \  __/\ \/\ \/\  __/\ \ \_ 
-------------\ \__\\ \____//\_/\_\ \____\ \____/\ \_\\ \___,_\/\_\ \_\ \_\ \____\\ \__\
--------------\/__/ \/___/ \//\/_/\/____/\/___/  \/_/ \/__,_ /\/_/\/_/\/_/\/____/ \/__/
-							  A friendly Linux community.
-
-		
- - Services we provide: - - Join us: - -
- - Members: - - -
- -
-
-	    .-"""-.
-           '       \
-          |,.  ,-.  |
-          |()L () \ |
-          |,'  `".| |
-          |.___.',| `
-         .j `--"' `  `.
-        / '        '   \
-       / /          `   `.
-      / /            `    .
-     / /              l   |
-    . ,    TuxCord    |   |
-  _ ,"`.             .|   |
- | '   ``.          | [..-'l
- /      `.`,        | '--' `.
-(         `.    __.j         )
- \_        |--""___|      ,-'
-   `"--...,+""""   `._,.-' mh
-
-			
-
- - - diff --git a/main.py b/main.py index fa6cb53..987ea7e 100644 --- a/main.py +++ b/main.py @@ -1,34 +1,32 @@ -from flask import Flask, render_template, request, redirect +from django.shortcuts import render +from django.urls import path +from django.http import HttpResponse +import os from datetime import datetime -app = Flask(__name__) - def decide_ascii(): day = datetime.today().strftime('%d') month = datetime.today().strftime('%m') if month == "12": - return open(f'./ascii/christmas.html', 'r').read() + return open('./ascii/christmas.html', 'r').read() if month == "10": - return open(f'./ascii/halloween.html', 'r').read() + return open('./ascii/halloween.html', 'r').read() else: - return open(f'./ascii/normal.html', 'r').read() + return open('./ascii/normal.html', 'r').read() -@app.route('/') -def index(): +def index(request): ascii_penguin = decide_ascii() - return render_template('index.html', ascii_penguin = ascii_penguin) + return render(request, 'index.html', {'ascii_penguin': ascii_penguin}) -@app.route('/mc') -def mc(): +def mc(request): ascii_penguin = decide_ascii() - return render_template('mc.html', ascii_penguin = ascii_penguin) + return render(request, 'mc.html', {'ascii_penguin': ascii_penguin}) +urlpatterns = [ + path('', index, name='index'), + path('mc', mc, name='mc'), +] -if __name__ == '__main__': - app.run( - debug = True, - host = "0.0.0.0", - port = 8081 - ) - +# In your main file (e.g., manage.py or wsgi.py), set up the server to run. +# Django handles the server running automatically. Configure your settings as needed. diff --git a/mc/.index.html.swp b/mc/.index.html.swp deleted file mode 100644 index 73d839f..0000000 Binary files a/mc/.index.html.swp and /dev/null differ diff --git a/mc/index.html b/mc/index.html deleted file mode 100644 index 0ec310f..0000000 --- a/mc/index.html +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - -
-		
-	  __                                          __                      __      
----------/\ \__                                      /\ \                    /\ \__   
----------\ \ ,_\  __  __  __  _   ___    ___   _ __  \_\ \        ___      __\ \ ,_\  
-----------\ \ \/ /\ \/\ \/\ \/'\ /'___\ / __`\/\`'__\/'_` \      /'_ `\  /'__`\ \ \/  
------------\ \ \_\ \ \_\ \/>  <//\ \__//\ \L\ \ \ \//\ \L\ \  __/\ \/\ \/\  __/\ \ \_ 
-------------\ \__\\ \____//\_/\_\ \____\ \____/\ \_\\ \___,_\/\_\ \_\ \_\ \____\\ \__\
--------------\/__/ \/___/ \//\/_/\/____/\/___/  \/_/ \/__,_ /\/_/\/_/\/_/\/____/ \/__/
-							  A friendly Linux community.
-
-		
- - Name: Tuxcord-MC
- IP/Server Address: mc.tuxcord.net
- Version: 1.12.8
- The server has a whitelist, so join our Discord, Matrix or irc.tuxcord.net and ask
if you can join in the #.minecraft channel.
- The server is cracked, so as to prevent bots and spam, we also have a registration system.
- -
- Rules:
-
    -
  1. - Joking around is Ok, but no directed hate speech. -
  2. -
  3. - Greifing and killing others is permitted. -
  4. -
  5. - No attempting to crash server or disrupt other people's gameplay with lag machines and the like. -
  6. -
  7. - While greifing is permitted in most cases, do not greif the main end island -
  8. -
- -
-
-	    .-"""-.
-           '       \
-          |,.  ,-.  |
-          |()L () \ |
-          |,'  `".| |
-          |.___.',| `
-         .j `--"' `  `.
-        / '        '   \
-       / /          `   `.
-      / /            `    .
-     / /              l   |
-    . ,    TuxCord    |   |
-  _ ,"`.             .|   |
- | '   ``.          | [..-'l
- /      `.`,        | '--' `.
-(         `.    __.j         )
- \_        |--""___|      ,-'
-   `"--...,+""""   `._,.-' mh
-
-			
-
- - - diff --git a/templates/.mc.html.swp b/templates/.mc.html.swp deleted file mode 100644 index 5e1aec5..0000000 Binary files a/templates/.mc.html.swp and /dev/null differ diff --git a/templates/head.html b/templates/head.html deleted file mode 100644 index d33f8e1..0000000 --- a/templates/head.html +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/tuxcord.png b/tuxcord.png deleted file mode 100755 index 571f32c..0000000 Binary files a/tuxcord.png and /dev/null differ diff --git a/ascii/christmas.html b/tuxcord/ascii/christmas.html similarity index 100% rename from ascii/christmas.html rename to tuxcord/ascii/christmas.html diff --git a/ascii/halloween.html b/tuxcord/ascii/halloween.html similarity index 100% rename from ascii/halloween.html rename to tuxcord/ascii/halloween.html diff --git a/ascii/normal.html b/tuxcord/ascii/normal.html similarity index 100% rename from ascii/normal.html rename to tuxcord/ascii/normal.html diff --git a/ascii/singles-day.html b/tuxcord/ascii/singles-day.html similarity index 100% rename from ascii/singles-day.html rename to tuxcord/ascii/singles-day.html diff --git a/tuxcord/manage.py b/tuxcord/manage.py new file mode 100755 index 0000000..8df3737 --- /dev/null +++ b/tuxcord/manage.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python +"""Django's command-line utility for administrative tasks.""" +import os +import sys + + +def main(): + """Run administrative tasks.""" + os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'tuxcord.settings') + try: + from django.core.management import execute_from_command_line + except ImportError as exc: + raise ImportError( + "Couldn't import Django. Are you sure it's installed and " + "available on your PYTHONPATH environment variable? Did you " + "forget to activate a virtual environment?" + ) from exc + execute_from_command_line(sys.argv) + + +if __name__ == '__main__': + main() diff --git a/favicon.ico b/tuxcord/static/favicon.ico similarity index 100% rename from favicon.ico rename to tuxcord/static/favicon.ico diff --git a/static/index.css b/tuxcord/static/index.css similarity index 100% rename from static/index.css rename to tuxcord/static/index.css diff --git a/robots.txt b/tuxcord/static/robots.txt similarity index 100% rename from robots.txt rename to tuxcord/static/robots.txt diff --git a/templates/footer.html b/tuxcord/templates/footer.html similarity index 100% rename from templates/footer.html rename to tuxcord/templates/footer.html diff --git a/tuxcord/templates/head.html b/tuxcord/templates/head.html new file mode 100644 index 0000000..89d42a3 --- /dev/null +++ b/tuxcord/templates/head.html @@ -0,0 +1,5 @@ +{% load static %} + + +Tuxcord.NET + diff --git a/templates/header.html b/tuxcord/templates/header.html similarity index 92% rename from templates/header.html rename to tuxcord/templates/header.html index c3e038e..78a41cc 100644 --- a/templates/header.html +++ b/tuxcord/templates/header.html @@ -8,6 +8,6 @@ -----------\ \ \_\ \ \_\ \/> <//\ \__//\ \L\ \ \ \//\ \L\ \ __/\ \/\ \/\ __/\ \ \_ ------------\ \__\\ \____//\_/\_\ \____\ \____/\ \_\\ \___,_\/\_\ \_\ \_\ \____\\ \__\ -------------\/__/ \/___/ \//\/_/\/____/\/___/ \/_/ \/__,_ /\/_/\/_/\/_/\/____/ \/__/ - A friendly Linux community. + A friendly Linux community. diff --git a/templates/index.html b/tuxcord/templates/index.html similarity index 100% rename from templates/index.html rename to tuxcord/templates/index.html diff --git a/templates/mc.html b/tuxcord/templates/mc.html similarity index 100% rename from templates/mc.html rename to tuxcord/templates/mc.html diff --git a/tuxcord/tuxcord/asgi.py b/tuxcord/tuxcord/asgi.py new file mode 100644 index 0000000..d1420ca --- /dev/null +++ b/tuxcord/tuxcord/asgi.py @@ -0,0 +1,16 @@ +""" +ASGI config for tuxcord project. + +It exposes the ASGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/5.2/howto/deployment/asgi/ +""" + +import os + +from django.core.asgi import get_asgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'tuxcord.settings') + +application = get_asgi_application() diff --git a/tuxcord/tuxcord/urls.py b/tuxcord/tuxcord/urls.py new file mode 100644 index 0000000..987ea7e --- /dev/null +++ b/tuxcord/tuxcord/urls.py @@ -0,0 +1,32 @@ +from django.shortcuts import render +from django.urls import path +from django.http import HttpResponse +import os +from datetime import datetime + +def decide_ascii(): + day = datetime.today().strftime('%d') + month = datetime.today().strftime('%m') + + if month == "12": + return open('./ascii/christmas.html', 'r').read() + if month == "10": + return open('./ascii/halloween.html', 'r').read() + else: + return open('./ascii/normal.html', 'r').read() + +def index(request): + ascii_penguin = decide_ascii() + return render(request, 'index.html', {'ascii_penguin': ascii_penguin}) + +def mc(request): + ascii_penguin = decide_ascii() + return render(request, 'mc.html', {'ascii_penguin': ascii_penguin}) + +urlpatterns = [ + path('', index, name='index'), + path('mc', mc, name='mc'), +] + +# In your main file (e.g., manage.py or wsgi.py), set up the server to run. +# Django handles the server running automatically. Configure your settings as needed. diff --git a/tuxcord/tuxcord/wsgi.py b/tuxcord/tuxcord/wsgi.py new file mode 100644 index 0000000..e6440c9 --- /dev/null +++ b/tuxcord/tuxcord/wsgi.py @@ -0,0 +1,16 @@ +""" +WSGI config for tuxcord project. + +It exposes the WSGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/5.2/howto/deployment/wsgi/ +""" + +import os + +from django.core.wsgi import get_wsgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'tuxcord.settings') + +application = get_wsgi_application()