Permalink
Browse files

initial commit

  • Loading branch information...
1 parent 9bf73a7 commit 52db3856610effac9eab9bb31f4205a09e5d3494 @baijum committed Jan 25, 2011
Showing with 405 additions and 0 deletions.
  1. +25 −0 LICENSE.txt
  2. +1 −0 py3k/__init__.py
  3. +37 −0 py3k/application.py
  4. +42 −0 py3k/config.py
  5. +35 −0 py3k/main.py
  6. +30 −0 py3k/model.py
  7. +39 −0 py3k/static/css/base.css
  8. +167 −0 py3k/static/js/jquery-1.4.4.min.js
  9. +1 −0 py3k/templates/index.html
  10. +28 −0 runserver.py
View
@@ -0,0 +1,25 @@
+Copyright 2011 Baiju M <baiju.m.mail@gmail.com>. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are
+permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice, this list of
+ conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright notice, this list
+ of conditions and the following disclaimer in the documentation and/or other materials
+ provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS'' AND ANY EXPRESS OR IMPLIED
+WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+The views and conclusions contained in the software and documentation are those of the
+authors and should not be interpreted as representing official policies, either expressed
+or implied, of Baiju M <baiju.m.mail@gmail.com>.
View
@@ -0,0 +1 @@
+# Python Package
View
@@ -0,0 +1,37 @@
+# Copyright 2011 Baiju M <baiju.m.mail@gmail.com>. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without modification, are
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of source code must retain the above copyright notice, this list of
+# conditions and the following disclaimer.
+#
+# 2. Redistributions in binary form must reproduce the above copyright notice, this list
+# of conditions and the following disclaimer in the documentation and/or other materials
+# provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS'' AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR
+# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+# The views and conclusions contained in the software and documentation are those of the
+# authors and should not be interpreted as representing official policies, either expressed
+# or implied, of Baiju M <baiju.m.mail@gmail.com>.
+
+from flask import Flask
+from flaskext.sqlalchemy import SQLAlchemy
+
+app = Flask(__name__)
+
+app.config.from_object('py3k.config.DevelopmentConfig')
+
+db = SQLAlchemy(app)
+
+import model
+import main
View
@@ -0,0 +1,42 @@
+# Copyright 2011 Baiju M <baiju.m.mail@gmail.com>. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without modification, are
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of source code must retain the above copyright notice, this list of
+# conditions and the following disclaimer.
+#
+# 2. Redistributions in binary form must reproduce the above copyright notice, this list
+# of conditions and the following disclaimer in the documentation and/or other materials
+# provided with the distribution.
+
+# THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS'' AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR
+# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+# The views and conclusions contained in the software and documentation are those of the
+# authors and should not be interpreted as representing official policies, either expressed
+# or implied, of Baiju M <baiju.m.mail@gmail.com>.
+
+class Config(object):
+ DEBUG = False
+ TESTING = False
+ SQLALCHEMY_DATABASE_URI = 'sqlite:////tmp/test.db'
+
+class ProductionConfig(Config):
+ SQLALCHEMY_DATABASE_URI = 'mysql://user:passwd@localhost/db'
+
+class DevelopmentConfig(Config):
+ DEBUG = True
+ SECRET_KEY = 'secret'
+ SQLALCHEMY_ECHO = True
+
+class TestinConfig(Config):
+ TESTING = True
+ SQLALCHEMY_DATABASE_URI = 'sqlite://:memory:'
View
@@ -0,0 +1,35 @@
+# Copyright 2011 Baiju M <baiju.m.mail@gmail.com>. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without modification, are
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of source code must retain the above copyright notice, this list of
+# conditions and the following disclaimer.
+#
+# 2. Redistributions in binary form must reproduce the above copyright notice, this list
+# of conditions and the following disclaimer in the documentation and/or other materials
+# provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS'' AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR
+# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+# The views and conclusions contained in the software and documentation are those of the
+# authors and should not be interpreted as representing official policies, either expressed
+# or implied, of Baiju M <baiju.m.mail@gmail.com>.
+
+from flask import render_template
+
+import application
+app = application.app
+import model
+
+@app.route('/')
+def index():
+ return render_template('index.html')
View
@@ -0,0 +1,30 @@
+from .application import db
+
+from werkzeug import generate_password_hash, check_password_hash
+
+class User(db.Model):
+ __tablename__ = 'users'
+ id = db.Column(db.Integer, primary_key=True)
+ username = db.Column(db.String(16), unique=True)
+ pw_hash = db.Column(db.String(80))
+ email = db.Column(db.String(120), unique=True)
+ first_name = db.Column(db.String(50))
+ middle_name = db.Column(db.String(50))
+ last_name = db.Column(db.String(50))
+
+ def __init__(self, username, password, email, first_name='', middle_name='', last_name=''):
+ self.username = username
+ self.set_password(password)
+ self.email = email
+ self.first_name = first_name
+ self.middle_name = middle_name
+ self.last_name = last_name
+
+ def set_password(self, password):
+ self.pw_hash = generate_password_hash(password)
+
+ def check_password(self, password):
+ return check_password_hash(self.pw_hash, password)
+
+ def __repr__(self):
+ return '<User %r>' % (self.username)
@@ -0,0 +1,39 @@
+html, body, div, span, object, iframe,
+h1, h2, h3, h4, h5, h6, p, blockquote, pre,
+abbr, address, cite, code,
+del, dfn, em, img, ins, kbd, q, samp,
+small, strong, sub, sup, var,
+b, i, dl, dt, dd, ol, ul, li,
+fieldset, form, label, legend,
+table, caption, tbody, tfoot, thead, tr, th, td,
+article, aside, figure, footer, header,
+hgroup, menu, nav, section, menu,
+time, mark, audio, video {
+ margin: 0;
+ padding: 0;
+ border: 0;
+ outline: 0;
+ font-size: 100%;
+ vertical-align: baseline;
+ background: transparent; }
+
+input, select {
+ vertical-align: middle; }
+
+::-moz-selection {
+ background: #ADC0FF;
+ color: #fff;
+ text-shadow: none; }
+
+::selection {
+ background: #ADC0FF;
+ color: #fff;
+ text-shadow: none; }
+
+body {
+ font-family: 'Cantarell', arial, serif;
+ font-size: 14pt; }
+
+body {
+ background-color: #F7F7F7;
+ text-shadow: 0 1px 0 white; }
Oops, something went wrong.

0 comments on commit 52db385

Please sign in to comment.