Integrating FeinCMS into existing project

276 views
Skip to first unread message

Cromulent

unread,
Apr 15, 2012, 2:47:21 PM4/15/12
to Django FeinCMS
I'm a Python/Django newbie who has built a small, barely working
project. After getting a bunch of visitors to my site this week I've
realized that I'll need a blog. I've decided on ElephantBlog which
runs off of FeinCMS.

I've got no idea how to go about this and the FCMS instructions assume
FCMS is the main project and one will be integrating *other* apps into
FCMS.

Can someone point me to an example that I can follow for this?

Matthias Kestenholz

unread,
Apr 16, 2012, 6:08:21 AM4/16/12
to django-...@googlegroups.com

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

Cromulent

unread,
Apr 18, 2012, 1:30:41 PM4/18/12
to Django FeinCMS
Matthias,

Matthias,

Thanks for the reply.

So does the code below go into elephantblog/utils.py? For a newbie you
really need to be precise. You need to say "put this in utils.py".

Also on the EB installation.html page some code is presented for some
content types. You state to put it in "application/models.py".

Which models.py? The particular site I'm running had two apps, and now
with FeinCMS and EB I have four. Where specifically does it go?

Dave

Cromulent

unread,
Apr 19, 2012, 8:35:45 AM4/19/12
to Django FeinCMS
And following the instructions both here and on the elephantblog pages
is generating an error:

"You need to create at least one content type for the Entry model." in
feincms/models.py in _needs_content_types, line 773.

So I take it that putting the content type definitions in elephantblog/
utils.py ain't right. Where should they go?

Cromulent

unread,
Apr 21, 2012, 1:02:20 AM4/21/12
to Django FeinCMS
Please, I need to know *exactly* where this snippet is supposed to be
placed:

Matthias Kestenholz

unread,
Apr 21, 2012, 2:40:48 AM4/21/12
to django-...@googlegroups.com

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

Cromulent

unread,
Apr 21, 2012, 10:23:10 AM4/21/12
to Django FeinCMS
Ok. I have two apps sitting under the project folder. Routing to the
particular app is done by the main project urls.py. So no models.py in
the project folder. Per your instructions I made a models.py for the
project folder and put the "Entry" statements in it.

Not sure why I need to add anything to the Installed_Apps in
settings.py since IA refers to things outside of the main project
folder as I understand it. But I did. Just 'mysitename' to the IA
setting.

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:

----------------------------------
'django.contrib.staticfiles',
'mysitename',
'feincms',
'elephantblog',
----------------------------------

What next?

On Apr 21, 2:40 am, Matthias Kestenholz <m...@feinheit.ch> wrote:

Matthias Kestenholz

unread,
Apr 21, 2012, 10:54:30 AM4/21/12
to django-...@googlegroups.com
On Sat, Apr 21, 2012 at 16:23, Cromulent <dave....@gmail.com> wrote:
> Ok. I have two apps sitting under the project folder. Routing to the
> particular app is done by the main project urls.py. So no models.py in
> the project folder. Per your instructions I made a models.py for the
> project folder and put the "Entry" statements in it.
>
> Not sure why I need to add anything to the Installed_Apps in
> settings.py since IA refers to things outside of the main project
> folder as I understand it. But I did. Just 'mysitename' to the IA
> setting.

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

Cromulent

unread,
Apr 21, 2012, 11:15:15 AM4/21/12
to Django FeinCMS
Ok, now things aren't blowing up. I edited as you outlined and now my
site appears as normal. I did a syncdb and now mysite.net/blog is
appearing as I imagine it should. Then I hit the admin side to enter a
post. Having a problem here. EB wants Region and Ordering filled out,
but there appears to be no actual widgets to enter that data in. Not
that I would know *what* to enter either. But I can fumble my way
through that.

Cromulent

unread,
Apr 21, 2012, 11:18:57 AM4/21/12
to Django FeinCMS
So I looked at the html source of the data entry page for a new post,
and in the Region section this is what I see:

