diff --git a/.gitignore b/.gitignore index 0d20b64..085c4fe 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ *.pyc +*.db diff --git a/app/__init__.py b/pypowerdns/__init__.py similarity index 86% rename from app/__init__.py rename to pypowerdns/__init__.py index 0cd4822..27b4a61 100644 --- a/app/__init__.py +++ b/pypowerdns/__init__.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + from flask import Flask, render_template, session from flask_sqlalchemy import SQLAlchemy from locale import setlocale, LC_ALL @@ -24,3 +26,6 @@ def contexto_para_templates(): ), 'utf8') ) +# Faz a importação das views: +import app.views.login +import app.views.main \ No newline at end of file diff --git a/app/libs/__init__.py b/pypowerdns/libs/__init__.py similarity index 100% rename from app/libs/__init__.py rename to pypowerdns/libs/__init__.py diff --git a/app/libs/forms.py b/pypowerdns/libs/forms.py similarity index 100% rename from app/libs/forms.py rename to pypowerdns/libs/forms.py diff --git a/app/models.py b/pypowerdns/models.py similarity index 100% rename from app/models.py rename to pypowerdns/models.py diff --git a/app/templates/404.html b/pypowerdns/templates/404.html similarity index 100% rename from app/templates/404.html rename to pypowerdns/templates/404.html diff --git a/app/templates/base.html b/pypowerdns/templates/base.html similarity index 100% rename from app/templates/base.html rename to pypowerdns/templates/base.html diff --git a/app/templates/login.html b/pypowerdns/templates/login.html similarity index 100% rename from app/templates/login.html rename to pypowerdns/templates/login.html diff --git a/app/var/readme.txt b/pypowerdns/var/readme.txt similarity index 100% rename from app/var/readme.txt rename to pypowerdns/var/readme.txt diff --git a/app/views/__init__.py b/pypowerdns/views/__init__.py similarity index 100% rename from app/views/__init__.py rename to pypowerdns/views/__init__.py diff --git a/app/views/login.py b/pypowerdns/views/login.py similarity index 100% rename from app/views/login.py rename to pypowerdns/views/login.py diff --git a/app/views/main.py b/pypowerdns/views/main.py similarity index 64% rename from app/views/main.py rename to pypowerdns/views/main.py index 2e17234..21b0452 100644 --- a/app/views/main.py +++ b/pypowerdns/views/main.py @@ -1,8 +1,10 @@ # -*- coding: utf-8 -*- from flask import render_template +from flask.ext.login import login_required from app import app -@app.route("/") +@app.route('/') +@login_required def index(): return render_template('principal.html') \ No newline at end of file