【问题标题】:django hosting error , about alwaysdata.comdjango托管错误,关于alwaysdata.com
【发布时间】:2011-05-26 08:52:58
【问题描述】:

这是我的 alwaysdata 页面 - http://zjm.alwaysdata.net/:

没有配置成功,但是当我访问http://zjm.alwaysdata.net/mysite/public/

它显示了我的主页:

那么我该怎么做才能在http://zjm.alwaysdata.net/ 上显示我的主页

谢谢

更新

这是我的django.fcgi

#!/usr/bin/python
import os, sys

_PROJECT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.insert(0, _PROJECT_DIR)
sys.path.insert(0, os.path.dirname(_PROJECT_DIR))

_PROJECT_NAME = _PROJECT_DIR.split('/')[-1]
os.environ['DJANGO_SETTINGS_MODULE'] = "%s.settings" % _PROJECT_NAME

from django.core.servers.fastcgi import runfastcgi
runfastcgi(method="threaded", daemonize="false")

.htaccess

AddHandler fcgid-script .fcgi
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ django.fcgi/$1 [QSA,L]

这是我的 urls.py:

from django.conf.urls.defaults import *

# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()
from views import *

urlpatterns = patterns('',
    # Example:
    #(r'^$', homepage),
    # (r'^mysite/', include('mysite.foo.urls')),

    # 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)),
)

【问题讨论】:

  • 你按照我在这里的建议做了吗:stackoverflow.com/questions/4435406/…
  • 嗨@luc,如何将我的子域指向正确的目录?看看更新的,这是我的文件。
  • 你的 urls.py 文件的内容是什么?
  • @Seitaridis,看看更新的。
  • 您的第一页在哪里?

标签: python django hosting fastcgi


【解决方案1】:

您应该将您的域 (zjm.alwaysdata.net) 配置为指向服务器上的 /public 目录:/home/zjm/www/mysite/public/

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2010-12-29
    • 2022-12-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多