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

Typography update #7

Merged
merged 6 commits into from
Apr 25, 2024
Merged
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
18 changes: 18 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Copyright 2024 gh0stfrk

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

Conditions

1) There should be no commercial usage without notice to the copyright holder.

2) Copyright holder is liable to have 20% of the profits of any commercial or personal usage, or sale or purchage from this repository.

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

52 changes: 28 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,39 @@
# Django Blogs
<h1 align="center">
<picture>
<img width="343" src="screenshots/django-blogs.svg" alt="django-blogs">
</picture>
</h1>
<p align="center">
<br>
<a href="https://github.com/gh0stfrk/djangoblogs/actions">
<img src="https://github.com/gh0stfrk/djangoblogs/workflows/Django%20CI/badge.svg" alt="Build Status" />
</a>
<a href="https://opensource.org/licenses/BSD-3-Clause">
<img src="https://img.shields.io/badge/license-BSD-blue.svg" alt="License" />
</a>
<a href="https://twitter.com/gh0stfrk">
<img src="https://img.shields.io/twitter/follow/gh0stfrk?style=social&logo=twitter" alt="follow on Twitter">
</a>
</p>
Django Blogs is a simple and lightweight blogging application built with Django.

It allows users to register and create their own blogs where they can write short and informative posts.

## App Structure
## 🔥 Features
- Sign up and create profiles, customize your profiles with avatars
- Create mini-blog posts, update them and share them
- Likes and Comments, like posts and comment your own thoughts.

## 📦 Structure
- Django project contains two applications one is `users` and the other one is `blogs`.
- `users` app is controlling all things user related, inculding sign up, registering and updating user information.
- Signals are used to create user profile when a user is created, the user profile contains additional information about a user, such as profile photo.
- `blogs` app is responsible for creating and updating blogs.

## Infrastructure
![deployment](./screenshots/deployment.png)
## 🏛️ Infrastructure
![deployment](./screenshots/deployment_dig.png)

## Development Environment
## 👷 Development Environment
- Clone the latest branch
```bash
git clone https://github.com/gh0stfrk/django-blog.git
Expand All @@ -25,24 +46,7 @@ source ./venv/source/activate
```
- Install dependencies
```bash
pip install -r requirements.txt
```
- Setup postgres database credentials in a .env file
```bash
# Postgres db information
DB_NAME=
DB_USER=
DB_PASSWORD=
DB_HOST=
DB_PORT=
pip install -r requirements-deploy.txt
```
- Setup postgres database credentials in a .env file, copy the contents of [.sample.env](./sample.env)

## Screenshots
<img src="./screenshots/demo.gif" style="border-radius: 20px; display:block; margin: auto;"/>



![home](./screenshots/home.png)


![profile](./screenshots/profile.png)
2 changes: 1 addition & 1 deletion blog/templates/blog/about.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% extends "blog/base.html" %}
{% block content %}
<div class="container">
<h1 class="display-4">Django Blogs</h1>
<h1 class="display-4" style="font-family: 'Inria Sans', sans-serif; font-weight: 700;">Django Blogs</h1>
<p class="lead">A Simple Blogging Platform</p>
<hr class="my-4">
<div class="row">
Expand Down
178 changes: 97 additions & 81 deletions blog/templates/blog/base.html
Original file line number Diff line number Diff line change
@@ -1,95 +1,111 @@
{% load static %}
<!DOCTYPE html>
<html lang="en">

<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link
href="https://fonts.googleapis.com/css2?family=Inria+Sans:ital,wght@0,300;0,400;0,700;1,300;1,400;1,700&display=swap"
rel="stylesheet">

{% if title %}
<title>Django Blogs - {{ title }}</title>
{% else %}
<title>Django Blogs</title>
{% endif %}
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"
integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">

