some changes
This commit is contained in:
32
main.py
32
main.py
@@ -1,32 +0,0 @@
|
|||||||
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.
|
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "DeaDvey",
|
"name": "DeaDvey",
|
||||||
"website": "https://deadvey.com",
|
"website": "https://deadvey.tuxcord.net",
|
||||||
"pfp": "deadvey.png"
|
"pfp": "deadvey.png"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user