#!/usr/bin/env python
# -*- coding: utf-8 -*-

# Copyright 2017 EMBL - European Bioinformatics Institute
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# from django.contrib import admin
from django.conf.urls import include, url

from rest_framework.schemas import get_schema_view
from rest_framework_swagger.views import get_swagger_view

from rest_auth import views as rest_auth_views


EMG_TITLE = 'EBI Metagenomics JSON API'
EMG_URL = 'http://www.ebi.ac.uk/metagenomics/api/'
EMG_DESC = (
    'Is a free resource to visualise and discover metagenomic datasets. '
    'For more details and full documentation go to '
    'http://www.ebi.ac.uk/metagenomics'
)


schema_view = get_schema_view(
    title=EMG_TITLE, url=EMG_URL, description=EMG_DESC)

docs_schema_view = get_swagger_view(title=EMG_TITLE, url=EMG_URL)

# Wire up our API using automatic URL routing.
# Additionally, we include login URLs for the browsable API.
urlpatterns = [

    url(r'^$', schema_view),

    # url(r'^admin/', admin.site.urls),

    url(r'^http-auth/', include('rest_framework.urls',
                                namespace='rest_framework')),

    # url(r'^api/auth/', include('rest_auth.urls')),
    url(
        r'^api/auth/login$',
        rest_auth_views.LoginView.as_view(),
        name='rest_auth_login'
    ),

    url(
        r'^api/auth/logout$',
        rest_auth_views.LogoutView.as_view(),
        name='rest_auth_logout'
    ),

    url(r'^api/doc$', docs_schema_view),

    url(r'^api/', include('emgapi.urls',
                          namespace='emgapi')),

]

@@ -916,16 +916,18 @@
 ON API'%0A
+# 
 EMG_URL 
@@ -1208,21 +1208,8 @@
 TLE,
- url=EMG_URL,
  des
@@ -1283,21 +1283,8 @@
 ITLE
-, url=EMG_URL
 )%0A%0A#

remove api url