Skip to content

Commit

Permalink
166409937-task(heroku): Host app on heroku
Browse files Browse the repository at this point in the history
- Add Procfile

[Start #166409937]
  • Loading branch information
misocho committed Jun 3, 2019
1 parent 701729b commit 51010ee
Show file tree
Hide file tree
Showing 4 changed files with 117 additions and 31 deletions.
2 changes: 2 additions & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
web: gunicorn wger.wsgi
worker: python setup.py build
90 changes: 60 additions & 30 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,30 +1,60 @@
#
# Requirements for wger for production
#

Django
django-recaptcha
reportlab
django_mobile
django-formtools
bleach
python-mimeparse
pillow
easy-thumbnails
django_compressor
icalendar
django-bootstrap-breadcrumbs
sphinx
django-sortedm2m
django-bower
invoke
requests

# REST API
djangorestframework
django-filter
django-tastypie
django-cors-headers

# Python3 compatibility
six
alabaster==0.7.12
autopep8==1.4.4
Babel==2.7.0
bleach==3.1.0
captcha==0.3
certifi==2019.3.9
chardet==3.0.4
coverage==4.5.3
Django==2.2.1
django-appconf==1.0.3
django-bootstrap-breadcrumbs==0.9.1
django-bower==5.2.0
django-compressor==2.2
django-cors-headers==3.0.2
django-debug-toolbar==1.11
django-filter==2.1.0
django-formtools==2.1
django-mobile==0.7.0
django-recaptcha==2.0.4
django-sortedm2m==1.5.0
django-tastypie==0.14.2
djangorestframework==3.9.4
docutils==0.14
easy-thumbnails==2.6
entrypoints==0.3
flake8==3.7.7
gunicorn==19.9.0
icalendar==4.0.3
idna==2.8
imagesize==1.1.0
invoke==1.2.0
Jinja2==2.10.1
MarkupSafe==1.1.1
mccabe==0.6.1
packaging==19.0
pep8==1.7.1
Pillow==6.0.0
pycodestyle==2.5.0
pyflakes==2.1.1
Pygments==2.4.2
pyparsing==2.4.0
python-dateutil==2.8.0
python-mimeparse==1.6.0
pytz==2019.1
rcssmin==1.0.6
reportlab==3.5.21
requests==2.22.0
rjsmin==1.0.12
six==1.12.0
snowballstemmer==1.2.1
Sphinx==2.0.1
sphinxcontrib-applehelp==1.0.1
sphinxcontrib-devhelp==1.0.1
sphinxcontrib-htmlhelp==1.0.2
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.2
sphinxcontrib-serializinghtml==1.1.3
sqlparse==0.3.0
urllib3==1.25.3
webencodings==0.5.1
7 changes: 7 additions & 0 deletions script.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import subprocess
import os

rootdir = os.path.abspath(os.path.dirname(__file__))
settingsfile = os.path.join(rootdir, 'wger', 'settings.py')
print('Settings file =========>', settingsfile)
subprocess.run("invoke create-settings --settings-path {}".format(settingsfile), shell=True)
49 changes: 48 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,14 @@
:license: GNU GPL, see LICENSE for more details.
"""

import os
import setuptools.command.build_py
import distutils
import subprocess
from setuptools import (
setup,
find_packages
find_packages,
Command
)
from wger import get_version

Expand All @@ -20,6 +25,46 @@
with open('requirements.txt') as requirements_production:
install_requires = requirements_production.readlines()

rootdir = os.path.abspath(os.path.dirname(__file__))
settingsfile = os.path.join(rootdir, 'wger', 'settings.py')
print('Settings file =========>', settingsfile)


class CreateSettings(Command):
""" A custom command to run create settings """
user_options = [
('settings_file', None, 'path to settings file')
]

def initialize_options(self):
""" Set default values for options """
self.settings_file = ''

def finalize_options(self):
""" Post-process options """
if self.settings_file:
assert os.path.exists(self.settings_file), (
'Settings file %s does not exist.' % self.settings_file
)

def run(self):
""" Run command """
command = "invoke create-settings --settings-path {}".format(settingsfile)
print("Path ====>", os.path.abspath(__file__))
self.announce(
'Running command: %s' % str(command),
level=distutils.log.INFO)
subprocess.run(command, shell=True)


class BuildPyCommand(setuptools.command.build_py.build_py):
""" Custom build command """

def run(self):
self.run_command('create_settings')
setuptools.command.build_py.build_py.run(self)


setup(
name='wger',
description='FLOSS workout, fitness and weight manager/tracker written with Django',
Expand Down Expand Up @@ -51,4 +96,6 @@
'wger = wger.__main__:main',
],
},
cmdclass={'create_settings': CreateSettings,
'build_py': BuildPyCommand, }
)

0 comments on commit 51010ee

Please sign in to comment.