问题
I need to integrate Django-CMS 3.x into an existing project (mypjc
hereafter). I already checked this question (and other similar) but they point to a tutorial page that is no longer available.
I'm a bit confused by the tons of infos you can find online and I have not really understood if Django-CMS can be integrated as an app into an existing and independently running Django project.
mypjc
(using Django 1.8) would benefit from a user friendly CMS. Basically I'd the user to be able to write texts and to load in their posts images stored in the (common) database, images that are created by the user in mypjc
.
Is it possible? if yes, could anyone help me defying the steps needed to make the integration clean and successful?
Thank you in advance for any help you could provide.
回答1:
With Django CMS, it is indeed possible to integrate it into an existing project.
If you already have an existing project with URL/menu management, then you can simply integrate just the per-page CMS, which can be added as additional field to your model:
from django.db import models
from cms.models.fields import PlaceholderField
class MyModel(models.Model):
# your fields
my_placeholder = PlaceholderField('placeholder_name')
# your methods
You can find more information here.
For any existing projects, you are likely to need to use the manual installation process outlined here.
来源:https://stackoverflow.com/questions/40022161/how-to-integrate-django-cms-into-an-existing-project