so i have this code:
views.py
class NewPost(View):
def get(self, request, *args, **kwargs):
return HttpResponse('Hello world')
urls.py
app_name = 'blog'
urlpatterns = [
url(r'^$', views.PostListView.as_view(), name='post-list'),
url(r'^loginto/$', views.loginto, name='loginto'),
url(r'^logoutof/$', views.logoutof, name='logoutof'),
url(r'^(?P<category>.+)/$', views.CategoryView, name='category-view'),
url(r'^create/$', views.NewPost.as_view(), name='create'),
]
and everything is working fine, except the last create bit. everytime i try to load create from from the address bar, it returns the base.html no matter what i put in the return. Any ideas why that is happening?
Aucun commentaire:
Enregistrer un commentaire