from django.contrib.auth import login from django.contrib.auth.models import User from django.contrib.auth.decorators import login_required from django.contrib.auth.signals import user_logged_in, user_logged_out, user_login_failed from django.dispatch import receiver from django.shortcuts import render, redirect from django.views.generic import UpdateView from django.utils.decorators import method_decorator from django.urls import reverse_lazy from howdimain.utils.plogger import Logger from howdimain.utils.get_ip import get_client_ip from .models import Signup, Home from .forms import SignUpForm logger = Logger.getlogger() def home_page(request): welcome_text = Home.objects.last().welcome_text welcome_image = Home.objects.last().welcome_image member_text = Home.objects.last().member_text member_image = Home.objects.last().member_image context = { 'welcome_image': welcome_image, 'welcome_text': welcome_text, 'member_image': member_image, 'member_text': member_text, } return render(request, 'accounts/home.html', context)
Django settings for howdimain project. Generated by 'django-admin startproject' using Django 1.11.4. For more information on this file, see https://docs.djangoproject.com/en/1.11/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.11/ref/settings/ """ import os from decouple import config, Csv from howdimain.utils.plogger import Logger logformat = '%(asctime)s:%(levelname)s:%(message)s' Logger.set_logger(config('LOG_FILE'), logformat, 'INFO') logger = Logger.getlogger() HOWDIMAIN_VERSION = 'https://github.com/bvermeulen/Django/tree/howdimain-digitalocean_v6' HOWDIMAIN_DATE = '21 April 2020 - patch alphavantage.co' HOWDIMAIN_AUTHOR = '*****@*****.**' # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = config('SECRET_KEY') # SECURITY WARNING: don't run with debug turned on in production! DEBUG = config('DEBUG', default=False, cast=bool)