evennia/game/web/urls.py

43 lines
1.4 KiB
Python
Raw Normal View History

2007-04-26 02:19:49 +00:00
#
# File that determines what each URL points to. This uses _Python_ regular
# expressions, not Perl's.
#
# See:
# http://diveintopython.org/regular_expressions/street_addresses.html#re.matching.2.3
#
2006-11-20 18:54:10 +00:00
from django.conf.urls.defaults import *
2008-11-05 18:17:59 +00:00
from django.conf import settings
from django.contrib import admin
2006-11-20 18:54:10 +00:00
admin.autodiscover()
2006-11-20 18:54:10 +00:00
urlpatterns = patterns('',
# User Authentication
2008-11-05 18:17:59 +00:00
url(r'^accounts/login', 'django.contrib.auth.views.login'),
url(r'^accounts/logout', 'django.contrib.auth.views.logout'),
# Front page
url(r'^', include('game.web.apps.website.urls')),
# News stuff
url(r'^news/', include('game.web.apps.news.urls')),
# Page place-holder for things that aren't implemented yet.
url(r'^tbi/', 'game.web.apps.website.views.to_be_implemented'),
2008-11-05 18:17:59 +00:00
# Admin interface
url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
url(r'^admin/(.*)', admin.site.root, name='admin'),
2006-11-20 18:54:10 +00:00
)
# If you'd like to serve media files via Django (strongly not recommended!),
# open up your settings.py file and set SERVE_MEDIA to True. This is
# appropriate on a developing site, or if you're running Django's built-in
# test server. Normally you want a webserver that is optimized for serving
# static content to handle media files (apache, lighttpd).
if settings.SERVE_MEDIA:
urlpatterns += patterns('',
(r'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}),
)