Skip to content

Commit

Permalink
feat: Add prj
Browse files Browse the repository at this point in the history
  • Loading branch information
JoHyukJun committed Jul 14, 2024
1 parent b496e61 commit b65611e
Show file tree
Hide file tree
Showing 8 changed files with 390 additions and 122 deletions.
121 changes: 0 additions & 121 deletions src/unluckystrike/blog/templates/blog_base.html

This file was deleted.

12 changes: 12 additions & 0 deletions src/unluckystrike/main/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,24 @@
'blog',
'service',
# addon apps
'channels',
'letsencrypt',
'rest_framework',
'drf_yasg',
'ckeditor',
]

# Channels
ASGI_APPLICATION = 'config.asgi.application'
CHANNEL_LAYERS = {
'default': {
'BACKEND': 'channels_redis.core.RedisChannelLayer',
'CONFIG': {
"hosts": [('127.0.0.1', 6379)],
},
},
}

MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
Expand Down
2 changes: 2 additions & 0 deletions src/unluckystrike/main/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@
<details>
<summary><a href="{% url 'project_index' %}">Project</a></summary>
<ul>
<li><a href="/projects/open-webcam-test">Open Webcam Test</a></li>
<li><a href="/projects/exchange-rate">Exchange Rate</a></li>
<li><a href="/projects/lottery">lottery</a></li>
<li><a href="/projects/object-detection">Object Detection</a></li>
<li><a href="/projects/raspberry-pi-lab">Raspberry Pi Lab</a></li>
Expand Down
40 changes: 40 additions & 0 deletions src/unluckystrike/projects/fishingram.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# fishingram

from rest_framework import serializers

from service.models import FishingPlaceInfoData

import os
import glob

from pathlib import Path

BASE_DIR = Path(__file__).resolve(strict=True).parent.parent


class FishingPlcInfoSerializer(serializers.ModelSerializer):
class Meta:
model = FishingPlaceInfoData
fields = (
'sigun_name',
'sigun_code',
'facility_name',
'facility_type',
'refine_roadnm_addr',
'refine_lotnm_addr',
'refine_lat',
'refine_logt',
'facility_tel',
'wtr_ar',
'fishkind_nm',
'aceptnc_posbl_psn_cnt',
'wtr_facility_info',
'chrg_info',
'main_plc_info',
'safe_facility_info',
'convnce_facility_info',
'circumfr_tursm_info',
'manage_inst_telno',
'manage_inst_name',
'data_std_de'
)
66 changes: 66 additions & 0 deletions src/unluckystrike/projects/templates/exchange-rate.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{% extends "base.html" %}

{% block title%}원달러 환율 - Unlucky Strike{% endblock title %}

{% block content %}

<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<style>
/* 차트를 감싸는 컨테이너 스타일 */
.chart-container {
width: 80%;
margin: auto;
padding: 20px;
background-color: #f0f0f0;
border-radius: 8px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
</style>

<h2 id="lottery">원달러 환율</h2>

<section class="component">
<section class="chart-container">
<h2>Monthly Sales Chart</h2>
<!-- Canvas 요소를 사용하여 차트를 그릴 공간을 마련 -->
<canvas id="myChart" width="800" height="400"></canvas>
</section>

<script>
// 차트 데이터 설정
const data = {
labels: ['January', 'February', 'March', 'April', 'May', 'June'],
datasets: [{
label: 'Sales',
backgroundColor: 'rgba(54, 162, 235, 0.6)',
borderColor: 'rgba(54, 162, 235, 1)',
borderWidth: 1,
data: [65, 59, 80, 81, 56, 55],
}]
};

// 차트 옵션 설정
const options = {
scales: {
yAxes: [{
ticks: {
beginAtZero: true
}
}]
}
};

// Canvas 요소 가져오기
const ctx = document.getElementById('excRateChart').getContext('2d');

// 차트 생성
const excRateChart = new Chart(ctx, {
type: 'line',
data: data,
options: options
});
</script>
</section>


{% endblock %}
Loading

0 comments on commit b65611e

Please sign in to comment.