Skip to content

Commit 807094c

Browse files
committed
penambahan app article
1 parent 7bffbea commit 807094c

38 files changed

+266
-3
lines changed

.DS_Store

6 KB
Binary file not shown.

article/__init__.py

Whitespace-only changes.

article/__init__.pyc

149 Bytes
Binary file not shown.

article/admin.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# -*- coding: utf-8 -*-
2+
from __future__ import unicode_literals
3+
4+
from django.contrib import admin
5+
from article.models import Category, Post
6+
7+
# Register your models here.
8+
admin.site.register(Category)
9+
admin.site.register(Post)

article/admin.pyc

408 Bytes
Binary file not shown.

article/apps.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# -*- coding: utf-8 -*-
2+
from __future__ import unicode_literals
3+
4+
from django.apps import AppConfig
5+
6+
7+
class ArticleConfig(AppConfig):
8+
name = 'article'

article/migrations/0001_initial.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# -*- coding: utf-8 -*-
2+
# Generated by Django 1.11.3 on 2017-08-07 04:33
3+
from __future__ import unicode_literals
4+
5+
from django.db import migrations, models
6+
7+
8+
class Migration(migrations.Migration):
9+
10+
initial = True
11+
12+
dependencies = [
13+
]
14+
15+
operations = [
16+
migrations.CreateModel(
17+
name='Category',
18+
fields=[
19+
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
20+
('name', models.CharField(max_length=255, null=True)),
21+
('description', models.TextField(blank=True, null=True)),
22+
('created_on', models.DateTimeField(auto_now_add=True)),
23+
('last_modified', models.DateTimeField(auto_now=True)),
24+
],
25+
options={
26+
'verbose_name_plural': 'Category',
27+
},
28+
),
29+
]

article/migrations/0001_initial.pyc

1.14 KB
Binary file not shown.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# -*- coding: utf-8 -*-
2+
# Generated by Django 1.11.3 on 2017-08-09 03:01
3+
from __future__ import unicode_literals
4+
5+
from django.db import migrations, models
6+
7+
8+
class Migration(migrations.Migration):
9+
10+
dependencies = [
11+
('article', '0001_initial'),
12+
]
13+
14+
operations = [
15+
migrations.AlterField(
16+
model_name='category',
17+
name='name',
18+
field=models.CharField(blank=True, max_length=255, null=True),
19+
),
20+
]
871 Bytes
Binary file not shown.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# -*- coding: utf-8 -*-
2+
# Generated by Django 1.11.3 on 2017-08-09 03:11
3+
from __future__ import unicode_literals
4+
5+
from django.db import migrations
6+
7+
8+
class Migration(migrations.Migration):
9+
10+
dependencies = [
11+
('article', '0002_auto_20170809_0301'),
12+
]
13+
14+
operations = [
15+
migrations.RemoveField(
16+
model_name='category',
17+
name='name',
18+
),
19+
]
767 Bytes
Binary file not shown.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# -*- coding: utf-8 -*-
2+
# Generated by Django 1.11.3 on 2017-08-09 03:12
3+
from __future__ import unicode_literals
4+
5+
from django.db import migrations, models
6+
7+
8+
class Migration(migrations.Migration):
9+
10+
dependencies = [
11+
('article', '0003_remove_category_name'),
12+
]
13+
14+
operations = [
15+
migrations.AddField(
16+
model_name='category',
17+
name='name',
18+
field=models.CharField(blank=True, max_length=255, null=True),
19+
),
20+
]
885 Bytes
Binary file not shown.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# -*- coding: utf-8 -*-
2+
# Generated by Django 1.11.3 on 2017-08-09 03:17
3+
from __future__ import unicode_literals
4+
5+
from django.db import migrations
6+
7+
8+
class Migration(migrations.Migration):
9+
10+
dependencies = [
11+
('article', '0004_category_name'),
12+
]
13+
14+
operations = [
15+
migrations.AlterModelTable(
16+
name='category',
17+
table='anu',
18+
),
19+
]
751 Bytes
Binary file not shown.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# -*- coding: utf-8 -*-
2+
# Generated by Django 1.11.3 on 2017-08-09 03:20
3+
from __future__ import unicode_literals
4+
5+
from django.db import migrations
6+
7+
8+
class Migration(migrations.Migration):
9+
10+
dependencies = [
11+
('article', '0005_auto_20170809_0317'),
12+
]
13+
14+
operations = [
15+
migrations.AlterModelTable(
16+
name='category',
17+
table=None,
18+
),
19+
]
763 Bytes
Binary file not shown.

article/migrations/0007_post.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# -*- coding: utf-8 -*-
2+
# Generated by Django 1.11.3 on 2017-08-09 03:57
3+
from __future__ import unicode_literals
4+
5+
from django.db import migrations, models
6+
import django.db.models.deletion
7+
8+
9+
class Migration(migrations.Migration):
10+
11+
dependencies = [
12+
('article', '0006_auto_20170809_0320'),
13+
]
14+
15+
operations = [
16+
migrations.CreateModel(
17+
name='Post',
18+
fields=[
19+
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
20+
('title', models.CharField(max_length=200, null=True)),
21+
('slug', models.SlugField(max_length=255, null=True)),
22+
('content', models.TextField(blank=True, null=True)),
23+
('created_on', models.DateTimeField(auto_now_add=True)),
24+
('last_modified', models.DateTimeField(auto_now=True)),
25+
('category', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='post_category', to='article.Category')),
26+
],
27+
options={
28+
'verbose_name_plural': 'Post',
29+
},
30+
),
31+
]