<div class="form-row region">
<div>
<label for="id_richtextcontent_set-__prefix__-region"
class="required">Region:</label>
<input type="hidden" name="richtextcontent_set-__prefix__-region"
id="id_richtextcontent_set-__prefix__-region" />
</div>
</div>

I took out the formatting to make it easy on the eyes. We're missing a
visible widget here.

Still, this is awesome progress. I can almost taste it.


Dave

Matthias Kestenholz

unread,
Apr 21, 2012, 11:20:34 AM4/21/12
to django-...@googlegroups.com

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

Cromulent

unread,
Apr 21, 2012, 11:28:19 AM4/21/12
to Django FeinCMS
In the html source for that page I do see this:

<script type="text/javascript" src="Nonefeincms/item_editor.js"></
script>

among many other similar loads of JS stuff. And I haven't been
encountering any JS errors.

Cromulent

unread,
Apr 21, 2012, 11:31:23 AM4/21/12
to Django FeinCMS
I thought maybe it had to do with the fact I didn't have any
Categories yet. But no.

Cromulent

unread,
Apr 21, 2012, 11:33:35 AM4/21/12
to Django FeinCMS
I did have the Flatpages app enabled. Could there be a conflict there?

Matthias Kestenholz

unread,
Apr 21, 2012, 11:33:43 AM4/21/12
to django-...@googlegroups.com
On Sat, Apr 21, 2012 at 17:28, Cromulent <dave....@gmail.com> wrote:
> In the html source for that page I do see this:
>
> <script type="text/javascript" src="Nonefeincms/item_editor.js"></
> script>
>
> among many other similar loads of JS stuff. And I haven't been
> encountering any JS errors.
>

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

Cromulent

unread,
Apr 21, 2012, 11:40:13 AM4/21/12
to Django FeinCMS
Funny, I don't have *any* of those in my settings.py. Will put that in
now......

Ok, here is my TCP setting:

TEMPLATE_CONTEXT_PROCESSORS = (
'django.contrib.auth.context_processors.auth',
'django.core.context_processors.static',
)

That first line Django demanded so that the admin section would
process ok.

Unfortunately I still am not getting widgets showing - just labels -
for the Region and Ordering values. Thanks for the awesome help
though. Will make a small donation when I get done here.


Dave

Cromulent

unread,
Apr 21, 2012, 11:42:54 AM4/21/12
to Django FeinCMS
You want me to display all the html being rendered for the RichText
section?

Matthias Kestenholz

unread,
Apr 21, 2012, 11:44:11 AM4/21/12
to django-...@googlegroups.com
On Sat, Apr 21, 2012 at 17:40, Cromulent <dave....@gmail.com> wrote:
> Funny, I don't have *any* of those in my settings.py. Will put that in
> now......
>
> Ok, here is my TCP setting:
>
> TEMPLATE_CONTEXT_PROCESSORS = (
>    'django.contrib.auth.context_processors.auth',
>    'django.core.context_processors.static',
> )
>
> That first line Django demanded so that the admin section would
> process ok.
>
> Unfortunately I still am not getting widgets showing - just labels -
> for the Region and Ordering values. Thanks for the awesome help
> though. Will make a small donation when I get done here.
>

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

Cromulent

unread,
Apr 21, 2012, 11:48:34 AM4/21/12
to Django FeinCMS
Didnt know I was supposed to do a collectstatic. Don't even know what
this. But I did it. Got an error in trying. Last item in the error
trace says " You're using the staticfiles app without having set the
STATIC_ROOT setting."

Sure enough I don't have one of those. I'll use here whatever you
recommend.

Cromulent

unread,
Apr 21, 2012, 11:54:20 AM4/21/12
to Django FeinCMS
Ok, so:

STATIC_ROOT = '/home/myname/public_html/mysitename/staticroot/'

And now a ./manage.py collectstatic gives me an error on STATIC_URL.
More doc reading.

Cromulent

