PEP8 Stuff

This commit is contained in:
Felipe Martín 2015-03-19 23:11:19 +01:00
parent 3b1b2d6135
commit b39612b4be
3 changed files with 44 additions and 38 deletions

View File

@ -1,10 +1,6 @@
from django.contrib import admin
from .models import Entry, Tag
from django import forms
from django.utils.translation import ugettext as _
from django import forms
from django.db import models
from ckeditor.widgets import CKEditorWidget
import reversion
@ -50,15 +46,6 @@ class EntryAdmin(reversion.VersionAdmin):
obj.author = request.user
super(self.__class__, self).save_model(request, obj, form, change)
class Media:
#css = {
# "all": ("ckeditor/redactor.css",)
#}
# js = (
# "ckeditor/ckeditor.js",
# "js/wysiwyg.js",
# )
pass
admin.site.register(Entry, EntryAdmin)

View File

@ -1,21 +1,14 @@
# coding: utf-8
"""
Django settings for fmartingrcom project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
# python
import os
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.6/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '0123456789'
@ -127,6 +120,8 @@ COMPRESS_PRECOMPILERS = (
#
# MEDIA FILES
#
MEDIA_URL = '/media/'
CKEDITOR_UPLOAD_PATH = 'ckeditor/'
CKEDITOR_CONFIGS = {
@ -134,20 +129,24 @@ CKEDITOR_CONFIGS = {
'toolbar': 'Standard',
'width': '100%',
'stylesSet': (
{ 'name': 'Code',
'element': 'code',
{
'name': 'Code',
'element': 'code',
},
{ 'name': 'Code block',
'element': 'pre',
'attributes': { 'class': 'prettyprint' }
{
'name': 'Code block',
'element': 'pre',
'attributes': {'class': 'prettyprint'}
},
{ 'name': 'Code block (Bash)',
'element': 'pre',
'attributes': { 'class': 'lang-bash prettyprint' }
{
'name': 'Code block (Bash)',
'element': 'pre',
'attributes': {'class': 'lang-bash prettyprint'}
},
{ 'name': 'Code block (Python)',
'element': 'pre',
'attributes': { 'class': 'lang-python prettyprint' }
{
'name': 'Code block (Python)',
'element': 'pre',
'attributes': {'class': 'lang-python prettyprint'}
},
)
},
@ -166,9 +165,21 @@ TEMPLATE_LOADERS = (
TEMPLATE_DIRS = (
'{}/themes/v1/templates/'.format(BASE_DIR),
)
from django_jinja.base import DEFAULT_EXTENSIONS
JINJA2_EXTENSIONS = DEFAULT_EXTENSIONS + [
'compressor.contrib.jinja2ext.CompressorExtension',
JINJA2_EXTENSIONS = [
"jinja2.ext.do",
"jinja2.ext.loopcontrols",
"jinja2.ext.with_",
"jinja2.ext.i18n",
"jinja2.ext.autoescape",
"django_jinja.builtins.extensions.CsrfExtension",
"django_jinja.builtins.extensions.CacheExtension",
"django_jinja.builtins.extensions.TimezoneExtension",
"django_jinja.builtins.extensions.UrlsExtension",
"django_jinja.builtins.extensions.StaticFilesExtension",
"django_jinja.builtins.extensions.DjangoFiltersExtension",
"django_jinja.builtins.extensions.DjangoExtraFiltersExtension",
"compressor.contrib.jinja2ext.CompressorExtension",
]
TEMPLATE_CONTEXT_PROCESSORS = (

View File

@ -19,3 +19,11 @@ urlpatterns = patterns('',
url(r'^blog/', include('fmartingrcom.apps.blog.urls', namespace='blog')),
url(r'^$', include('fmartingrcom.apps.homepage.urls', namespace='home')),
)
from django.conf import settings
from django.conf.urls.static import static
if settings.DEBUG:
urlpatterns += static(settings.MEDIA_URL,
document_root=settings.MEDIA_ROOT)