@@ -54,7 +54,7 @@ def setup():
54
54
install_requirements ()
55
55
destroy_database ()
56
56
create_database ()
57
- load_data ()
57
+ syncdb ()
58
58
install_server_conf ()
59
59
collect_static_files ()
60
60
reload_app ();
@@ -64,6 +64,8 @@ def setup_directories():
64
64
Create directories necessary for deployment.
65
65
"""
66
66
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' )
67
69
68
70
def setup_virtualenv ():
69
71
"""
@@ -88,14 +90,14 @@ def install_requirements():
88
90
"""
89
91
Install the required packages using pip.
90
92
"""
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 )
92
94
93
95
def install_server_conf ():
94
96
"""
95
97
Install the server config file.
96
98
"""
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 )
99
101
sudo ('initctl reload-configuration' % env )
100
102
101
103
"""
@@ -123,7 +125,7 @@ def reload_app():
123
125
"""
124
126
Restart the uwsgi server.
125
127
"""
126
- sudo ('service %(project )s restart' % env )
128
+ sudo ('service %(project_name )s restart' % env )
127
129
128
130
def update_requirements ():
129
131
"""
@@ -149,7 +151,7 @@ def create_database():
149
151
Creates the user and database for this project.
150
152
"""
151
153
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' )
153
155
154
156
def destroy_database ():
155
157
"""
0 commit comments