unread,
Apr 21, 2012, 11:56:57 AM4/21/12
to Django FeinCMS
Ok, genuinely stumped as to what the STATIC_URL should be called given
my STATIC_ROOT. What would you use here?

I didn't have all this stuff in my settings.py because I didn't need
them.

Cromulent

unread,
Apr 21, 2012, 12:09:51 PM4/21/12
to Django FeinCMS
Ok, here are the entries I made in settings.py for the static stuff:

STATIC_ROOT = '/home/myname/public_html/mysite/staticroot/'
STATIC_URL = '/static/'

And I did a successful ./manage.py collectstatic.

And still no Region and Ordering widgets.

On Apr 21, 11:44 am, Matthias Kestenholz <m...@feinheit.ch> wrote:

Cromulent

unread,
Apr 21, 2012, 12:16:39 PM4/21/12
to Django FeinCMS
Sent you a screenshot.

Cromulent

unread,
Apr 21, 2012, 1:17:54 PM4/21/12
to Django FeinCMS
Maybe I'm missing some middleware?:

'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',


On Apr 21, 11:20 am, Matthias Kestenholz <m...@feinheit.ch> wrote:

Cromulent

unread,
Apr 21, 2012, 1:43:21 PM4/21/12
to Django FeinCMS
Ok, I think I found a problem.

Here is the JS line for item_editor, as found in the rendered admin
page:

<script type="text/javascript" src="/staticfeincms/item_editor.js"></
script>

That ain't right. It should read "/static/feincms/item_editor.js" Here
again are the static setting from my settings.py:

STATIC_ROOT = '/home/myname/public_html/mysite/staticroot/'
STATIC_URL = '/static/'

Not sure what I'm doing wrong but it looks like it has to be here. SR
from what I understand *must* have a trailing slash. Don't know about
SU.


Dave

Cromulent

unread,
Apr 21, 2012, 2:29:07 PM4/21/12
to Django FeinCMS
Ok, so I modified SU to "/staticroot/". Now my admin page comes up and
I can make an entry.

New problem: can't see the page at mysite.net/blog/. Homepage shows up
as before, just no blog entry. I made the first entry "featured",
which I assume means top on blog homepage. Also if I try to bring up
the post using slug I get page not found. Please look at the EB urls
its looking thru according to the error page:

^blog/ ^feed/$
^blog/ ^$ [name='elephantblog_entry_archive']
^blog/ ^(?P<year>\d{4})/$ [name='elephantblog_entry_archive_year']
^blog/ ^(?P<year>\d{4})/(?P<month>\d{2})/$
[name='elephantblog_entry_archive_month']
^blog/ ^(?P<year>\d{4})/(?P<month>\d{2})/(?P<day>\d{2})/$
[name='elephantblog_entry_archive_day']
^blog/ ^(?P<year>\d{4})/(?P<month>\d{2})/(?P<day>\d{2})/(?P<slug>[-\w]
+)/$ [name='elephantblog_entry_detail']
^blog/ ^category/(?P<slug>[-\w]+)/$
[name='elephantblog_category_detail']

That doesn't look right. I can see why the url ain't matching. It
looks like EB has incorrectly put these together. Just as EB docs say
I put the following snippet in my /mysite/urls.py:

# Elephantblog urls
urlpatterns += patterns('',
url(r'^blog/', include('elephantblog.urls')),
)

Dave


On Apr 21, 11:44 am, Matthias Kestenholz <m...@feinheit.ch> wrote:

Cromulent

unread,
Apr 21, 2012, 7:18:25 PM4/21/12
to Django FeinCMS
Ok, this is interesting. I have no problem getting the right page for
mysite.net/blog/feed. But the post that shows up in the feed doesn't
have the right target. It reads "http://www.example.com/4012/04/20/
myslug". Example.com. Did a search of the EB folder for that and can't
find anything.

