Permalink
Browse files

adding bootstrap CSS to the mix, and getting things to finally work

  • Loading branch information...
1 parent 3031cad commit 5020dcbcfb61afd573dcd51377dad18e42583bec @jfmatth committed Jan 21, 2012
View
BIN __init__.pyc
Binary file not shown.
View
2 aim/models.py
@@ -5,7 +5,7 @@
from decimal import *
import datetime
-import aim_utilities
+import util.aim_utilities
#
# Stock
View
4 aim/views.py
@@ -156,9 +156,9 @@ def aim_login(request):
if user is not None:
if user.is_active:
login(request, user)
- return HttpResponseRedirect('/aim')
+ return HttpResponseRedirect('/')
else:
- return HttpResponseRedirect('/aim')
+ return HttpResponseRedirect('/')
# Return a 'disabled account' error message
else:
return HttpResponseRedirect('/')
View
BIN aim_utilities.pyc
Binary file not shown.
View
BIN manage.pyc
Binary file not shown.
View
32 settings.py
@@ -1,4 +1,7 @@
# Django settings for website project.
+import os
+
+SITE_ROOT = os.path.dirname(os.path.realpath(__file__))
DEBUG = True
TEMPLATE_DEBUG = DEBUG
@@ -8,13 +11,23 @@
)
MANAGERS = ADMINS
-
-DATABASE_ENGINE = 'sqlite3' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
-DATABASE_NAME = 'database.sqlite3' # 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.
+DATABASES = {
+ 'default': {
+ 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
+ 'NAME': 'database.sq3', # Or path to database file if using sqlite3.
+ 'USER': '', # Not used with sqlite3.
+ 'PASSWORD': '', # Not used with sqlite3.
+ 'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
+ 'PORT': '', # Set to empty string for default. Not used with sqlite3.
+ }
+}
+
+#DATABASE_ENGINE = 'sqlite3' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
+#DATABASE_NAME = 'database.sqlite3' # 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
@@ -59,6 +72,7 @@
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
+ 'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
)
@@ -69,15 +83,15 @@
# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
- '/Users/john/Development/Python/investing/templates'
+ os.path.join(SITE_ROOT, 'templates')
)
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.admin',
- 'south',
+# 'south',
'aim',
#'django.contrib.sites',
)
View
4 templates/base.html
@@ -1,7 +1,3 @@
-<!--
-To change this template, choose Tools | Templates
-and open the template in the editor.
--->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
View
103 templates/bootstrap.html
@@ -0,0 +1,103 @@
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8">
+
+ <!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
+ <!--[if lt IE 9]>
+ <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
+ <![endif]-->
+
+ <!-- Le styles -->
+ <link rel="stylesheet" href="http://twitter.github.com/bootstrap/1.4.0/bootstrap.min.css">
+ <style type="text/css">
+ body {
+ padding-top: 60px;
+ }
+ </style>
+
+ <!-- Le fav and touch icons -->
+ <link rel="shortcut icon" href="images/favicon.ico">
+ <link rel="apple-touch-icon" href="images/apple-touch-icon.png">
+ <link rel="apple-touch-icon" sizes="72x72" href="images/apple-touch-icon-72x72.png">
+ <link rel="apple-touch-icon" sizes="114x114" href="images/apple-touch-icon-114x114.png">
+ </head>
+
+ <body>
+
+ <div class="topbar">
+ <div class="fill">
+ <div class="container">
+
+ <a class="brand" href="#">RetireOnAIM</a>
+
+ <ul class="nav">
+ <li class="active"><a href="#">Home</a></li>
+ <li><a href="#about">About</a></li>
+ <li><a href="#contact">Contact</a></li>
+ </ul>
+
+<!-- User or login on toolbar? -->
+{% if user.is_authenticated %}
+ <form action="/accounts/logout/" class="pull-right">
+ {% csrf_token %}
+ Hello {{ user.username}}
+ <input type="hidden" name="next" value="/" />
+ <button class="btn" type="submit">Logout</button>
+ </form>
+{% else %}
+ <p class="pull-right">
+ <form method="post" action="/accounts/login/" class="pull-right">
+ {% csrf_token %}
+ <input class="input-small" type="text" name="username">
+ <input class="input-small" type="password" name="password">
+ <input type="hidden" name="next" value="/" />
+ <button class="btn" type="submit">Login</button>
+ </form>
+ </p>
+{% endif %}
+
+ </div>
+ </div>
+ </div>
+
+ <div class="container">
+
+ <!-- Main hero unit for a primary marketing message or call to action -->
+ <div class="hero-unit">
+ <h1>Make your stock portfolio shine</h1>
+ <p>
+ <p>Welcome to RetireOnAIM, the program that helps increase the value of your investments</p>
+ <p><a class="btn primary large">Learn more &raquo;</a></p>
+ </div>
+
+ <div class="row">
+
+ <div class="span-one-third">
+ <h2>Why use this?</h2>
+ <p>Etiam porta sem malesuada magna mollis euismod. Integer posuere erat a ante venenatis dapibus posuere velit aliquet. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.</p>
+ <p><a class="btn" href="#">View details &raquo;</a></p>
+ </div>
+
+ <div class="span-one-third">
+ <h2>How does it work?</h2>
+ <p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
+ <p><a class="btn" href="#">View details &raquo;</a></p>
+ </div>
+
+ <div class="span-one-third">
+ <h2>How much does it costk?</h2>
+ <p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
+ <p><a class="btn" href="#">View details &raquo;</a></p>
+ </div>
+
+ </div> <!-- row -->
+
+ <footer>
+ <p>&copy; Company 2011</p>
+ </footer>
+
+ </div> <!-- /container -->
+
+ </body>
+</html>
View
14 urls.py
@@ -1,10 +1,16 @@
from django.conf.urls.defaults import *
+from django.views.generic import TemplateView
+
# Uncomment the next two lines to enable the admin:
-from django.contrib import admin
-admin.autodiscover()
+#from django.contrib import admin
+#admin.autodiscover()
+
urlpatterns = patterns('',
+
+ (r'^$', TemplateView.as_view(template_name="bootstrap.html")),
+
# Example:
(r'^aim/', include('aim.urls') ),
@@ -13,8 +19,8 @@
# (r'^admin/doc/', include('django.contrib.admindocs.urls')),
(r'^accounts/login/$', 'django.contrib.auth.views.login'),
- (r'^accounts/logout/$', 'django.contrib.auth.views.logout', {'next_page':'/aim/'}),
+ (r'^accounts/logout/$', 'django.contrib.auth.views.logout'),
# Uncomment the next line to enable the admin:
- (r'^admin/(.*)', admin.site.root),
+# (r'^admin/(.*)', admin.site.root),
)
View
BIN urls.pyc
Binary file not shown.
View
0 aim_utilities.py → util/aim_utilities.py
File renamed without changes.

0 comments on commit 5020dcb

Please sign in to comment.