Skip to content
Snippets Groups Projects
Verified Commit 130d6a1a authored by TheJoeCoder's avatar TheJoeCoder
Browse files

Add app

parent 654d0c39
Branches master
No related tags found
No related merge requests found
from django.contrib import admin
# Register your models here.
from django.apps import AppConfig
class AppConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'app'
from django.db import models
# Create your models here.
from django.test import TestCase
# Create your tests here.
from django.urls import path
from app import views
app_name = "app"
urlpatterns = [
path("", views.home, name="home"),
]
\ No newline at end of file
from allauth.account.decorators import verified_email_required
from django.shortcuts import render
# Create your views here.
@verified_email_required
def home(request):
return render(request, "app/home.html")
\ No newline at end of file
......@@ -42,7 +42,8 @@ INSTALLED_APPS = [
'allauth',
'allauth.account',
'allauth.mfa',
'publicweb.apps.PublicwebConfig'
'publicweb.apps.PublicwebConfig',
'app.apps.AppConfig'
]
MIDDLEWARE = [
......
......@@ -26,5 +26,6 @@ urlpatterns = [
path('admin/', admin.site.urls),
path('accounts/', include('allauth.urls')),
path("accounts/profile/", TemplateView.as_view(template_name="profile.html")),
path("app/", include("app.urls", "app")),
path("", include("publicweb.urls")),
]
......@@ -7,7 +7,7 @@
<header>
<nav class="navbar navbar-expand-lg bg-body-tertiary">
<div class="container-fluid">
<a class="navbar-brand" href="{% url "index" %}">attendio</a>
<a class="navbar-brand" href="{% if user.is_authenticated %}{% url "app:home" %}{% else %}{% url "index" %}{% endif %}">attendio</a>
<button class="navbar-toggler"
type="button"
data-bs-toggle="collapse"
......@@ -22,10 +22,7 @@
aria-label="Project links"
class="navbar-nav me-auto mb-2 mb-lg-0">
<li class="nav-item">
<a class="nav-link active" href="https://docs.allauth.org/">Documentation</a>
</li>
<li class="nav-item">
<a class="nav-link" href="https://codeberg.org/allauth/django-allauth">Repository</a>
<a class="nav-link" href="https://docs.allauth.org/">Documentation</a>
</li>
</ul>
<div class="d-flex flex-column flex-sm-row gap-2 col-lg-3 justify-content-lg-end text-nowrap">
......
{% extends 'app/base.html' %}
{% load django_bootstrap5 %}
{% block title %}django-bootstrap5{% endblock %}
{% block title %}Attendio Home{% endblock %}
{% block content %}
This is <em>bootstrap5</em> for <strong>Django</strong>.
Browse the companies you are a part of here.
{% endblock %}
\ No newline at end of file
{% extends 'app/base.html' %}
{% load django_bootstrap5 %}
{% block title %}django-bootstrap5{% endblock %}
{% block title %}Attendio{% endblock %}
{% block content %}
This is <em>bootstrap5</em> for <strong>Django</strong>.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment