-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
83 changed files
with
365 additions
and
940 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,3 @@ | ||
#!/usr/bin/env python | ||
# encoding: utf-8 | ||
|
||
|
||
""" | ||
@version: ?? | ||
@author: liangliangyy | ||
@license: MIT Licence | ||
@contact: [email protected] | ||
@site: https://www.lylinux.net/ | ||
@software: PyCharm | ||
@file: forms.py | ||
@time: 2016/11/20 下午3:16 | ||
""" | ||
from django import forms | ||
from django.contrib.auth import get_user_model, password_validation | ||
from django.contrib.auth.forms import AuthenticationForm, UserCreationForm | ||
|
@@ -108,7 +94,7 @@ def clean_new_password2(self): | |
def clean_email(self): | ||
user_email = self.cleaned_data.get("email") | ||
if not BlogUser.objects.filter( | ||
email=user_email | ||
email=user_email | ||
).exists(): | ||
# todo 这里的报错提示可以判断一个邮箱是不是注册过,如果不想暴露可以修改 | ||
raise ValidationError("未找到邮箱对应的用户") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +0,0 @@ | ||
#!/usr/bin/env python | ||
# encoding: utf-8 | ||
|
||
|
||
""" | ||
@version: ?? | ||
@author: liangliangyy | ||
@license: MIT Licence | ||
@contact: [email protected] | ||
@site: https://www.lylinux.net/ | ||
@software: PyCharm | ||
@file: __init__.py | ||
@time: 2016/11/2 下午9:15 | ||
""" | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,8 @@ | ||
#!/usr/bin/env python | ||
# encoding: utf-8 | ||
|
||
|
||
""" | ||
@version: ?? | ||
@author: liangliangyy | ||
@license: MIT Licence | ||
@contact: [email protected] | ||
@site: https://www.lylinux.net/ | ||
@software: PyCharm | ||
@file: urls.py | ||
@time: 2016/11/20 下午3:52 | ||
""" | ||
|
||
from django.conf.urls import url | ||
from django.urls import path | ||
|
||
from .forms import LoginForm | ||
from . import views | ||
from .forms import LoginForm | ||
|
||
app_name = "accounts" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,3 @@ | ||
#!/usr/bin/env python | ||
# encoding: utf-8 | ||
|
||
|
||
""" | ||
@version: ?? | ||
@author: liangliangyy | ||
@license: MIT Licence | ||
@contact: [email protected] | ||
@site: https://www.lylinux.net/ | ||
@software: PyCharm | ||
@file: user_login_backend.py | ||
@time: 2017/2/17 下午8:45 | ||
""" | ||
from django.conf import settings | ||
from django.contrib.auth import get_user_model | ||
from django.contrib.auth.backends import ModelBackend | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,8 @@ | ||
#!/usr/bin/env python | ||
# encoding: utf-8 | ||
|
||
|
||
""" | ||
@version: ?? | ||
@author: liangliangyy | ||
@license: MIT Licence | ||
@contact: [email protected] | ||
@site: https://www.lylinux.net/ | ||
@software: PyCharm | ||
@file: context_processors.py | ||
@time: 2016/11/6 下午4:23 | ||
""" | ||
from .models import Category, Article, Tag, BlogSettings | ||
from DjangoBlog.utils import cache, get_blog_setting | ||
|
||
from datetime import datetime | ||
import logging | ||
from datetime import datetime | ||
|
||
from djangoblog.utils import cache, get_blog_setting | ||
from .models import Category, Article | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,11 @@ | ||
#!/usr/bin/env python | ||
# encoding: utf-8 | ||
""" | ||
@version: ?? | ||
@author: liangliangyy | ||
@license: MIT Licence | ||
@contact: [email protected] | ||
@site: https://www.lylinux.net/ | ||
@software: PyCharm | ||
@file: documents.py | ||
@time: 2019-04-05 13:05 | ||
""" | ||
import elasticsearch.client | ||
from elasticsearch_dsl.connections import connections | ||
import time | ||
from blog.models import Article | ||
from elasticsearch_dsl import Document, InnerDoc, Date, Integer, Long, Text, Object, GeoPoint, Keyword, Boolean | ||
|
||
import elasticsearch.client | ||
from django.conf import settings | ||
from elasticsearch_dsl import Document, InnerDoc, Date, Integer, Long, Text, Object, GeoPoint, Keyword, Boolean | ||
from elasticsearch_dsl.connections import connections | ||
|
||
from blog.models import Article | ||
|
||
ELASTICSEARCH_ENABLED = hasattr(settings, 'ELASTICSEARCH_DSL') | ||
|
||
|
Oops, something went wrong.