Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New branch #9

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
venv/
db.sqlite3
db.sqlite3
__pycache__/
Binary file modified blog/__pycache__/__init__.cpython-37.pyc
Binary file not shown.
Binary file modified blog/__pycache__/settings.cpython-37.pyc
Binary file not shown.
Binary file modified blog/__pycache__/urls.cpython-37.pyc
Binary file not shown.
Binary file modified blog/__pycache__/wsgi.cpython-37.pyc
Binary file not shown.
7 changes: 6 additions & 1 deletion blog/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'main.apps.MainConfig',
]

MIDDLEWARE = [
Expand All @@ -54,7 +55,7 @@
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'DIRS': [os.path.join(BASE_DIR, 'templates')],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
Expand Down Expand Up @@ -118,3 +119,7 @@
# https://docs.djangoproject.com/en/2.2/howto/static-files/

STATIC_URL = '/static/'

STATICFILES_DIRS = [
os.path.join(BASE_DIR, "static"),
]
3 changes: 2 additions & 1 deletion blog/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path
from django.urls import path, include

urlpatterns = [
path('admin/', admin.site.urls),
path('',include('main.urls')),
]
Empty file added main/__init__.py
Empty file.
3 changes: 3 additions & 0 deletions main/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.contrib import admin

# Register your models here.
5 changes: 5 additions & 0 deletions main/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from django.apps import AppConfig


class MainConfig(AppConfig):
name = 'main'
Empty file added main/migrations/__init__.py
Empty file.
3 changes: 3 additions & 0 deletions main/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.db import models

# Create your models here.
3 changes: 3 additions & 0 deletions main/tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.test import TestCase

# Create your tests here.
7 changes: 7 additions & 0 deletions main/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from django.contrib import admin
from django.urls import path
from . import views

urlpatterns = [
path('', views.blogHome, name='blog-home')
]
7 changes: 7 additions & 0 deletions main/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from django.shortcuts import render
from django.http import HttpResponse
# Create your views here.


def blogHome(request):
return render(request,'index.html')
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
21 changes: 11 additions & 10 deletions Static/templates/index1.html → templates/index.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
<!-- Template for the home page of the blog -->
{% load static %}
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Latest Blogs</title>
<meta name="viewport" content="width=device-width,initial-scale=0.1">
<link rel="stylesheet" href="../CSS/style1.css">
<link rel="stylesheet" href="{% static 'css/style1.css' %}" type="text/css">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">

Expand Down Expand Up @@ -35,7 +37,7 @@ <h1 class="text-center">Latest Blogs</h1>
<div class="col-md-4">
<div class="single-blog">
<p class="blog-meta">By Admin <span>September 24,2020</span></p>
<img class="blog-1-img" src="../images/image1.jpeg">
<img class="blog-1-img" src="{% static 'images/image1.jpeg' %}">
<h2><a href="#"> Contact Admin For More Blogs</a></h2>
<p class="blog-text">Lorem Ipsum is simply dummy text of the printing and typesetting industry.
Lorem Ipsum has been the industry's standard dummy text ever since the 1500s,
Expand All @@ -46,9 +48,8 @@ <h2><a href="#"> Contact Admin For More Blogs</a></h2>
</div>
</div>
<div class="col-md-4">
<div class="single-blog">
<p class="blog-meta">By Admin <span>September 26,2020</span></p>
<img class="blog-1-img" src="../images/image2.jfif">
<div class="single-blog">{% static 'images/image1.jpeg' %}span>September 26,2020</span></p>
<img class="blog-1-img" src="{% static 'images/image2.jfif' %}">
<h2><a href="#"> Contact Admin For More Blogs</a></h2>
<p class="blog-text">Lorem Ipsum is simply dummy text of the printing and typesetting industry.
Lorem Ipsum has been the industry's standard dummy text ever since the 1500s,
Expand All @@ -61,20 +62,20 @@ <h2><a href="#"> Contact Admin For More Blogs</a></h2>
<div class="col-md-4">
<div class="single-blog">
<p class="blog-meta">By Admin <span>October 2,2020</span></p>
<img class="blog-1-img" src="../images/image3.jfif">
<img class="blog-1-img" src="{% static 'images/image3.jfif' %}">
<h2><a href="#"> Contact Admin For More Blogs</a></h2>
<p class="blog-text">Lorem Ipsum is simply dummy text of the printing and typesetting industry.
Lorem Ipsum has been the industry's standard dummy text ever since the 1500s,
when an unknown printer took a galley of type and scrambled it to make a type specimen book</p>
<p><a href="" class="read-more-btn">Read More</a>
<span><i class="fa fa-thumbs-o-up"></i>7 people liked <i class="fa fa-comment-o">3..</i></span>
</p>
</p>../images/image3.jfif
</div>
</div>
<div class="col-md-4">
<div class="single-blog">
<p class="blog-meta">By Admin <span>October 2,2020</span></p>
<img class="blog-1-img" src="../images/image3.jfif">
<img class="blog-1-img" src="{% static 'images/image3.jfif' %}">
<h2><a href="#"> Contact Admin For More Blogs</a></h2>
<p class="blog-text">Lorem Ipsum is simply dummy text of the printing and typesetting industry.
Lorem Ipsum has been the industry's standard dummy text ever since the 1500s,
Expand All @@ -87,7 +88,7 @@ <h2><a href="#"> Contact Admin For More Blogs</a></h2>
<div class="col-md-4">
<div class="single-blog">
<p class="blog-meta">By Admin <span>September 26,2020</span></p>
<img class="blog-1-img" src="../images/image1.jpeg">
<img class="blog-1-img" src="{% static 'images/image1.jpeg' %}">
<h2><a href="#"> Contact Admin For More Blogs</a></h2>
<p class="blog-text">Lorem Ipsum is simply dummy text of the printing and typesetting industry.
Lorem Ipsum has been the industry's standard dummy text ever since the 1500s,
Expand All @@ -100,7 +101,7 @@ <h2><a href="#"> Contact Admin For More Blogs</a></h2>
<div class="col-md-4">
<div class="single-blog">
<p class="blog-meta">By Admin <span>September 26,2020</span></p>
<img class="blog-1-img" src="../images/image2.jfif">
<img class="blog-1-img" src="{% static 'images/image1.jpeg' %}">
<h2><a href="#"> Contact Admin For More Blogs</a></h2>
<p class="blog-text">Lorem Ipsum is simply dummy text of the printing and typesetting industry.
Lorem Ipsum has been the industry's standard dummy text ever since the 1500s,
Expand Down