Exemplo n.º 1
0
class MainController():
    def __init__(self):
        """Class initialization."""

        self.view = MainView()

    def display(self):
        """Method displaying page."""

        self.view.display()

    def get_command(self):
        """Method getting user input."""

        choice = input("> ")

        if choice == "1":
            return "goto-category"
        elif choice == "2":
            return "goto-substitute"
        elif choice == "3":
            return "rebuild-database"
        elif choice == "4":
            return "quit"
Exemplo n.º 2
0
    return render_template('error/404.html'), 404


# can print template's filename in HTML title tag
@app.template_filter('quoted')
def quoted(s):
    l = re.findall('\'([^\']*)\'', str(s))
    if l:
        return l[0]
    return None

# 샐러리 초기화
celery = make_celery(app)

# Import a module
from app.views.main import MainView
from app.views.start import StartView
from app.views.auth import *
from app.views.admin import AdminView

MainView.register(app)
StartView.register(app)
AuthView.register(app)
AdminView.register(app)
LeaveView.register(app)
DeleteUserView.register(app)

# Build the database:
# This will create the database file using SQLAlchemy
db.create_all()
Exemplo n.º 3
0
    def __init__(self):
        """Class initialization."""

        self.view = MainView()
Exemplo n.º 4
0
from django.conf.urls import patterns, include, url
from django.conf.urls.static import static
from django.contrib import admin
from app import settings
from app.settings import DEBUG
from app.views.category import CategoryView
from app.views.main import MainView
from app.views.page import PageView

urlpatterns = patterns('',
    # Examples:
    url(r'^$', MainView.as_view(), name='home'),
    url(r'^albums/(?P<alias>[\w]+)$', CategoryView.as_view(), name='category'),
    url(r'^(?P<page>[0-9a-z]+)$', PageView.as_view(), name='page'),
    # url(r'^blog/', include('blog.urls')),

    url(r'^admin/', include(admin.site.urls)),
    (r'^ckeditor/', include('ckeditor.urls')),
)

if DEBUG:
    urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)