pokeapi/config/urls.py

55 lines
1.4 KiB
Python
Raw Normal View History

2014-12-04 11:11:46 +00:00
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
2015-12-30 13:22:15 +00:00
from django.conf.urls import url, include
2014-12-04 11:11:46 +00:00
from django.conf.urls.static import static
from django.contrib import admin
2016-01-06 22:10:05 +00:00
from django.views.generic import TemplateView
2015-12-30 13:22:15 +00:00
from pokemon import urls as pokemon_urls
from pokemon_v2 import urls as pokemon_v2_urls
2015-09-06 01:22:06 +00:00
# need to make sure v2 urls resolve last so angular routes have control
2016-01-06 22:10:05 +00:00
# v2 = [ url(r'^', include(pokemon_v2_urls)) ]
2015-09-06 01:22:06 +00:00
urlpatterns = [
2015-09-06 01:22:06 +00:00
2014-12-04 11:11:46 +00:00
url(r'^admin/', include(admin.site.urls)),
2015-09-06 01:22:06 +00:00
2014-12-04 11:11:46 +00:00
url(r'^media/(?P<path>.*)',
'django.views.static.serve',
{'document_root': settings.MEDIA_ROOT}),
2015-09-06 01:22:06 +00:00
2014-12-04 11:11:46 +00:00
url(r'^static/(?P<path>.*)',
'django.views.static.serve',
{'document_root': settings.STATIC_ROOT}),
2016-01-06 22:10:05 +00:00
url(r'^$', 'config.views.home'),
url(r'^docsv1/$',
2016-01-09 15:55:39 +00:00
TemplateView.as_view(template_name='pages/docsv1.html'),
2016-01-06 22:10:05 +00:00
name="documentation"
),
url(r'^docsv2/$',
2016-01-09 15:55:39 +00:00
TemplateView.as_view(template_name='pages/docsv2.html'),
2016-01-06 22:10:05 +00:00
name="documentation_v2"
),
2016-01-09 15:55:39 +00:00
url(r'^404/$',
TemplateView.as_view(template_name='404.html'),
name="404"
),
url(r'^500/$',
TemplateView.as_view(template_name='500.html'),
name="500"
),
2016-01-06 22:10:05 +00:00
url(r'^about/$', 'config.views.about'),
url(r'^', include(pokemon_urls)),
2016-01-06 22:10:05 +00:00
url(r'^', include(pokemon_v2_urls)),
2016-01-06 22:10:05 +00:00
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) # + v2