Verified Commit 53c875f9 authored by Davide Depau's avatar Davide Depau
Browse files

Use proper Python packaging layout

parent 4c49579c
recursive-include uus/templates *
recursive-include uus/static *
import setuptools
setuptools.setup(name='uus',
version='1.0',
description='Uncomplicated URL Shortener',
long_description=open('README.md').read().strip(),
author='JackV',
author_email='1vercesig@gmail.com',
url='https://gitlab.poul.org/jackv/uus',
packages=['uus'],
install_requires=['Flask', 'Flask-Redis', 'Flask-HTTPAuth'],
license='MIT License',
zip_safe=False,
include_package_data=True,
keywords='url shortener',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Framework :: Flask',
'Operating System :: OS Independent',
'License :: OSI Approved :: MIT License',
'Topic :: Internet :: WWW/HTTP',
])
......@@ -38,17 +38,7 @@ def handle_login(username, password):
@app.route('/admin')
@auth.login_required
def adminui():
return flask.send_from_directory(admin_dir,
'admin.html',
as_attachment=False)
@app.route('/admin/<path:path>')
@auth.login_required
def admin_files(path):
return flask.send_from_directory(admin_dir,
path,
as_attachment=False)
return flask.render_template("admin.html")
@app.route('/api/v1/addurl', methods=['POST'])
......
from . import app
if __name__ == "__main__":
app.run()
<html>
<head>
<title>UUS Admin Area</title>
<link rel="stylesheet" href="admin/admin.css">
<link rel="stylesheet" href="{{ url_for('static', filename='css/admin.css') }}">
</head>
<body>
<div>
......@@ -25,7 +25,7 @@
</table>
</div>
</div>
<script src="admin/jquery-3.3.1.min.js"></script>
<script src="admin/admin.js"></script>
<script src="{{ url_for('static', filename='js/jquery-3.3.1.min.js') }}"></script>
<script src="{{ url_for('static', filename='js/admin.js') }}"></script>
</body>
</html>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment