Move finished project
This commit is contained in:
parent
d8aba1b140
commit
ba7bf21d9a
Binary file not shown.
|
@ -1,6 +0,0 @@
|
|||
from django.contrib import admin
|
||||
from projects.models import Project
|
||||
|
||||
|
||||
# Register your models here.
|
||||
admin.site.register(Project)
|
|
@ -1,5 +0,0 @@
|
|||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class ProjectsConfig(AppConfig):
|
||||
name = 'projects'
|
|
@ -1,24 +0,0 @@
|
|||
# Generated by Django 2.2.1 on 2019-05-31 04:59
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Project',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('title', models.CharField(max_length=100)),
|
||||
('description', models.TextField()),
|
||||
('technology', models.CharField(max_length=20)),
|
||||
('image', models.FilePathField(path='/img')),
|
||||
],
|
||||
),
|
||||
]
|
|
@ -1,18 +0,0 @@
|
|||
# Generated by Django 2.2.1 on 2019-05-31 05:33
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('projects', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='project',
|
||||
name='image',
|
||||
field=models.FilePathField(path='/projects/img'),
|
||||
),
|
||||
]
|
|
@ -1,18 +0,0 @@
|
|||
# Generated by Django 2.2.1 on 2019-06-01 03:33
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('projects', '0002_auto_20190531_0533'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='project',
|
||||
name='image',
|
||||
field=models.CharField(max_length=100),
|
||||
),
|
||||
]
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,9 +0,0 @@
|
|||
from django.db import models
|
||||
|
||||
|
||||
# Create your models here.
|
||||
class Project(models.Model):
|
||||
title = models.CharField(max_length=100)
|
||||
description = models.TextField()
|
||||
technology = models.CharField(max_length=20)
|
||||
image = models.CharField(max_length=100)
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 153 KiB |
Binary file not shown.
Before Width: | Height: | Size: 152 KiB |
Binary file not shown.
Before Width: | Height: | Size: 103 KiB |
Binary file not shown.
|
@ -1,25 +0,0 @@
|
|||
{% extends 'projects/base.html' %}
|
||||
|
||||
{% load static %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class="container">
|
||||
<h1>Projects</h1>
|
||||
<div class="row">
|
||||
{% for project in projects %}
|
||||
<div class="col-md-4">
|
||||
<div class="card mb-2">
|
||||
<img class="card-img-top" src="{% static project.image %}" alt="{{ project.description }}">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">{{ project.title }}</h5>
|
||||
<p class="card-text">{{ project.description }}</p>
|
||||
<a href="{% url 'projects:project_detail' project.pk %}" class="btn btn-primary">Read More</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
|
@ -1,35 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Portfolio</title>
|
||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<nav class="navbar navbar-expand-lg navbar-light bg-light">
|
||||
<div class="container">
|
||||
<a class="navbar-brand" href="{% url 'projects:all_projects' %}">Portfolio</a>
|
||||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
|
||||
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
||||
<ul class="navbar-nav mr-auto">
|
||||
<li class="nav-item active">
|
||||
<a class="nav-link" href="{% url 'projects:all_projects' %}">Home</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<div class="container">
|
||||
{% block content %}
|
||||
|
||||
{% endblock %}
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -1,20 +0,0 @@
|
|||
{% extends 'projects/base.html' %}
|
||||
|
||||
{% load static %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<h1>{{ project.title }}</h1>
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<img src="{% static project.image %}" alt="{{ project.description }}" width="100%">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<h5>About the project</h5>
|
||||
<p>{{ project.description }}</p>
|
||||
<h5>Built with:</h5>
|
||||
<p>{{ project.technology }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
|
@ -1,3 +0,0 @@
|
|||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
|
@ -1,10 +0,0 @@
|
|||
from django.urls import path
|
||||
from projects import views
|
||||
|
||||
|
||||
app_name = 'projects'
|
||||
|
||||
urlpatterns = [
|
||||
path('', views.all_projects, name='all_projects'),
|
||||
path('<int:pk>', views.project_detail, name='project_detail'),
|
||||
]
|
|
@ -1,16 +0,0 @@
|
|||
from django.shortcuts import render
|
||||
from projects.models import Project
|
||||
|
||||
|
||||
# Create your views here.
|
||||
def all_projects(request):
|
||||
# query the db to return all project objects
|
||||
projects = Project.objects.all()
|
||||
return render(request, 'projects/all_projects.html',
|
||||
{'projects': projects})
|
||||
|
||||
|
||||
def project_detail(request, pk):
|
||||
project = Project.objects.get(pk=pk)
|
||||
return render(request, 'projects/detail.html',
|
||||
{'project': project})
|
Loading…
Reference in New Issue