现在,任何url只是提出了一个项目默认页面(“欢迎来到Django”)。
无论我放什么(example.com,example.com/hello,example.com/asdfjkasdf( &$(#$ $#))
我是新来的Django,并遵循一个简单的教程。
我的Nginx.conf有这个:
在没有ROOT权限的Linux上安装OpenCL(AMD SDK工具包)
你如何在Windows上安装PyCairo(开罗for Python)?
cmake“make install”到远程机器?
location / { # host and port to fastcgi server fastcgi_pass 127.0.0.1:8801; fastcgi_param PATH_INFO $fastcgi_script_name; fastcgi_param REQUEST_METHOD $request_method; fastcgi_param QUERY_STRING $query_string; fastcgi_param SERVER_NAME $server_name; fastcgi_param SERVER_PORT $server_port; fastcgi_param SERVER_PROTOCOL $server_protocol; fastcgi_param CONTENT_TYPE $content_type; fastcgi_param CONTENT_LENGTH $content_length; fastcgi_pass_header Authorization; fastcgi_intercept_errors off; }
我的views.py有这样的:
from django.http import HttpResponse def hello(request): return HttpResponse("Hello world")
而我的urls.py有这样的:
from django.conf.urls.defaults import * from firstsite.views import hello # Uncomment the next two lines to enable the admin: # from django.contrib import admin # admin.autodiscover() urlpatterns = patterns('',('^hello/$',hello),# Example: # (r'^firstsite/',include('firstsite.foo.urls')),# Uncomment the admin/doc line below and add 'django.contrib.admindocs' # to INSTALLED_APPS 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)),)
我需要重新启动fcgi实例,每次更改(我不这么认为)。 我一直在使用: python manage.py runfcgi method="thread" host=127.0.0.1 port=8080
所以是的,我怎样才能让url工作? 有没有一种方法可以使用django进行debugging? 例如,可能打印出接收到的数据以确保Nginx运行正常?
在Linux上自动化Inline :: Java安装(Centos / Redhat)
Bash脚本 – 确定供应商并安装系统(apt-get,yum等)
像Python中的脚本一样的安装向导
如何在构buildgcc-4.8.2时理解这些可怕的错误?
Google Cloud SDK安装程序在Windows 7上失败(gcloud crashed(UnicodeDecodeError))
不要试图用FastCGI设置Django。 按照实际的教程 ,并使用内置的开发服务器。 一旦掌握了基本框架的工作方式,就可以理解如何部署它。
而为什么你会说你不会觉得你必须重新启动与每个变化的实例? 这正是你需要做的 。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。