From 82dbcf330448bdc07447d39c831643f1f3572d01 Mon Sep 17 00:00:00 2001 From: "Luiz Gustavo Costa (gugabsd)" Date: Mon, 7 Jan 2013 16:40:23 -0200 Subject: [PATCH] rename directory for app --- .gitignore | 1 + {app => pypowerdns}/__init__.py | 5 +++++ {app => pypowerdns}/libs/__init__.py | 0 {app => pypowerdns}/libs/forms.py | 0 {app => pypowerdns}/models.py | 0 {app => pypowerdns}/templates/404.html | 0 {app => pypowerdns}/templates/base.html | 0 {app => pypowerdns}/templates/login.html | 0 {app => pypowerdns}/var/readme.txt | 0 {app => pypowerdns}/views/__init__.py | 0 {app => pypowerdns}/views/login.py | 0 {app => pypowerdns}/views/main.py | 4 +++- 12 files changed, 9 insertions(+), 1 deletion(-) rename {app => pypowerdns}/__init__.py (86%) rename {app => pypowerdns}/libs/__init__.py (100%) rename {app => pypowerdns}/libs/forms.py (100%) rename {app => pypowerdns}/models.py (100%) rename {app => pypowerdns}/templates/404.html (100%) rename {app => pypowerdns}/templates/base.html (100%) rename {app => pypowerdns}/templates/login.html (100%) rename {app => pypowerdns}/var/readme.txt (100%) rename {app => pypowerdns}/views/__init__.py (100%) rename {app => pypowerdns}/views/login.py (100%) rename {app => pypowerdns}/views/main.py (64%) 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