2015-12-30 13:22:15 +00:00
|
|
|
|
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
from __future__ import unicode_literals
|
|
|
|
|
2016-03-05 11:40:41 +00:00
|
|
|
from django.conf.urls import include, url
|
|
|
|
|
|
|
|
from tastypie.api import Api
|
|
|
|
|
|
|
|
from pokemon.api import (
|
|
|
|
PokemonResource, TypeResource, AbilityResource, GameResource,
|
|
|
|
SpriteResource, DescriptionResource, EggResource, MoveResource,
|
|
|
|
PokedexResource
|
|
|
|
)
|
2016-01-06 22:10:05 +00:00
|
|
|
|
2015-12-30 13:22:15 +00:00
|
|
|
|
|
|
|
from django.contrib import admin
|
|
|
|
admin.autodiscover()
|
|
|
|
|
|
|
|
##################################
|
|
|
|
#
|
|
|
|
# V1 API setup using Tastypie
|
2016-03-05 11:40:41 +00:00
|
|
|
#
|
2015-12-30 13:22:15 +00:00
|
|
|
##################################
|
|
|
|
|
|
|
|
api_resources = Api()
|
|
|
|
api_resources.register(PokemonResource())
|
|
|
|
api_resources.register(AbilityResource())
|
|
|
|
api_resources.register(TypeResource())
|
|
|
|
api_resources.register(GameResource())
|
|
|
|
api_resources.register(SpriteResource())
|
|
|
|
api_resources.register(DescriptionResource())
|
|
|
|
api_resources.register(EggResource())
|
|
|
|
api_resources.register(MoveResource())
|
|
|
|
api_resources.register(PokedexResource())
|
|
|
|
|
|
|
|
urlpatterns = [
|
|
|
|
|
|
|
|
url(r'^api/', include(api_resources.urls)),
|
2016-03-05 11:40:41 +00:00
|
|
|
]
|