Ejemplo n.º 1
0
def build_project(request, object_id):
    project = get_object_or_404(Project, id=object_id)
    if project.project_builder == PROJECT_BUILDER_DJANGO:
        # Create variables
        builder = DjangoBuilder(project)

    if request.method == 'POST':
        form = ConfigurationForm(project, request.POST)
        if form.is_valid():
            builder.build()
            return TemplateResponse(request, 'core/build_success.html', {'project': project})
    else:
        form = ConfigurationForm(project)

    return TemplateResponse(request, 'core/build.html', {'form': form, 'project': project})
Ejemplo n.º 2
0
def write_project(project):
    if project.project_builder == PROJECT_BUILDER_DJANGO:
        builder = DjangoBuilder(project)
    else:
        return
    builder.build()