Skip to content

Commit

Permalink
Moved search configuration to manage.py; updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
jace committed Feb 10, 2014
1 parent 481406b commit 31b8426
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 5 deletions.
19 changes: 17 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,29 @@ Don't copy ours. We will like you better if you contribute a patch.
This code runs on [Python][] with the [Flask][] microframework. You will need
to install all the requirements listed in `requirements.txt` using
`easy_install` or `pip`. Copy `settings-sample.py` to `settings.py`, edit as
necessary, and start the server with:
necessary, and finish configuration with:

$ python manage.py db create
$ python manage.py configure

To run the server in development mode:

$ python runserver.py

WSGI is recommended for production. Enable `mod_wsgi` in Apache and make a
WSGI is recommended for production. For Apache: enable `mod_wsgi` and make a
`VirtualHost` with:

WSGIScriptAlias / /path/to/website.wsgi

For Nginx, run website.py under uWSGI and proxy to it:

location / {
include uwsgi_params; # Include common uWSGI settings here
uwsgi_pass 127.0.0.1:8093;
uwsgi_param UWSGI_CHDIR /path/to/hasjob/git/repo/folder;
uwsgi_param UWSGI_MODULE website;
}


[Python]: http://python.org/
[Flask]: http://flask.pocoo.org/
2 changes: 0 additions & 2 deletions hasjob/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ def init_for(env):
'jquery.tinymce', 'jquery.form', 'jquery.cookie', 'select2', 'jquery.sparkline', 'baseframe-networkbar', 'hasjob'
])
app.assets.register('js_tinymce', assets.require('tiny_mce.js>=3.5.0,<4.0.0'))
from hasjob.search import configure as search_configure
from hasjob.uploads import configure as uploads_configure
search_configure()
uploads_configure()
mail.init_app(app)
lastuser.init_app(app)
2 changes: 1 addition & 1 deletion hasjob/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ class EMPLOYER_RESPONSE(LabeledEnum):
REJECTED = (6, u"Rejected") # Employer rejected candidate with a message


from hasjob.models.user import *
from hasjob.models.jobcategory import *
from hasjob.models.jobpostreport import *
from hasjob.models.jobtype import *
from hasjob.models.reportcode import *
from hasjob.models.jobpost import *
from hasjob.models.user import *
9 changes: 9 additions & 0 deletions manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,18 @@

from hasjob.models import db
from hasjob import app, init_for
from hasjob.search import configure as search_configure


def configure(env='dev'):
"""Configure Hasjob's search indexing"""
init_for(env)
search_configure()


if __name__ == '__main__':
db.init_app(app)
manager = init_manager(app, db, init_for)
manager.command(configure)

manager.run()

0 comments on commit 31b8426

Please sign in to comment.