Add htmx and format
This commit is contained in:
@ -2,5 +2,5 @@ from django.apps import AppConfig
|
||||
|
||||
|
||||
class WebsiteConfig(AppConfig):
|
||||
default_auto_field = 'django.db.models.BigAutoField'
|
||||
name = 'app.website'
|
||||
default_auto_field = "django.db.models.BigAutoField"
|
||||
name = "app.website"
|
||||
|
@ -8,9 +8,7 @@ class Profile(AbstractBaseUser):
|
||||
"""User model"""
|
||||
|
||||
email = models.EmailField("Email", unique=True)
|
||||
full_name = models.CharField(
|
||||
max_length=100, verbose_name="Full name", default=""
|
||||
)
|
||||
full_name = models.CharField(max_length=100, verbose_name="Full name", default="")
|
||||
avatar = models.ImageField(verbose_name="Avatar", upload_to="uploads/avatars/")
|
||||
|
||||
USERNAME_FIELD = "email" # make the user log in with the email
|
||||
|
22
app/website/templates/layouts/base.html
Normal file
22
app/website/templates/layouts/base.html
Normal file
@ -0,0 +1,22 @@
|
||||
{% load static %}
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>htmx demo</title>
|
||||
<link rel="icon" type="image/png" href="favicon.png">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, shrink-to-fit=no">
|
||||
<meta name="author" content="Andros Fenollosa">
|
||||
<meta name="generator" content="Django">
|
||||
<meta name="description" content="Demo WebSockets over HTML with htmx">
|
||||
<meta property="og:type" content="website">
|
||||
{# Styles #}
|
||||
<link rel="stylesheet" type="text/css" href="{% static "css/normalize.css" %}">
|
||||
<link rel="stylesheet" type="text/css" href="{% static "css/pico.min.css" %}">
|
||||
{# JavaScript #}
|
||||
<script defer src="{% static "js/htmx.min.js" %}"></script>
|
||||
</head>
|
||||
<body>
|
||||
{% block content %}{% endblock %}
|
||||
</body>
|
||||
</html>
|
5
app/website/templates/pages/posts.html
Normal file
5
app/website/templates/pages/posts.html
Normal file
@ -0,0 +1,5 @@
|
||||
{% extends 'layouts/base.html' %}
|
||||
|
||||
{% block content %}
|
||||
Hola
|
||||
{% endblock %}
|
@ -1,3 +1,5 @@
|
||||
from django.shortcuts import render
|
||||
|
||||
# Create your views here.
|
||||
|
||||
def index(request):
|
||||
return render(request, "pages/posts.html")
|
||||
|
Reference in New Issue
Block a user