feat: added django-pipeline and login templating

This commit is contained in:
Rushil Umaretiya 2023-02-03 17:25:29 -05:00
parent 65f0c03770
commit 9920bf248c
No known key found for this signature in database
GPG Key ID: 4E8FAF9C926AF959
11 changed files with 88 additions and 9 deletions

View File

@ -5,6 +5,7 @@ name = "pypi"
[packages]
django = "4.1"
django-pipeline = "*"
[dev-packages]

16
Pipfile.lock generated
View File

@ -1,7 +1,7 @@
{
"_meta": {
"hash": {
"sha256": "6e083d21ae729f05292ed8d38994c39ad2c02808466a03b60ca48d029f95d26c"
"sha256": "20e0e61a140c2a2e5a120e614e8197a4019fe20020b436c81e0b923e68d65148"
},
"pipfile-spec": 6,
"requires": {
@ -26,11 +26,19 @@
},
"django": {
"hashes": [
"sha256:4b214a05fe4c99476e99e2445c8b978c8369c18d4dea8e22ec412862715ad763",
"sha256:ff56ebd7ead0fd5dbe06fe157b0024a7aaea2e0593bb3785fb594cf94dad58ef"
"sha256:bceb0fe1a386781af0788cae4108622756cd05e7775448deec04a71ddf87685d",
"sha256:c6fe7ebe7c017fe59f1029821dae0acb5a2ddcd6c9a0138fd20a8bfefac914bc"
],
"index": "pypi",
"version": "==4.1.5"
"version": "==4.1.6"
},
"django-pipeline": {
"hashes": [
"sha256:b0f2748d43e4e773033f563ac0e8c3b2d47b88320abf726eb83e35a7172bf83a",
"sha256:deb278d151c6cc8de3d3eec5e70d8a21527000dd58b616215deba2fa9a51c7e2"
],
"index": "pypi",
"version": "==2.0.9"
},
"sqlparse": {
"hashes": [

8
iaso/apps/auth/urls.py Normal file
View File

@ -0,0 +1,8 @@
from django.urls import path
from . import views
urlpatterns = [
path("", views.index, name="index"),
path("login/", views.login, name="login"),
path("logout/", views.logout, name="logout"),
]

View File

@ -12,4 +12,10 @@ def index(request):
"form": form
}
return render(request, 'auth/login.html', context=context)
return render(request, 'auth/login.html', context=context)
def login(request):
return render(request, 'auth/login.html')
def logout(request):
return render(request, 'auth/logout.html')

View File

@ -10,8 +10,13 @@ BASE_DIR = Path(__file__).resolve().parent.parent
# Application definition
INSTALLED_APPS = [
# iaso
"iaso.apps.users",
# packages
"pipeline",
# django
"django.contrib.admin",
"django.contrib.auth",
"django.contrib.contenttypes",
@ -35,7 +40,7 @@ ROOT_URLCONF = "iaso.urls"
TEMPLATES = [
{
"BACKEND": "django.template.backends.django.DjangoTemplates",
"DIRS": [],
'DIRS': [BASE_DIR / 'templates'],
"APP_DIRS": True,
"OPTIONS": {
"context_processors": [
@ -92,6 +97,23 @@ STATICFILES_DIRS = (
BASE_DIR / 'static/',
)
STATICFILES_STORAGE = 'pipeline.storage.PipelineManifestStorage'
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
'pipeline.finders.PipelineFinder',
)
PIPELINE = {
"CSS_COMPRESSOR": None,
"COMPILERS": ["pipeline.compilers.sass.SASSCompiler"],
"STYLESHEETS": {
}
}
MEDIA_ROOT = BASE_DIR / 'media/'
MEDIA_URL = '/media/'

View File

@ -1 +0,0 @@
/* base.css */

View File

@ -0,0 +1 @@
/* base.scss */

View File

@ -0,0 +1,3 @@
* {
color: red
}

View File

@ -0,0 +1,30 @@
{% extends "base_page.html" %}
{% load static %}
{% load pipeline %}
{% block title %}
{{ block.super }} - login
{% endblock %}
{% block css %}
{{ block.super }}
<link rel="stylesheet" href="{% static 'dist/skeleton.css' %}">
{% stylesheet 'login' %}
{% endblock %}
{% block body %}
<div id="login">
<h1 id="logo"
style="margin-bottom: 10px; color: #000000!important; text-shadow: -0px 0 #DDE3EB, 0 0px #DDE3EB, 0px 0 #DDE3EB, 0 -0px #DDE3EB!important;">
iaso</h1>
<form method="POST" action="?i=redirect&amp;r=YToxOntzOjE6ImkiO3M6NDoibWFpbiI7fQ=="><input type="text" name="user"
style="background: url(https://i.imgur.com/a80wRzt.png) no-repeat scroll 7px 3px; padding-left: 30px; background-size: 17px; width: 184px; margin-bottom: 10px;"><input
type="password" name="pass"
style="background: url(https://i.imgur.com/Z2JxXsv.png) no-repeat scroll 7px 4px; padding-left: 30px; background-size: 16px; width: 184px; margin-bottom: 10px;"><input
type="submit" value="Access">
<blockquote style="border-left: 0px">
<p style="margin-bottom: 10px; font-size: 15px;">Gladness becomes Weeping</p><cite>Amos Tutuola</cite>
</blockquote>
</form><a href="?i=forget" id="forget">don't remember your pass?</a>
</div>
{% endblock %}

View File

@ -1,6 +1,7 @@
from django.contrib import admin
from django.urls import path
from django.urls import path, include
urlpatterns = [
path("admin/", admin.site.urls),
]
path("", include("iaso.apps.auth.urls")),
]