-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from withlogicco/release-1.2.0
Release 1.2.0
- Loading branch information
Showing
30 changed files
with
358 additions
and
282 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"name": "Django Prose", | ||
"dockerComposeFile": [ | ||
"../docker-compose.yml", | ||
"docker-compose.yml" | ||
], | ||
"service": "web", | ||
"workspaceFolder": "/usr/src/app", | ||
"settings": { | ||
"python.formatting.provider": "black", | ||
"editor.formatOnSave": true, | ||
"eslint.format.enable": true | ||
}, | ||
"extensions": [ | ||
"batisteo.vscode-django", | ||
"editorconfig.editorconfig", | ||
"ms-python.python" | ||
], | ||
"features": { | ||
"ghcr.io/devcontainers/features/common-utils:1": {}, | ||
"ghcr.io/devcontainers/features/git:1": {} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
version: "3.8" | ||
|
||
services: | ||
web: | ||
command: sleep infinity |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Django: Run server", | ||
"type": "python", | ||
"request": "launch", | ||
"program": "${workspaceFolder}/example/manage.py", | ||
"args": [ | ||
"runserver", | ||
"0.0.0.0:8000" | ||
], | ||
"django": true, | ||
"justMyCode": true | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Generated by Django 4.1.5 on 2023-01-27 13:26 | ||
|
||
from django.db import migrations | ||
import prose.fields | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("blog", "0001_initial"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="article", | ||
name="excerpt", | ||
field=prose.fields.RichTextField(blank=True), | ||
), | ||
] |
18 changes: 18 additions & 0 deletions
18
example/blog/migrations/0003_rename_content_article_body.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Generated by Django 4.1.5 on 2023-01-27 13:39 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("blog", "0002_article_excerpt"), | ||
] | ||
|
||
operations = [ | ||
migrations.RenameField( | ||
model_name="article", | ||
old_name="content", | ||
new_name="body", | ||
), | ||
] |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{% extends 'blog/base.html' %} | ||
|
||
{% block title %}{{ article.title }} | Blog example | Django Prose{% endblock title %} | ||
{% block description %}{{ article.excerpt }}{% endblock description %} | ||
|
||
{% block content %} | ||
<h1>{{ article.title }}</h1> | ||
<div>{{ article.author.username }}</div> | ||
<div>{{ article.body.content | safe }}</div> | ||
{% endblock content %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>{% block title %}Blog example | Django Prose{% endblock %}</title> | ||
<meta name="description" content="{% block description %}This is a blog example built with Django Prose{% endblock %}"> | ||
<style> | ||
body { | ||
font-family: sans-serif; | ||
font-size: 14px; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
{% block content %}{% endblock content %} | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{% extends 'blog/base.html' %} | ||
|
||
{% block title %}Articles | Blog example | Django Prose{% endblock title %} | ||
{% block description %}Read {{ articles.count }} in this blog built with Django Prose{% endblock description %} | ||
|
||
{% block content %} | ||
<ul> | ||
{% for article in articles %} | ||
<li> | ||
<h2>{{ article.title }}</h2> | ||
<p>{{ article.excerpt | safe }}</p> | ||
<a href="{% url 'blog_article' article.pk %}">Read more</a> | ||
</li> | ||
{% empty %} | ||
<li>No articles written yet!</li> | ||
{% endfor %} | ||
</ul> | ||
{% endblock content %} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
from django.shortcuts import render | ||
|
||
from blog.models import Article | ||
|
||
|
||
def blog_index(request): | ||
articles = Article.objects.all() | ||
context = { | ||
"articles": articles, | ||
} | ||
return render(request, "blog/index.html", context) | ||
|
||
|
||
def blog_article(request, pk): | ||
article = Article.objects.get(pk=pk) | ||
context = { | ||
"article": article, | ||
} | ||
return render(request, "blog/article.html", context) |
File renamed without changes.
Oops, something went wrong.