-
Notifications
You must be signed in to change notification settings - Fork 527
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix bug 1407532: Fix "Deploy to Heroku" button (#735)
* Update version of buildpack for git submodules * Add SITE_URL setting to app.json and mark as required * Remove code responsible for automatic discovery of SITE_URL after a deploy on Heroku * Add runtime.txt and set python2 as the default for python buildpack
- Loading branch information
Showing
8 changed files
with
35 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import os | ||
|
||
from urlparse import urlparse, urljoin | ||
|
||
from django.core.management.base import BaseCommand | ||
from django.contrib.sites.models import Site | ||
|
||
from pontoon.base.models import Project, User | ||
|
||
|
||
class Command(BaseCommand): | ||
help = 'Setup an instance of Pontoon deployed via Heroku Deploy.' | ||
|
||
def handle(self, *args, **options): | ||
site_url = os.environ.get('SITE_URL') | ||
app_host = urlparse(site_url).netloc | ||
admin_email = os.environ.get('ADMIN_EMAIL') | ||
admin_password = os.environ.get('ADMIN_PASSWORD') | ||
|
||
User.objects.create_superuser(admin_email, admin_email, admin_password) | ||
Site.objects.filter(pk=1).update(name=app_host, domain=app_host) | ||
|
||
Project.objects.filter(slug='pontoon-intro').update( | ||
url=urljoin(site_url, 'intro/') | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
python-2.7.14 |