beautifed code and added descriptive comments
This commit is contained in:
parent
db60f32c07
commit
faaa66aa8e
@ -6,23 +6,23 @@ from django.contrib.auth.models import User
|
|||||||
|
|
||||||
from .models import Post, CustomUser
|
from .models import Post, CustomUser
|
||||||
|
|
||||||
|
|
||||||
#external code customised
|
#external code customised
|
||||||
#import from https://docs.djangoproject.com/en/dev/topics/auth/customizing/#extending-the-existing-user-model
|
#import from https://docs.djangoproject.com/en/dev/topics/auth/customizing/#extending-the-existing-user-model
|
||||||
|
#start ---
|
||||||
class CustomUserInline(admin.StackedInline):
|
class CustomUserInline(admin.StackedInline):
|
||||||
model = CustomUser
|
model = CustomUser
|
||||||
can_delete = False
|
can_delete = False
|
||||||
verbose_name_plural = 'customUsers'
|
verbose_name_plural = 'customUsers'
|
||||||
|
|
||||||
#external code customised
|
|
||||||
#import from https://docs.djangoproject.com/en/dev/topics/auth/customizing/#extending-the-existing-user-model
|
|
||||||
# Define a new User admin
|
# Define a new User admin
|
||||||
class UserAdmin(BaseUserAdmin):
|
class UserAdmin(BaseUserAdmin):
|
||||||
inlines = (CustomUserInline, )
|
inlines = (CustomUserInline, )
|
||||||
|
|
||||||
#external code customised
|
|
||||||
#import from https://docs.djangoproject.com/en/dev/topics/auth/customizing/#extending-the-existing-user-model
|
|
||||||
# Re-register UserAdmin
|
# Re-register UserAdmin
|
||||||
admin.site.unregister(User)
|
admin.site.unregister(User)
|
||||||
admin.site.register(User, UserAdmin)
|
admin.site.register(User, UserAdmin)
|
||||||
admin.site.register(Post)
|
admin.site.register(Post)
|
||||||
|
#end ---
|
@ -6,6 +6,7 @@ from django.forms import ModelForm, ValidationError
|
|||||||
|
|
||||||
from taggit.forms import *
|
from taggit.forms import *
|
||||||
|
|
||||||
|
|
||||||
#extended code customised
|
#extended code customised
|
||||||
#import from https://tutorial.djangogirls.org/en/django_forms/
|
#import from https://tutorial.djangogirls.org/en/django_forms/
|
||||||
class PostForm(forms.ModelForm):
|
class PostForm(forms.ModelForm):
|
||||||
|
@ -1,24 +1,29 @@
|
|||||||
from django.db import models
|
from django.db import models
|
||||||
|
|
||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
|
|
||||||
from taggit.managers import TaggableManager
|
from taggit.managers import TaggableManager
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from croniter import croniter
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#external code customised
|
||||||
|
#import from https://docs.djangoproject.com/en/dev/topics/auth/customizing/#extending-the-existing-user-model
|
||||||
class CustomUser(models.Model):
|
class CustomUser(models.Model):
|
||||||
user = models.OneToOneField(User, null=True, on_delete=models.CASCADE)
|
user = models.OneToOneField(User, null=True, on_delete=models.CASCADE)
|
||||||
|
#add tags to User Model with possibility to leave empty
|
||||||
tags = TaggableManager(blank=True)
|
tags = TaggableManager(blank=True)
|
||||||
|
|
||||||
|
|
||||||
|
#external code customised
|
||||||
|
#import from https://tutorial.djangogirls.org/en/django_models/
|
||||||
class Post(models.Model):
|
class Post(models.Model):
|
||||||
author = models.ForeignKey('auth.User', on_delete=models.CASCADE)
|
author = models.ForeignKey('auth.User', on_delete=models.CASCADE)
|
||||||
title = models.CharField(max_length=200)
|
title = models.CharField(max_length=200)
|
||||||
text = models.TextField()
|
text = models.TextField()
|
||||||
created_date = models.DateTimeField(
|
created_date = models.DateTimeField(default=timezone.now)
|
||||||
default=timezone.now)
|
published_date = models.DateTimeField(blank=True, null=True)
|
||||||
published_date = models.DateTimeField(
|
#add tags to Post Model
|
||||||
blank=True, null=True)
|
|
||||||
tags = TaggableManager()
|
tags = TaggableManager()
|
||||||
|
|
||||||
def publish(self):
|
def publish(self):
|
||||||
|
@ -112,6 +112,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
|
<!-- Content -->
|
||||||
<div class="content container">
|
<div class="content container">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
@ -125,5 +126,4 @@
|
|||||||
<script src="{% static 'js/app.js' %}"></script>
|
<script src="{% static 'js/app.js' %}"></script>
|
||||||
<script src="{% static 'bootstrap/js/bootstrap.bundle.js' %}"></script>
|
<script src="{% static 'bootstrap/js/bootstrap.bundle.js' %}"></script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
@ -1,6 +1,12 @@
|
|||||||
|
<!--
|
||||||
|
marked parts of the template is external code
|
||||||
|
import from https://tutorial.djangogirls.org/en/template_extending/
|
||||||
|
-->
|
||||||
{% extends 'base.html' %}{% block content %}
|
{% extends 'base.html' %}{% block content %}
|
||||||
{% load hitcount_tags %}
|
{% load hitcount_tags %}
|
||||||
<div class="col-md-8">
|
<div class="col-md-8">
|
||||||
|
|
||||||
|
<!-- imported start -->
|
||||||
<div class="post">
|
<div class="post">
|
||||||
{% if post.published_date %}
|
{% if post.published_date %}
|
||||||
<div class="date">
|
<div class="date">
|
||||||
@ -8,7 +14,11 @@
|
|||||||
</div>
|
</div>
|
||||||
{% else %}
|
{% else %}
|
||||||
<a class="btn btn-outline-dark" href="{% url 'post_publish' pk=post.pk %}">Publish</a>
|
<a class="btn btn-outline-dark" href="{% url 'post_publish' pk=post.pk %}">Publish</a>
|
||||||
|
<!-- imported end -->
|
||||||
|
|
||||||
{% endif %} {% if user.is_staff and user == post.author %}
|
{% endif %} {% if user.is_staff and user == post.author %}
|
||||||
|
|
||||||
|
<!-- imported start -->
|
||||||
<a class="btn btn-outline-dark" href="{% url 'post_edit' pk=post.pk %}">
|
<a class="btn btn-outline-dark" href="{% url 'post_edit' pk=post.pk %}">
|
||||||
<span class="glyphicon glyphicon-pencil">Bearbeiten</span>
|
<span class="glyphicon glyphicon-pencil">Bearbeiten</span>
|
||||||
</a>
|
</a>
|
||||||
@ -18,6 +28,7 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
<h1>{{ post.title }}</h1>
|
<h1>{{ post.title }}</h1>
|
||||||
<p>{{ post.text|linebreaksbr }}</p>
|
<p>{{ post.text|linebreaksbr }}</p>
|
||||||
|
<!-- imported end -->
|
||||||
<p>
|
<p>
|
||||||
Tags:
|
Tags:
|
||||||
{% for tag in post.tags.all %}
|
{% for tag in post.tags.all %}
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
|
<!--
|
||||||
|
external code
|
||||||
|
import from https://tutorial.djangogirls.org/en/template_extending/
|
||||||
|
-->
|
||||||
{% extends 'base.html' %}
|
{% extends 'base.html' %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-8">
|
<div class="col-md-8">
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
|
<!--
|
||||||
|
external code
|
||||||
|
import from https://tutorial.djangogirls.org/en/template_extending/
|
||||||
|
-->
|
||||||
{% extends 'base.html' %}
|
{% extends 'base.html' %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="mx-auto">
|
<div class="mx-auto">
|
||||||
|
@ -1,24 +1,31 @@
|
|||||||
|
<!--
|
||||||
|
marked parts of the template is external code
|
||||||
|
import from https://tutorial.djangogirls.org/en/template_extending/
|
||||||
|
-->
|
||||||
{% extends 'base.html' %} {% block content %}
|
{% extends 'base.html' %} {% block content %}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
{% if tag %} <div class="mx-auto">
|
{% if tag %} <div class="mx-auto">
|
||||||
<h2> Artikel mit dem Tag "{{ tag.name }}" </h2>
|
<h2> Artikel mit dem Tag "{{ tag.name }}" </h2>
|
||||||
</div>{% endif %}
|
</div>{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
<!-- imported start -->
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="mx-auto">
|
<div class="mx-auto">
|
||||||
<h1> Artikleübersicht </h1>
|
<h1> Artikleübersicht </h1>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<!-- imported end -->
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-8">
|
<div class="col-md-8">
|
||||||
|
|
||||||
{% if messages %}
|
{% if messages %}
|
||||||
<div class="messages">
|
<div class="messages">
|
||||||
{% for message in messages %}
|
{% for message in messages %}
|
||||||
<p {% if message.tags %} class="{{ message.tags }}" {% endif %}>{{ message }}</p>
|
<p {% if message.tags %} class="{{ message.tags }}" {% endif %}>{{ message }}</p>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- imported start -->
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% for post in posts %}
|
{% for post in posts %}
|
||||||
<div class="mt-5 post">
|
<div class="mt-5 post">
|
||||||
@ -29,6 +36,8 @@
|
|||||||
<a href="{% url 'post_detail' pk=post.pk %}">{{ post.title }}</a>
|
<a href="{% url 'post_detail' pk=post.pk %}">{{ post.title }}</a>
|
||||||
</h2>
|
</h2>
|
||||||
<p>{{ post.text|linebreaks }}</p>
|
<p>{{ post.text|linebreaks }}</p>
|
||||||
|
<!-- imported end -->
|
||||||
|
|
||||||
Tags: {% for tag in post.tags.all %}
|
Tags: {% for tag in post.tags.all %}
|
||||||
<a href="{% url 'post_list_by_tag' tag.slug %}">{{ tag.name }}</a>
|
<a href="{% url 'post_list_by_tag' tag.slug %}">{{ tag.name }}</a>
|
||||||
{% if not forloop.last %}, {% endif %} {% endfor %} <p>
|
{% if not forloop.last %}, {% endif %} {% endfor %} <p>
|
||||||
|
@ -1,4 +1,10 @@
|
|||||||
|
<!--
|
||||||
|
marked parts of the template is external code
|
||||||
|
import from https://github.com/fizista/django-taggit-templatetags2
|
||||||
|
-->
|
||||||
{% extends "base.html" %} {% block content %}
|
{% extends "base.html" %} {% block content %}
|
||||||
|
|
||||||
|
<!-- imported start -->
|
||||||
{% load taggit_templatetags2_tags %}
|
{% load taggit_templatetags2_tags %}
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="row equal">
|
<div class="row equal">
|
||||||
@ -11,6 +17,8 @@
|
|||||||
{% include_tagcloud 'application.Post' %}
|
{% include_tagcloud 'application.Post' %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- imported end -->
|
||||||
|
|
||||||
<div style="padding-bottom:40px;">
|
<div style="padding-bottom:40px;">
|
||||||
</div>
|
</div>
|
||||||
Tag-Suche
|
Tag-Suche
|
||||||
@ -43,7 +51,6 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<h1> Bereits abonnierten Tags
|
<h1> Bereits abonnierten Tags
|
||||||
@ -54,14 +61,12 @@
|
|||||||
{% for tag in tagsuser %}
|
{% for tag in tagsuser %}
|
||||||
<a class="text-white bg-dark p-3" href="{% url 'post_list_by_tag' tag.slug %}">{{ tag.name }}</a>
|
<a class="text-white bg-dark p-3" href="{% url 'post_list_by_tag' tag.slug %}">{{ tag.name }}</a>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
<div style="padding-bottom:145px;">
|
<div style="padding-bottom:145px;">
|
||||||
</div>
|
</div>
|
||||||
<div class="mx-auto">
|
<div class="mx-auto">
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
Abonniere deine Tags hier!
|
Abonniere deine Tags hier!
|
||||||
</div>
|
</div>
|
||||||
@ -69,7 +74,6 @@
|
|||||||
{% csrf_token %} {{form.as_p}}
|
{% csrf_token %} {{form.as_p}}
|
||||||
<button type="submit" class="save btn btn-outline-dark">Sichern</button>
|
<button type="submit" class="save btn btn-outline-dark">Sichern</button>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
{% if messages %}
|
{% if messages %}
|
||||||
{% for message in messages %}
|
{% for message in messages %}
|
||||||
<div {% if message.tags %} class="{{ message.tags }}" {% endif %}>{{ message }}</div>
|
<div {% if message.tags %} class="{{ message.tags }}" {% endif %}>{{ message }}</div>
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
|
<!--
|
||||||
|
marked parts of the template is external code
|
||||||
|
import from https://tutorial.djangogirls.org/en/template_extending/
|
||||||
|
-->
|
||||||
{% extends "base.html" %} {% block content %}
|
{% extends "base.html" %} {% block content %}
|
||||||
{% load taggit_templatetags2_tags %}
|
{% load taggit_templatetags2_tags %}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@ -10,6 +14,8 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-8">
|
<div class="col-md-8">
|
||||||
<div>
|
<div>
|
||||||
|
|
||||||
|
<!-- imported start -->
|
||||||
{% for post in posts %}
|
{% for post in posts %}
|
||||||
<div class="mt-5 post">
|
<div class="mt-5 post">
|
||||||
<div class="date">
|
<div class="date">
|
||||||
@ -18,6 +24,8 @@
|
|||||||
<h2>
|
<h2>
|
||||||
<a href="{% url 'post_detail' pk=post.pk %}">{{ post.title }}</a>
|
<a href="{% url 'post_detail' pk=post.pk %}">{{ post.title }}</a>
|
||||||
</h2>
|
</h2>
|
||||||
|
<!-- imported end -->
|
||||||
|
|
||||||
<p>{{ post.text|linebreaks }}</p>
|
<p>{{ post.text|linebreaks }}</p>
|
||||||
Tags: {% for tag in post.tags.all %}
|
Tags: {% for tag in post.tags.all %}
|
||||||
<a href="{% url 'post_list_by_tag' tag.slug %}">{{ tag.name }}</a>
|
<a href="{% url 'post_list_by_tag' tag.slug %}">{{ tag.name }}</a>
|
||||||
@ -34,6 +42,5 @@
|
|||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
@ -1,20 +0,0 @@
|
|||||||
{% extends 'base.html' %} {% block content %}
|
|
||||||
{% if tag %} Posts tagged with "{{ tag.name }}" {% endif %}
|
|
||||||
{% for post in posts %}
|
|
||||||
<div class="post">
|
|
||||||
<div class="date">
|
|
||||||
{{ post.published_date }}
|
|
||||||
</div>
|
|
||||||
<h1>
|
|
||||||
<a href="{% url 'post_detail' pk=post.pk %}">{{ post.title }}</a>
|
|
||||||
</h1>
|
|
||||||
<p>{{ post.text|linebreaks }}</p>
|
|
||||||
Tags: {% for tag in post.tags.all %}
|
|
||||||
<a href="{% url 'student_page_remove' tag.slug %}">{{ tag.name }}</a>
|
|
||||||
{% if not forloop.last %}, {% endif %} {% endfor %} <p>
|
|
||||||
{{ post.author }}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
{% endfor %}
|
|
||||||
</div>
|
|
||||||
{% endblock %}
|
|
@ -8,8 +8,6 @@ from . import views
|
|||||||
from taggit_templatetags2 import urls as taggit_templatetags2_urls
|
from taggit_templatetags2 import urls as taggit_templatetags2_urls
|
||||||
import debug_toolbar
|
import debug_toolbar
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
url(r'^$', views.tag_list, name='tag_list'),
|
url(r'^$', views.tag_list, name='tag_list'),
|
||||||
url(r'^tag/(?P<slug>[-\w]+)/$', views.post_list, name='post_list_by_tag'),
|
url(r'^tag/(?P<slug>[-\w]+)/$', views.post_list, name='post_list_by_tag'),
|
||||||
@ -25,7 +23,6 @@ urlpatterns = [
|
|||||||
url(r'^tags/', include('taggit_templatetags2.urls')),
|
url(r'^tags/', include('taggit_templatetags2.urls')),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
#external code
|
#external code
|
||||||
#import from https://django-debug-toolbar.readthedocs.io/en/latest/installation.html
|
#import from https://django-debug-toolbar.readthedocs.io/en/latest/installation.html
|
||||||
if settings.DEBUG:
|
if settings.DEBUG:
|
||||||
|
@ -1,28 +1,21 @@
|
|||||||
from django.shortcuts import render, get_object_or_404
|
|
||||||
from django.utils import timezone
|
|
||||||
from .models import Post, CustomUser
|
|
||||||
from taggit.models import Tag
|
|
||||||
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
|
|
||||||
from .forms import PostForm, NewTagForm
|
|
||||||
from django.shortcuts import redirect
|
|
||||||
from django.contrib.auth.decorators import login_required
|
|
||||||
from django.contrib.admin.views.decorators import staff_member_required
|
|
||||||
from django.contrib.auth import authenticate, login, logout
|
|
||||||
import sys
|
|
||||||
import collections
|
|
||||||
from taggit_templatetags2.views import TagCanvasListView
|
|
||||||
from django.contrib.auth.models import User
|
|
||||||
from django.contrib import messages
|
|
||||||
from post_office.models import EmailTemplate
|
|
||||||
from post_office import mail
|
|
||||||
|
|
||||||
from hitcount.models import HitCount
|
|
||||||
from hitcount.views import HitCountMixin
|
|
||||||
|
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
import mysite.settings
|
import mysite.settings
|
||||||
import operator
|
|
||||||
|
from django.shortcuts import render, get_object_or_404
|
||||||
|
from django.contrib.auth import authenticate, login, logout
|
||||||
|
from django.contrib.auth.decorators import login_required
|
||||||
|
from django.shortcuts import redirect
|
||||||
|
from django.utils import timezone
|
||||||
|
from django.contrib.admin.views.decorators import staff_member_required
|
||||||
|
from django.contrib.auth.models import User
|
||||||
|
|
||||||
|
from .models import Post, CustomUser
|
||||||
|
from taggit.models import Tag
|
||||||
|
from .forms import PostForm, NewTagForm
|
||||||
|
from django.contrib import messages
|
||||||
|
from post_office import mail
|
||||||
|
from hitcount.models import HitCount
|
||||||
|
from hitcount.views import HitCountMixin
|
||||||
|
|
||||||
|
|
||||||
def navlogin(request):
|
def navlogin(request):
|
||||||
@ -47,7 +40,9 @@ def navlogin(request):
|
|||||||
context = {'error': error}
|
context = {'error': error}
|
||||||
return render(request, 'index.html', context)
|
return render(request, 'index.html', context)
|
||||||
|
|
||||||
|
#external code customised
|
||||||
|
#import from https://tutorial.djangogirls.org/en/django_forms/
|
||||||
|
#start ---
|
||||||
@login_required
|
@login_required
|
||||||
def post_list(request, slug=None):
|
def post_list(request, slug=None):
|
||||||
log = logging.getLogger('mysite')
|
log = logging.getLogger('mysite')
|
||||||
@ -122,7 +117,7 @@ def post_remove(request, pk):
|
|||||||
messages.info(request, 'Der Artikel "' + post.title + '" wurde gelöscht')
|
messages.info(request, 'Der Artikel "' + post.title + '" wurde gelöscht')
|
||||||
post.delete()
|
post.delete()
|
||||||
return redirect('post_list')
|
return redirect('post_list')
|
||||||
|
#end ---
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
def tag_list(request):
|
def tag_list(request):
|
||||||
@ -165,8 +160,12 @@ def search_add(request):
|
|||||||
form = NewTagForm()
|
form = NewTagForm()
|
||||||
return render(request, 'search_add.html', locals())
|
return render(request, 'search_add.html', locals())
|
||||||
|
|
||||||
|
|
||||||
|
#external code customised
|
||||||
|
#import from https://github.com/ui/django-post_office
|
||||||
mail.send(
|
mail.send(
|
||||||
'kleinhenz.e@gmail.com', # List of email addresses also accepted
|
# List of email addresses also accepted
|
||||||
|
'kleinhenz.e@gmail.com',
|
||||||
'esther.kleinhenz@web.de',
|
'esther.kleinhenz@web.de',
|
||||||
subject='My email',
|
subject='My email',
|
||||||
message='Hi there!',
|
message='Hi there!',
|
||||||
|
10
log.txt
10
log.txt
@ -447,3 +447,13 @@
|
|||||||
[07/Dec/2018 19:55:08] INFO [mysite:147] <QuerySet [<Post: Kein bisschen Fränkisch>, <Post: Das ist ein Titel>, <Post: Strange Things>, <Post: Hier kommt was neues>, <Post: Bavaria>, <Post: test>]>
|
[07/Dec/2018 19:55:08] INFO [mysite:147] <QuerySet [<Post: Kein bisschen Fränkisch>, <Post: Das ist ein Titel>, <Post: Strange Things>, <Post: Hier kommt was neues>, <Post: Bavaria>, <Post: test>]>
|
||||||
[07/Dec/2018 19:55:08] INFO [mysite:147] <QuerySet []>
|
[07/Dec/2018 19:55:08] INFO [mysite:147] <QuerySet []>
|
||||||
[07/Dec/2018 19:55:08] INFO [mysite:147] <QuerySet [<Post: Kein bisschen Fränkisch>, <Post: Das ist ein Titel>, <Post: Hier kommt was neues>, <Post: Bavaria>]>
|
[07/Dec/2018 19:55:08] INFO [mysite:147] <QuerySet [<Post: Kein bisschen Fränkisch>, <Post: Das ist ein Titel>, <Post: Hier kommt was neues>, <Post: Bavaria>]>
|
||||||
|
[09/Dec/2018 19:06:28] INFO [mysite:128] <QuerySet [<Tag: hi>, <Tag: test>, <Tag: two>, <Tag: second>]>
|
||||||
|
[09/Dec/2018 19:06:29] INFO [mysite:131] <QuerySet [<Post: Das ist ein Titel>, <Post: Strange Things>, <Post: Hier kommt was neues>]>
|
||||||
|
[09/Dec/2018 19:06:29] INFO [mysite:131] <QuerySet [<Post: Kein bisschen Fränkisch>, <Post: Das ist ein Titel>, <Post: Strange Things>, <Post: Hier kommt was neues>, <Post: Bavaria>, <Post: test>]>
|
||||||
|
[09/Dec/2018 19:06:29] INFO [mysite:131] <QuerySet []>
|
||||||
|
[09/Dec/2018 19:06:29] INFO [mysite:131] <QuerySet [<Post: Kein bisschen Fränkisch>, <Post: Das ist ein Titel>, <Post: Hier kommt was neues>, <Post: Bavaria>]>
|
||||||
|
[09/Dec/2018 19:20:36] INFO [mysite:128] <QuerySet [<Tag: hi>, <Tag: test>, <Tag: two>, <Tag: second>]>
|
||||||
|
[09/Dec/2018 19:20:37] INFO [mysite:131] <QuerySet [<Post: Das ist ein Titel>, <Post: Strange Things>, <Post: Hier kommt was neues>]>
|
||||||
|
[09/Dec/2018 19:20:37] INFO [mysite:131] <QuerySet [<Post: Kein bisschen Fränkisch>, <Post: Das ist ein Titel>, <Post: Strange Things>, <Post: Hier kommt was neues>, <Post: Bavaria>, <Post: test>]>
|
||||||
|
[09/Dec/2018 19:20:37] INFO [mysite:131] <QuerySet []>
|
||||||
|
[09/Dec/2018 19:20:37] INFO [mysite:131] <QuerySet [<Post: Kein bisschen Fränkisch>, <Post: Das ist ein Titel>, <Post: Hier kommt was neues>, <Post: Bavaria>]>
|
||||||
|
@ -176,7 +176,11 @@ else:
|
|||||||
|
|
||||||
AUTH_PROFILE_MODULE = 'application.CustomUser'
|
AUTH_PROFILE_MODULE = 'application.CustomUser'
|
||||||
|
|
||||||
|
|
||||||
#Log Configuration
|
#Log Configuration
|
||||||
|
#external code
|
||||||
|
#import form https://docs.djangoproject.com/en/2.1/topics/logging/
|
||||||
|
|
||||||
LOGGING = {
|
LOGGING = {
|
||||||
'version': 1,
|
'version': 1,
|
||||||
'disable_existing_loggers': True,
|
'disable_existing_loggers': True,
|
||||||
@ -224,6 +228,9 @@ LOGGING = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#Logging Addon
|
||||||
|
#external code
|
||||||
|
#import from https://django-debug-toolbar.readthedocs.io/en/latest/installation.html
|
||||||
|
|
||||||
if DEBUG:
|
if DEBUG:
|
||||||
INTERNAL_IPS = ('127.0.0.1', 'localhost',)
|
INTERNAL_IPS = ('127.0.0.1', 'localhost',)
|
||||||
@ -254,8 +261,11 @@ if DEBUG:
|
|||||||
'INTERCEPT_REDIRECTS': False,
|
'INTERCEPT_REDIRECTS': False,
|
||||||
}
|
}
|
||||||
|
|
||||||
EMAIL_BACKEND = 'post_office.EmailBackend'
|
#E-Mail administration
|
||||||
|
#external code customised
|
||||||
|
#import from https://github.com/ui/django-post_office
|
||||||
|
|
||||||
|
EMAIL_BACKEND = 'post_office.EmailBackend'
|
||||||
EMAIL_HOST = 'smtp.web.de'
|
EMAIL_HOST = 'smtp.web.de'
|
||||||
EMAIL_HOST_USER = "esther.kleinhenz@web.de"
|
EMAIL_HOST_USER = "esther.kleinhenz@web.de"
|
||||||
EMAIL_PORT = 25 # default smtp port
|
EMAIL_PORT = 25 # default smtp port
|
||||||
|
@ -17,7 +17,6 @@ from django.contrib import admin
|
|||||||
from django.conf.urls import include, url
|
from django.conf.urls import include, url
|
||||||
from django.views.generic import TemplateView
|
from django.views.generic import TemplateView
|
||||||
|
|
||||||
|
|
||||||
from django.contrib.auth import views
|
from django.contrib.auth import views
|
||||||
import application.views
|
import application.views
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user