As a Django newbie I haven't really looked at the Sites section in the
admin interface. And there I spot the "example.com" entry. So I
deleted that and entered a record with my site name. Now the /blog/
feed page doesn't work - "site matching query doesn't exist". But at
least the blog page mysite.net/2012/04/20/myslug shows up. Not with
the text I assigned on it. But at least it aint blowing up.

Matthias Kestenholz

unread,
Apr 22, 2012, 6:17:36 AM4/22/12
to django-...@googlegroups.com
On Sun, Apr 22, 2012 at 01:18, Cromulent <dave....@gmail.com> wrote:
> Ok, this is interesting. I have no problem getting the right page for
> mysite.net/blog/feed. But the post that shows up in the feed doesn't
> have the right target. It reads "http://www.example.com/4012/04/20/
> myslug". Example.com. Did a search of the EB folder for that and can't
> find anything.
>
> As a Django newbie I haven't really looked at the Sites section in the
> admin interface. And there I spot the "example.com" entry. So I
> deleted that and entered a record with my site name. Now the /blog/
> feed page doesn't work - "site matching query doesn't exist". But at
> least the blog page mysite.net/2012/04/20/myslug shows up. Not with
> the text I assigned on it. But at least it aint blowing up.
>

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

Cromulent

unread,
Apr 22, 2012, 9:00:04 AM4/22/12
to Django FeinCMS
> 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.

I dl'ed the sqlite3 db to look at it. Indeed the lone entry in the
django_site table now has a site_id = 2 for the lone entry. I changed
the settings.py value.

> What's with the text which did not show up? Do you see no text at all,
> or something else?

After making the above change I'm getting no blog post text coming up
for either of these

http://www.mysite.net/blog/2012/04/20/first/
http://www.mysite.net/blog/

What I *do* see looks like my /mysite/templates/base.html file. But
not quite. The <title> tag has the string "News - " in front of my
regular title and I can't quite figure out how it got there. EB is
doing *something*.

> 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 %}

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?

> Not sure why the archive page at /blog/ wouldn't show anything though.

The archive page looks *exactly* the same as the post page.

Thanks much for your continuing help. If I can finally get over the
hump I can see that fcms & eb are things I'll probably use over
again.

Dave

Matthias Kestenholz

unread,
Apr 22, 2012, 9:45:45 AM4/22/12
to django-...@googlegroups.com
On Sun, Apr 22, 2012 at 15:00, Cromulent <dave....@gmail.com> wrote:
>> What's with the text which did not show up? Do you see no text at all,
>> or something else?
>
> After making the above change I'm getting no blog post text coming up
> for either of these
>
> http://www.mysite.net/blog/2012/04/20/first/
> http://www.mysite.net/blog/
>
> What I *do* see looks like my /mysite/templates/base.html file. But
> not quite. The <title> tag has the string "News - " in front of my
> regular title and I can't quite figure out how it got there. EB is
> doing *something*.

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

Cromulent

unread,
Apr 22, 2012, 10:29:17 AM4/22/12
to Django FeinCMS
> 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'.

1 entry in that table:

id = 1
text = "first post blah blah blah"
parent_id = 1
region = "main"
ordering = 1

elephantblog_entry has one row, id = 1, is_active = 1


Dave


Cromulent

unread,
Apr 22, 2012, 10:51:26 AM4/22/12
to Django FeinCMS
I wonder if there isn't some sort of debug statement we could put in
feincms_tags.py to understand precisely what is getting passed to
feincms_render_region.

Cromulent

unread,
Apr 22, 2012, 8:57:18 PM4/22/12
to Django FeinCMS
I did notice that author_id in the elephantblog_entry table isn't
being populated. I filled that in manually on a couple of blog posts
but it did not affect behavior.

On Apr 22, 9:45 am, Matthias Kestenholz <m...@feinheit.ch> wrote:

Matthias Kestenholz

unread,
Apr 25, 2012, 2:26:42 AM4/25/12
to django-...@googlegroups.com
On Mon, Apr 23, 2012 at 02:57, Cromulent <dave....@gmail.com> wrote:
> I did notice that author_id in the elephantblog_entry table isn't
> being populated. I filled that in manually on a couple of blog posts
> but it did not affect behavior.
>

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

