-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathurls.py
27 lines (25 loc) · 1.14 KB
/
urls.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
from django.conf.urls.defaults import *
from django.conf import settings
from django.contrib.auth.views import login, logout
from django.contrib import admin
from django.views.generic.list_detail import object_list
from pxcs2w2.default.views import register
from pxcs2w2.card.views import card_list
from pxcs2w2.card.models import Card
admin.autodiscover()
urlpatterns = patterns('',
url(r'^$', card_list, name='site_root'),
(r'^cards/', include('pxcs2w2.card.urls')),
(r'^nordrassil/(.*)', admin.site.root),
url(r'^accounts/logout/$', logout, {'next_page': '/'}, name='logout'),
url(r'^accounts/register/$', register, name='register'),
)
if settings.DEBUG:
import os.path
from django.views import static
statics_dir = os.path.join(os.path.dirname(__file__), 'statics').replace('\\','/')
urlpatterns += patterns('',
(r'^styles/(?P<path>.*)$', static.serve, {'document_root': os.path.join(statics_dir, 'styles')}),
(r'^js/(?P<path>.*)$', static.serve, {'document_root': os.path.join(statics_dir, 'js')}),
(r'^images/(?P<path>.*)$', static.serve, {'document_root': os.path.join(statics_dir, 'images')}),
)