在sae配置django项目
1:使用sae开发必须有sae帐号,自己注册吧;
2:在sae上新建立一个python项目;
3:建立完成之后新建一个版本,即版本1;
4:获取svn的地址在eclipse中check下来;
5:注意check过程中本地建立的项目名称要和sae中建立的应用名称相同;
6:注意在建立本地的django项目时不用勾选生成src目录;
7:check完成之后建立views.py文件并且编写:
from django.http import HttpResponse
def hello(request):
return HttpResponse("Hello, world! - Django")
8:配置config.yaml文件
libraries:
- name: "django"
version: "1.4"
9:创建文件index.wsgi,内容如下
import sys
import os.path
# manage.py is automatically created in each Django project. manage.py is a thin
# wrapper around django-admin.py that takes care of two things for you before
# delegating to django-admin.py:
#
# It puts your project's package on sys.path.
# It sets the DJANGO_SETTINGS_MODULE environment variable so that it points to
# your project's settings.py file.
#
# ref: https://docs.djangoproject.com/en/1.4/ref/django-admin/
os.environ['DJANGO_SETTINGS_MODULE'] = 'theonlyyou.settings'
sys.path.append(os.path.join(os.path.dirname(__file__), 'theonlyyou'))
import sae
import django.core.handlers.wsgi
application = sae.create_wsgi_app(django.core.handlers.wsgi.WSGIHandler())
10:Add “django.contrib.admin” to your INSTALLED_APPS setting.在setttings.py文件中打开注释即可;
11:编写urls.py文件
from django.conf.urls.defaults import *
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Example:
# (r'^mysite/', include('mysite.foo.urls')),
(r'^$', 'theonlyyou.views.hello'),
(r'^demo/$', 'theonlyyou.demo.views.showdemo'),
# Uncomment the admin/doc line below to enable admin documentation:
# (r'^admin/doc/', include('django.contrib.admindocs.urls')),
# Uncomment the next line to enable the admin:
(r'^admin/', include(admin.site.urls)),
)
12:最后完成的项目目录如下图:
13:完成后提交代码
14:访问应用地址,显示结果:Hello, world! - Django
在sae配置django项目的更多相关文章
- centos7 apache httpd安装和配置django项目
一.安装httpd服务 apache在centos7中是Apache HTTP server.如下对httpd的解释就是Apache HTTP Server.所以想安装apache其实是要安装http ...
- 配置django项目总结
1.在django项目应用文件夹中的models.py文件中导入(1)from django.db import models(2)建立需要的映射的类名和属性类型也就是数据库中的表名和字段名 2.在s ...
- 在linux上配置Django项目
依赖包 [root@web01 ~]# yum install openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel sqli ...
- ubuntu 下配置django 项目能够被局域网下的其他电脑访问
在项目下的路径下下运行 python manage.py runserver 后面的端口换成其他可用的端口也可以 如何让外网也能访问呢,有待更新
- Django项目基础配置和基本使用
博文配置内容包括: django项目的创建 django项目下应用的创建及配置 数据库的配置 templates模板的配置 命令行创建项目: 在需要的目录下创建Django项目输入命令:django- ...
- Django项目在linux系统中虚拟环境部署
1.在linux系统下,安装virtualenv 命令:pip install virtualenv 2.项目部署前的准备 1. Django web project deployment 1.1. ...
- Django项目部署(django+guncorn+virtualenv+nginx)
一.说明 为了django项目部署到生产环境上,能够稳定的运行,且能够同时指出http和https的访问,对django的部署进行了一些研究,决定采用django + gunicorn + virtu ...
- 在windows上用apache+mod_wsgi服务部署django项目
之前一直在本地跑django项目,最近尝试在服务器上部署项目,目前已经成功部署,也花了好多时间,这里跟大家交流一下,希望对像我一样的新手有帮助. 一.配置环境: 1.Python版本3.7 2.服务器 ...
- Django项目中添加富文本编辑器django-ckeditor
django-ckeditor库的使用步骤: 1.在命令行下安装django-ckeditor这个库: 命令:pip install django-ckeditor 2.安装成功后,配置Django项 ...
随机推荐
- Welcome to Apache™ Hadoop®!
What Is Apache Hadoop? Getting Started Download Hadoop Who Uses Hadoop? News 15 October, 2013: relea ...
- Hibernate Validation各注解的用法
Bean Validation 中内置的 constraint @Null 被注释的元素必须为 null @NotNull 被注释的元素必须不为 null @AssertTrue 被注释的元素必须为 ...
- SpringMvc之@RequestParam详解
@RequestParam是传递参数的. @RequestParam用于将请求参数区数据映射到功能处理方法的参数上. public String queryUserName(@RequestParam ...
- 毕业设计 ASP.Net+EasyUI开发 X X露天矿调度管理信息系统(二)
这是本毕业设计的雏形和框架,实现的功能在左侧的功能框导航菜单内. 做的太烂,还是把学校名字给马赛克掉吧....省的挨校友批 登陆界面.. <cookie +ispostback实现记住我功能& ...
- iOS基础框架的搭建 / 及国际化操作
1.基础框架的搭建 1.1 pod引入常用的第三方类库 1.2 创建基础文件夹结构/目录结构 Resource———存放声音/图片/xib/storyboard 等资源文件 Define——宏定义, ...
- c++回调实现
回调是A将一个函数指针传给B,然后调用B,B在执行自身函数后,再在合适的时候执行A的这个函数指针,这样就能避免A和B的相互包含和链接,在大型项目中回调是一种打破循环依赖的常用技术. typedef v ...
- memcache运维整理
memcache运维总结 第一部分:memcache安装 1.安装libevent 2.安装memcache 3.安装php的memcache扩展 4.测试 第二部分:memcache客户端操作 1. ...
- Cracking the coding interview--Q1.1
原文: Implement an algorithm to determine if a string has all unique characters. What if you can not u ...
- PCIE体系结构
http://blog.sina.com.cn/s/articlelist_1685243084_3_1.html BAR寄存器 http://zhidao.baidu.com/link?url=rE ...
- Java Json开源解析包 google-gson download(下载)
官方下载地址:http://code.google.com/p/google-gson/ http://files.cnblogs.com/hnrainll/google-gson-2.1-relea ...