-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
97 lines (72 loc) · 2.74 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
To deploy this app on Heroku, do the following:
Install Heroku Toolbelt: https://toolbelt.herokuapp.com/
$ virtualenv cloudapp --distribute --no-site-packages
$ cd cloudapp
$ . bin/activate
$ git clone git://github.com/ptahproject/heroku-ptah.git
$ cd heroku-ptah
$ heroku create --stack cedar
$ heroku addons:add shared-database
$ git push heroku master
$ heroku ps:scale web=1
$ heroku open
To deploy this app on dotcloud, do the following:
$ virtualenv cloudapp --distribute --no-site-packages
$ cd cloudapp
$ . bin/activate
$ pip install dotcloud
$ git clone git://github.com/ptahproject/heroku-ptah.git
$ cd heroku-ptah
$ dotcloud create ptah
$ dotcloud push --all ptah
The directory structure will look like:
./
./cloudapp
./bin
./src
./lib
./heroku-ptah
./setup.py
./settings.ini
./herokuapp
./__init__.py
./ ...
./Procfile
./runapp.py
./run
./ ...
./dotcloud.yml
./builder
./wsgi.py
./ ...
Heroku files are: Profile, runapp.py, and run
dotcloud files are: dotcloud.yml, builder, wsgi.py
Ideally, you would have forked the repository first, and so checked out a
writable clone in step five instead of a read-only copy.
To run this code locally, do the following in cloudapp/heroku-ptah:
$ pip install -r localrequirements.txt
$ python setup.py develop
$ ../cloudapp/bin/pserve settings.ini --reload
Changes made to this skeleton from the default ptah_starter:
Heroku::
1. Procfile added to tell Heroku what to run upon deployment to start the web
service.
2. A 'run' bash script that causes Heroku to develop then run the app.
3. runapp.py that actually runs the app using waitress.
4. requirements.txt informs Heroku what the dependencies are. Dependencies
added from the stock ptah_starter are waitress and psycopg2. These haven't
been added to localrequirements.txt.
5. Heroku doesn't support SQLite, so a small change was required to get Ptah
to use the shared postgres db that Heroku provisions. Heroku exposes the DB
connection string as the environment variable DATABASE_URL (if the database
is a shared database, it is also available as SHARED_DATABASE_URL). app.py
has been modified to use this environment variable (if present) to override
the sqlalchemy.url parameter from settings.ini before the settings are
applied.
dotcloud::
1. dotcloud.yml added to tell dotcloud what environment should be setup for the
project. As well as how to start the web server.
2. builder script which installs requirements and run herokuapp setup.py develop
3. wsgi.py The python module which starts the WSGI server
4. dotcloud *does* support SQLite so postgresql is not necessary. although each
time you deploy you will lose your data.