flask init
This commit is contained in:
parent
b833ac96ea
commit
aba3a484b7
17
build-deb/Makefile
Normal file
17
build-deb/Makefile
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
all: man deb
|
||||||
|
|
||||||
|
man: man/freeriders.1.md
|
||||||
|
pandoc man/freeriders.1.md -f markdown+hard_line_breaks -s -t man -o man/freeriders.1
|
||||||
|
cp man/freeriders.1 freeriders/usr/share/man/man1/
|
||||||
|
gzip -f freeriders/usr/share/man/man1/freeriders.1
|
||||||
|
deb: man ../requirments.txt ../run.py ../freeriders ../LICENSE
|
||||||
|
cp -r ../freeriders/* freeriders/var/freeriders/freeriders/
|
||||||
|
cp ../run.py freeriders/var/freeriders/
|
||||||
|
cp ../LICENSE freeriders/var/freeriders/
|
||||||
|
dpkg-deb --build freeriders
|
||||||
|
clean:
|
||||||
|
rm -f freeriders.deb
|
||||||
|
rm -f man/freeriders.1
|
||||||
|
rm -rf freeriders/var
|
||||||
|
mkdir -p freeriders/var/freeriders/freeriders
|
||||||
|
mkdir -p freeriders/usr/share/man/man1/
|
11
build-deb/freeriders/DEBIAN/control
Normal file
11
build-deb/freeriders/DEBIAN/control
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
Package: freeriders
|
||||||
|
Section: net
|
||||||
|
Priority: optional
|
||||||
|
Architecture: all
|
||||||
|
Essential: no
|
||||||
|
Installed-Size: 2000
|
||||||
|
Depends: python3-flask, gunicorn
|
||||||
|
Homepage: https://gitea.dmz.rs/Decentrala/freeriders
|
||||||
|
Maintainer: Decentrala <dmz@dmz.rs>
|
||||||
|
Description: Web app that tracks bus transport ticket numbers
|
||||||
|
Version: 1.0.0
|
3
build-deb/freeriders/DEBIAN/postinst
Executable file
3
build-deb/freeriders/DEBIAN/postinst
Executable file
@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
/usr/bin/systemctl enable freeriders.service
|
||||||
|
/sbin/service freeriders start
|
3
build-deb/freeriders/DEBIAN/prerm
Executable file
3
build-deb/freeriders/DEBIAN/prerm
Executable file
@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
/sbin/service freeriders stop
|
||||||
|
/usr/bin/systemdctl disable freeriders.service
|
12
build-deb/freeriders/lib/systemd/system/freeriders.service
Normal file
12
build-deb/freeriders/lib/systemd/system/freeriders.service
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Gunicorn freeriders service
|
||||||
|
Documentation=man:gunicorn(1)
|
||||||
|
After=network.target nss-lookup.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
WorkingDirectory=/var/freeriders/
|
||||||
|
ExecStart=/usr/bin/gunicorn --workers 3 --bind 127.0.0.1:5000 run:app
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
|
21
build-deb/man/freeriders.1.md
Normal file
21
build-deb/man/freeriders.1.md
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
% FREERIDERS(1) freeriders 1.0.0
|
||||||
|
% Decentrala
|
||||||
|
% Jun 2023
|
||||||
|
|
||||||
|
# NAME
|
||||||
|
freeriders - Web app for tracking bus transport ticket numbers
|
||||||
|
|
||||||
|
# SYNOPSIS
|
||||||
|
**python3 run.py**
|
||||||
|
|
||||||
|
# DESCRIPTION
|
||||||
|
Web app for tracking bus transport ticket numbers
|
||||||
|
|
||||||
|
# AUTHORS
|
||||||
|
Decentrala
|
||||||
|
|
||||||
|
# COPYRIGHT
|
||||||
|
**AGPLv3+**: GNU AGPL version 3 <https://gnu.org/licenses/agpl.html>
|
||||||
|
This is *free* software: you are free to change and redistribute it.
|
||||||
|
There is **NO WARRANTY**, to the extent permitted by law.
|
||||||
|
|
5
freeriders/__init__.py
Normal file
5
freeriders/__init__.py
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
from flask import Flask
|
||||||
|
|
||||||
|
app = Flask(__name__)
|
||||||
|
|
||||||
|
from freeriders import routes
|
10
freeriders/routes.py
Normal file
10
freeriders/routes.py
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
from flask import render_template, request, redirect
|
||||||
|
from freeriders import app
|
||||||
|
|
||||||
|
@app.route('/', methods=['POST', 'GET'])
|
||||||
|
def changepassword():
|
||||||
|
if request.method == 'GET':
|
||||||
|
return render_template('index.html')
|
||||||
|
elif request.method == 'POST':
|
||||||
|
else:
|
||||||
|
return 'HTTP request method not recogniezed'
|
14
freeriders/templates/index.html
Normal file
14
freeriders/templates/index.html
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<link rel="stylesheet" href="/styles/style.css">
|
||||||
|
<link rel="shortcut icon" href="/img/favicon.ico" type="image/x-icon">
|
||||||
|
<title>Ticket tracking</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<main>
|
||||||
|
</main>
|
||||||
|
</body>
|
||||||
|
</html>
|
1
requirments.txt
Normal file
1
requirments.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
flask
|
Loading…
Reference in New Issue
Block a user