Skip to content

Commit

Permalink
Merge pull request #134 from liangliangyy/dev
Browse files Browse the repository at this point in the history
update logger
  • Loading branch information
liangliangyy committed Jul 6, 2018
2 parents 5a6a06e + 02eb47a commit 4ac5b32
Show file tree
Hide file tree
Showing 13 changed files with 57 additions and 29 deletions.
6 changes: 5 additions & 1 deletion DjangoBlog/blog_signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,14 @@
import django.dispatch
from django.dispatch import receiver
from django.conf import settings
from DjangoBlog.utils import cache, send_email, expire_view_cache, logger
from DjangoBlog.utils import cache, send_email, expire_view_cache
from DjangoBlog.spider_notify import SpiderNotify
from django.contrib.sites.models import Site

import logging

logger = logging.getLogger(__name__)

comment_save_signal = django.dispatch.Signal(providing_args=["comment_id", "username", "serverport"])
article_save_signal = django.dispatch.Signal(providing_args=['id', 'is_update_views'])
user_login_logout_signal = django.dispatch.Signal(providing_args=['id', 'type'])
Expand Down
2 changes: 1 addition & 1 deletion DjangoBlog/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from django.core.mail import EmailMultiAlternatives
from django.conf import settings

logger = logging.getLogger('djangoblog')
logger = logging.getLogger(__name__)


def get_max_articleid_commentid():
Expand Down
4 changes: 2 additions & 2 deletions bin/docker_start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ echo "Starting $NAME as `whoami`"
cd $DJANGODIR
export DJANGO_SETTINGS_MODULE=$DJANGO_SETTINGS_MODULE
export PYTHONPATH=$DJANGODIR:$PYTHONPATH
pip install -Ur requirements.txt -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com && \
pip install gunicorn -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
#pip install -Ur requirements.txt -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com && \
# pip install gunicorn -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
python manage.py makemigrations
python manage.py migrate
python manage.py collectstatic --noinput
Expand Down
5 changes: 4 additions & 1 deletion blog/context_processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@
from .models import Category, Article, Tag, BlogSettings
from django.conf import settings
from comments.models import Comment
from DjangoBlog.utils import logger, cache, get_blog_setting
from DjangoBlog.utils import cache, get_blog_setting
import logging

logger = logging.getLogger(__name__)


def seo_processor(requests):
Expand Down
5 changes: 3 additions & 2 deletions blog/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
from django.urls import reverse
from django.conf import settings
from uuslug import slugify

import logging
from django.core.exceptions import ValidationError
from django.utils.translation import gettext_lazy as _
from django.contrib.sites.models import Site
from DjangoBlog.utils import cache_decorator, logger, cache
from DjangoBlog.utils import cache_decorator, cache
from django.utils.functional import cached_property
from django.utils.timezone import now

logger = logging.getLogger(__name__)

class BaseModel(models.Model):
slug = models.SlugField(default='no-slug', max_length=160, blank=True)
Expand Down
5 changes: 4 additions & 1 deletion blog/templatetags/blog_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,13 @@
import hashlib
import urllib
from comments.models import Comment
from DjangoBlog.utils import cache_decorator, logger
from DjangoBlog.utils import cache_decorator
from django.contrib.auth import get_user_model
from oauth.models import OAuthUser
from django.contrib.sites.models import Site
import logging

logger = logging.getLogger(__name__)

register = template.Library()

Expand Down
5 changes: 4 additions & 1 deletion blog/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@
from django.http import HttpResponseRedirect
from django.views.decorators.csrf import csrf_exempt
from django.contrib.auth.decorators import login_required
from DjangoBlog.utils import cache, logger
from DjangoBlog.utils import cache
from django.shortcuts import get_object_or_404
from blog.models import Article, Category, Tag
from comments.forms import CommentForm
import logging

logger = logging.getLogger(__name__)


class ArticleListView(ListView):
Expand Down
1 change: 0 additions & 1 deletion comments/models.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from django.db import models
from django.conf import settings
from blog.models import Article
from DjangoBlog.utils import logger
from django.utils.timezone import now


