pythonanywhere搭建过程
来源:互联网 发布:小型组态软件 编辑:程序博客网 时间:2024/05/18 00:37
1.web建立django项目:在framework的时候选择Manual configuration
这里注意 如果是选择的django framework 后面的都会出错
2.使用bash的virtualenv创建项目mkvirtualenv django18
source django18/bin/activate
3.在virtualenv中安装django
pip install django==1.8 /home/yw/.virtualenvs/django18/local/lib/python2.7/site-packages/django
4.创建项目
django-admin startproject TeaGZcd TeaGZpython manage.py startapp TeaBusiness
5.添加virtualenv到pythonanywhere:/home/yw/.virtualenvs/django18
6.修改wsgi文件 删除所有处django之外的东西
取消以下语句的注释:
import osimport syspath = '/home/yw/TeaGZ'if path not in sys.path:sys.path.append(path)os.environ['DJANGO_SETTINGS_MODULE'] = 'TeaGZ.settings'from django.core.wsgi import get_wsgi_applicationapplication = get_wsgi_application()
7.reload
8.pip install mysql-python
9.设置static
path:/home/yw/.virtualenvs/django18/lib/python2.7/site-packages/django/contrib/admin/static/adminurl:/static/admin/path:/home/yw/TeaGZ/staticurl:/static/
10.在pythonanywhere上设置mysql
DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': 'username$TeaBusiness', 'USER':'username', 'PASSWORD':'password', 'HOST':'mysql.server', }}
Git:
建立远程仓库
1.mkdir TeaGZ(django的project名称)2.cd !$(进入TeaGZ)3.git init(在TeaGZ中生成.git文件夹)4.git config --global user.email "your-email"5.git config --global user.name "your-username"pwd:Panda12086.git add TeaGZ(复制TeaGZ文件夹) TeaBusiness(复制TeaBusiness文件夹) manage.py(复制manage.py文件)7.git commit -m "project-initiation-introduction" (提交)8.在github上建立repository,并命名为TeaGZ.git9.git remote add origin https://github.com/username/your-repo.git (远程连接建立)10.git push -u origin master(将提交的文件和文件夹推送到远程TeaGZ.git中)
git clone
<repo URL from GitHub> https://github.com/username/your-repo.gitgit@github.com:username/your-repo.git
create a new repository on the command line:
git initgit add README.mdgit commit -m "first commit"git remote add origin https://github.com/username/your-repo.gitgit push -u origin master
push an existing repository from the command line
git remote add origin https://github.com/username/your-repo.gitgit push -u origin master
在另外一台电脑上获取并更新远程git库:
1.git clone https://github.com/sunshinezzz/TeaGZ.git (获取、复制)2.git config --global user.email "your-email"3.git config --global user.name "your-username"4.git add templates media static----------务必要确保这3个文件夹都不是空的 不然commit的时候会失败 提示你没有任何改动----------5.git commit -m "add routes for static files"6.git push -u origin master
如果其他文件更改后需要git远程更新的可重复步骤4-6
第一次使用git时:
https://help.github.com/articles/generating-ssh-keys/1. ssh-keygen -t rsa -b 4096 -C "email_address" Enter Enter2. ssh-agent -s3. ssh-add ~/.ssh/id_rsa (very important)4. clip < ~/.ssh/id_rsa.pub and paste to the website5. ssh -T git@github.com ->test$ git remote add origin git@github.com:username/learngit.git$ git clone git@github.com:michaelliao/gitskills.gitFor the very first time,before using git push, you have to use git pull first.git remote add origin git@github.com:username/learngit.git5. git add file6. git commit -m "description of this submission"git pull origion mastergit push -u origin mastergit remote -v查看是否名字写错了 如果错了用git remote remove origin 然后再用git remote addpush的文件夹不能为空 否则不会pushgit clone https://username:password@github.com/sunshinezzz/repo_name.git
0 0
- pythonanywhere搭建过程
- pythonanywhere在本地提交代码搭建django+mysql网站
- pythonanywhere+django
- 在pythonanywhere上搭建django程序(Virtualenv+python2.7+django1.7+)
- 【python learing】玩玩pythonanywhere
- pythonanywhere下django无法匹配url问题解决
- pythonAnyWhere 是不能够使用爬虫的
- PythonAnyWhere免费部署python类网站
- NFS文件系统搭建过程
- PHP环境搭建过程
- 搭建智能DNS过程
- NFS搭建过程
- SVN搭建过程
- cvs服务器搭建过程
- LAMP环境搭建过程
- Citrix_XenDesktop 搭建过程
- git服务器搭建过程
- ssh搭建过程
- Oozie配合Hive、Sqoop定时导出Hive表数据至RDB
- SWfit学习2:函数和闭包
- Dapper ORM 用法—Net下无敌的ORM(转)
- iOS网络基础第一篇
- Hibernate学习之一对多关联
- pythonanywhere搭建过程
- 第一周项目1-c/c++中参数传递方式
- 微信公众平台后台接入简明指南
- 知道创宇研发技能列表v3.0
- iOS开发利器-CocoaPods安装和使用教程
- java对redis的基本操作
- 对象解耦和设计模式
- Aspose.words编程指南之DocumentBuilder一
- 软件测试面试题集锦