Exemplo n.º 1
0
def projects_GETresponse(request, redirect, kw):
    visits_counter(request.path)
    projects_content = get_json(PROJECTS)
    template = get_content(PROJECTS_TEMPLATE)
    projects = ""

    for project in projects_content:
        projects += template.format(
            project_name=projects_content[project]["project_name"],
            project_id=project,
            project_date=projects_content[project]["project_date"],
            project_description=projects_content[project]
            ["project_description"],
        )

    page_content = get_content(PROJECTS_INDEX).format(projects=projects)
    return HttpResponse(page_content, "text/html")
Exemplo n.º 2
0
def get_editing_page(request, **kw):
    project_id = kw["project_id"]
    projects = get_json(PROJECTS)
    certain_project = projects[project_id]
    editing_page = get_content(
        PORTFOLIO / "test_projects" /
        "edit_projects.html").format(**certain_project, project_id=project_id)
    return HttpResponse(editing_page)
Exemplo n.º 3
0
def get_projects_page(request):
    visits_counter(request.path)
    file_name = MY_PROJECTS_PAGE
    content = get_content(file_name)
    return HttpResponse(content)
Exemplo n.º 4
0
def get_adding_page(request):
    adding_page = get_content(PORTFOLIO / "test_projects" /
                              "add_projects.html")
    return HttpResponse(adding_page)
Exemplo n.º 5
0
def get_portfolio(request):
    visits_counter(request.path)
    file_name = RESUME_INDEX
    content = get_content(file_name)
    return HttpResponse(content)