Matthias Kestenholz

unread,
Apr 25, 2012, 2:27:30 AM4/25/12
to django-...@googlegroups.com

Everything looks correct. Still no idea why this wouldn't work.


Matthias

Cromulent

unread,
Apr 25, 2012, 12:04:18 PM4/25/12
to Django FeinCMS
Ok. I dl'ed the db to my local machine and deleted all eb tables. Then
I exported my the db (a sqlite db) to a sql file, deleted the db,
reconstructed db from sql file, then uploaded back to my host. Put a
dummy blog entry in called "first post" and still the same behavior.
I've got the feed page back and working.

Matt, I have this nagging suspicion that I'm doing something in my own
main app template files to keep the "main" region from rendering.

And the author_id field is still not populating correctly. Gotta be JS
related on the admin page I'd bet.

Cromulent

unread,
Apr 25, 2012, 12:05:59 PM4/25/12
to Django FeinCMS
Wait a minute. The author_id field *is* getting populated. My middle-
aged eyes deceive me.

Cromulent

unread,
Apr 25, 2012, 2:59:04 PM4/25/12
to Django FeinCMS
Finally some success. I decided return to first principle: that I was
doing something wrong. Insert jokes here.

I've been staring at elephantblog/entry_detail.html for a while now. I
couldn't figure out why the "{% block title %}{% trans "News" %} -
{{ block.super }}{% endblock %}" was rendering nicely but nothing else
from this file. Other than that my own /myapp/templates/base.html was
running the show. That is the base template for my site. Each of my
two apps - besides eb & feincms - have their own subfolders that
extend that base.

I kept thinking that eb had to be working right and I just wasn't
pumping it out right. And it hit me. In my own base.html I had
properly named my title block, but not my content block. Insert
massive double facepalm.

I fixed that problem and while I'm still getting errors I now have
something for you to chew on.

mysite.net/blog/ is popping this error: TemplateSyntaxError at /blog/
---> Caught DatabaseError while rendering: no such table:
medialibrary_mediafile. Its a bomb in entry_archive.html at "{% for
entry in object_list %}".

mysite.net/blog/2012/04/25/first-post/ is popping this:
TemplateSyntaxError at /blog/2012/04/25/first-post/ ----> Caught
VariableDoesNotExist while rendering: Failed lookup for key [request]
in u'[{\'entry\': <Entry: first post>, \'object\': <Entry: first
post>, \'view\': <elephantblog.views.DateDetailView object at
0x7f7ef09bbf90.......

In the first instance I can verify that the db does not have a table
called medialibrary_mediafile. Not sure what to do about the latter.
Still, this is progress.

Cromulent

unread,
Apr 25, 2012, 3:24:04 PM4/25/12
to Django FeinCMS
Ok, so I read another thread here from 10 days ago and entered
'feincms.module.medialibrary' to INSTALLED_APPS and did a syncdb. That
knocks one error out of the box and gets me my first successful page:
mysite.net/blog. Yay!

The entry_archive.html does not look pretty. What is the best way of
overriding this?

Matthias Kestenholz

unread,
Apr 25, 2012, 3:25:44 PM4/25/12
to django-...@googlegroups.com
On Wed, Apr 25, 2012 at 20:59, Cromulent <dave....@gmail.com> wrote:
> Finally some success. I decided return to first principle: that I was
> doing something wrong. Insert jokes here.
>
> I've been staring at elephantblog/entry_detail.html for a while now. I
> couldn't figure out why the "{% block title %}{% trans "News" %} -
> {{ block.super }}{% endblock %}" was rendering nicely but nothing else
> from this file. Other than that my own /myapp/templates/base.html was
> running the show. That is the base template for my site. Each of my
> two apps - besides eb & feincms - have their own subfolders that
> extend that base.
>
> I kept thinking that eb had to be working right and I just wasn't
> pumping it out right. And it hit me. In my own base.html I had
> properly named my title block, but not my content block. Insert
> massive double facepalm.
>
> I fixed that problem and while I'm still getting errors I now have
> something for you to chew on.
>
> mysite.net/blog/ is popping this error: TemplateSyntaxError at /blog/
> ---> Caught DatabaseError while rendering: no such table:
> medialibrary_mediafile. Its a bomb in entry_archive.html at "{% for
> entry in object_list %}".
>