article/migrations/0007_post.pyc

1.49 KB
Binary file not shown.

article/migrations/0008_post_image.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# -*- coding: utf-8 -*-
2+
# Generated by Django 1.11.3 on 2017-08-09 04:12
3+
from __future__ import unicode_literals
4+
5+
from django.db import migrations, models
6+
7+
8+
class Migration(migrations.Migration):
9+
10+
dependencies = [
11+
('article', '0007_post'),
12+
]
13+
14+
operations = [
15+
migrations.AddField(
16+
model_name='post',
17+
name='image',
18+
field=models.ImageField(blank=True, null=True, upload_to='post_image'),
19+
),
20+
]
854 Bytes
Binary file not shown.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# -*- coding: utf-8 -*-
2+
# Generated by Django 1.11.3 on 2017-08-09 04:29
3+
from __future__ import unicode_literals
4+
5+
from django.db import migrations
6+
import tinymce.models
7+
8+
9+
class Migration(migrations.Migration):
10+
11+
dependencies = [
12+
('article', '0008_post_image'),
13+
]
14+
15+
operations = [
16+
migrations.AlterField(
17+
model_name='post',
18+
name='content',
19+
field=tinymce.models.HTMLField(blank=True, null=True),
20+
),
21+
]
887 Bytes
Binary file not shown.

article/migrations/__init__.py

Whitespace-only changes.

article/migrations/__init__.pyc

160 Bytes
Binary file not shown.

article/models.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# -*- coding: utf-8 -*-
2+
from __future__ import unicode_literals
3+
4+
from django.db import models
5+
from tinymce.models import HTMLField
6+
7+
# Create your models here.
8+
class Category(models.Model):
9+
name = models.CharField(max_length=255, blank=True, null=True)
10+
description = models.TextField(blank=True, null=True)
11+
created_on = models.DateTimeField(auto_now_add=True)
12+
last_modified = models.DateTimeField(auto_now=True)
13+
14+
class Meta:
15+
verbose_name_plural = "Category"
16+
17+
def __unicode__(self):
18+
return self.name
19+
20+
class Post(models.Model):
21+
title = models.CharField(max_length=200, null=True)
22+
slug = models.SlugField(max_length=255, null=True)
23+
category = models.ForeignKey(Category,related_name='post_category', null=True)
24+
image = models.ImageField(upload_to='post_image', blank=True, null=True)
25+
content = HTMLField(blank=True, null=True)
26+
created_on = models.DateTimeField(auto_now_add=True)
27+
last_modified = models.DateTimeField(auto_now=True)
28+
29+
class Meta:
30+
verbose_name_plural = "Post"
31+
32+
def __unicode__(self):
33+
return self.title

article/models.pyc

2.15 KB
Binary file not shown.

article/tests.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# -*- coding: utf-8 -*-
2+
from __future__ import unicode_literals
3+
4+
from django.test import TestCase
5+
6+
# Create your tests here.

article/views.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# -*- coding: utf-8 -*-
2+
from __future__ import unicode_literals
3+
4+
from django.shortcuts import render
5+
6+
# Create your views here.

db.sqlite3

43 KB
Binary file not shown.

myblog/__init__.pyc

15 Bytes
Binary file not shown.

myblog/settings.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
SECRET_KEY = 'r7-iox2n!&ell5v=7!r!pm6$zwv89!o)l37r&o6#8fu_m*@3=!'
2424

2525
# SECURITY WARNING: don't run with debug turned on in production!
26-
DEBUG = False
26+
DEBUG = True
2727

28-
ALLOWED_HOSTS = []
28+
ALLOWED_HOSTS = ['*']
2929

3030

3131
# Application definition
@@ -37,6 +37,8 @@
3737
'django.contrib.sessions',
3838
'django.contrib.messages',
3939
'django.contrib.staticfiles',
40+
'article',
41+
'tinymce',
4042
]
4143

4244
MIDDLEWARE = [

myblog/settings.pyc

58 Bytes
Binary file not shown.

myblog/urls.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@
1313
1. Import the include() function: from django.conf.urls import url, include
1414
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
1515
"""
16-
from django.conf.urls import url
16+
from django.conf.urls import url, include
1717
from django.contrib import admin
1818

1919
urlpatterns = [
2020
url(r'^admin/', admin.site.urls),
21+
url(r'^tinymce/', include('tinymce.urls')),
2122
]

myblog/urls.pyc

89 Bytes
Binary file not shown.

myblog/wsgi.pyc

15 Bytes
Binary file not shown.
Loading

0 commit comments

Comments
 (0)