from django.conf.urls import url from games.views import GameView urlpatterns = [ url(r'^(?P<game_sname>[a-zA-Z-0-9]*)/$', GameView.as_view(), name='game'), ]
"""connect_four URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/3.0/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-based views 1. Add an import: from other_app.views import Home 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') Including another URLconf 1. Import the include() function: from django.urls import include, path 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) """ from django.urls import path from games.views import PickUser, GameView from presence.views import LobbyView urlpatterns = [ path("", PickUser.as_view(), name="home"), path("play/<int:game_id>/", GameView.as_view(), name="game"), path("lobby/", LobbyView.as_view(), name="lobby"), ]
from django.conf.urls import url from games.views import AttackView from games.views import CreateGameView from games.views import GameView urlpatterns = [ url(r'^(?P<game_id>.+)/attack/$', AttackView.as_view(), name='attack'), url(r'^create_game/$', CreateGameView.as_view(), name='create_game'), url(r'^(?P<game_id>.+)/$', GameView.as_view(), name='game'), ]
"""tipper URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.9/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 from django.contrib import admin from games.views import GameView urlpatterns = [ url(r'^games/', GameView.as_view(), name='games'), url(r'^admin/', admin.site.urls), ]
from django.conf.urls import include, url from django.contrib import admin from core.views import index, urls_as_view from games.views import GameView, DefaultGameView, MultiGameView from responses.views import ResponseView urlpatterns = [] apipatterns = [ url(r'^game/$', GameView.as_view()), url(r'^game/default/$', DefaultGameView.as_view()), url(r'^game/multi/$', MultiGameView.as_view()), url(r'^response/$', ResponseView.as_view()) ] urlpatterns += [url(r'^api/', include(apipatterns))] urlpatterns += [ url(r'^$', index), url(r'^admin/', include(admin.site.urls)), url(r'^api/$', urls_as_view) ]
from django.conf.urls import url from games.views import GameView urlpatterns = [ # Show Game # GameView - games:game-detail # /games/<pk>. url(r'^(?P<pk>\d+)/$', GameView.as_view(), name='game-detail') ]