views.py
class Test(CreateView):
template_name = 'test/test.html'
form_class = TestForm
success_url = '/'
def get_context_data(self, **kwargs):
context = super(Test, self).get_context_data(**kwargs)
context['username'] = self.kwargs['username']
return context
urls.py
url(r'^(?P\w{3,30})/$' , Test.as_view() , name='test')
test.html
<a href="%7B%25%20url%20'test'%20username%7D">test</a>