|
@@ -8,6 +8,9 @@ import inspect
|
8
|
8
|
|
9
|
9
|
from django.views.decorators.csrf import csrf_exempt
|
10
|
10
|
|
|
11
|
+from django.views.generic import ListView, CreateView # new
|
|
12
|
+
|
|
13
|
+
|
11
|
14
|
# from wsps.tasks_loop import *
|
12
|
15
|
|
13
|
16
|
# wsps.
|
|
@@ -52,6 +55,16 @@ def fn_v(request,*a,**kw):
|
52
|
55
|
def fn_v0(request,*a,**kw):
|
53
|
56
|
return HttpResponse("fn_v0")
|
54
|
57
|
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+class CreatePostView(CreateView): # new
|
|
61
|
+ model = Post
|
|
62
|
+ form_class = PostForm
|
|
63
|
+ template_name = "post.html"
|
|
64
|
+ # success_url = reverse_lazy("home")
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
55
|
68
|
arbitrary_string_as_template = "abc 123 {% csrf_token %}"
|
56
|
69
|
def fn_v1(request,*a,**kw):
|
57
|
70
|
|