<link rel="shortcut icon" href="{% static 'icon.png' %}" type="image/x-icon" class=" filter: invert(100%);">
{% block head %} {% endblock %}
{% if title %}
<title>Django Blogs - {{ title }}</title>
{% else %}
<title>Django Blogs</title>
{% endif %}
<link rel="shortcut icon" href="{% static 'icon.png' %}" type="image/x-icon" class=" filter: invert(100%);">
{% block head %} {% endblock %}
</head>
<body>
<nav class="navbar navbar-light bg-light navbar-expand-lg p-4">
<a class="navbar-brand fw-bold" href="{% url 'blog-home' %}">Django Blogs</a>
<button class="navbar-toggler btn-outline-none border-none" type="button" data-toggle="collapse" data-target="#navbarText" aria-controls="navbarText" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon dark"></span>
</button>
<div class="collapse navbar-collapse" id="navbarText">
<ul class="navbar-nav mr-auto">
<li class="nav-item active">
<a class="nav-link" href="{% url 'blog-home' %}">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{% url 'blog-about' %}">About</a>
</li>
{% if user.is_authenticated %}
<li class="nav-item">
<a class="nav-link" href="{% url 'profile' %}">Profile</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{% url 'create_post' %}">Post</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{% url 'logout' %}">Logout</a>
</li>
{% else %}
<li class="nav-item">
<a class="nav-link" href="{% url 'login' %}">Login</a>

<body style="font-family: 'Inria Sans', sans-serif;">
<nav class="navbar navbar-light bg-light navbar-expand-lg p-4">
<a class="navbar-brand fw-bold" style="font-family: 'Inria Sans', sans-serif; font-weight: 700;" href="{% url 'blog-home' %}">
DjangoBlogs
</a>
<button class="navbar-toggler btn-outline-none border-none" type="button" data-toggle="collapse"
data-target="#navbarText" aria-controls="navbarText" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon dark"></span>
</button>
<div class="collapse navbar-collapse" id="navbarText">
<ul class="navbar-nav mr-auto">
<li class="nav-item active">
<a class="nav-link" href="{% url 'blog-home' %}">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{% url 'blog-about' %}">About</a>
</li>
{% if user.is_authenticated %}
<li class="nav-item">
<a class="nav-link" href="{% url 'profile' %}">Profile</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{% url 'create_post' %}">Post</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{% url 'logout' %}">Logout</a>
</li>
{% else %}
<li class="nav-item">
<a class="nav-link" href="{% url 'login' %}">Login</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{% url 'register' %}">Register</a>
</li>
{% endif %}
</ul>
</div>
</nav>
<main role="main" class="container">
<div class="row">
<div class="col-md-8 p-4">
{% if messages %}
{% for message in messages %}
<div class="alert alert-{{ message.tags }} alert-dismissible">
{{ message }}
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
{% endfor %}
{% endif %}
{% block content %}{% endblock %}
</div>
<div class="col-md-4 p-4">
<div class="content-section">
<h3>Contact Information</h3>
<p class='text-muted'>
<ul class="list-group">
<li class="list-group-item list-group-item-light">
<a href="https://github.com/gh0stfrk" target="_blank">Github</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{% url 'register' %}">Register</a>
<li class="list-group-item list-group-item-light">
<a href="https://twitter.com/gh0stfrk" target="_blank">Twitter</a>
</li>
{% endif %}
</ul>
</div>
</nav>
<main role="main" class="container">
<div class="row">
<div class="col-md-8 p-4">
{% if messages %}
{% for message in messages %}
<div class="alert alert-{{ message.tags }} alert-dismissible">
{{ message }}
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
{% endfor %}
{% endif %}
{% block content %}{% endblock %}
</div>
<div class="col-md-4 p-4">
<div class="content-section">
<h3>Contact Information</h3>
<p class='text-muted'>
<ul class="list-group">
<li class="list-group-item list-group-item-light">
<a href="https://github.com/gh0stfrk" target="_blank">Github</a>
</li>
<li class="list-group-item list-group-item-light">
<a href="https://twitter.com/gh0stfrk" target="_blank">Twitter</a>
</li>
</ul>
</p>
</div>
</p>
</div>
</div>
</main>

<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
</div>
</main>
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"
integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN"
crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"
integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q"
crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"
integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl"
crossorigin="anonymous"></script>
</body>
</html>
</html>
File renamed without changes.
Binary file added screenshots/deployment_dig.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading