code: def add_topic(request, forum_slug=None):
      
      forum = Forum.objects.get(slug=forum_slug)
      form  = AddTopicForm(request.POST or None, request.FILES or None, initial={'forum': forum})
  
      current_time   = time.time()
      user           = request.user
  
      if form.is_valid():
          instance = form.save(commit=False)
          instance.forum           = forum
          instance.name            = strip_tags(instance.name)
          instance.slug            = slugify(instance.name)
          instance.user            = user
          instance.author          = user.display_name
          instance.lastpost_author = user.display_name
          instance.created_int     = current_time
          instance.modified_int    = current_time
          instance.save()
  
          # and now add the child post
          post = Post(
              topic            = instance,
              text             = request.POST['text'],
              user             = user,
              post_date_int    = current_time
          )
          if request.FILES:
              post.image = request.FILES['image']
          post.save()
  
          return HttpResponseRedirect("/forum/%s/?new_topic=%s" % (forum_slug, instance.id))
  
      return render(request, 'fretboard/add_edit.html', {
          'form': form,
          'form_title': 'Add a topic',
          'FORUM_BASE_NAME': FORUM_BASE_NAME
      })
docs: Adds a topic to a given forum