diff options
| author | Yuval Adam <yuv.adm@gmail.com> | 2011-01-20 11:06:19 +0200 |
|---|---|---|
| committer | Yuval Adam <yuv.adm@gmail.com> | 2011-01-20 11:06:19 +0200 |
| commit | f6b389233e2d8ac3b4d29322d86fceb2e2de7a37 (patch) | |
| tree | 2228ea145cad6b89e6ce188694637633dbcf04db | |
initial commit
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | __init__.py | 0 | ||||
| -rw-r--r-- | apache/staging.conf | 31 | ||||
| -rw-r--r-- | apache/staging.wsgi | 12 | ||||
| -rw-r--r-- | bootstrap.py | 12 | ||||
| -rw-r--r-- | fabfile.py | 43 | ||||
| -rw-r--r-- | main/__init__.py | 0 | ||||
| -rw-r--r-- | main/models.py | 3 | ||||
| -rw-r--r-- | main/tests.py | 23 | ||||
| -rw-r--r-- | main/views.py | 7 | ||||
| -rwxr-xr-x | manage.py | 11 | ||||
| -rw-r--r-- | media/css/bp/ie.css | 21 | ||||
| -rw-r--r-- | media/css/bp/print.css | 42 | ||||
| -rw-r--r-- | media/css/bp/rtl.css | 110 | ||||
| -rw-r--r-- | media/css/bp/screen.css | 372 | ||||
| -rw-r--r-- | notes.txt | 11 | ||||
| -rw-r--r-- | requirements/apps.txt | 2 | ||||
| -rw-r--r-- | settings.py | 94 | ||||
| -rw-r--r-- | templates/main.html | 39 | ||||
| -rw-r--r-- | test.db | bin | 0 -> 69632 bytes | |||
| -rw-r--r-- | urls.py | 21 |
21 files changed, 855 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7e99e36 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.pyc
\ No newline at end of file diff --git a/__init__.py b/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/__init__.py diff --git a/apache/staging.conf b/apache/staging.conf new file mode 100644 index 0000000..919a3d6 --- /dev/null +++ b/apache/staging.conf @@ -0,0 +1,31 @@ +<VirtualHost *:80> + WSGIScriptReloading On + WSGIReloadMechanism Process + WSGIDaemonProcess caktus_website-staging + WSGIProcessGroup caktus_website-staging + WSGIApplicationGroup caktus_website-staging + WSGIPassAuthorization On + + WSGIScriptAlias / /var/www/generic_django/apache/staging.wsgi/ + + <Location "/"> + Order Allow,Deny + Allow from all + </Location> + + <Location "/media"> + SetHandler None + </Location> + + Alias /media /var/www/staging/generic_django/media + + <Location "/adminmedia"> + SetHandler None + </Location> + + Alias /adminmedia /var/www/staging/generic_django/media/admin + + ErrorLog /var/www/log/error.log + LogLevel info + CustomLog /var/www/log/access.log combined +</VirtualHost>
\ No newline at end of file diff --git a/apache/staging.wsgi b/apache/staging.wsgi new file mode 100644 index 0000000..33e898a --- /dev/null +++ b/apache/staging.wsgi @@ -0,0 +1,12 @@ +import os +import sys +import site + +PROJECT_ROOT = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) +site_packages = os.path.join(PROJECT_ROOT, 'env/lib/python2.6/site-packages') +site.addsitedir(os.path.abspath(site_packages)) +sys.path.insert(0, PROJECT_ROOT) +os.environ['DJANGO_SETTINGS_MODULE'] = 'generic_django.settings' + +import django.core.handlers.wsgi +application = django.core.handlers.wsgi.WSGIHandler()
\ No newline at end of file diff --git a/bootstrap.py b/bootstrap.py new file mode 100644 index 0000000..7fed32c --- /dev/null +++ b/bootstrap.py @@ -0,0 +1,12 @@ +import os +import subprocess +import parser + +if "VIRTUAL_ENV" not in os.environ: + sys.stderr.write("$VIRTUAL_ENV not found.\n\n") + parser.print_usage() + sys.exit(-1) +virtualenv = os.environ["VIRTUAL_ENV"] +file_path = os.path.dirname(__file__) +subprocess.call(["pip", "install", "-E", virtualenv, "--requirement", + os.path.join(file_path, "requirements/apps.txt")])
\ No newline at end of file diff --git a/fabfile.py b/fabfile.py new file mode 100644 index 0000000..0a25331 --- /dev/null +++ b/fabfile.py @@ -0,0 +1,43 @@ +def bootstrap(): + """ initialize remote host environment (virtualenv, deploy, update) """ + require('root', provided_by=('staging', 'production')) + run('mkdir -p %(root)s' % env) + run('mkdir -p %s' % os.path.join(env.home, 'www', 'log')) + create_virtualenv() + deploy() + update_requirements() + + +def create_virtualenv(): + """ setup virtualenv on remote host """ + require('virtualenv_root', provided_by=('staging', 'production')) + args = '--clear --distribute' + run('virtualenv %s %s' % (args, env.virtualenv_root)) + + +def deploy(): + """ rsync code to remote host """ + require('root', provided_by=('staging', 'production')) + if env.environment == 'production': + if not console.confirm('Are you sure you want to deploy production?', + default=False): + utils.abort('Production deployment aborted.') + extra_opts = '--omit-dir-times' + rsync_project( + env.root, + exclude=RSYNC_EXCLUDE, + delete=True, + extra_opts=extra_opts, + ) + touch() + + +def update_requirements(): + """ update external dependencies on remote host """ + require('code_root', provided_by=('staging', 'production')) + requirements = os.path.join(env.code_root, 'requirements') + with cd(requirements): + cmd = ['pip install'] + cmd += ['-E %(virtualenv_root)s' % env] + cmd += ['--requirement %s' % os.path.join(requirements, 'apps.txt')] + run(' '.join(cmd))
\ No newline at end of file diff --git a/main/__init__.py b/main/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/main/__init__.py diff --git a/main/models.py b/main/models.py new file mode 100644 index 0000000..71a8362 --- /dev/null +++ b/main/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/main/tests.py b/main/tests.py new file mode 100644 index 0000000..2247054 --- /dev/null +++ b/main/tests.py @@ -0,0 +1,23 @@ +""" +This file demonstrates two different styles of tests (one doctest and one +unittest). These will both pass when you run "manage.py test". + +Replace these with more appropriate tests for your application. +""" + +from django.test import TestCase + +class SimpleTest(TestCase): + def test_basic_addition(self): + """ + Tests that 1 + 1 always equals 2. + """ + self.failUnlessEqual(1 + 1, 2) + +__test__ = {"doctest": """ +Another way to test that 1 + 1 is equal to 2. + +>>> 1 + 1 == 2 +True +"""} + diff --git a/main/views.py b/main/views.py new file mode 100644 index 0000000..b0f1454 --- /dev/null +++ b/main/views.py @@ -0,0 +1,7 @@ +from django.http import HttpResponse +from django.shortcuts import render_to_response +from django.template import RequestContext +import mptt + +def index(request): + return render_to_response('main.html', {}, context_instance=RequestContext(request))
\ No newline at end of file diff --git a/manage.py b/manage.py new file mode 100755 index 0000000..5e78ea9 --- /dev/null +++ b/manage.py @@ -0,0 +1,11 @@ +#!/usr/bin/env python +from django.core.management import execute_manager +try: + import settings # Assumed to be in the same directory. +except ImportError: + import sys + sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__) + sys.exit(1) + +if __name__ == "__main__": + execute_manager(settings) diff --git a/media/css/bp/ie.css b/media/css/bp/ie.css new file mode 100644 index 0000000..bf52030 --- /dev/null +++ b/media/css/bp/ie.css @@ -0,0 +1,21 @@ +/* ie.css */ +body {text-align:center;} +.container {text-align:left;} +* html .column {overflow-x:hidden;} +* html legend {margin:-18px -8px 16px 0;padding:0;} +ol {margin-left:2em;} +sup {vertical-align:text-top;} +sub {vertical-align:text-bottom;} +html>body p code {*white-space:normal;} +hr {margin:-8px auto 11px;} +ul { list-style: disc outside; margin-left: 2em; } /* IE can't handle :before and :after */ +ul li { text-indent: 0; margin-left: 0; } +legend { margin-bottom: 1.6em; } /* IE form margin bug */ +sup, sub { font-size: 100%; } /* IE superscript & subscript bug */ +blockquote p, blockquote ul, blockquote ol, blockquote dl, blockquote pre, blockquote address, +blockquote table, blockquote form, blockquote h1, blockquote h2, blockquote h3, blockquote h4, blockquote h5, blockquote h6 { margin-top: .8em; margin-bottom: .8em; } /* IE can't handle :first-child */ +* html textarea, * html input { padding: 0; } /* IE < 7 form fix */ +input[type='submit'], input[type='button'] { padding: 0; } /* IE 7 button fix */ +legend+* { margin-top: 0; } /* we already added legend margin */ +a abbr, a acronym { text-decoration: underline; } /* IE 7 bug */ +fieldset legend { margin: 0; } /* IE 6 disappearing legend bug */
\ No newline at end of file diff --git a/media/css/bp/print.css b/media/css/bp/print.css new file mode 100644 index 0000000..c047d16 --- /dev/null +++ b/media/css/bp/print.css @@ -0,0 +1,42 @@ +body { +width:100% !important; +margin:0 !important; +padding:0 !important; +line-height: 1.4; +word-spacing:1.1pt; +letter-spacing:0.2pt; font-family: Garamond,"Times New Roman", serif; color: #000; background: none; font-size: 12pt; } + +/*Headings */ +h1,h2,h3,h4,h5,h6 { font-family: Helvetica, Arial, sans-serif; } +h1{font-size:19pt;} +h2{font-size:17pt;} +h3{font-size:15pt;} +h4,h5,h6{font-size:12pt;} + +code { font: 10pt Courier, monospace; } +blockquote { margin: 1.3em; padding: 1em; font-size: 10pt; } +hr { background-color: #ccc; } + +/* Images */ +img { float: left; margin: 1em 1.5em 1.5em 0; } +a img { border: none; } + +/* Links */ +a:link, a:visited { background: transparent; font-weight: 700; text-decoration: underline;color:#333; } +a:link[href^="http://"]:after, a[href^="http://"]:visited:after { content: " (" attr(href) ") "; font-size: 90%; } +a[href^="http://"] {color:#000; } + +/* Table */ +table { margin: 1px; text-align:left; } +th { border-bottom: 1px solid #333; font-weight: bold; } +td { border-bottom: 1px solid #333; } +th,td { padding: 4px 10px 4px 0; } +tfoot { font-style: italic; } +caption { background: #fff; margin-bottom:2em; text-align:left; } +thead {display: table-header-group;} +tr {page-break-inside: avoid;} + +/*add sections here to hide various parts from the site*/ + +#header, #footer, #navigation, #sidebar, button, a.button +{display:none;}
\ No newline at end of file diff --git a/media/css/bp/rtl.css b/media/css/bp/rtl.css new file mode 100644 index 0000000..afe1105 --- /dev/null +++ b/media/css/bp/rtl.css @@ -0,0 +1,110 @@ +/* --------------------------------------------------------------
+
+ rtl.css
+ * Mirrors Blueprint for left-to-right languages
+
+ By Ran Yaniv Hartstein [ranh.co.il]
+
+-------------------------------------------------------------- */
+
+body .container { direction: rtl; }
+body .column, body .span-1, body .span-2, body .span-3, body .span-4, body .span-5, body .span-6, body .span-7, body .span-8, body .span-9, body .span-10, body .span-11, body .span-12, body .span-13, body .span-14, body .span-15, body .span-16, body .span-17, body .span-18, body .span-19, body .span-20, body .span-21, body .span-22, body .span-23, body .span-24 {
+ float: right;
+ margin-right: 0;
+ margin-left: 10px;
+ text-align:right;
+}
+
+body div.last { margin-left: 0; }
+body table .last { padding-left: 0; }
+
+body .append-1 { padding-right: 0; padding-left: 40px; }
+body .append-2 { padding-right: 0; padding-left: 80px; }
+body .append-3 { padding-right: 0; padding-left: 120px; }
+body .append-4 { padding-right: 0; padding-left: 160px; }
+body .append-5 { padding-right: 0; padding-left: 200px; }
+body .append-6 { padding-right: 0; padding-left: 240px; }
+body .append-7 { padding-right: 0; padding-left: 280px; }
+body .append-8 { padding-right: 0; padding-left: 320px; }
+body .append-9 { padding-right: 0; padding-left: 360px; }
+body .append-10 { padding-right: 0; padding-left: 400px; }
+body .append-11 { padding-right: 0; padding-left: 440px; }
+body .append-12 { padding-right: 0; padding-left: 480px; }
+body .append-13 { padding-right: 0; padding-left: 520px; }
+body .append-14 { padding-right: 0; padding-left: 560px; }
+body .append-15 { padding-right: 0; padding-left: 600px; }
+body .append-16 { padding-right: 0; padding-left: 640px; }
+body .append-17 { padding-right: 0; padding-left: 680px; }
+body .append-18 { padding-right: 0; padding-left: 720px; }
+body .append-19 { padding-right: 0; padding-left: 760px; }
+body .append-20 { padding-right: 0; padding-left: 800px; }
+body .append-21 { padding-right: 0; padding-left: 840px; }
+body .append-22 { padding-right: 0; padding-left: 880px; }
+body .append-23 { padding-right: 0; padding-left: 920px; }
+
+body .prepend-1 { padding-left: 0; padding-right: 40px; }
+body .prepend-2 { padding-left: 0; padding-right: 80px; }
+body .prepend-3 { padding-left: 0; padding-right: 120px; }
+body .prepend-4 { padding-left: 0; padding-right: 160px; }
+body .prepend-5 { padding-left: 0; padding-right: 200px; }
+body .prepend-6 { padding-left: 0; padding-right: 240px; }
+body .prepend-7 { padding-left: 0; padding-right: 280px; }
+body .prepend-8 { padding-left: 0; padding-right: 320px; }
+body .prepend-9 { padding-left: 0; padding-right: 360px; }
+body .prepend-10 { padding-left: 0; padding-right: 400px; }
+body .prepend-11 { padding-left: 0; padding-right: 440px; }
+body .prepend-12 { padding-left: 0; padding-right: 480px; }
+body .prepend-13 { padding-left: 0; padding-right: 520px; }
+body .prepend-14 { padding-left: 0; padding-right: 560px; }
+body .prepend-15 { padding-left: 0; padding-right: 600px; }
+body .prepend-16 { padding-left: 0; padding-right: 640px; }
+body .prepend-17 { padding-left: 0; padding-right: 680px; }
+body .prepend-18 { padding-left: 0; padding-right: 720px; }
+body .prepend-19 { padding-left: 0; padding-right: 760px; }
+body .prepend-20 { padding-left: 0; padding-right: 800px; }
+body .prepend-21 { padding-left: 0; padding-right: 840px; }
+body .prepend-22 { padding-left: 0; padding-right: 880px; }
+body .prepend-23 { padding-left: 0; padding-right: 920px; }
+
+body .border {
+ padding-right: 0;
+ padding-left: 4px;
+ margin-right: 0;
+ margin-left: 5px;
+ border-right: none;
+ border-left: 1px solid #eee;
+}
+
+body .colborder {
+ padding-right: 0;
+ padding-left: 24px;
+ margin-right: 0;
+ margin-left: 25px;
+ border-right: none;
+ border-left: 1px solid #eee;
+}
+
+body .pull-1 { margin-left: 0; margin-right: -40px; }
+body .pull-2 { margin-left: 0; margin-right: -80px; }
+body .pull-3 { margin-left: 0; margin-right: -120px; }
+body .pull-4 { margin-left: 0; margin-right: -160px; }
+
+body .push-0 { margin: 0 18px 0 0; }
+body .push-1 { margin: 0 18px 0 -40px; }
+body .push-2 { margin: 0 18px 0 -80px; }
+body .push-3 { margin: 0 18px 0 -120px; }
+body .push-4 { margin: 0 18px 0 -160px; }
+body .push-0, body .push-1, body .push-2,
+body .push-3, body .push-4 { float: left; }
+
+
+/* Typography with RTL support */
+body h1,body h2,body h3,
+body h4,body h5,body h6 { font-family: Arial, sans-serif; }
+html body { font-family: Arial, sans-serif; }
+body pre,body code,body tt { font-family: monospace; }
+
+/* Mirror floats and margins on typographic elements */
+body p img { float: right; margin: 1.5em 0 1.5em 1.5em; }
+body dd, body ul, body ol { margin-left: 0; margin-right: 1.5em;}
+body td, body th { text-align:right; }
diff --git a/media/css/bp/screen.css b/media/css/bp/screen.css new file mode 100644 index 0000000..f449a00 --- /dev/null +++ b/media/css/bp/screen.css @@ -0,0 +1,372 @@ +/* MEYER RESET v1.0*/ +html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,font,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td{margin:0;padding:0;border:0;outline:0;font-size:100%;vertical-align:baseline;background:transparent}body{line-height:1}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:'';content:none}:focus{outline:0}ins{text-decoration:none}del{text-decoration:line-through}table{border-collapse:collapse;border-spacing:0} + +/* BASIC TYPOGRAPHY */ +html { font-size: 62.5%; font-family: "Liberation Sans", Helvetica, Arial, sans-serif; } +strong, th, thead td, h1, h2, h3, h4, h5, h6 { font-weight: bold; } +cite, em, dfn { font-style: italic; } +code, kbd, samp, pre, tt, var, input[type='text'], input[type='password'], textarea { font-size: 92%; font-family: monaco, "Lucida Console", courier, monospace; } +del { text-decoration: line-through; color: #666; } +ins, dfn { border-bottom: 1px solid #ccc; } +small, sup, sub { font-size: 85%; } +abbr, acronym { text-transform: uppercase; font-size: 85%; letter-spacing: .1em; } +a abbr, a acronym { border: none; } +abbr[title], acronym[title], dfn[title] { cursor: help; border-bottom: 1px solid #ccc; } +sup { vertical-align: super; } +sub { vertical-align: sub; } + +/* QUOTES */ +blockquote { border-top: 1px solid #ccc; border-bottom: 1px solid #ccc; color: #666; } +blockquote *:first-child:before { content: "\201C"; } +blockquote *:first-child:after { content: "\201D"; } + +/* FORMS */ +fieldset { padding:1.4em; margin: 0 0 1.5em 0; border: 1px solid #ccc; } +legend { font-weight: bold; font-size:1.2em; } +label { font-weight: bold; } +textarea, input[type='text'], input[type='password'], select { border: 1px solid #ccc; background: #fff; } +textarea:hover, input[type='text']:hover, input[type='password']:hover, select:hover { border-color: #aaa; } +textarea:focus, input[type='text']:focus, input[type='password']:focus, select:focus { border-color: #888; outline: 2px solid #ffffaa; } +input, select { cursor: pointer; } +input[type='text'],input[type='password'] { cursor: text; } + +/* BASE SIZES */ +.container { font-size: 1.2em; line-height: 1.6em; } +h1 { font-size: 1.9em; } +h2 { font-size: 1.7em; } +h3 { font-size: 1.5em; } +h4 { font-size: 1.3em; } +h5 { font-size: 1.2em; } +h6 { font-size: 1em; } + +/* LISTS */ +ul li { margin-left: .85em; } +ul { list-style-type: disc; } +ul ul { list-style-type: square; } +ul ul ul { list-style-type: circle; } +ol { list-style-position: outside; list-style-type: decimal; } +dt { font-weight: bold; } + +/* TABLES */ +table { border-top: 1px solid #ccc; border-left: 1px solid #ccc; } +th, td { border-bottom: 1px solid #ddd; border-right: 1px solid #ccc; } + +/* MARGINS & PADDINGS */ +blockquote *:first-child { margin: .8em 0; } +hr, p, ul, ol, dl, pre, blockquote, address, table, form { margin-bottom: 1.6em; } +/* NOTE: Calulate header margins: TOP: 1.6em/size, BOTTOM: 1.6em/size/2 */ +h1 { margin: 1em 0 .5em; } +h2 { margin: 1.07em 0 .535em; } +h3 { margin: 1.14em 0 .57em; } +h4 { margin: 1.23em 0 .615em; } +h5 { margin: 1.33em 0 .67em; } +h6 { margin: 1.6em 0 .8em; } +th, td { padding: .8em; } +caption { padding-bottom: .8em; } /* padding instead of margin for IE */ +blockquote { padding: 0 1em; margin: 1.6em 0; } +fieldset { padding: 0 1em 1em 1em; margin: 1.6em 0; } /* padding-top is margin-top for fieldsets in Opera */ +legend { padding-left: .8em; padding-right: .8em; } +legend+* { margin-top: 1em; } /* compensates for the opera margin bug */ +textarea, input { padding: .3em .4em .15em .4em; } +select { padding: .1em .2em 0 .2em; } +option { padding: 0 .4em; } +a { position: relative; padding: 0.3em 0 .1em 0; } /* for larger click-area */ +dt { margin-top: .8em; margin-bottom: .4em; } +ul { margin-left: 1.5em; } +ol { margin-left: 2.35em; } +ol ol, ul ol { margin-left: 2.5em; } +form div { margin-bottom: .8em; } + +/* COLORS */ +a:link { text-decoration: underline; color: #36c; } +a:visited { text-decoration: underline; color: #36c; } +a:hover { text-decoration: underline; color: #c33; } +a:active, a:focus { text-decoration: underline; color: #36c; } +code, pre { color: #c33; } /* very optional, but still useful. W3C uses about the same colors for codes */ + +/* 24 COLUMN GRID */ +.container {width:950px;margin:0 auto;} +.showgrid {background:url(/mymedia/img/grid.png);} +body {margin:1.5em 0;} +div.span-1, div.span-2, div.span-3, div.span-4, div.span-5, div.span-6, div.span-7, div.span-8, div.span-9, div.span-10, div.span-11, div.span-12, div.span-13, div.span-14, div.span-15, div.span-16, div.span-17, div.span-18, div.span-19, div.span-20, div.span-21, div.span-22, div.span-23 {float:left;margin-right:10px;} +div.span-24 {float:left;} +div.last {margin-right:0;} +.span-1 {width:30px;} +.span-2 {width:70px;} +.span-3 {width:110px;} +.span-4 {width:150px;} +.span-5 {width:190px;} +.span-6 {width:230px;} +.span-7 {width:270px;} +.span-8 {width:310px;} +.span-9 {width:350px;} +.span-10 {width:390px;} +.span-11 {width:430px;} +.span-12 {width:470px;} +.span-13 {width:510px;} +.span-14 {width:550px;} +.span-15 {width:590px;} +.span-16 {width:630px;} +.span-17 {width:670px;} +.span-18 {width:710px;} +.span-19 {width:750px;} +.span-20 {width:790px;} +.span-21 {width:830px;} +.span-22 {width:870px;} +.span-23 {width:910px;} +.span-24, div.span-24 {width:950px;} +.suffix-1 {padding-right:40px;} +.suffix-2 {padding-right:80px;} +.suffix-3 {padding-right:120px;} +.suffix-4 {padding-right:160px;} +.suffix-5 {padding-right:200px;} +.suffix-6 {padding-right:240px;} +.suffix-7 {padding-right:280px;} +.suffix-8 {padding-right:320px;} +.suffix-9 {padding-right:360px;} +.suffix-10 {padding-right:400px;} +.suffix-11 {padding-right:440px;} +.suffix-12 {padding-right:480px;} +.suffix-13 {padding-right:520px;} +.suffix-14 {padding-right:560px;} +.suffix-15 {padding-right:600px;} +.suffix-16 {padding-right:640px;} +.suffix-17 {padding-right:680px;} +.suffix-18 {padding-right:720px;} +.suffix-19 {padding-right:760px;} +.suffix-20 {padding-right:800px;} +.suffix-21 {padding-right:840px;} +.suffix-22 {padding-right:880px;} +.suffix-23 {padding-right:920px;} +.prefix-1 {padding-left:40px;} +.prefix-2 {padding-left:80px;} +.prefix-3 {padding-left:120px;} +.prefix-4 {padding-left:160px;} +.prefix-5 {padding-left:200px;} +.prefix-6 {padding-left:240px;} +.prefix-7 {padding-left:280px;} +.prefix-8 {padding-left:320px;} +.prefix-9 {padding-left:360px;} +.prefix-10 {padding-left:400px;} +.prefix-11 {padding-left:440px;} +.prefix-12 {padding-left:480px;} +.prefix-13 {padding-left:520px;} +.prefix-14 {padding-left:560px;} +.prefix-15 {padding-left:600px;} +.prefix-16 {padding-left:640px;} +.prefix-17 {padding-left:680px;} +.prefix-18 {padding-left:720px;} +.prefix-19 {padding-left:760px;} +.prefix-20 {padding-left:800px;} +.prefix-21 {padding-left:840px;} +.prefix-22 {padding-left:880px;} +.prefix-23 {padding-left:920px;} +div.border {padding-right:4px;margin-right:5px;border-right:1px solid #eee;} +div.colborder {padding-right:24px;margin-right:25px;border-right:1px solid #eee;} +.pull-1 {margin-left:-40px;} +.pull-2 {margin-left:-80px;} +.pull-3 {margin-left:-120px;} +.pull-4 {margin-left:-160px;} +.pull-5 {margin-left:-200px;} +.pull-6 {margin-left:-240px;} +.pull-7 {margin-left:-280px;} +.pull-8 {margin-left:-320px;} +.pull-9 {margin-left:-360px;} +.pull-10 {margin-left:-400px;} +.pull-11 {margin-left:-440px;} +.pull-12 {margin-left:-480px;} +.pull-13 {margin-left:-520px;} +.pull-14 {margin-left:-560px;} +.pull-15 {margin-left:-600px;} +.pull-16 {margin-left:-640px;} +.pull-17 {margin-left:-680px;} +.pull-18 {margin-left:-720px;} +.pull-19 {margin-left:-760px;} +.pull-20 {margin-left:-800px;} +.pull-21 {margin-left:-840px;} +.pull-22 {margin-left:-880px;} +.pull-23 {margin-left:-920px;} +.pull-24 {margin-left:-960px;} +.pull-1, .pull-2, .pull-3, .pull-4, .pull-5, .pull-6, .pull-7, .pull-8, .pull-9, .pull-10, .pull-11, .pull-12, .pull-13, .pull-14, .pull-15, .pull-16, .pull-17, .pull-18, .pull-19, .pull-20, .pull-21, .pull-22, .pull-23, .pull-24 {float:left;position:relative;} +.push-1 {margin:0 -40px 1.5em 40px;} +.push-2 {margin:0 -80px 1.5em 80px;} +.push-3 {margin:0 -120px 1.5em 120px;} +.push-4 {margin:0 -160px 1.5em 160px;} +.push-5 {margin:0 -200px 1.5em 200px;} +.push-6 {margin:0 -240px 1.5em 240px;} +.push-7 {margin:0 -280px 1.5em 280px;} +.push-8 {margin:0 -320px 1.5em 320px;} +.push-9 {margin:0 -360px 1.5em 360px;} +.push-10 {margin:0 -400px 1.5em 400px;} +.push-11 {margin:0 -440px 1.5em 440px;} +.push-12 {margin:0 -480px 1.5em 480px;} +.push-13 {margin:0 -520px 1.5em 520px;} +.push-14 {margin:0 -560px 1.5em 560px;} +.push-15 {margin:0 -600px 1.5em 600px;} +.push-16 {margin:0 -640px 1.5em 640px;} +.push-17 {margin:0 -680px 1.5em 680px;} +.push-18 {margin:0 -720px 1.5em 720px;} +.push-19 {margin:0 -760px 1.5em 760px;} +.push-20 {margin:0 -800px 1.5em 800px;} +.push-21 {margin:0 -840px 1.5em 840px;} +.push-22 {margin:0 -880px 1.5em 880px;} +.push-23 {margin:0 -920px 1.5em 920px;} +.push-24 {margin:0 -960px 1.5em 960px;} +.push-1, .push-2, .push-3, .push-4, .push-5, .push-6, .push-7, .push-8, .push-9, .push-10, .push-11, .push-12, .push-13, .push-14, .push-15, .push-16, .push-17, .push-18, .push-19, .push-20, .push-21, .push-22, .push-23, .push-24 {float:right;position:relative;} +hr {background:#ddd;color:#ddd;clear:both;float:none;width:100%;height:.1em;margin:0 0 1.45em;border:none;} +hr.space {background:#fff;color:#fff;} +.clearfix:after, .container:after {content:".";display:block;height:0;clear:both;visibility:hidden;max-height:0;} +.clearfix, .container {display:inline-block;} +* html .clearfix, * html .container {height:1%;} +.clearfix, .container {display:block;} +.clear {clear:both;} + +/* to create serif italic dramatic text, use this class */ +.fancy { + color: #666; + font-family: "Warnock Pro", "Goudy Old Style","Palatino","Book Antiqua", Georgia, serif; + font-style: italic; + font-weight: normal; +} + +/* creates small caps */ +.caps { + font-variant: small-caps; + letter-spacing: 1px; + text-transform: lowercase; + font-size:1.2em; + font-weight:bold; + padding:0 2px; +} + +/* Use this class if a link gets an icon when it shouldn't. */ +body a.noicon { background:none !important; padding:0 !important; margin:0 !important; } + +/* Make sure the icons are not cut */ +a[href^="http:"], a[href^="mailto:"], a[href^="http:"]:visited, +a[href$=".pdf"], a[href$=".doc"], a[href$=".xls"], a[href$=".rss"], +a[href$=".rdf"], a[href^="aim:"] { + padding:2px 2px 2px 0; + margin:-2px 0; + background-repeat: no-repeat; + background-position: right center; +} + +/* External links +a[href^="http:"] { background-image: url(/mymedia/img/icons/external.png); padding-right: 14px; } +a[href^="mailto:"] { background-image: url(/mymedia/img/icons/email.png); } +a[href^="http:"]:visited { background-image: url(/mymedia/img/icons/visited.png); } +*/ +/* Files */ +a[href$=".pdf"] { background-image: url(/mymedia/img/icons/pdf.png); } +a[href$=".doc"] { background-image: url(/mymedia/img/icons/doc.png); } +a[href$=".xls"] { background-image: url(/mymedia/img/icons/xls.png); } + +/* Misc */ +a[href$=".rss"], +a[href$=".rdf"] { background-image: url(/mymedia/img/icons/feed.png); } +a[href^="aim:"] { background-image: url(/mymedia/img/icons/im.png); } +a[href^="http://urbex-il.org"] { background:none; padding:0; margin:0; } + +/* TEXT CLASSES */ + +.small {font-size:.8em;margin-bottom:1.875em;line-height:1.875em;} +.large {font-size:1.2em;line-height:2.5em;margin-bottom:1.25em;} +.hide {display:none;} +.quiet {color:#666;} +.loud {color:#000;} +.highlight {background:#ff0;} +.top {margin-top:0;padding-top:0;} +.bottom {margin-bottom:0;padding-bottom:0;} +.thin {font-weight: lighter;} +.error, .notice, .success {padding:.8em;margin-bottom:1.6em;border:2px solid #ddd;} +.error {background:#FBE3E4;color:#8a1f11;border-color:#FBC2C4;} +.notice {background:#FFF6BF;color:#514721;border-color:#FFD324;} +.success {background:#E6EFC2;color:#264409;border-color:#C6D880;} +.error a {color:#8a1f11; background:none; padding:0; margin:0; } +.notice a {color:#514721; background:none; padding:0; margin:0; } +.success a {color:#264409; background:none; padding:0; margin:0; } +.center {text-align: center;} + +/*---------STYLES FOR BUTTONS----------*/ +a.button, button { + display: inline-block; + float: left; + margin:0 0.583em 0.667em 0; + padding:5px 10px 5px 7px; /* Links */ + border:1px solid #dedede; + border-top:1px solid #eee; + border-left:1px solid #eee; + background-color:#f5f5f5; + font-family:"Lucida Grande", Tahoma, Arial, Verdana, sans-serif; + font-size:100%; + line-height:130%; + text-decoration:none; + font-weight:bold; + color:#565656; + cursor:pointer; +} +button { + width:auto; + overflow:visible; + padding:4px 10px 3px 7px; /* IE6 */ +} +button[type] { + padding:4px 10px 4px 7px; /* Firefox */ + line-height:17px; /* Safari */ +} + +*:first-child+html .container button[type] { + padding:4px 10px 3px 7px; /* IE7 */ +} + +button img, a.button img{ + margin:0 3px -3px 0 !important; + padding:0; + border:none; + width:16px; + height:16px; + float:none; +} + +/* Standard Buttons */ +button:hover, a.button:hover{ + background-color:#dff4ff; + border:1px solid #c2e1ef; + color:#336699; +} +a.button:active, button:active{ + background-color:#6299c5; + border:1px solid #6299c5; + color:#fff; +} + +/* Positive */ +body .positive { + color:#529214; +} +a.positive:hover, button.positive:hover { + background-color:#E6EFC2; + border:1px solid #C6D880; + color:#529214; +} +a.positive:active, button.positive:active { + background-color:#529214; + border:1px solid #529214; + color:#fff; +} + +/* Negative */ +body .negative { + color:#d12f19; +} +a.negative:hover, button.negative:hover { + background:#fbe3e4; + border:1px solid #fbc2c4; + color:#d12f19; +} +a.negative:active, button.negative:active { + background-color:#d12f19; + border:1px solid #d12f19; + color:#fff; +} diff --git a/notes.txt b/notes.txt new file mode 100644 index 0000000..d90f5b3 --- /dev/null +++ b/notes.txt @@ -0,0 +1,11 @@ +Prerequisites for setting up a generic project: +----------------------------------------------- + +1. easy_install pip +2. pip install virtualenv +3. pip install virtualenvwrapper +4. source /usr/local/bin/virtualenvwrapper.sh (possibly add to .bash_profile) +5. mkvirtualenv --distribute proj_name +6. ./bootstrap.py +7. ./manage.py syncdb +8. ./manage.py runserver diff --git a/requirements/apps.txt b/requirements/apps.txt new file mode 100644 index 0000000..d134fe3 --- /dev/null +++ b/requirements/apps.txt @@ -0,0 +1,2 @@ +-e svn+http://code.djangoproject.com/svn/django/branches/releases/1.2.X#egg=django +django-mptt
\ No newline at end of file diff --git a/settings.py b/settings.py new file mode 100644 index 0000000..ab09e9b --- /dev/null +++ b/settings.py @@ -0,0 +1,94 @@ +import os +import django + +DJANGO_ROOT = os.path.dirname(os.path.realpath(django.__file__)) +SITE_ROOT = os.path.dirname(os.path.realpath(__file__)) + +DEBUG = True +TEMPLATE_DEBUG = DEBUG + +ADMINS = ( + # ('Your Name', 'your_email@domain.com'), +) + +MANAGERS = ADMINS + +DATABASE_ENGINE = 'sqlite3' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. +DATABASE_NAME = 'test.db' # Or path to database file if using sqlite3. +DATABASE_USER = '' # Not used with sqlite3. +DATABASE_PASSWORD = '' # Not used with sqlite3. +DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3. +DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3. + +# Local time zone for this installation. Choices can be found here: +# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name +# although not all choices may be available on all operating systems. +# If running in a Windows environment this must be set to the same as your +# system time zone. +TIME_ZONE = 'Asia/Jerusalem' + +# Language code for this installation. All choices can be found here: +# http://www.i18nguy.com/unicode/language-identifiers.html +LANGUAGE_CODE = 'en-us' + +SITE_ID = 1 + +# If you set this to False, Django will make some optimizations so as not +# to load the internationalization machinery. +USE_I18N = True + +# Absolute path to the directory that holds media. +# Example: "/home/media/media.lawrence.com/" +MEDIA_ROOT = os.path.join(SITE_ROOT, 'media') + +# URL that handles the media served from MEDIA_ROOT. Make sure to use a +# trailing slash if there is a path component (optional in other cases). +# Examples: "http://media.lawrence.com", "http://example.com/media/" +MEDIA_URL = '/media/' + +# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a +# trailing slash. +# Examples: "http://foo.com/media/", "/media/". +ADMIN_MEDIA_PREFIX = '/adminmedia/' + +# Make this unique, and don't share it with anybody. +SECRET_KEY = '3_q16o2ku8m#bcqj4mns)po#4gf$%_8l0l*put1gp99homzr91' + +# List of callables that know how to import templates from various sources. +TEMPLATE_LOADERS = ( + 'django.template.loaders.filesystem.load_template_source', + 'django.template.loaders.app_directories.load_template_source', +# 'django.template.loaders.eggs.load_template_source', +) + +MIDDLEWARE_CLASSES = ( + 'django.middleware.common.CommonMiddleware', + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', +) + +ROOT_URLCONF = 'generic_django.urls' + +TEMPLATE_DIRS = ( + os.path.join(SITE_ROOT, 'templates'), +) + +TEMPLATE_CONTEXT_PROCESSORS = ( + "django.core.context_processors.auth", + "django.core.context_processors.debug", + "django.core.context_processors.i18n", + "django.core.context_processors.media", + "django.core.context_processors.request", +) + + +INSTALLED_APPS = ( + 'django.contrib.auth', + 'django.contrib.admin', + 'django.contrib.contenttypes', + 'django.contrib.markup', + 'django.contrib.sessions', + 'django.contrib.sites', + 'generic_django.main', +) + diff --git a/templates/main.html b/templates/main.html new file mode 100644 index 0000000..8fc79c4 --- /dev/null +++ b/templates/main.html @@ -0,0 +1,39 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + {% block extraMeta %}{% endblock %} + + <link rel="stylesheet" href="{{ MEDIA_URL }}css/bp/screen.css" type="text/css" media="screen, projection"/> + <link rel="stylesheet" href="{{ MEDIA_URL }}css/bp/rtl.css" type="text/css" media="screen, projection"/> + <link rel="stylesheet" href="{{ MEDIA_URL }}css/bp/print.css" type="text/css" media="print"/> + <!--[if IE]><link rel="stylesheet" href="{{ MEDIA_URL }}css/ie.css" type="text/css" media="screen, projection"/><![endif]--> + {% block extraCSS %}{% endblock %} + + <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> + <script type="text/javascript" src="{{ MEDIA_URL }}js/base.js"></script> + {% block extraJS %}{% endblock %} + + <title>{% block baseTitle %}Hello{% endblock %}{% block extraTitle %}{% endblock %}</title> + </head> + + <body class="fullDoc"> + <div id="fullWidthContainer" class="container"> + {% block header %} + <h1>שלום</h1> + {% endblock %} + + <div id="content" class="span-24 last"> + {% block contentArea %} + <h2>לורם איפסום...</h2> + {% endblock %} + </div> + + <div id="footer" class="span-24 last"> + {% block footer %} + <p>- סוף -</p> + {% endblock %} + </div> + </div> + </body> +</html> Binary files differ@@ -0,0 +1,21 @@ +from django.conf.urls.defaults import * +from django.conf import settings + +# Uncomment the next two lines to enable the admin: +# from django.contrib import admin +# admin.autodiscover() + +urlpatterns = patterns('', + (r'^$', 'generic_django.main.views.index'), + # Example: + # (r'^generic_django/', include('generic_django.foo.urls')), + + # Uncomment the admin/doc line below to enable admin documentation: + # (r'^admin/doc/', include('django.contrib.admindocs.urls')), + + # Uncomment the next line to enable the admin: + # (r'^admin/', include(admin.site.urls)), + + # media serving, will move later on to subdomain served by Apache + (r'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}), +) |
