-
Notifications
You must be signed in to change notification settings - Fork 0
Develop #99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
galaxyhm
wants to merge
3
commits into
master
Choose a base branch
from
develop
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Develop #99
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 +1,2 @@ | ||
| db_connect.json | ||
| db_connect.json | ||
| fast_api.json |
This file contains hidden or 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 hidden or 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 | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -12,8 +12,8 @@ | |||||||||||
| import re | ||||||||||||
| from . import models | ||||||||||||
| from django.db.models import Q | ||||||||||||
| import random | ||||||||||||
| import pandas as pd | ||||||||||||
| from django.conf import settings | ||||||||||||
|
|
||||||||||||
| # Create your views here. | ||||||||||||
|
|
||||||||||||
|
|
||||||||||||
|
|
@@ -38,9 +38,6 @@ def index(request): | |||||||||||
| # return render(request, 'board/join_membership.html', context) | ||||||||||||
|
|
||||||||||||
|
|
||||||||||||
| # def summarize(request): | ||||||||||||
| # return render() | ||||||||||||
|
|
||||||||||||
| @require_http_methods(['POST']) | ||||||||||||
| def news_summarizae_request_ajax(request): | ||||||||||||
| # print(request.body) | ||||||||||||
|
|
@@ -53,9 +50,9 @@ def news_summarizae_request_ajax(request): | |||||||||||
| url = regex.match(url) | ||||||||||||
| print(url) | ||||||||||||
|
|
||||||||||||
| if not url : | ||||||||||||
| if not url: | ||||||||||||
| print('error 올바르지 않는 url') | ||||||||||||
| # return 해서 어떻게 처리하셈 | ||||||||||||
| return JsonResponse({'status':'false', 'message': '잘못된 url'}, status=500) | ||||||||||||
| url = url[0] | ||||||||||||
|
|
||||||||||||
| # DB에서 해당 url에 맞는 데이터 필드 가져옴. | ||||||||||||
|
|
@@ -70,7 +67,7 @@ def news_summarizae_request_ajax(request): | |||||||||||
| # 입력받은 URL을 가진 기사가 데이터베이스에 존재하는지 확인. | ||||||||||||
| if models.NewsArticleInfo.objects.filter(url=url) : | ||||||||||||
| # 해당 URL을 가진 기사가 데이터베이스에 존재하면, 수정일자를 비교하여 최신 버전인지 확인. | ||||||||||||
| if models.NewsArticleInfo.objects.filter(Q(url=url) & Q(modify_date__isnull=True)) or models.NewsArticleInfo.objects.filter(Q(url=url) & Q(modify_date = crawl_data_dict.get('modify_date'))): | ||||||||||||
| if (models.NewsArticleInfo.objects.filter(Q(url=url) & Q(modify_date__isnull=True)) and crawl_data_dict.get('modify_date') != -1 ) or models.NewsArticleInfo.objects.filter(Q(url=url) & Q(modify_date = crawl_data_dict.get('modify_date'))): | ||||||||||||
|
||||||||||||
| if (models.NewsArticleInfo.objects.filter(Q(url=url) & Q(modify_date__isnull=True)) and crawl_data_dict.get('modify_date') != -1 ) or models.NewsArticleInfo.objects.filter(Q(url=url) & Q(modify_date = crawl_data_dict.get('modify_date'))): | |
| is_new_article_with_modify_date = models.NewsArticleInfo.objects.filter(Q(url=url) & Q(modify_date__isnull=True)) and crawl_data_dict.get('modify_date') != -1 | |
| is_article_up_to_date = models.NewsArticleInfo.objects.filter(Q(url=url) & Q(modify_date=crawl_data_dict.get('modify_date'))) | |
| if is_new_article_with_modify_date or is_article_up_to_date: |
This file contains hidden or 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,25 +1,4 @@ | ||
| asgiref==3.6.0 | ||
| beautifulsoup4==4.12.2 | ||
| certifi==2022.12.7 | ||
| charset-normalizer==3.1.0 | ||
| Django==3.2.18 | ||
| django-extensions==3.2.1 | ||
| idna==3.4 | ||
| lxml==4.9.2 | ||
| mpmath==1.3.0 | ||
| mysqlclient==2.1.1 | ||
| networkx==3.1 | ||
| numpy==1.24.3 | ||
| packaging==23.1 | ||
| pytz==2023.3 | ||
| PyYAML==6.0 | ||
| regex==2023.3.23 | ||
| requests==2.29.0 | ||
| six==1.16.0 | ||
| soupsieve==2.4.1 | ||
| sqlparse==0.4.4 | ||
| sympy==1.11.1 | ||
| tokenizers==0.13.3 | ||
| typing_extensions==4.5.0 | ||
| tzdata==2023.3 | ||
| urllib3==1.26.15 | ||
| lxml==4.9.2 |
This file contains hidden or 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 hidden or 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,11 +1,4 @@ | ||
| transformers>=4.28.1 | ||
| fastapi>=0.95.1 | ||
| pydantic>=1.10.7 | ||
| pymysql>=1.0.3 | ||
| mariadb>=1.1.6 | ||
| requests>=2.28.2 | ||
| numpy>=1.24.3 | ||
| bs4>=0.0.1 | ||
| beautifulsoup4>=4.12.2 | ||
| lxml | ||
| pytorch | ||
| fastapi | ||
| uvicorn[standard] | ||
| torch |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Calling
.close()on the file handle inside awith open(...)block is redundant becausewithalready handles closing.