Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion apps/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from flask_migrate import Migrate
from flask_sqlalchemy import SQLAlchemy
from flask_wtf.csrf import CSRFProtect

from apps.config import config

db = SQLAlchemy()
Expand Down Expand Up @@ -43,4 +42,10 @@ def create_app(config_key):
# register_blueprintを使いviewsのauthをアプリへ登録する
app.register_blueprint(auth_views.auth, url_prefix="/auth")

# これから作成するdetectorパッケージからviewsをimportする
from apps.detector import views as dt_views

# register_blueprintを使いviewsのdtをアプリへ登録する
app.register_blueprint(dt_views.dt)

return app
Empty file added apps/detector/__init__.py
Empty file.
Empty file added apps/detector/forms.py
Empty file.
Empty file added apps/detector/models.py
Empty file.
Empty file.
Empty file.
18 changes: 18 additions & 0 deletions apps/detector/templates/detector/base.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<title>detector</title>
<link
rel="stylesheet"
href="{{ url_for('static', filename='css/bootstrap.min.css') }}"
/>
<link
rel="stylesheet"
href="{{ url_for('static', filename='css/style.css') }}"
/>
</head>
<body>
{% block content %}{% endblock %}
</body>
</html>
4 changes: 4 additions & 0 deletions apps/detector/templates/detector/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{% extends "detector/base.html" %}
{% block content %}
<div class="alert alert-primary">detector</div>
{% endblock %}
Empty file.
9 changes: 9 additions & 0 deletions apps/detector/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from flask import Blueprint, render_template

# template_folderを指定する(staticは指定しない)
dt = Blueprint("detector", __name__, template_folder="templates")

# dtアプリケーションを使ってエンドポイントを作成する
@dt.route("/")
def index():
return render_template("detector/index.html")
7 changes: 7 additions & 0 deletions apps/static/css/bootstrap.min.css

Large diffs are not rendered by default.

72 changes: 72 additions & 0 deletions apps/static/css/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
body {
background-color: #f5f5f5;
}
h4 {
margin-top: 20px;
}
input[type="search"] {
background-color: #f5f5f5;
}
.dt-auth-main {
width: 400px;
margin-top: 45px;
}
.dt-auth-main .card {
box-shadow: 0 12px 18px 2px rgba(34, 0, 51, 0.04), 0 6px 22px 4px rgba(7, 48, 114, 0.12),
0 6px 10px -4px rgba(14, 13, 26, 0.12) !important;
border-radius: 16px;
}
.dt-auth-main .dt-auth-login {
height: 300px !important;
}
.dt-auth-main .dt-auth-signup {
height: 340px !important;
}
.dt-auth-main header {
text-align: center;
margin: 30px 0 0 0;
font-size: 24px;
}
.dt-auth-main section {
width: 300px;
margin: 10px auto;
}
.dt-auth-flash {
font-size: 14px;
color: #9c1a1c;
}
.dt-auth-input {
margin-top: 10px;
}
.dt-auth-btn {
margin: 30px 0 0 0;
}
.dt-search {
height: 28px !important;
}
.dt-image-content {
margin: 20px auto;
padding: 0;
}
.dt-image-username {
padding-top: 15px;
}
.dt-image-register-btn {
padding: 10px 47px 0 0;
}
.dt-image-content header {
padding: 10px 10px 0 10px;
}
.dt-image-content section {
padding: 10px 0;
margin : auto;
}
.dt-image-content footer {
padding: 10px;
}
.dt-image-content section img {
width: 100px;
}
.dt-image-submit {
margin-left: 10px;
}
Empty file added apps/templates/404.html
Empty file.
Empty file added apps/templates/500.html
Empty file.
45 changes: 25 additions & 20 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,33 +1,38 @@
alembic==1.7.5
alembic==1.16.1
antiorm==1.2.1
black==21.12b0
blinker==1.4
click==8.0.3
dnspython==2.1.0
blinker==1.9.0
click==8.2.0
colorama==0.4.6
db==0.1.1
dnspython==2.7.0
email-validator==1.1.3
flake8==4.0.1
Flask==2.0.2
Flask==2.3.3
Flask-DebugToolbar==0.11.0
Flask-Login==0.5.0
Flask-Mail==0.9.1
Flask-Migrate==3.1.0
Flask-SQLAlchemy==2.5.1
Flask-WTF==1.0.0
idna==3.3
Flask-Login==0.6.3
Flask-Mail==0.10.0
Flask-Migrate==4.1.0
Flask-SQLAlchemy==3.1.1
Flask-WTF==1.2.2
greenlet==3.2.2
idna==3.10
isort==5.10.1
itsdangerous==2.0.1
Jinja2==3.0.3
Mako==1.1.6
MarkupSafe==2.0.1
itsdangerous==2.2.0
Jinja2==3.1.6
Mako==1.3.10
MarkupSafe==3.0.2
mccabe==0.6.1
mypy==0.920
mypy-extensions==0.4.3
pathspec==0.9.0
pip==25.0.1
platformdirs==2.4.0
pycodestyle==2.8.0
pyflakes==2.4.0
python-dotenv==0.19.2
SQLAlchemy==1.4.28
python-dotenv==1.1.0
SQLAlchemy==2.0.41
tomli==1.2.3
typing_extensions==4.0.1
Werkzeug==2.0.2
WTForms==3.0.0
typing_extensions==4.13.2
Werkzeug==3.1.3
WTForms==3.2.1
Empty file added tests/__init__.py
Empty file.
Empty file added tests/conftest.py
Empty file.
Empty file added tests/detector/__init__.py
Empty file.
Empty file added tests/detector/test_views.py
Empty file.
Empty file.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file added tests/test_sample.py
Empty file.