Exemple #1
0
from django.conf.urls import patterns, url
from django.contrib.auth.decorators import login_required

from game import views
from game.views import GameListView, GameView, \
    RoundListView, RoundView

urlpatterns = patterns(
    '',
    url(r'^$', views.tournament, name='tournament'),
    url(r'^games/$', GameListView.as_view(), name='games'),
    #    (r'^add_game/', login_required(GameView.as_view())),
    url(r'^games/(?P<pk>\d+)/$', GameView.as_view(), name='game-detail'),
    url(r'^games/(?P<pk>\d+)/edit$',
        views.edit_game_result,
        name='game-result-edit'),
    url(r'^rounds/$', RoundListView.as_view(), name='rounds'),
    #        (r'^add_round/', login_required(RoundView.as_view())),
    url(r'^rounds/(?P<pk>\d+)/$', RoundView.as_view(), name='round-detail'),
    url(r'^rounds/(?P<pk>\d+)/finish$',
        views.finish_round,
        name='round-finish'),
)
Exemple #2
0
from django.contrib import admin
from django.urls import path, include
from game.views import GameListView
from django.views.static import serve
from users.views import LoginView, RegisterView, LogoutView, ForgetPassword, ResetView, ModifyPassword
from GameShop.settings import MEDIA_ROOT, MEDIA_URL
from django.conf.urls.static import static


urlpatterns = [
    path('admin/', admin.site.urls),
    path('', GameListView.as_view(), name="index"),
    path('logout', LogoutView.as_view(), name="logout"),
    path('login/', LoginView.as_view(), name="login"),
    path('register', RegisterView.as_view(), name="register"),
    path('game', include('game.urls', namespace="game")),
    path('user', include('users.urls', namespace="user")),
    path('forget/', ForgetPassword.as_view(), name="forget_password"),
    path('reset/<str:code>/', ResetView.as_view(), name="reset password"),
    path('modify', ModifyPassword.as_view(), name="modify password"),
] + static(MEDIA_URL, document_root=MEDIA_ROOT)
Exemple #3
0
"""thaigametrade URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.conf.urls import url, include
    2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import url, include
from django.contrib import admin
from django.contrib.auth import views as auth_views
from .views import HomePageView, GameRequestView
from game.views import ProductListView, GameListView

urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^$', HomePageView.as_view(), name='home'),
    url(r'^product/', include('game.urls')),
    url(r'^gamerequest/$', GameRequestView.as_view(), name='gamerequest'),
    url(r'^game/$', GameListView.as_view(), name='gamelist'),
    url(r'^game/(?P<pk>\d+)/$', ProductListView.as_view(), name='game'),
    url(r'^accounts/', include('accounts.urls')),
]
Exemple #4
0
# -*- coding: utf-8 -*-
from django.conf.urls import patterns, include, url
from game.views import GameListView, GameDetailView, NewForecastView, buy_forecast
from django.contrib.auth.decorators import login_required


urlpatterns = patterns('',
    url(r'^games$', GameListView.as_view(), name='game_list'),
    url(r'^game/(?P<pk>\d+)$', GameDetailView.as_view(), name='game_detail'),
    url(r'^forecast/new$', login_required(NewForecastView.as_view(), login_url='/accounts/login/')),
    url(r'^forecast/buy/(?P<pk>\d+)$', login_required(buy_forecast), name='buy_forecast'),
)