I see you fixed this already.

> mysite.net/blog/2012/04/25/first-post/ is popping this:
> TemplateSyntaxError at /blog/2012/04/25/first-post/ ----> Caught
> VariableDoesNotExist while rendering: Failed lookup for key [request]
> in u'[{\'entry\': <Entry: first post>, \'object\': <Entry: first
> post>, \'view\': <elephantblog.views.DateDetailView object at
> 0x7f7ef09bbf90.......
>

You'll have to add 'django.core.context_processors.request' to the
TEMPLATE_CONTEXT_PROCESSORS if you want to use the standard {%
feincms_render_region %} template tag.



Matthias

Cromulent

unread,
Apr 25, 2012, 3:34:58 PM4/25/12
to Django FeinCMS
Great minds think alike. I just got done searching the archives and
found a thread from mid-2010 about
"django.core.context_processors.request" and did it myself. I've gone
from dunce to super genius in no time flat.

Thanks for all your help Matt. Which is not to say I don't need more.
What is the recommended way to provide my own look and feel?

Some of this stuff ought to be in the docs.

Cromulent

unread,
May 2, 2012, 11:17:45 AM5/2/12
to Django FeinCMS
Ok, its a week later and I'm happy to have a functional EB install.
Now I'd like to make it a bit smoother. While the RTF content is
available to edit I'm missing all the extra visual editing candy
available in this screen:

http://www.feinheit.ch/media/labs/feincms/admin.html#module-feincms.admin.item_editor

No tabs for me, and no toolbar. Just a straight textarea. Enough to
get the job done, but just enough.

Is there a line in the html source for this page I should be looking
for Matt?


Dave

Cromulent

unread,
May 2, 2012, 11:32:54 AM5/2/12
to Django FeinCMS
Matt,

I think I've found the issue. It look like TinyMCE isn't in the right
place. The html source for the Entry page says TinyMCE should be here:

mysite.net/media/js/tiny_mce/tiny_mce.js

Fact is not only is it not there I'm having a time finding it at all.


Dave

Cromulent

unread,
May 2, 2012, 12:00:18 PM5/2/12
to Django FeinCMS
Ok, solved it on my own. Gotta get used to the idea of having to do
things for myself. Installed TinyMCE on my own. But I'm stumped as to
why I don't see the tabs - Sidebar & Properties. Is that from an
earlier version?

sbaechler

unread,
May 3, 2012, 2:36:07 AM5/3/12
to django-...@googlegroups.com
Hi Dave


Some of this stuff ought to be in the docs.


I know the docs for Elephantblog are a bit sparse. If you could write up a few notes where you had issues I will make sure these will get covered in the docs.

Regards
Simon 

Matthias Kestenholz

unread,
May 3, 2012, 3:19:41 AM5/3/12
to django-...@googlegroups.com
Hi Dave

On Wed, May 2, 2012 at 6:00 PM, Cromulent <dave....@gmail.com> wrote:
> Ok, solved it on my own. Gotta get used to the idea of having to do
> things for myself. Installed TinyMCE on my own. But I'm stumped as to
> why I don't see the tabs - Sidebar & Properties. Is that from an
> earlier version?

Yes, properties are from an older version (FeinCMS 1.0 or 1.1 if I
remember correctly) -- those screenshots should really be updated. The
sidebar region does not exist because your Entry.register_regions()
call only creates a "Main" region. While regions make lots of sense
for pages they aren't used often for blog entries -- one region is
sufficient most of the time.

Matthias
Reply all
Reply to author
Forward
0 new messages