Skip to content

Commit f15001d

Browse files
committed
init
0 parents  commit f15001d

File tree

21 files changed

+500
-0
lines changed

21 files changed

+500
-0
lines changed

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# generated
2+
*.pyc
3+
*.pyo
4+
# eclipse project config
5+
.project
6+
.pydevproject
7+
# db
8+
sqlite3.db
9+
#logs
10+
logs

__init__.py

Whitespace-only changes.

manage.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env python
2+
from django.core.management import execute_manager
3+
import imp
4+
try:
5+
imp.find_module('settings') # Assumed to be in the same directory.
6+
except ImportError:
7+
import sys
8+
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" % __file__)
9+
sys.exit(1)
10+
11+
import settings
12+
13+
if __name__ == "__main__":
14+
execute_manager(settings)

pyrcp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../python/pyrcp

settings.py

Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
# Django settings for nemo project.
2+
from os.path import dirname, abspath
3+
4+
DEBUG = True
5+
TEMPLATE_DEBUG = DEBUG
6+
7+
_PROJECT_ROOT = dirname(abspath(__file__))
8+
LOGIN_REDIRECT_URL = '/'
9+
10+
TEMPLATE_CONTEXT_PROCESSORS = (
11+
'django.core.context_processors.request',
12+
"django.contrib.auth.context_processors.auth",
13+
"django.core.context_processors.debug",
14+
"django.core.context_processors.i18n",
15+
"django.core.context_processors.media",
16+
"django.core.context_processors.static",
17+
"django.contrib.messages.context_processors.messages"
18+
)
19+
20+
ADMINS = (
21+
('Snow Hellsing', '[email protected]'),
22+
)
23+
24+
MANAGERS = ADMINS
25+
26+
DATABASES = {
27+
'default': {
28+
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
29+
'NAME': _PROJECT_ROOT + '/sqlite3.db', # Or path to database file if using sqlite3.
30+
'USER': '', # Not used with sqlite3.
31+
'PASSWORD': '', # Not used with sqlite3.
32+
'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
33+
'PORT': '', # Set to empty string for default. Not used with sqlite3.
34+
}
35+
}
36+
37+
# Local time zone for this installation. Choices can be found here:
38+
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
39+
# although not all choices may be available on all operating systems.
40+
# On Unix systems, a value of None will cause Django to use the same
41+
# timezone as the operating system.
42+
# If running in a Windows environment this must be set to the same as your
43+
# system time zone.
44+
TIME_ZONE = 'Asia/Chongqing'
45+
46+
# Language code for this installation. All choices can be found here:
47+
# http://www.i18nguy.com/unicode/language-identifiers.html
48+
LANGUAGE_CODE = 'en-us'
49+
50+
SITE_ID = 1
51+
52+
# If you set this to False, Django will make some optimizations so as not
53+
# to load the internationalization machinery.
54+
USE_I18N = True
55+
56+
# If you set this to False, Django will not format dates, numbers and
57+
# calendars according to the current locale
58+
USE_L10N = True
59+
60+
# Absolute filesystem path to the directory that will hold user-uploaded files.
61+
# Example: "/home/media/media.lawrence.com/media/"
62+
MEDIA_ROOT = ''
63+
64+
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
65+
# trailing slash.
66+
# Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
67+
MEDIA_URL = ''
68+
69+
# Absolute path to the directory static files should be collected to.
70+
# Don't put anything in this directory yourself; store your static files
71+
# in apps' "static/" subdirectories and in STATICFILES_DIRS.
72+
# Example: "/home/media/media.lawrence.com/static/"
73+
STATIC_ROOT = ''
74+
75+
# URL prefix for static files.
76+
# Example: "http://media.lawrence.com/static/"
77+
STATIC_URL = '/s/'
78+
79+
# URL prefix for admin static files -- CSS, JavaScript and images.
80+
# Make sure to use a trailing slash.
81+
# Examples: "http://foo.com/static/admin/", "/static/admin/".
82+
ADMIN_MEDIA_PREFIX = '/static/admin/'
83+
84+
# Additional locations of static files
85+
STATICFILES_DIRS = (
86+
# Put strings here, like "/home/html/static" or "C:/www/django/static".
87+
# Always use forward slashes, even on Windows.
88+
# Don't forget to use absolute paths, not relative paths.
89+
)
90+
91+
# List of finder classes that know how to find static files in
92+
# various locations.
93+
STATICFILES_FINDERS = (
94+
'django.contrib.staticfiles.finders.FileSystemFinder',
95+
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
96+
# 'django.contrib.staticfiles.finders.DefaultStorageFinder',
97+
)
98+
99+
# Make this unique, and don't share it with anybody.
100+
SECRET_KEY = '-(f3g=n6a930n-$epam62h&9&*rs6(%tc(vqsaxi#@(fyb+jxx'
101+
102+
# List of callables that know how to import templates from various sources.
103+
TEMPLATE_LOADERS = (
104+
'django.template.loaders.filesystem.Loader',
105+
'django.template.loaders.app_directories.Loader',
106+
# 'django.template.loaders.eggs.Loader',
107+
)
108+
109+
MIDDLEWARE_CLASSES = (
110+
'django.middleware.common.CommonMiddleware',
111+
'django.contrib.sessions.middleware.SessionMiddleware',
112+
'django.middleware.csrf.CsrfViewMiddleware',
113+
'django.contrib.auth.middleware.AuthenticationMiddleware',
114+
'django.contrib.messages.middleware.MessageMiddleware',
115+
)
116+
117+
ROOT_URLCONF = 'nemo.urls'
118+
119+
TEMPLATE_DIRS = (
120+
# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
121+
# Always use forward slashes, even on Windows.
122+
# Don't forget to use absolute paths, not relative paths.
123+
)
124+
125+
INSTALLED_APPS = (
126+
'django.contrib.auth',
127+
'django.contrib.contenttypes',
128+
'django.contrib.sessions',
129+
'django.contrib.sites',
130+
'django.contrib.messages',
131+
'django.contrib.staticfiles',
132+
# Uncomment the next line to enable the admin:
133+
# 'django.contrib.admin',
134+
# Uncomment the next line to enable admin documentation:
135+
# 'django.contrib.admindocs',
136+
'wishlist'
137+
)
138+
139+
# A sample logging configuration. The only tangible logging
140+
# performed by this configuration is to send an email to
141+
# the site admins on every HTTP 500 error.
142+
# See http://docs.djangoproject.com/en/dev/topics/logging for
143+
# more details on how to customize your logging configuration.
144+
LOGGING = {
145+
'version': 1,
146+
'disable_existing_loggers': False,
147+
'formatters': {
148+
'custom': {
149+
'format': '[%(asctime)-15s][%(levelname)s] %(message)s | %(pathname)s (%(lineno)d)'
150+
},
151+
},
152+
'handlers': {
153+
'mail_admins': {
154+
'level': 'ERROR',
155+
'class': 'django.utils.log.AdminEmailHandler'
156+
},
157+
'console':{
158+
'level':'DEBUG',
159+
'class':'logging.StreamHandler',
160+
'formatter': 'custom'
161+
},
162+
},
163+
'loggers': {
164+
'django.request': {
165+
'handlers': ['mail_admins'],
166+
'level': 'ERROR',
167+
'propagate': True,
168+
},
169+
'demo':{
170+
'handlers': ['console'],
171+
'level': 'INFO',
172+
},
173+
'core':{
174+
'handlers': ['console'],
175+
'level': 'INFO',
176+
}
177+
}
178+
}

