English README Jump to Japanese Version
This is a web application built in Python using the Flask framework. It's designed to help you keep track of the birthdays of people you know, ensuring you never forget them.
- Add people's names and their corresponding birthday dates.
-
application.py: This file contains the code for the Flask web application. It includes one route (/) that handles both POST and GET requests. When the/route is requested via GET, it renders theindex.htmltemplate. When requested via POST, the user is redirected back to/via GET. -
birthdays.db: This is an SQLite database with abirthdaystable, including columns forid,name,month, andday. You can insert new rows into this table using the web application. -
static/styles.css: This directory contains the CSS code for the web application. You can modify this file to customize the appearance of your application. -
templates/index.html: This HTML file is rendered when users visit your web application.
To set up the required dependencies, follow these steps: Be sure to change pip for pip3 if necessary.
-
Clone this repository to your local machine.
-
Create a virtual environment (optional but recommended):
Using
virtualenv(if not installed, runpip install virtualenv):virtualenv venv
Or using venv (Python 3.3+):
python -m venv venv
-
If using a virtual environment (Step 2), activate it:
- On Windows:
venv\Scripts\activate
- On macOS and Linux:
source venv/bin/activate -
Install the required packages from requirements.txt:
pip install -r requirements.txt
This will set up the necessary packages for the project.
To test the Flask application, run the following command in your terminal while in your the directory:
flask runThis will start a web server that serves the Flask application. You can then access the application by opening your web browser and navigating to http://localhost:5000.
Enjoy using the Birthday Reminder Web Application!
このウェブアプリケーションは、知人の誕生日を追跡し、それらを忘れないようにするために設計されました。
- 人々の名前とそれに対応する誕生日の日付を追加します。
-
application.py: このファイルにはFlaskウェブアプリケーションのコードが含まれています。このアプリケーションにはPOSTリクエストとGETリクエストの両方を処理する1つのルート(/)が含まれています。/ルートはGETでリクエストされるとindex.htmlテンプレートがレンダリングされます。POSTでリクエストされた場合、ユーザーはGETを介して再度/にリダイレクトされます。 -
birthdays.db: これはid、name、month、およびdayの列を含むbirthdaysテーブルを持つSQLiteデータベースです。このウェブアプリケーションを使用して新しい行をこのテーブルに挿入できます。 -
static/styles.css: このディレクトリにはウェブアプリケーションのCSSコードが含まれています。このファイルをカスタマイズしてアプリケーションの外観を変更できます。 -
templates/index.html: このHTMLファイルはユーザーがウェブアプリケーションを訪れたときにレンダリングされます。
必要な依存関係を設定するには、次の手順に従ってください:
必要に応じてpipをpip3に変更してください。
-
このリポジトリをローカルマシンにクローンしてください。
-
仮想環境を作成します(オプションですが推奨):
virtualenvを使用する場合(インストールされていない場合はpip install virtualenvを実行):virtualenv venv
またはvenvを使用する場合(Python 3.3+):
python -m venv venv
-
仮想環境を使用する場合(ステップ2)、それをアクティブにします:
- Windowsの場合:
venv\Scripts\activate
- macOSおよびLinuxの場合:
source venv/bin/activate -
requirements.txtから必要なパッケージをインストールします:
pip install -r requirements.txt
これでプロジェクトの必要なパッケージが設定されます。
Flaskアプリケーションをテストするには、ディレクトリ内で次のコマンドを実行してください:
flask runこれにより、Flaskアプリケーションを提供するウェブサーバーが起動します。その後、ウェブブラウザを開いてhttp://localhost:5000 にアクセスすることで、アプリケーションにアクセスできます。
Enjoy!