llazzaro / django-scheduler

A calendaring app for Django.
BSD 3-Clause "New" or "Revised" License
1.29k stars 391 forks source link

DjangoCMS #302

Open DanielTate opened 7 years ago

DanielTate commented 7 years ago

Is this app compatible with django cms? if so how do I do about integrating it correctly.

munsy commented 7 years ago

I'm a novice so take this with a grain of salt. I've had mild amounts of success getting it to integrate with django cms. So far I've just been able to create a calendar, add an event to it, add a relation to it, etc. All being done through the admin panel.

As far as actually viewing a calendar though? No luck so far. I'm sort of just playing with it with the hopes that intuition from the example project will guide the way. I'm gonna keep messing with it and I'll report back if/when I get it working. At this point though I don't really see why it wouldn't be compatible with django-cms.

FlorinTar commented 6 years ago

I'm no expert either, but try following this Django CMS tutorial.

aubricus commented 6 years ago

Just my 2c:

If you can expose the urls through an app hook you should be able to attach this to a DjangoCMS page no problem.

UPDATE: Url reversing fails when attempting to attach this to a djangocms apphook (Possibly this is due to a combination of how Djangocms namespaces apphook urls and the fact that urls are not namespaced in this app).

The below solution did work; however.

That said you're free to import the urls as normal, if they are higher in the chain than the dynamic DjangoCMS urls. Just avoid creating any DjangoCMS app that expects to consume a url identical to this app's urls.

Example:


# My main urls.py 

urlpatterns = [
    # schedule urls
    url(r'^calendar/', include("schedule.urls")),
    # djangocms urls
    url(r"^", include("cms.urls")),
]
woodz- commented 5 years ago

@aubricus: this is not a truly integration. Check your url (sample)

then navigate to a detail from within the main view. Will the url then still point to djangocms-site/en/appointment/...? I guess no.

If you intend to integrate via application hooks, then check this statement of the djangocms doc. Urls of integrated applications shall not occur in urls.py.

A better approach would be to fork, make those urls namespaced, test the changes, then file a pull request against this repo. If you like reusable applications then follow the guidelines of django programming namespaces.

The expression "calendar" is such a common one. It highly endangers collisions between multiple reused applications in one project if not namespaced. And of course it isn't djangocms compatible. Djangocms docs make no clear statement of how to deal with external applications being not namespaced. Find a discussion here.