ai on zfl
Project description
zfl-ai
目次
詳細
djangoプロジェクトでインストールできるDjangoアプリです。
使用方法は以下からご覧ください。
インストールとDjangoプロジェクト作成
実行環境は「Python3.7」、「Django2.2.5」です。
$ python3 --version
Python 3.7.0
Djangoアプリはpipでインストールします。
$ pip install zfl-ai
Djangoプロジェクトを作成
$ django-admin startproject myproject .
言語を設定します。
myproject/settings.py
# Internationalization
# https://docs.djangoproject.com/en/4.2/topics/i18n/
LANGUAGE_CODE = 'ja'
TIME_ZONE = 'Asia/Tokyo'
USE_I18N = True
USE_TZ = True
Djangoプロジェクトにプラグイン
Djangoアプリを設定します。
myproject/settings.py
INSTALLED_APPS = [
...,
"ai",
]
プロジェクト直下のtemplatesを読み込むように設定。
TEMPLATES = [
{
...
'DIRS': [os.path.join(BASE_DIR, 'templates')],
...
},
]
myproject/urls.py
...
from django.urls import path, include
urlpatterns = [
...,
path('', include('ai.urls')),
]
zfl-aiのテンプレートである「index.html」ではテンプレートタグ「{% extends '...' %}」で「base.html」を読み込むように設定しているので、「templates/base.html」を作成する必要があります。
$ mkdir templates && touch templates/base.html
base.htmlの内容
{% load static %}
<html lang="ja" prefix="og: http://ogp.me/ns#">
<head>
<!-- BootStrap CSS Link -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<!-- StaticFiles CSS -->
{% block ai-style %}{% endblock %}
</head>
<body>
<!-- Djangoテンプレートタグ -->
{% block content %}
{% endblock %}
<!-- BootStrap jQuery -->
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
</body>
</html>
サーバーを起動します。
$ python3 manage.py runserver
127.0.0.1:8000/ai/にアクセスします。
License
zfl-ai is distributed under the terms of the MIT license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file zfl_ai-0.0.13.tar.gz.
File metadata
- Download URL: zfl_ai-0.0.13.tar.gz
- Upload date:
- Size: 30.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.24.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
34ad479217d995fc1666d0f9443bcaa4f08c96bb029f9b3ff1c8d16c2e587c41
|
|
| MD5 |
c243a73075d03ea35a89d9ab8e2d9bce
|
|
| BLAKE2b-256 |
7a3f6516ca66dc488c4cd425dc61df742831e6ca60a96ec101645df066896dcc
|
File details
Details for the file zfl_ai-0.0.13-py3-none-any.whl.
File metadata
- Download URL: zfl_ai-0.0.13-py3-none-any.whl
- Upload date:
- Size: 30.2 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.24.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
59f93c35214955c7759bb5949dd5970e67438a95a6a0aea438c7d794cba12506
|
|
| MD5 |
d8108d63160df15305162b6e84e2be2e
|
|
| BLAKE2b-256 |
ddfcc615611f8f52953b04d5406c8d4660f373a80a8fb45633a807e7e187f3ef
|