Fix up content

This commit is contained in:
jmsgrogan 2024-02-18 21:27:08 +00:00
parent 7ba077608c
commit 7de5cd52d2
7 changed files with 23 additions and 8 deletions

2
.gitignore vendored
View file

@ -1,5 +1,5 @@
/build
*/uploads
*/mediafiles
*/staticfiles
__pycache__
*.pyc

View file

@ -13,7 +13,7 @@ RUN pip install -r requirements.txt
RUN mkdir staticfiles
RUN mkdir mediafiles
ADD ./uploads /mediafiles
ADD ./mediafiles /mediafiles
# copy project
COPY . .

View file

@ -35,7 +35,8 @@ img {
margin:0 auto;
display: flex;
justify-content: center;
max-width:800px;
max-width:100%;
max-height:300px;
border-radius: 8px;
box-shadow: 0 4px 8px 0;
}
@ -146,7 +147,7 @@ input[type=submit] {
margin-top: 30px;
text-align: center;
font-size: 20px;
width: 50%;
width: 75%;
margin:0 auto;
font-family: GlacialIndifference;
}

View file

@ -7,6 +7,7 @@ urlpatterns = [
path("", views.index, name="index"),
path('login', views.login_view, name="login"),
path("home", views.home, name="home"),
path("afters", views.afters, name="afters"),
path("schedule", views.schedule, name="schedule"),
path("thingstodo", views.things_to_do, name="thingstodo"),
path("travel", views.travel, name="travel"),

View file

@ -27,7 +27,7 @@ _TEMPLATE = """
"""
def handler404(request, exception, template_name="404.html"):
page_names = ["home", "schedule", "thingstodo"]
page_names = ["home", "schedule", "thingstodo", "afters"]
working_path = request.path.lower()
if working_path and working_path[0] == "/":
working_path = working_path[1:]
@ -71,6 +71,10 @@ def login_view(request):
def home(request):
return get_page("Home")
@login_required(login_url="/")
def afters(request):
return get_page("Afters")
def get_page_header(site: Site):
pages = site.page_set.order_by("priority").filter(navigable=True)

View file

@ -22,8 +22,10 @@ BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = os.environ.get("SECRET_KEY")
#DEBUG = bool(os.environ.get("DEBUG", default=0))
#DEBUG=True
if "DJANGO_DEBUG" in os.environ:
DEBUG = os.environ.get("DJANGO_DEBUG") == 1
else:
DEBUG=False
if "DJANGO_ALLOWED_HOSTS" in os.environ:
ALLOWED_HOSTS = os.environ.get("DJANGO_ALLOWED_HOSTS").split(" ")

View file

@ -19,9 +19,16 @@ from django.urls import path, include
from django.conf import settings
from django.conf.urls.static import static
import os
if "DJANGO_ADMIN_PATH" in os.environ:
ADMIN_URL = os.environ.get("DJANGO_ADMIN_PATH") + "/"
else:
ADMIN_URL = "admin/"
urlpatterns = [
path("", include('primary.urls')),
path('admin/', admin.site.urls),
path(ADMIN_URL, admin.site.urls),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
handler404 = 'primary.views.handler404'