## 解决方案

### Enabling the sites framework

To enable the sites framework, follow these steps:

### Define a SITE_ID setting:

SITE_ID = 1

### Run migrate.

django.contrib.sites registers a post_migrate signal handler which creates a default site named example.com with the domain example.com. This site will also be created after Django creates the test database. To set the correct name and domain for your project, you can use a data migration.

In order to serve different sites in production, you’d create a separate settings file with each SITE_ID (perhaps importing from a common settings file to avoid duplicating shared settings) and then specify the appropriate DJANGO_SETTINGS_MODULE for each site.

## 参考项目

https://github.com/flyhigher139/mayblog