示例#1
0
from django.conf.urls import patterns, include, url
#import the current project view
from views import IndexPageView, DaasPageView, GDRPageView, generateCSV
from django.contrib.staticfiles.urls import staticfiles_urlpatterns

from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
    #Examples:
    #url(r'^$', 'mysite.views.home', name='home'),
    # url(r'^polls/', include('polls.urls')),
    #url(r'^$', views.index, name='index'),
    #url(r'^polls/', include('polls.urls', namespace="polls")),
    #url(r'^admin/', include(admin.site.urls)),
    url(r'^$', IndexPageView.as_view(), name='index'),
    url(r'^daas', DaasPageView.as_view(), name='daas'),
    url(r'^GDR', GDRPageView.as_view(), name='GDR'),
    #url(r'^generateCSV', generateCSV.as_view(), name='generateCSV'),
    url(r'^generateCSV', generateCSV, name='generateCSV'),
)

urlpatterns += staticfiles_urlpatterns()
示例#2
0
import os
from flask import Flask
from flask.ext.bootstrap import Bootstrap
from flask_peewee.db import Database

app = Flask(__name__)
app.config.from_object(os.environ.get('BADBATCH_SETTINGS'))
Bootstrap(app)
db = Database(app)

# Register views
from views import RegisterView, IndexPageView, AlertsView, ContactView, CallView
IndexPageView.register(app, route_base="/")
RegisterView.register(app, route_base="/register")
AlertsView.register(app, route_base="/alerts")
ContactView.register(app, route_base="/contact")
CallView.register(app, route_base="/voice")