简体   繁体   English

如何在 Django 中设置站点框架

[英]how to setup sites framework in django

I am trying to setup multiple sites from a single project in django.我正在尝试从 django 中的单个项目设置多个站点。 I was trying to set this up following https://docs.djangoproject.com/en/1.8/ref/contrib/sites/ but there is no mention of setup only how to use the sites framework once implemented.我试图按照https://docs.djangoproject.com/en/1.8/ref/contrib/sites/进行设置,但没有提到设置只如何在实施后使用站点框架。

I have implmented sites before and I added sites to my installed apps like this:我之前已经实现了网站,并将网站添加到我安装的应用程序中,如下所示:

INSTALLED_APPS = (
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.messages',
    'django.contrib.staticfiles',

)

I tried to issue the command: python manage.py makemigrations but it says:我试图发出命令:python manage.py makemigrations 但它说:

No Changes detected未检测到更改

I'm using django 1.8 , does the sites framework setup still create a table called django_site ?我正在使用 django 1.8,站点框架设置是否仍然创建一个名为 django_site 的表?

How do I do the initial setup to have this table created?如何进行初始设置以创建此表?

我想我只需要迁移而不是像这样进行迁移:

python manage.py migrate

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM