@login_required(login_url='/login')
def post_project(request):
    current_user = request.user
    user = Profile.objects.get(user=current_user)
    form = SubmitProjectForm()
    if (request.method == 'POST'):
        form = SubmitProjectForm(request.POST, request.FILES)
        if form.is_valid():
            project = form.save(commit=False)
            project.user = user
            project.save()
            return redirect('/')
    else:
        form = SubmitProjectForm()
    ctx = {'form': form}
    return render(request, 'main/post_project.html', ctx)
@login_required(login_url='/login')
def post_project(request):
    current_user = request.user
    user = Profile.objects.get(user=current_user)
    form = SubmitProjectForm()
    if (request.method == 'POST'):
        form = SubmitProjectForm(request.POST, request.FILES)
        if form.is_valid():
            project = form.save(commit=False)
            project.user = user
            project.save()
            return redirect('/')
    else:
        form = SubmitProjectForm()
    ctx = {'form': form}
    return render(request, 'main/post_project.html', ctx)