Skip to content

Commit

Permalink
Everything works now, sort of
Browse files Browse the repository at this point in the history
  • Loading branch information
Nigel Babu committed Jul 7, 2012
1 parent 2f5d624 commit 89452b2
Show file tree
Hide file tree
Showing 6 changed files with 109 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
.DS_Store
*.pyc
settings.py
test.db
*.wpr
.project
Expand All @@ -9,3 +8,5 @@ test.db
.sass-cache
error.log
.coverage
instance/production.py
instance/development.py
8 changes: 6 additions & 2 deletions hasjob/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from flask.ext.mail import Mail
from flask.ext.assets import Environment, Bundle
from coaster import configureapp
import uploads, search

# First, make an app and config it

Expand All @@ -15,9 +14,10 @@
mail = Mail()
mail.init_app(app)
assets = Environment(app)
from uploads import configure
from search import configure
uploads.configure()
search.configure()

# Second, setup assets

assets = Environment(app)
Expand All @@ -35,5 +35,9 @@

import hasjob.models
import hasjob.views
from uploads import configure
from search import configure
uploads.configure()
search.configure()
if environ.get('HASJOB_ENV') == 'prod':
import hasjob.loghandler
3 changes: 1 addition & 2 deletions hasjob/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
from whoosh.qparser import QueryParser
from whoosh.analysis import StemmingAnalyzer

import models
from app import app
from hasjob import models, app

search_schema = fields.Schema(title=fields.TEXT(stored=True),
content=fields.TEXT(analyzer=StemmingAnalyzer()),
Expand Down
3 changes: 2 additions & 1 deletion hasjob/uploads.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
from werkzeug import FileStorage

from flask.ext.uploads import UploadSet, configure_uploads, IMAGES, UploadNotAllowed
from app import app

from hasjob import app

uploaded_logos = UploadSet('logos', IMAGES)

Expand Down
48 changes: 48 additions & 0 deletions instance/settings-sample.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#: The title of this site
SITE_TITLE='Job Board'
#: TypeKit code for fonts
TYPEKIT_CODE=''
#: Google Analytics code UA-XXXXXX-X
GA_CODE=''
#: Database backend
SQLALCHEMY_DATABASE_URI = 'sqlite:///test.db'
#: Secret key
SECRET_KEY = 'make this something random'
#: Timezone
TIMEZONE = 'Asia/Calcutta'
#: Upload path
UPLOADED_LOGOS_DEST='/tmp/uploads'
#: Search index path
SEARCH_INDEX_PATH='/tmp/search'
#: Mail settings
#: MAIL_FAIL_SILENTLY : default True
#: MAIL_SERVER : default 'localhost'
#: MAIL_PORT : default 25
#: MAIL_USE_TLS : default False
#: MAIL_USE_SSL : default False
#: MAIL_USERNAME : default None
#: MAIL_PASSWORD : default None
#: DEFAULT_MAIL_SENDER : default None
MAIL_FAIL_SILENTLY = False
MAIL_SERVER = 'localhost'
DEFAULT_MAIL_SENDER = ('Job Board', '[email protected]')
#: Logging: recipients of error emails
ADMINS=[]
#: Log file
LOGFILE='error.log'
#: Use SSL for some URLs
USE_SSL=False
#: Twitter integration (register as a "client" app)
TWITTER_ENABLED=False
TWITTER_CONSUMER_KEY = ''
TWITTER_CONSUMER_SECRET = ''
TWITTER_ACCESS_KEY = ''
TWITTER_ACCESS_SECRET = ''
#: Bit.ly integration for short URLs
BITLY_USER = ''
BITLY_KEY = ''
#: Access key for periodic server-only tasks
PERIODIC_KEY = ''
#: Throttle limit for email domain
THROTTLE_LIMIT = 5
SUPPORT_EMAIL = '[email protected]'
50 changes: 50 additions & 0 deletions instance/settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#: The title of this site
SITE_TITLE='Job Board'
#: TypeKit code for fonts
TYPEKIT_CODE=''
#: Google Analytics code UA-XXXXXX-X
GA_CODE=''
#: Database backend
SQLALCHEMY_DATABASE_URI = 'mysql://root:@localhost/hasjob'
#: Secret key
SECRET_KEY = 'make this something random'
#: Timezone
TIMEZONE = 'Asia/Calcutta'
#: Upload path
UPLOADED_LOGOS_DEST='/tmp/uploads'
#: Search index path
SEARCH_INDEX_PATH='/tmp/search'
#: Mail settings
#: MAIL_FAIL_SILENTLY : default True
#: MAIL_SERVER : default 'localhost'
#: MAIL_PORT : default 25
#: MAIL_USE_TLS : default False
#: MAIL_USE_SSL : default False
#: MAIL_USERNAME : default None
#: MAIL_PASSWORD : default None
#: DEFAULT_MAIL_SENDER : default None
MAIL_FAIL_SILENTLY = False
MAIL_SERVER = 'localhost'
DEFAULT_MAIL_SENDER = ('Job Board', '[email protected]')
MAIL_USERNAME = None
MAIL_PASSWORD = None
#: Logging: recipients of error emails
ADMINS=['[email protected]']
#: Log file
LOGFILE='error.log'
#: Use SSL for some URLs
USE_SSL=False
#: Twitter integration (register as a "client" app)
TWITTER_ENABLED=False
TWITTER_CONSUMER_KEY = ''
TWITTER_CONSUMER_SECRET = ''
TWITTER_ACCESS_KEY = ''
TWITTER_ACCESS_SECRET = ''
#: Bit.ly integration for short URLs
BITLY_USER = ''
BITLY_KEY = ''
#: Access key for periodic server-only tasks
PERIODIC_KEY = ''
#: Throttle limit for email domain
THROTTLE_LIMIT = 5
SUPPORT_EMAIL = '[email protected]'

0 comments on commit 89452b2

Please sign in to comment.