Integrating Mezzanine to an existing Django Project

603 views
Skip to first unread message

Petar Petrov

unread,
Feb 11, 2016, 11:52:14 PM2/11/16
to Mezzanine Users
By looking at the docs (FAQ more specifically), it seems like it could be added as an app to a current project, even though pretty much nothing has been said. 

So I decided to challenge myself and I spent a good chunk of todays day to make it work and i did get to dashboard, pages, blog and then i realized I can't access the admin which has all the Rich text editing etc. 

So was just curious if it is possible to have both admins work in like a reasonable time without rewriting tons of stuff, or should I drop it as an idea, since there is virtually no guidance online. If you have ideas on how to do it, please share, that would be awesome. 

Thanx!
pp


Ken Bolton

unread,
Feb 12, 2016, 8:20:19 AM2/12/16
to mezzanine-users
Hi Peter,

Try going in the other direction. Create a new Mezzanine project, merge your project into it, then migrate your data.

ken

--
You received this message because you are subscribed to the Google Groups "Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mezzanine-use...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Petar Petrov

unread,
Feb 12, 2016, 10:17:03 AM2/12/16
to Mezzanine Users
Ken,

That sounds like a good idea, but my other project is a lot more complicated with all kinds of apps, settings, customizations etc. But even then mezzanine has it's own admin, while the django project uses the generic admin, we come to the same issue of being able to access both admins

pp

Encolpe Degoute

unread,
Feb 24, 2016, 10:14:59 AM2/24/16
to Mezzanine Users


Hello,

I followed this today to transform my django site into mezzanine site:
http://mezzanine.jupo.org/docs/frequently-asked-questions.html#how-can-i-add-mezzanine-to-an-existing-django-project

No more, no less.
The most painful was to review the url dispatcher.

Regards

Petar Petrov

unread,
Feb 24, 2016, 4:44:35 PM2/24/16
to mezzani...@googlegroups.com
Hmmm, 

That info was not enough for me i needed more guidance. Did you make it work with both admins - original Django admin and the CMS admin? If so, how? 
Can you share your urls dispatcher to see how you have done it?

If I make it work I will write a long detailed tutorial for everybody. 

pp



--
You received this message because you are subscribed to a topic in the Google Groups "Mezzanine Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mezzanine-users/GINVTKyBMEg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mezzanine-use...@googlegroups.com.

Ryne Everett

unread,
Feb 24, 2016, 4:50:44 PM2/24/16
to Mezzanine Users
Did you make it work with both admins - original Django admin and the CMS admin? If so, how? 

AFAIK, nobody does this. 

--
You received this message because you are subscribed to the Google Groups "Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mezzanine-use...@googlegroups.com.

Stephen McDonald

unread,
Feb 24, 2016, 4:52:15 PM2/24/16
to Mezzanine Users

Yeah, please don't.

Petar Petrov

unread,
Feb 24, 2016, 5:04:02 PM2/24/16
to mezzani...@googlegroups.com
Well, that's what stackoverflow is, right?

If he did
- i will make my project
- all people here will have easier time making it
- i will write a tutorial that helps everybody around the world trying it out. maybe even someone might fork it or make it easier to happen.

So i don't see a reason why not. every private detail can be changed not to reflect his real site. 

my2c

Stephen McDonald

unread,
Feb 24, 2016, 5:56:06 PM2/24/16
to Mezzanine Users
Sorry, I guess it wasn't clearly spelled out - there's no good reason at all to try and have two admin sites running. You'd intentionally be working *against* one of the best features Mezzanine has over other Django based CMSes, in that the Mezzanine admin *is* the Django admin, just with a different look to it. All your admin functionality that you supposedly want to put in the "Django" admin should Just Work in the "Mezzanine" admin.

Again, they're the same thing. Providing two admin interfaces to your administrators does them a disservice, and Mezzanine very intentionally aims to help you not have to do that. 

Hope that makes it clear for you. 


Stephen McDonald
http://jupo.org

Petar Petrov

unread,
Feb 24, 2016, 6:05:58 PM2/24/16
to mezzani...@googlegroups.com
Stephen, 

