栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

使用openshift部署本地Django应用

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

使用openshift部署本地Django应用

1)  Step 1 install  RubygemsUbuntu - https://rubygems.org/pages/downloadWindows - https://forwardhq.com/support/installing-ruby-windows$ gemorC:WindowsSystem32>gemRubyGems is a sophisticated package manager for Ruby.  This is abasic help message containing pointers to more information……..2)  Step 2:$ gem install rhcOrC:WindowsSystem32> gem install rhc3)  $ rhcOrC:WindowsSystem32> rhcUsage: rhc [--help] [--version] [--debug] <command> [<args>]Command line interface for OpenShift.4)  $ rhc app create -a mysite -t python-2.7Or C:WindowsSystem32>  rhc app create -a mysite -t python-2.7# Here mysite would be the sitename of your choice#It will ask you to enter your openshift account id and passwordLogin to openshift.redhat.com: Enter your openshift id herePassword : **********Application Options---------------------Domain:    mytutorialsCartridges: python-2.7Gear Size:  DefaultScaling:    no............Your application 'mysite' is now available. URL : http://mysite..................... SSH to :  39394949...................... Git remote: ssh://......................Run 'rhc show-app mysite' for more details about your app.5)  Clone your site$ rhc git-clone mysiteOrD:> rhc git-clone mysite.......................Your application Git repository has been cloned to "D:mysite"6)  #”D:mysite>” is the location we cloned.D:mysite> git remote add upstream -m master git://github.com/rancavil/django-openshift-quickstart.gitD:mysite> git pull -s recursive -X theirs upstream master7)  D:mysite> git pushremote : ................remote: Django application credentials    user: admin    xertefkefktremote: Git Post-Receive Result: success.............8)  D:mysite>virtualenv venv --no-site-packagesD:mysite>venvscriptsactivate.bat<venv> D:mysite> python setup.py installcreating .....Searching for Django<=1.6.............Finished processing dependencies for mysite==1.09)  Change admin password<venv> D:mysitewsgiopenshift> python manage.py changepassword adminpassword:...Password changed successfully for user 'admin'<venv> D:mysitewsgiopenshift> python manage.py runserverValidating models….10) Git add<venv> D:mysite> git add.<venv> D:mysite> git commit -am"activating the app on Django / Openshift"   .......<venv> D:mysite> git push#----------------------------------------------------------------------------------#-----------Edit your setup.py in mysite with packages you want to install----------from setuptools import setupimport os# Put here required packagespackages = ['Django<=1.6',  'lxml', 'beautifulsoup4', 'openpyxl']if 'REDISCLOUD_URL' in os.environ and 'REDISCLOUD_PORT' in os.environ and 'REDISCLOUD_PASSWORD' in os.environ:     packages.append('django-redis-cache')     packages.append('hiredis')setup(name='mysite',      version='1.0',      description='OpenShift App',      author='Tanveer Alam',      author_email='xyz@gmail.com',      url='https://pypi.python.org/pypi',      install_requires=packages,)


转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/400464.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号