I don't think there's an example around --
You only need to add 'feincms' and 'elephantblog' to INSTALLED_APPS,
and add the elephantblog URLs to your URLconf somewhere. Of course you
also have to create a RichTextContent and a MediaFileContent for the
entry (currently both are required, this will change in the future
when I get around to fixing elephantblog/utils.py):
from feincms.content.richtext.models import RichTextContent
from feincms.content.medialibrary.v2 import MediaFileContent
from elephantblog.models import Entry
Entry.create_content_type(RichTextContent)
Entry.create_content_type(MediaFileContent, TYPE_CHOICES=(
('default', 'default'),
))
Hope it helps,
Matthias
First, thanks for your patience and sorry for not getting back to you earlier.
You shouldn't have to edit any code inside FeinCMS or Elephantblog. Do
you have an app which is specific to the website you are working on?
You should put those statements into the models.py file of your
site-specific app.
If there is no such app yet, add a models.py file containing those
lines of code in the same folder as your settings.py file, and add the
folder containing those files to your INSTALLED_APPS.
The models.py files of all apps are loaded first by Django on server
startup -- in principle those statements could go anywhere, putting
them into a models.py file ensures that these statements are executed
"early enough" (whatever that means).
Hope it helps,
Matthias
That's great. It's absolutely correct that the 'mysitename' app isn't
a classical Django app. It's just that there is no other way of
ensuring that those statements (create_content_type etc.) are executed
early enough during Django startup if you put them somewhere else.
> I uncommented out the 'feincms' and 'elephantblog' from Installed_apps
> and ran my home page:
>
> -------------------------------------
> ImproperlyConfigured at /
>
> You need to register at least one template or one region on Entry.
>
> Exception location is at /home/myname/public_html/mysitename/feincms/
> models.py in _needs_templates, line 765
> ---------------------------------
>
> I think I may not have put those 'Entry' statements in the right
> place. I tried jumbling up the order of the Installed_Apps entries to
> no avail. Here are the additions I made to Installed_Apps:
No, my fault. Another piece was missing in the instructions I sent on
April 16. You have to add an Entry.register_regions call too, so that
it looks like this in the end:
from feincms.content.richtext.models import RichTextContent
from feincms.content.medialibrary.v2 import MediaFileContent
from elephantblog.models import Entry
Entry.register_regions(('main', 'Main'),) # That is the new line
Entry.create_content_type(RichTextContent)
Entry.create_content_type(MediaFileContent, TYPE_CHOICES=(
('default', 'default'),
))
Best regards,
Matthias
This field is normally filled in by javascript (contained in item_editor.js)
Did you check that the item editor javascript files are loaded
correctly and that you do not get any javascript errors in the
administration interface?
Regards,
Matthia
You have to add 'django.core.context_processors.static' to the list of
TEMPLATE_CONTEXT_PROCESSORS. Otherwise django.contrib.staticfiles does
not work correctly.
Matthias
Thanks! Not sure what's still missing ... did you run ./manage.py
collectstatic? Can you send a screenshot of what you are seeing when
you edit a blog entry?
Matthias
If you deleted the site entry and added a new one, you have to modify
SITE_ID in your settings.py. The default is SITE_ID=1 (which is the
site object you deleted), the correct setting would probably be
SITE_ID=2 now for the newly added site object.
What's with the text which did not show up? Do you see no text at all,
or something else?
The register_regions(('main', 'Main region')) call corresponds with
the {% feincms_render_region object "main" request %} snippet in
elephantblog/entry_detail.html. The two "main" strings must be exactly
the same, otherwise it will silently display nothing.
Not sure why the archive page at /blog/ wouldn't show anything though.
Matthias
Great -- this means that the correct template is used for rendering the content.
Could you take a look at the contents of the
elephantblog_entry_richtextcontent table? If you entered some text in
the admin interface, you should have at least one row in this table
with a parent_id pointing to one of your blog entries and a region
value of 'main'.
>
>> The register_regions(('main', 'Main region')) call corresponds with
>> the {% feincms_render_region object "main" request %} snippet in
>> elephantblog/entry_detail.html. The two "main" strings must be exactly
>> the same, otherwise it will silently display nothing.
>
> In /mysite/models.py I put this:
>
> Entry.register_regions(('main', 'Main'),) # That is the new line
>
> In /elephantblog/entry_detail.html I have:
>
> {% feincms_render_region object "main" request %}
>
Yes, all of this seems to be correct.
> And as I look at this file I see where the "News" bit comes in - the
> nifty '{% trans "News" %} - {{ block.super }}'. So something is being
> done right. But as you say the "render" request isn't getting the job
> done for some reason. Shouldn't the way I have this set up work?
>
I don't see an obvious problem with your setup, but
debugging-over-email isn't easy :-)
Matthias
Strange --
It should not be possible to save entries without an author defined.
The Django administration interface does not allow that.
An author foreign key with invalid values would possibly explain why
you don't see any content on the archive views... you could try
removing and re-creating all database tables related to elephantblog
(if you don't have any valuable data yet of course).
Matthias
Everything looks correct. Still no idea why this wouldn't work.
Matthias
Some of this stuff ought to be in the docs.