开发者

HOw can i use subdomain with django and mod_wsgi

开发者 https://www.devze.com 2023-03-20 19:12 出处:网络
I have my main site atwww开发者_C百科.example.com I want to run sites like site1.example.com I tried this

I have my main site at www开发者_C百科.example.com

I want to run sites like site1.example.com

I tried this

<VirtualHost ip:80>
DocumentRoot /home/user/django/app
ServerAlias site1.example.com

I have also added record to /etc/hosts but its not working.

i am able to ping site1.example.com from server but not from outside


i am able to ping site1.example.com from server but not from outside

This is not a Django problem. ping is a low-level IP protocol (ICMP) that is handled well down from the HTTP server (application) level.

Adding something to /etc/hosts only affects the machine that /etc/hosts is on.

You should get subdomains working with static web pages (e.g. "Hello World") first, leaving Django out of it. Then read up on django.contrib.sites and go from there.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号