from django.conf.urls import url
from django.conf import settings
from django.conf.urls.static import  static
from . import views

urlpatterns = [
    url(r'^$', views.index, name='index'),
    url(r'^image/$', views.add_image, name='upload_image'),
    url(r'^profile/$', views.profile_info, name='profile'),
    url(r'^update/$', views.profile_update, name='update'),
    url(r'^comment/(?P<image_id>\d+)', views.comment, name='comment'),
    url(r'^search/', views.search_results, name = 'search_results'),
    url(r'^follow/(?P<user_id>\d+)', views.follow, name = 'follow'),
    url(r'^unfollow/(?P<user_id>\d+)', views.unfollow, name='unfollow'),
    url(r'^likes/(\d+)/$', views.like_images,name='likes')
]
if settings.DEBUG:
    urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

[(7, 'django.conf.urls.url', 'url', (['"""^$"""', 'views.index'], {'name': '"""index"""'}), False, 'from django.conf.urls import url\n'), (8, 'django.conf.urls.url', 'url', (['"""^image/$"""', 'views.add_image'], {'name': '"""upload_image"""'}), False, 'from django.conf.urls import url\n'), (9, 'django.conf.urls.url', 'url', (['"""^profile/$"""', 'views.profile_info'], {'name': '"""profile"""'}), False, 'from django.conf.urls import url\n'), (10, 'django.conf.urls.url', 'url', (['"""^update/$"""', 'views.profile_update'], {'name': '"""update"""'}), False, 'from django.conf.urls import url\n'), (11, 'django.conf.urls.url', 'url', (['"""^comment/(?P<image_id>\\\\d+)"""', 'views.comment'], {'name': '"""comment"""'}), False, 'from django.conf.urls import url\n'), (12, 'django.conf.urls.url', 'url', (['"""^search/"""', 'views.search_results'], {'name': '"""search_results"""'}), False, 'from django.conf.urls import url\n'), (13, 'django.conf.urls.url', 'url', (['"""^follow/(?P<user_id>\\\\d+)"""', 'views.follow'], {'name': '"""follow"""'}), False, 'from django.conf.urls import url\n'), (14, 'django.conf.urls.url', 'url', (['"""^unfollow/(?P<user_id>\\\\d+)"""', 'views.unfollow'], {'name': '"""unfollow"""'}), False, 'from django.conf.urls import url\n'), (15, 'django.conf.urls.url', 'url', (['"""^likes/(\\\\d+)/$"""', 'views.like_images'], {'name': '"""likes"""'}), False, 'from django.conf.urls import url\n'), (18, 'django.conf.urls.static.static', 'static', (['settings.MEDIA_URL'], {'document_root': 'settings.MEDIA_ROOT'}), False, 'from django.conf.urls.static import static\n')]