Beispiel #1
0
from django.conf.urls import patterns, include, url
from django.contrib import admin
from main.views import GetPost, StatesListView, CityDetailView
from django.conf import settings
admin.autodiscover()


urlpatterns = patterns('',
    # Examples:
    # url(r'^$', 'djf.views.home', name='home'),
    # url(r'^blog/', include('blog.urls')),

    url(r'^admin/', include(admin.site.urls)),
    url(r'^first_view/(?P<starts_with>\w+)/$', 'main.views.first_view'),
    url(r'^get_post/', 'main.views.get_post'),
    #url(r'^mtv_view/', 'main.views.mtv_view'),
    url(r'^template_view/', 'main.views.template_view'),
    url(r'^GetPost/', GetPost.as_view()),
	url(r'^states_list_view/', StatesListView.as_view()),
	url(r'^cities/(?P<pk>[0-9]+)/$', CityDetailView.as_view()),
	url(r'^city_search/$', 'main.views.city_search'),
	url(r'^city_create/$', 'main.views.city_create'),
)


if settings.DEBUG:
    urlpatterns = patterns('',
    url(r'^media/(?P<path>.*)$', 'django.views.static.serve',
        {'document_root': settings.MEDIA_ROOT, 'show_indexes': True}),
    url(r'', include('django.contrib.staticfiles.urls')),
) + urlpatterns
Beispiel #2
0
from django.conf.urls import patterns, include, url

from django.contrib import admin
admin.autodiscover()

from main.views import GetPost
from django.views.decorators.csrf import csrf_exempt 

urlpatterns = patterns('',
    # Examples:
    # url(r'^$', 'django_states.views.home', name='home'),
    # url(r'^blog/', include('blog.urls')),

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

    url(r'^first_view/$', 'main.views.first_view'),

    url(r'^city_search/(?P<city>\w+)/(?P<state>\w+)/$', 'main.views.city_search'),

    url(r'^get_view/$', 'main.views.get_view'),

    url(r'^get_city_state/$', 'main.views.get_city_state'),

    url(r'^post_city_state/$', 'main.views.post_city_state'),

    url(r'^get_post/$', csrf_exempt(GetPost.as_view())),
)
Beispiel #3
0
from django.conf.urls import patterns, include, url
from django.views.decorators.csrf import csrf_exempt
from django.contrib import admin
from main.views import GetPost, StateListView, CityDetailView

admin.autodiscover()

urlpatterns = patterns('',
    # Examples:
    # url(r'^$', 'django_states.views.home', name='home'),
    # url(r'^blog/', include('blog.urls')),

    url(r'^admin/', include(admin.site.urls)),
    url(r'^first_view/(?P<starts_with>\w+)/$', 'main.views.first_view'),
    url(r'^first_view/$', 'main.views.first_view'),
    url(r'^get_post/$', 'main.views.get_post'),
    url(r'^template_view/$', 'main.views.template_view'),
    url(r'^city_search/$', 'main.views.city_search'),
    url(r'^city_create/$', 'main.views.city_create'),
    url(r'^GetPost/$', csrf_exempt(GetPost.as_view())),
    url(r'^state_list_view/$', StateListView.as_view()),
    url(r'^cities/(?P<pk>[0-9]+)/$', CityDetailView.as_view()),
    
)