summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Holland <william.holland@codethink.co.uk>2015-09-13 15:00:54 +0100
committerWilliam Holland <william.holland@codethink.co.uk>2015-09-13 15:00:54 +0100
commitef99f7b58ab7f200f4cda52780c7c9fe4fd8467c (patch)
tree9b1b3dc51991606f70d82f1a0060351ff015d337
downloaddjango-blog-ef99f7b58ab7f200f4cda52780c7c9fe4fd8467c.tar.bz2
Initial commit.
Setup django-blog-zannia in a virtualenv
-rw-r--r--setup.sh18
-rw-r--r--source/settings.py110
-rw-r--r--source/urls.py23
-rw-r--r--start.sh8
4 files changed, 159 insertions, 0 deletions
diff --git a/setup.sh b/setup.sh
new file mode 100644
index 0000000..80bbcf3
--- /dev/null
+++ b/setup.sh
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+set -eux
+
+BLOGNAME=unixster
+
+virtualenv --no-site-packages $BLOGNAME-env
+cd $BLOGNAME-env
+./bin/pip install django==1.8.4
+./bin/django-admin startproject $BLOGNAME
+./bin/pip install django-blog-zinnia
+cp ../source/settings.py ./$BLOGNAME/$BLOGNAME/settings.py
+cp ../source/urls.py ./$BLOGNAME/$BLOGNAME/urls.py
+cd $BLOGNAME
+../bin/python manage.py syncdb
+cd ../..
+sed -i "s/BLOGNAME=/BLOGNAME=$BLOGNAME/g" start.sh
+echo "Setup complete."
diff --git a/source/settings.py b/source/settings.py
new file mode 100644
index 0000000..93e9684
--- /dev/null
+++ b/source/settings.py
@@ -0,0 +1,110 @@
+"""
+Django settings for unixster project.
+
+Generated by 'django-admin startproject' using Django 1.8.4.
+
+For more information on this file, see
+https://docs.djangoproject.com/en/1.8/topics/settings/
+
+For the full list of settings and their values, see
+https://docs.djangoproject.com/en/1.8/ref/settings/
+"""
+
+# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
+import os
+
+BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
+
+
+# Quick-start development settings - unsuitable for production
+# See https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/
+
+# SECURITY WARNING: keep the secret key used in production secret!
+SECRET_KEY = 'kc@tni!1cks^_+c&)yu2_j%3#vpk1j3398lcskkp!-mtrtl%!1'
+
+# SECURITY WARNING: don't run with debug turned on in production!
+DEBUG = True
+
+ALLOWED_HOSTS = []
+
+
+# Application definition
+
+INSTALLED_APPS = (
+ 'django.contrib.auth',
+ 'django.contrib.admin',
+ 'django.contrib.sites',
+ 'django.contrib.sessions',
+ 'django.contrib.messages',
+ 'django.contrib.staticfiles',
+ 'django.contrib.contenttypes',
+ 'django_comments',
+ 'mptt',
+ 'tagging',
+ 'zinnia',
+)
+
+SITE_ID = 1
+
+MIDDLEWARE_CLASSES = (
+ 'django.contrib.sessions.middleware.SessionMiddleware',
+ 'django.middleware.common.CommonMiddleware',
+ 'django.middleware.csrf.CsrfViewMiddleware',
+ 'django.contrib.auth.middleware.AuthenticationMiddleware',
+ 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
+ 'django.contrib.messages.middleware.MessageMiddleware',
+ 'django.middleware.clickjacking.XFrameOptionsMiddleware',
+ 'django.middleware.security.SecurityMiddleware',
+)
+
+ROOT_URLCONF = 'unixster.urls'
+
+TEMPLATES = [
+ {
+ 'BACKEND': 'django.template.backends.django.DjangoTemplates',
+ 'APP_DIRS': True,
+ 'OPTIONS': {
+ 'context_processors': [
+ 'django.contrib.auth.context_processors.auth',
+ 'django.template.context_processors.i18n',
+ 'django.template.context_processors.request',
+ 'django.contrib.messages.context_processors.messages',
+ 'zinnia.context_processors.version', # Optional
+ ]
+ }
+ }
+]
+
+
+WSGI_APPLICATION = 'unixster.wsgi.application'
+
+
+# Database
+# https://docs.djangoproject.com/en/1.8/ref/settings/#databases
+
+DATABASES = {
+ 'default': {
+ 'ENGINE': 'django.db.backends.sqlite3',
+ 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
+ }
+}
+
+
+# Internationalization
+# https://docs.djangoproject.com/en/1.8/topics/i18n/
+
+LANGUAGE_CODE = 'en-us'
+
+TIME_ZONE = 'UTC'
+
+USE_I18N = True
+
+USE_L10N = True
+
+USE_TZ = True
+
+
+# Static files (CSS, JavaScript, Images)
+# https://docs.djangoproject.com/en/1.8/howto/static-files/
+
+STATIC_URL = '/static/'
diff --git a/source/urls.py b/source/urls.py
new file mode 100644
index 0000000..48d0238
--- /dev/null
+++ b/source/urls.py
@@ -0,0 +1,23 @@
+"""unixster URL Configuration
+
+The `urlpatterns` list routes URLs to views. For more information please see:
+ https://docs.djangoproject.com/en/1.8/topics/http/urls/
+Examples:
+Function views
+ 1. Add an import: from my_app import views
+ 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
+Class-based views
+ 1. Add an import: from other_app.views import Home
+ 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home')
+Including another URLconf
+ 1. Add an import: from blog import urls as blog_urls
+ 2. Add a URL to urlpatterns: url(r'^blog/', include(blog_urls))
+"""
+from django.conf.urls import include, url
+from django.contrib import admin
+
+urlpatterns = [
+ url(r'^admin/', include(admin.site.urls)),
+ url(r'^weblog/', include('zinnia.urls', namespace='zinnia')),
+ url(r'^comments/', include('django_comments.urls')),
+]
diff --git a/start.sh b/start.sh
new file mode 100644
index 0000000..50286e3
--- /dev/null
+++ b/start.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+set -eux
+
+BLOGNAME=unixster
+
+cd $BLOGNAME-env/$BLOGNAME
+../bin/python manage.py runserver