Expand Down
5 changes: 4 additions & 1 deletion oauth/oauthmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@
from django.conf import settings
import requests
import json
import logging
import urllib.parse
from DjangoBlog.utils import logger, parse_dict_to_url
from DjangoBlog.utils import parse_dict_to_url

logger = logging.getLogger(__name__)


class BaseOauthManager(metaclass=ABCMeta):
Expand Down
4 changes: 3 additions & 1 deletion owntracks/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@
from itertools import groupby
from django.http import HttpResponse
from .models import OwnTrackLog
from DjangoBlog.utils import logger
import logging
from django.shortcuts import render
from django.http import JsonResponse
from django.contrib.auth.decorators import login_required
from django.views.decorators.csrf import csrf_exempt
import requests

logger = logging.getLogger(__name__)


@csrf_exempt
def manage_owntrack_log(request):
Expand Down
20 changes: 12 additions & 8 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
appdirs==1.4.3
asn1crypto==0.24.0
bottle==0.12.13
certifi==2018.4.16
cffi==1.11.5
chardet==3.0.4
coverage==4.5.1
Django==2.0.5
cryptography==2.2.2
Django==2.0.7
django-appconf==1.0.2
django-autoslug==1.9.3
django-compressor==2.2
django-debug-toolbar==1.9.1
django-haystack==2.8.1
django-ipware==2.1.0
django-pagedown==1.0.4
django-pagedown==1.0.5
django-uuslug==1.1.8
idna==2.6
jieba==0.39
Expand All @@ -19,22 +22,23 @@ markdown2==2.3.5
mistune==0.8.3
olefile==0.45.1
packaging==17.1
Pillow==5.1.0
Pillow==5.2.0
pycparser==2.18
Pygments==2.2.0
PyMySQL==0.8.1
PyMySQL==0.9.2
pyparsing==2.2.0
python-memcached==1.59
python-slugify==1.2.5
pytz==2018.4
pytz==2018.5
raven==6.9.0
rcssmin==1.0.6
requests==2.18.4
requests==2.19.1
rjsmin==1.0.12
six==1.11.0
sqlparse==0.2.4
Unidecode==1.0.22
urllib3==1.22
urllib3==1.23
webencodings==0.5.1
WeRoBot==1.4.1
WeRoBot==1.6.0
Whoosh==2.7.4
xmltodict==0.11.0
4 changes: 3 additions & 1 deletion servermanager/Api/commonapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
"""
import requests
import json
from DjangoBlog.utils import logger
import logging

logger = logging.getLogger(__name__)


class TuLing():
Expand Down
20 changes: 12 additions & 8 deletions travis_test/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
appdirs==1.4.3
asn1crypto==0.24.0
bottle==0.12.13
certifi==2018.4.16
cffi==1.11.5
chardet==3.0.4
coverage==4.5.1
Django==2.0.5
cryptography==2.2.2
Django==2.0.7
django-appconf==1.0.2
django-autoslug==1.9.3
django-compressor==2.2
django-debug-toolbar==1.9.1
django-haystack==2.8.1
django-ipware==2.1.0
django-pagedown==1.0.4
django-pagedown==1.0.5
django-uuslug==1.1.8
idna==2.6
jieba==0.39
Expand All @@ -19,21 +22,22 @@ markdown2==2.3.5
mistune==0.8.3
olefile==0.45.1
packaging==17.1
Pillow==5.1.0
Pillow==5.2.0
pycparser==2.18
Pygments==2.2.0
PyMySQL==0.8.1
PyMySQL==0.9.2
pyparsing==2.2.0
python-slugify==1.2.5
pytz==2018.4
pytz==2018.5
raven==6.9.0
rcssmin==1.0.6
requests==2.18.4
requests==2.19.1
rjsmin==1.0.12
six==1.11.0
sqlparse==0.2.4
Unidecode==1.0.22
urllib3==1.22
urllib3==1.23
webencodings==0.5.1
WeRoBot==1.4.1
WeRoBot==1.6.0
Whoosh==2.7.4
xmltodict==0.11.0

0 comments on commit 4ac5b32

Please sign in to comment.