Well, the reason is that I already have models and custom things on my site that I would like to keep - databases of people, newsletter code generation, custom modules, etc. things that are not "pages"/"blog posts" so accordingly they are managed through the regular Django admin. Correct me if I am wrong, but the Mezzanine CMS is only for the content it provides. 

pp


Stephen McDonald

unread,
Feb 24, 2016, 6:14:22 PM2/24/16
to Mezzanine Users
Yes you're wrong.

Petar Petrov

unread,
Feb 24, 2016, 6:20:36 PM2/24/16
to mezzani...@googlegroups.com
So you are saying that all models hooked to work with Django models can appear in Mezzanine admin and be managed from there? How can we do that?

Ken Bolton

unread,
Feb 24, 2016, 6:23:15 PM2/24/16
to mezzanine-users
Hi Petar,

What have you tried?

In my experience, "all models hooked to work with Django models" do "appear in Mezzanine admin".

-ken

Petar Petrov

unread,
Feb 24, 2016, 6:35:16 PM2/24/16
to mezzani...@googlegroups.com
Ken, 

I have made the following steps:
1. Install mezzanine
2. generate an app called "bloga"
3. copied all settings from there to my general settings
4. i now have my website and the visitor blog part (minus some url and template issues i should be able to fix)
5. if i go to /admin i get to regular django admin actually, not the mezzanine admin:
my urls contains:
from bloga.bloga.urls import *
# here my normal urls including url(r'^admin/', include(admin.site.urls)), # which if i remove gives me errors
urlpatterns += blog_urls # which contains the generated mezzanine app url file. 

pp

Ken Bolton

unread,
Feb 24, 2016, 6:51:16 PM2/24/16
to mezzanine-users
Have you managed to deploy a vanilla Mezzanine site? Knowing the expected behavior will be crucial as you move toward customizing Mezzanine.

Ryne Everett

unread,
Feb 24, 2016, 6:53:58 PM2/24/16
to Mezzanine Users
Did you include mezzanine.urls?

Petar Petrov

unread,
Feb 24, 2016, 8:12:22 PM2/24/16
to mezzani...@googlegroups.com
@Ken: no, i hadn't. but i did now, and i see what you mean. So the question now is why do i see my regular Django admin, instead of the mezzanine one. 

@Ryne: I included the /bloga/urls.py file which is the application i created through "mezzanine-project bloga". Should i be including anything else?

FYI I was following this semi guide:

pp

Ryne Everett

unread,
Feb 24, 2016, 8:14:40 PM2/24/16
to Mezzanine Users
Look in the vanilla site you just created. You need a line like `url("^", include("mezzanine.urls")),`.

Ken Bolton

unread,
Feb 24, 2016, 8:17:12 PM2/24/16
to mezzanine-users
Alternatively, create/copy your bloga app into your vanilla project, add 'bloga' to INSTALLED_APPS, bloga.urls to urls.py, and you should be good.

Petar Petrov

unread,
Feb 24, 2016, 8:41:11 PM2/24/16
to mezzani...@googlegroups.com
@Ryne: i have the following files:
DjangoProject/urls.py
and it icludes the 
so the mezzanine urls are included. Yet when i go to /admin I still get Django Admin instead of mezzanine. I comment out the url(r'^admin/', include(admin.site.urls)), line, mezzanine starts throwing erros, so I am guessing that should be kept. 

@Ken: The issue is that I have a bigger project and i just want to add blog functionality, rather than starting from scratch as you propose. 


Ken Bolton

unread,
Feb 24, 2016, 8:47:30 PM2/24/16
to mezzanine-users
My way is very little work for the same result. You are welcome to try the other way, which involves merging the settings and urls from your new mezzanine project into your old project.

Petar Petrov

unread,
Feb 24, 2016, 8:52:46 PM2/24/16
to mezzani...@googlegroups.com
@Ken I will try what you are saying on a different branch and the problems I will encounter will go to a different thread. Right now I am so close to making this work and I just want to make this admin work. 


pp
Reply all
Reply to author
Forward
0 new messages