Skip to content

Commit c309756

Browse files
committed
Tweak config for deployment.
1 parent fb1b172 commit c309756

File tree

5 files changed

+13
-11
lines changed

5 files changed

+13
-11
lines changed

config/deployed/nginx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
server {
22
listen 80;
3-
server_name crime.hacktyler.com;
3+
server_name sirens.hacktyler.com;
44

55
client_max_body_size 1G;
66

config/deployed/settings.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
DATABASES['default']['PORT'] = '5433'
1010

1111
# Static media
12-
STATIC_ROOT = '/mnt/media'
12+
STATIC_ROOT = '/mnt/media/hacktyler_crime'
1313

1414
# Uploads
15-
MEDIA_ROOT = '/mnt/uploads'
15+
MEDIA_ROOT = '/mnt/uploads/hacktyler_crime'
1616

1717
# Caching
1818
CACHES = {

fabfile.py

+8-6
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def setup():
5454
install_requirements()
5555
destroy_database()
5656
create_database()
57-
load_data()
57+
syncdb()
5858
install_server_conf()
5959
collect_static_files()
6060
reload_app();
@@ -64,6 +64,8 @@ def setup_directories():
6464
Create directories necessary for deployment.
6565
"""
6666
run('mkdir -p %(path)s' % env)
67+
sudo('mkdir -p /var/log/sites/%(project_name)s/' % env, user='uwsgi')
68+
sudo('touch /var/log/sites/hacktyler_crime/hacktyler_crime.log', user='uwsgi')
6769

6870
def setup_virtualenv():
6971
"""
@@ -88,14 +90,14 @@ def install_requirements():
8890
"""
8991
Install the required packages using pip.
9092
"""
91-
run('source %(env_path)s/bin/activate; pip install -q -r %(repo_path)s/requirements.txt' % env)
93+
run('source %(env_path)s/bin/activate; pip install -r %(repo_path)s/requirements.txt' % env)
9294

9395
def install_server_conf():
9496
"""
9597
Install the server config file.
9698
"""
97-
sudo('ln -s %(repo_path)s/config/%(settings)s/nginx %(server_config_path)s' % env)
98-
sudo('ln -s %(repo_path)s/config/%(settings)s/uwsgi.conf /etc/init.d/%(project_name)s.conf' % env)
99+
sudo('ln -s %(repo_path)s/config/deployed/nginx %(server_config_path)s' % env)
100+
sudo('ln -s %(repo_path)s/config/deployed/uwsgi.conf /etc/init/%(project_name)s.conf' % env)
99101
sudo('initctl reload-configuration' % env)
100102

101103
"""
@@ -123,7 +125,7 @@ def reload_app():
123125
"""
124126
Restart the uwsgi server.
125127
"""
126-
sudo('service %(project)s restart' % env)
128+
sudo('service %(project_name)s restart' % env)
127129

128130
def update_requirements():
129131
"""
@@ -149,7 +151,7 @@ def create_database():
149151
Creates the user and database for this project.
150152
"""
151153
sudo('echo "CREATE USER %(project_name)s WITH PASSWORD \'%(database_password)s\';" | psql postgres' % env, user='postgres')
152-
sudo('createdb -O %(project_name)s %(project_name)s' % env, user='postgres')
154+
sudo('createdb -T template_postgis -O %(project_name)s %(project_name)s' % env, user='postgres')
153155

154156
def destroy_database():
155157
"""

requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ mock==0.7.2
1111
geopy==0.94.1
1212
git+https://github.com/toastdriven/django-tastypie.git#egg=django-tastypie
1313
BeautifulSoup==3.2.0
14-
pusher==0.5
14+
-e git+https://github.com/onyxfish/pusher_client_python.git#egg=pusher

sirens/static/js/views/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Sirens.views.Index = Backbone.View.extend({
6363

6464
init_socket: function() {
6565
this.pusher = new Pusher("d20fddb74c58823cd05d");
66-
this.channel = this.pusher.subscribe("active-calls");
66+
this.channel = this.pusher.subscribe("presence-active-calls");
6767

6868
this.channel.bind("pusher:subscription_succeeded", _.bind(function(members) {
6969
this.member_count = members.count;

0 commit comments

Comments
 (0)