mirror of
https://github.com/aljazceru/cryptoanarchywiki.github.io.git
synced 2025-12-17 13:14:21 +01:00
Add post
This commit is contained in:
@@ -13,15 +13,16 @@ from django.http import HttpResponse
|
||||
from django.views.generic.base import RedirectView
|
||||
from django.core.urlresolvers import reverse
|
||||
|
||||
def pool_fix(request, pk):
|
||||
return HttpResponse("You're looking at question %s." % pk)
|
||||
|
||||
#Ref: http://stackoverflow.com/a/16627830/3445802
|
||||
class UserRedirectView(RedirectView):
|
||||
permanent = False
|
||||
def get_redirect_url(self, pk):
|
||||
pk = ''.join(str(pk).split('/'))
|
||||
return reverse('pool_fix', kwargs={'pk': pk})
|
||||
|
||||
def pool_fix(request, pk):
|
||||
return HttpResponse("You're looking at question %s." % pk)
|
||||
|
||||
{% endhighlight %}
|
||||
|
||||
#### 2. In your `urls.py`
|
||||
|
||||
Reference in New Issue
Block a user