From 49ee54ec4cb4cdb74e4456db99c31fbcc5a3f231 Mon Sep 17 00:00:00 2001 From: Daniel Cortes Date: Wed, 13 Feb 2019 20:00:02 -0300 Subject: [PATCH] Preparando para deploy, eso espero --- MANIFEST.in | 6 ++++++ setup.py | 14 ++++++++++++++ www/__init__.py | 2 +- www/admin.py | 4 ++-- www/dummy.sql | 3 --- www/schema.sql | 4 ++++ www/templates/empty.html | 2 +- 7 files changed, 28 insertions(+), 7 deletions(-) create mode 100644 MANIFEST.in create mode 100644 setup.py diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..b88e3b1 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,6 @@ +include www/schema.sql +include www/dummy.sql +graft www/templates +graft www/static +global-exclude *.pyc + diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..05bb552 --- /dev/null +++ b/setup.py @@ -0,0 +1,14 @@ +from setuptools import find_packages, setup + +setup( + name='www', + version='1.0.0', + packages=find_packages(), + include_package_data=True, + zip_safe=False, + install_requires=[ + 'flask', + 'markdown', + ], +) + diff --git a/www/__init__.py b/www/__init__.py index ac9ceda..a059b29 100644 --- a/www/__init__.py +++ b/www/__init__.py @@ -19,7 +19,7 @@ def create_app(): @app.route('/') def index(): - return render_template('empty.html') + return redirect(url_for('blog.index')) from . import db diff --git a/www/admin.py b/www/admin.py index 628553c..6e33f67 100644 --- a/www/admin.py +++ b/www/admin.py @@ -32,7 +32,7 @@ def login(): if error is None: session.clear() session['user_id'] = user['id'] - return redirect(url_for('blog.index')) + return redirect(url_for('index')) flash(error) @@ -41,7 +41,7 @@ def login(): @bp.route('/logout') def logout(): session.clear() - return redirect(url_for('blog.index')) + return redirect(url_for('index')) @bp.before_app_request def load_logged_in_user(): diff --git a/www/dummy.sql b/www/dummy.sql index 0bcbaa4..6ca3bb3 100644 --- a/www/dummy.sql +++ b/www/dummy.sql @@ -23,6 +23,3 @@ INSERT INTO posts (title, markdown, html, resume) values "Sit necessitatibus quibusdam autem facere tempore quibusdam assumenda. Quo sit asperiores earum beatae unde reiciendis perspiciatis. Blanditiis natus ex similique possimus optio veritatis.", "Enim unde ut eaque vero saepe ut. Iure culpa modi ipsam maxime aliquid sed officiis. Consequatur minima quaerat molestias laudantium aut. Quia voluptas sint accusantium architecto." ); - -INSERT INTO now (markdown, html) values -("", "") diff --git a/www/schema.sql b/www/schema.sql index 337d80d..21cf560 100644 --- a/www/schema.sql +++ b/www/schema.sql @@ -22,3 +22,7 @@ CREATE TABLE users ( username TEXT NOT NULL, password TEXT NOT NULL ); + +INSERT INTO now (markdown, html) VALUES ( + "","" +); diff --git a/www/templates/empty.html b/www/templates/empty.html index 187250a..626d934 100644 --- a/www/templates/empty.html +++ b/www/templates/empty.html @@ -1,6 +1,6 @@ {% extends 'base.html' %} -{% block title %}/dev/null{% endblock %} +{% block title %}dev/null{% endblock %} {% block content %}