urls.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
from django.conf.urls.defaults import patterns, include, url
2+
3+
# Uncomment the next two lines to enable the admin:
4+
# from django.contrib import admin
5+
# admin.autodiscover()
6+
7+
urlpatterns = patterns('',
8+
url(r'^accounts/login/$', 'django.contrib.auth.views.login'),
9+
url(r'^accounts/logout/$', 'django.contrib.auth.views.logout',
10+
{'next_page': '/'}),
11+
12+
url(r'^', include('wishlist.urls'))
13+
)

wishlist/__init__.py

Whitespace-only changes.

wishlist/models.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
from django.db import models
2+
from django.contrib.auth.models import User as Account
3+
4+
# Create your models here.
5+
class User(models.Model):
6+
account = models.ForeignKey(Account, unique=True)
7+
8+
class Wish(models.Model):
9+
content = models.CharField(max_length=200)
10+
author = models.ForeignKey(User)
11+
created = models.DateTimeField(auto_now_add=True)
12+
#duedate = models.DateTimeField(null=True, blank=True, auto_now_add=True)
13+
14+
ayes = models.ManyToManyField(User, related_name='likes')
15+
negatives = models.ManyToManyField(User, related_name='bans')

wishlist/static/c/common.css

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
@CHARSET "UTF-8";
2+
/*
3+
* commons
4+
* ----------------
5+
*/
6+
.c {clear:both}
7+
8+
/*
9+
* components
10+
* ----------------
11+
*/
12+
.inr.layout {width:960px; margin:0 auto}
13+
14+
.hd.layout {height:44px; line-height:44px; border-bottom:1px solid #111;
15+
background:#333}
16+
.hd.layout a {text-decoration:none; color:#fff}
17+
18+
.hd.layout .logo,
19+
.hd.layout .logo_lt,
20+
.hd.layout .page_title {display:block; float:left; color:#fff}
21+
22+
.hd.layout .logo {padding:0 5px; font-size:20px}
23+
.hd.layout .page_title {margin-left:5px; color:#ccc; font-size:20px}
24+
25+
.hd.layout .user_info {float:right; color:#ccc}
26+
.hd.layout .user_info a {font-size:14px; color:#ccc}
27+
28+
/*
29+
* page specifics
30+
* ----------------
31+
*/

wishlist/static/c/reset.css

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
@CHARSET "UTF-8";
2+
3+
/* reset.css from blueprint*/
4+
html {margin:0;padding:0;border:0;}
5+
body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, code, del, dfn, em, img, q, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, dialog, figure, footer, header, hgroup, nav, section {margin:0;padding:0;border:0;font-weight:inherit;font-style:inherit;font-size:100%;font-family:inherit;vertical-align:baseline;}
6+
article, aside, dialog, figure, footer, header, hgroup, nav, section {display:block;}
7+
body {line-height:1.5;background:white;}
8+
table {border-collapse:separate;border-spacing:0;}
9+
caption, th, td {text-align:left;font-weight:normal;float:none !important;}
10+
table, th, td {vertical-align:middle;}
11+
blockquote:before, blockquote:after, q:before, q:after {content:'';}
12+
blockquote, q {quotes:"" "";}
13+
a img {border:none;}
14+
:focus {outline:0;}

0 commit comments

Comments
 (0)