Help with FlatPages

2016-09-20 Thread Lekan Wahab
Good morning guys,

I'm trying to locally set up an existing  project on my machine.
While I've set up most of the project,  the part giving me a hard time are
the ones using flatpages.

Now,  everytime I access those,  I get a "No Flatpages matches the given
query. " error.

I've tried everything I can but with no luck.

However, there's a flatpages.json file in the project folder.

What could that be for?

Is there something I am supposed to do with that json file?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAE6v7oeihYOYgqatE-HqPO0_aQS0P0JvXAwPwvs5_H-xs0d5bg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Flatpages

2014-08-15 Thread Lee Hinde
I just logged into the backend to make sure the django_flatpage_sites table
was populated and it is.


On Fri, Aug 15, 2014 at 2:21 PM, Lee Hinde  wrote:

> Yes.
>
>
> On Fri, Aug 15, 2014 at 2:10 PM, Collin Anderson 
> wrote:
>
>> SITE_ID is set, but is the correct site selected on the flatpage?
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2BePoMzbRnrmOu6bFM3OHcvkkXdbS78C1T8dzvnnDw9__KDHCA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Flatpages

2014-08-15 Thread Lee Hinde
Yes.


On Fri, Aug 15, 2014 at 2:10 PM, Collin Anderson 
wrote:

> SITE_ID is set, but is the correct site selected on the flatpage?
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2BePoMyQ8qR1Cx4M8cdLmN-A%3DKkz4WY4xYg1Lv9eWGb4%2B391QQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Flatpages

2014-08-15 Thread Collin Anderson
SITE_ID is set, but is the correct site selected on the flatpage?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFO84S59t2HVJ0QNTHVn0w-cWq-hPg8QmVaJxd31rqTcR1gk5w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Flatpages

2014-08-15 Thread Lee Hinde
I don't have APPEND_SLASH in my settings and the default is True, so I
don't think that's it.

Also, I used the django extension show_urls and the flatpages url showed up
in the output, so I think it's in the chain.


On Fri, Aug 15, 2014 at 12:19 PM, C. Kirby <mist...@gmail.com> wrote:

> There is a warning about APPEND_SLASH = False in the flatpages
> documentation:
>
> Warning
>
> If you set APPEND_SLASH
> <https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-APPEND_SLASH>
> to False, you must remove the slash in the catchall pattern or flatpages
> without a trailing slash will not be matched.
> Could it be that?
>
>
> On Friday, August 15, 2014 1:58:49 PM UTC-5, Lee Hinde wrote:
>
>> Yes, it's a record in the flatpages table on the production side.
>>
>>
>> On Fri, Aug 15, 2014 at 11:43 AM, Collin Anderson <cmawe...@gmail.com>
>> wrote:
>>
>>> I also assume you added the page to the production database and not just
>>> your dev database (if they're different)?
>>>
>>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2BePoMyFy8cMin5PU6oBjMj7jxfTgiyMbYS1_FqTNPprPYZgjw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Flatpages

2014-08-15 Thread C. Kirby
There is a warning about APPEND_SLASH = False in the flatpages 
documentation:

Warning

If you set APPEND_SLASH 
<https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-APPEND_SLASH> 
to False, you must remove the slash in the catchall pattern or flatpages 
without a trailing slash will not be matched. 
Could it be that?

On Friday, August 15, 2014 1:58:49 PM UTC-5, Lee Hinde wrote:
>
> Yes, it's a record in the flatpages table on the production side.
>
>
> On Fri, Aug 15, 2014 at 11:43 AM, Collin Anderson <cmawe...@gmail.com 
> > wrote:
>
>> I also assume you added the page to the production database and not just 
>> your dev database (if they're different)?
>>  
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com 
>> .
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/b3aecbf7-9dca-44b7-88e9-49ef80f2fb94%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/b3aecbf7-9dca-44b7-88e9-49ef80f2fb94%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4ebd79c2-202f-481e-aa3c-a3e9428af621%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Flatpages

2014-08-15 Thread Lee Hinde
Yes, it's a record in the flatpages table on the production side.


On Fri, Aug 15, 2014 at 11:43 AM, Collin Anderson <cmawebs...@gmail.com>
wrote:

> I also assume you added the page to the production database and not just
> your dev database (if they're different)?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/b3aecbf7-9dca-44b7-88e9-49ef80f2fb94%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/b3aecbf7-9dca-44b7-88e9-49ef80f2fb94%40googlegroups.com?utm_medium=email_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2BePoMxz0OQcPFw4tt7Z4NUO-pcfKbmo4V78Lx76CVsVYCSf9Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Flatpages

2014-08-15 Thread Collin Anderson
I also assume you added the page to the production database and not just 
your dev database (if they're different)?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b3aecbf7-9dca-44b7-88e9-49ef80f2fb94%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Flatpages

2014-08-15 Thread Lee Hinde
Yes, ALLOWED_HOSTS is set. This site has been in production since late
March, so it's otherwise a going concern. (1.6.x, which I didn't mention
earlier).


On Fri, Aug 15, 2014 at 11:37 AM, Lee Hinde <leehi...@gmail.com> wrote:

> It's the only page; I'll double-check allowed hosts...
>
> Thanks.
>
>
> On Fri, Aug 15, 2014 at 11:30 AM, C. Kirby <mist...@gmail.com> wrote:
>
>> Is it only occurring on the flatpages test page or all your pages (or is
>> that the only page)? Remember you need ALLOWED_HOSTS set in production[1]
>>
>> [1]https://docs.djangoproject.com/en/dev/ref/settings/#allowed-hosts
>>
>>
>> On Friday, August 15, 2014 12:40:43 PM UTC-5, Lee Hinde wrote:
>>>
>>> I added flatpages to a project and got it working fine locally, using
>>> dev server, but I get a 404 accessing my test page when I push to
>>> production.
>>>
>>> Googling the issue,  most common complaints fixed by making sure SITE_ID
>>> was set, and that's in place in my site.
>>>
>>> I'm not using middleware, I'm using the url:
>>>
>>> urlpatterns += patterns('django.contrib.flatpages.views',
>>>
>>> (r'^(?P.*/)$', 'flatpage'),
>>>
>>> )
>>>
>>> I'm not sure how to debug this...
>>>
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2BePoMwyZMxmKuAwtOtkZ%3DHjB_s5MsMhaHFEYChiGKg6xFxU1g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Flatpages

2014-08-15 Thread Lee Hinde
It's the only page; I'll double-check allowed hosts...

Thanks.


On Fri, Aug 15, 2014 at 11:30 AM, C. Kirby <mist...@gmail.com> wrote:

> Is it only occurring on the flatpages test page or all your pages (or is
> that the only page)? Remember you need ALLOWED_HOSTS set in production[1]
>
> [1]https://docs.djangoproject.com/en/dev/ref/settings/#allowed-hosts
>
>
> On Friday, August 15, 2014 12:40:43 PM UTC-5, Lee Hinde wrote:
>>
>> I added flatpages to a project and got it working fine locally, using dev
>> server, but I get a 404 accessing my test page when I push to production.
>>
>> Googling the issue,  most common complaints fixed by making sure SITE_ID
>> was set, and that's in place in my site.
>>
>> I'm not using middleware, I'm using the url:
>>
>> urlpatterns += patterns('django.contrib.flatpages.views',
>>
>> (r'^(?P.*/)$', 'flatpage'),
>>
>> )
>>
>> I'm not sure how to debug this...
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2BePoMz%3DaXn5wWkQYnzqGH1YTSowNSJj%3Dwco57VTc5txOitiZg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Flatpages

2014-08-15 Thread C. Kirby
Is it only occurring on the flatpages test page or all your pages (or is 
that the only page)? Remember you need ALLOWED_HOSTS set in production[1]

[1]https://docs.djangoproject.com/en/dev/ref/settings/#allowed-hosts

On Friday, August 15, 2014 12:40:43 PM UTC-5, Lee Hinde wrote:
>
> I added flatpages to a project and got it working fine locally, using dev 
> server, but I get a 404 accessing my test page when I push to production.
>
> Googling the issue,  most common complaints fixed by making sure SITE_ID 
> was set, and that's in place in my site.
>
> I'm not using middleware, I'm using the url:
>
> urlpatterns += patterns('django.contrib.flatpages.views',
>
> (r'^(?P.*/)$', 'flatpage'),
>
> )
>
> I'm not sure how to debug this...
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/740d40ea-f53a-4937-a73d-fad474fff626%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Flatpages

2014-08-15 Thread Lee Hinde
It's /test/. The flatpages admin form won't accept a url that doesn't begin
and end in a slash.


On Fri, Aug 15, 2014 at 10:55 AM, Collin Anderson <cmawebs...@gmail.com>
wrote:

> What is your page's url? Does it end with a slash?
>
> --
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2BePoMxqM5WCMf_o%2Bv4Ev4T23zcT9eiRnO68hKH8%2BTALRJP0CQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Flatpages

2014-08-15 Thread Collin Anderson
What is your page's url? Does it end with a slash?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a0f94321-e701-40c8-b874-f95a3d59d1e0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Flatpages

2014-08-15 Thread Lee Hinde
I added flatpages to a project and got it working fine locally, using dev
server, but I get a 404 accessing my test page when I push to production.

Googling the issue,  most common complaints fixed by making sure SITE_ID
was set, and that's in place in my site.

I'm not using middleware, I'm using the url:

urlpatterns += patterns('django.contrib.flatpages.views',

(r'^(?P.*/)$', 'flatpage'),

)

I'm not sure how to debug this...

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2BePoMx4k-rcotED1wjaXUaeMaahkvuOeVg6VFMpjV7zhC%3DPpQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Flatpages - Django 1.5.1

2014-01-21 Thread James
Fixed. After some Google-fu I set SITE_ID = 2 and it worked.

On Monday, January 20, 2014 4:41:05 PM UTC-8, James wrote:
>
> I’m having trouble implementing flatpages in Django 1.5.1 - I’m new to 
> Django/Python (~3 months) so any insight is appreciated.
>
> I’ve added flatpages in APPS and MIDDLEWARE_CLASSES and ran a syncdb:
>
> INSTALLED_APPS = (
>
> 'django.contrib.auth',
>
> 'django.contrib.contenttypes',
>
> 'django.contrib.sessions',
>
> 'django.contrib.sites',
>
> 'django.contrib.messages',
>
> 'django.contrib.staticfiles',
>
> # Uncomment the next line to enable the admin:
>
> 'django.contrib.admin',
>
> # Uncomment the next line to enable admin documentation:
>
> 'django.contrib.admindocs',
>
> 'django.contrib.flatpages',
>
> 'blog',
>
> )
>
>
> MIDDLEWARE_CLASSES = (
>
> 'django.middleware.common.CommonMiddleware',
>
> 'django.contrib.sessions.middleware.SessionMiddleware',
>
> 'django.middleware.csrf.CsrfViewMiddleware',
>
> 'django.contrib.auth.middleware.AuthenticationMiddleware',
>
> 'django.contrib.messages.middleware.MessageMiddleware',
>
> 'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',
>
> )
>
> I logged into Django admin and created:
>
> URL: /about/
>
> Title: About
>
> Content: testing…
>
> Sites:  127.0.0.1:8000
>
> I clicked ‘view on site’ within the Django admin > flatpages > /about/ and 
> I get sent to http://localhost:8000/about/ which returns a 404.  I opened 
> up a SQLite browser and I can see that my page is in the db.  Am I missing 
> anything else?
>
> Thanks
>
> James
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b15140af-244f-4fb1-8cae-82058849d0d8%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Flatpages - Django 1.5.1

2014-01-20 Thread James
 

I’m having trouble implementing flatpages in Django 1.5.1 - I’m new to 
Django/Python (~3 months) so any insight is appreciated.

I’ve added flatpages in APPS and MIDDLEWARE_CLASSES and ran a syncdb:

INSTALLED_APPS = (

'django.contrib.auth',

'django.contrib.contenttypes',

'django.contrib.sessions',

'django.contrib.sites',

'django.contrib.messages',

'django.contrib.staticfiles',

# Uncomment the next line to enable the admin:

'django.contrib.admin',

# Uncomment the next line to enable admin documentation:

'django.contrib.admindocs',

'django.contrib.flatpages',

'blog',

)


MIDDLEWARE_CLASSES = (

'django.middleware.common.CommonMiddleware',

'django.contrib.sessions.middleware.SessionMiddleware',

'django.middleware.csrf.CsrfViewMiddleware',

'django.contrib.auth.middleware.AuthenticationMiddleware',

'django.contrib.messages.middleware.MessageMiddleware',

'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',

)

I logged into Django admin and created:

URL: /about/

Title: About

Content: testing…

Sites:  127.0.0.1:8000

I clicked ‘view on site’ within the Django admin > flatpages > /about/ and 
I get sent to http://localhost:8000/about/ which returns a 404.  I opened 
up a SQLite browser and I can see that my page is in the db.  Am I missing 
anything else?

Thanks

James

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/019cf512-4712-4af0-9bde-0db7c46d71d0%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: flatpages-tinymce

2013-07-30 Thread Karl Arunachal
Thank you.


On Sun, Jul 28, 2013 at 7:03 PM, Roberto López López
wrote:

>
> Your message is quite confusing and difficult to understand, I have to
> say. What are you asking for? To show tinymce within your change_form or
> within the admin app? What do you mean by "flat pages"? Which error are you
> getting?
>
>
>
>
> On 07/28/2013 08:35 AM, Karl Arunachal wrote:
>
>  Hello,
>  I am trying to use tinymce in the flat pages. But i just can't show it up
> in my admin. Please help me out where am going wrong.
>
> The javascript file is in:
>
> C:\Users\Kakar\web\cms\static\js\tinymce\tinymce.min.js
>
> urls.py:
>
> (r'^tiny_mce/(?P.*)$', 'django.views.static.serve', {
> 'document_root': 'C:/Users/Kakar/web/cms/static/js/tinymce' }),
>
> In my templates dir i have another admin folder, which have the
> change_form.html, and right after {{ media }}:
>
> 
> 
> tinyMCE.init({
> mode: "textareas",
> theme: "simple"
> });
> 
>
>  Please help me out. Thank you.
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
>
>
> --
>
> Roberto López López
> System Developer
> Parallab, Uni Computing
> +47 55584091
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: flatpages-tinymce

2013-07-28 Thread Roberto López López

Your message is quite confusing and difficult to understand, I have to
say. What are you asking for? To show tinymce within your change_form or
within the admin app? What do you mean by "flat pages"? Which error are
you getting?



On 07/28/2013 08:35 AM, Karl Arunachal wrote:
> Hello,
> I am trying to use tinymce in the flat pages. But i just can't show it
> up in my admin. Please help me out where am going wrong.
>
> The javascript file is in:
>
> C:\Users\Kakar\web\cms\static\js\tinymce\tinymce.min.js
>
> urls.py:
>
> |(r'^tiny_mce/(?P.*)$','django.views.static.serve',{'document_root':'C:/Users/Kakar/web/cms/static/js/tinymce'}),
>
> |In my templates dir i have another admin folder, which have the
> change_form.html, and right after {{ media }}:
>
> |
> 
> tinyMCE.init({
> mode: "textareas",
> theme: "simple"
> });
> |
> Please help me out. Thank you.
> -- 
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  


-- 

Roberto López López
System Developer
Parallab, Uni Computing
+47 55584091

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: flatpages-tinymce

2013-07-28 Thread Roberto López López
On 07/28/2013 08:35 AM, Karl Arunachal wrote:
> ||


-- 

Roberto López López
System Developer
Parallab, Uni Computing
+47 55584091

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




flatpages-tinymce

2013-07-28 Thread Karl Arunachal
Hello,
I am trying to use tinymce in the flat pages. But i just can't show it up
in my admin. Please help me out where am going wrong.

The javascript file is in:

C:\Users\Kakar\web\cms\static\js\tinymce\tinymce.min.js

urls.py:

(r'^tiny_mce/(?P.*)$', 'django.views.static.serve', { 'document_root':
'C:/Users/Kakar/web/cms/static/js/tinymce' }),

In my templates dir i have another admin folder, which have the
change_form.html, and right after {{ media }}:



tinyMCE.init({
mode: "textareas",
theme: "simple"
});


Please help me out. Thank you.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




best way to track flatpages clicked by users?

2013-05-03 Thread frocco
Hello,

I am looking for a way to track links clicked on my website, so I can see 
what is being used.
Most pages are flat pages, so our my own design.

Thanks

Frank

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: css for flatpages

2013-04-21 Thread Michael Hernandez
Sorry what do you mean by flat. Do you mean that they dont import css files 
into them. As in mobile optimized? You would just create file in a 
templates directory and include it in any flat pages. It would be fully 
rendered on the server side, and no extra browser calls to grab the files.

On Sunday, April 21, 2013 4:53:40 PM UTC-4, Carlos Aboim wrote:
>
> Hi
>
> tell me, where should live css files for flatpages,
> these need a special folder for server to find them as for apps for 
> example?
>
> thank you!
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




css for flatpages

2013-04-21 Thread Carlos Aboim
Hi

tell me, where should live css files for flatpages,
these need a special folder for server to find them as for apps for example?

thank you!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




ValueError at /admin/flatpages/flatpage/1/

2013-02-08 Thread frocco
If I add a record and do not select the sites dropdown, I get
ValueError at /admin/flatpages/flatpage/1/

Cannot use None as a query value

Request Method:POSTRequest URL:
http://127.0.0.1:8000/admin/flatpages/flatpage/1/Django Version:1.4.3Exception 
Type:ValueErrorException Value:

Cannot use None as a query value

Exception Location:C:\Python27\lib\site-packages\django\db\models\sql\query.py 
in add_filter, line 1095Python Executable:C:\Python27\python.exe

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Can't display data from app in flatpages

2012-12-20 Thread Jason Arnst-Goodrich
The flatpages view is not provided the context which includes 'posts'.

IMO you are correct with the {% load posts %} technique because it is 
entirely as result of the template you are using that requires you display 
that information -- if that makes sense.

In other words it's not because of the flatpage you are loading but rather 
the template you are using which necessitates the 'posts' being used.

On Wednesday, December 19, 2012 8:40:21 PM UTC-8, Frank Valcarcel wrote:
>
> I have a Django app called blogengine which does exactly what the name 
> implies. I can't seem to get data from blogengine (posts) to display in 
> templates when they're called by flatpages. I'm new to Django but I assume 
> this is a urls.py issue.
>
> My urls.py:
>
> from django.conf.urls.defaults import patterns, include, urlfrom 
> blogengine.views import PostsFeed
> # Uncomment the next two lines to enable the admin:from django.contrib import 
> admin
> admin.autodiscover()
>
> urlpatterns = patterns('',
> # Uncomment the admin/doc line below to enable admin documentation:
> # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
>
> # Uncomment the next line to enable the admin:
> url(r'^admin/', include(admin.site.urls)),
>
> # Home page
> url(r'^$', 'blogengine.views.getPosts'),
> url(r'^(\d+)/?$', 'blogengine.views.getPosts'),
>
> # tinyMCE
> (r'^tinymce/', include('tinymce.urls')),
>
> # Blog posts
> url(r'^\d{4}/\d{1,2}/([-a-zA-Z0-9]+)/?$', 'blogengine.views.getPost'),
>
> # Categories
> url(r'^categories/(\w+)/?$', 'blogengine.views.getCategory'),
> url(r'^categories/(\w+)/(\d+)/?$', 'blogengine.views.getCategory'),
>
> # Comments
> #url(r'^comments/', include('django.contrib.comments.urls')),
>
> # RSS feeds
> url(r'^feeds/posts/$', PostsFeed()),
>
>
> # Flat pages
> #url(r'', include('django.contrib.flatpages.urls')),
> #not needed since '...middleware.FlatpageFallbackMiddleware' is installed 
> in settings.py
>
> )
>
> Would it be better practice to create a tag so I could just call {% load 
> posts %} when and where I need it?
>
> I can call them up by normal means by using  {% if posts %}...{% for post 
> in posts %}  but trying to use this in flatpages that call the same 
> template section of the page displays nothing. Any ideas?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/5EhD9WhaRREJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Can't display data from app in flatpages

2012-12-19 Thread Frank Valcarcel
I have a Django app called blogengine which does exactly what the name 
implies. I can't seem to get data from blogengine (posts) to display in 
templates when they're called by flatpages. I'm new to Django but I assume 
this is a urls.py issue.

My urls.py:

from django.conf.urls.defaults import patterns, include, urlfrom 
blogengine.views import PostsFeed
# Uncomment the next two lines to enable the admin:from django.contrib import 
admin
admin.autodiscover()

urlpatterns = patterns('',
# Uncomment the admin/doc line below to enable admin documentation:
# url(r'^admin/doc/', include('django.contrib.admindocs.urls')),

# Uncomment the next line to enable the admin:
url(r'^admin/', include(admin.site.urls)),

# Home page
url(r'^$', 'blogengine.views.getPosts'),
url(r'^(\d+)/?$', 'blogengine.views.getPosts'),

# tinyMCE
(r'^tinymce/', include('tinymce.urls')),

# Blog posts
url(r'^\d{4}/\d{1,2}/([-a-zA-Z0-9]+)/?$', 'blogengine.views.getPost'),

# Categories
url(r'^categories/(\w+)/?$', 'blogengine.views.getCategory'),
url(r'^categories/(\w+)/(\d+)/?$', 'blogengine.views.getCategory'),

# Comments
#url(r'^comments/', include('django.contrib.comments.urls')),

# RSS feeds
url(r'^feeds/posts/$', PostsFeed()),


# Flat pages
#url(r'', include('django.contrib.flatpages.urls')),
#not needed since '...middleware.FlatpageFallbackMiddleware' is installed 
in settings.py

)

Would it be better practice to create a tag so I could just call {% load 
posts %} when and where I need it?

I can call them up by normal means by using  {% if posts %}...{% for post 
in posts %}  but trying to use this in flatpages that call the same 
template section of the page displays nothing. Any ideas?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/yHp2fWCoq0AJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Cannot add/save flatpages via admin???

2012-04-28 Thread Karen Tracey
This was a bug in the flatpage form validation, where it would throw
an exception rather than give you an error message if you did not
specify any values for the required sites field. Fixed now on git
master. You can also avoid it by being sure to select at least one
site for the page.

Karen
-- 
http://tracey.org/kmt/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Cannot add/save flatpages via admin???

2012-04-28 Thread DjangoKid
I dont know much about Python and Django. Whenever i try to save a
flat page i got error:

ValueError at /admin/flatpages/flatpage/add/
Exception Value: Cannot use None as a query value

http://dpaste.com/739338/

I am using Python 2.7.3 and Django 1.4 ad sqlite3 as database

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



django flatpages and model translations

2012-04-14 Thread maumercado
Hello everyone,

What is your aproach or what app do you use in order to make translations 
for django flatpages and project apps models?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/VaYuwzWvZYIJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Question about flatpages + registration required

2011-07-22 Thread eddie
Sorry for the question, but I can't seem to track down a place to
start.

I've got a fairly simple django site that includes flatpages.  I'm
trying to require authentication to view one or two of the flatpages
(like I would with a .htaccess, for instance).  When I go to the
admin, and click the "registration required" checkbox and go to the
flatpage url, I'm still able to access the page when logged out.  I've
included django.contrib.auth and django.contrib.contenttypes as
installed apps, as well.

Can someone let me know what I'm missing here? Is there something more
that I have to do to enable authentication for these pages?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Flatpages do not work

2011-07-06 Thread Paul van der Vlis
Op 06-07-11 12:21, CareerDhaba tech schreef:
> Hi Paul,
> 
> As described in the error, Django couldn't find the url test/ in the
> URLconf because its not there.
> 
> Go to the urls.py of your app and add the appropriate link, and view to
> the URLconf.
> 
> Go through this link, it should be helpful -
> https://docs.djangoproject.com/en/1.3/topics/http/urls/

Thanks for your help. I fixed the problem by choosing the right "site"
in the admin interface. Because my SITE-ID is "1", I have to choose the
first site in the list somebody wrote my. This helped.

With regards,
Paul.


> On Wed, Jul 6, 2011 at 3:32 PM, Paul van der Vlis <p...@vandervlis.nl
> <mailto:p...@vandervlis.nl>> wrote:
> 
> Hallo!
> 
> I am a real beginner in Django, I try to install a new chat application
> called HelpIM, you will not know it.
> 
> My problem is that the flatpages do not work. I can create a flatpage in
> the admin-interface, but when I go to it, I always see a "page not
> found" message from HelpIM: https://testchat4.e-hulp.nl/test/
> Maybe this page needs to go "out of the way". But how?
> 
>     In the documentation I cannot find something what's not correct:
> https://docs.djangoproject.com/en/dev/ref/contrib/flatpages/
> 
> I am using the development version of Django (1.4), because HelpIM needs
> some new features from it.
> 
> When I turn debug on, I see this:
> 
> Page not found (404)
> Request Method: GET
> Request URL:https://testchat4.e-hulp.nl/test/
> Using the URLconf defined in helpim.urls, Django tried these URL
> patterns, in this order:
> ^admin/translate/
> ^$ [name='client_join_chat']
> ^admin/
> ^admin/doc/
> ^admin/threadedcomments/
> ^admin/rooms/join/one2oneroom/$ [name='staff_join_next_available_chat']
> ^admin/rooms/join/one2oneroom/(\d+)/$ [name='staff_join_specific_chat']
> ^jsi18n/$
> The current URL, test/, didn't match any of these.
> You're seeing this error because you have DEBUG = True in your Django
> settings file. Change that to False, and Django will display a standard
> 404 page.
> --
> 
> What I miss here is /var/www/testchat4/templates/flatpages/ , there is
> my default.html. And I don't know where to configure "helpim.urls".
> 
> With regards,
> Paul van der Vlis.
> 
> --
> Linux systeembeheer Groningen
> http://www.vandervlis.nl
> 
> --
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To post to this group, send email to django-users@googlegroups.com
> <mailto:django-users@googlegroups.com>.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com
> <mailto:django-users%2bunsubscr...@googlegroups.com>.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
> 
> 
> -- 
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.





-- 
Linux systeembeheer Groningen
http://www.vandervlis.nl

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Flatpages do not work

2011-07-06 Thread CareerDhaba tech
Hi Paul,

As described in the error, Django couldn't find the url test/ in the URLconf
because its not there.

Go to the urls.py of your app and add the appropriate link, and view to the
URLconf.

Go through this link, it should be helpful -
https://docs.djangoproject.com/en/1.3/topics/http/urls/

On Wed, Jul 6, 2011 at 3:32 PM, Paul van der Vlis <p...@vandervlis.nl>wrote:

> Hallo!
>
> I am a real beginner in Django, I try to install a new chat application
> called HelpIM, you will not know it.
>
> My problem is that the flatpages do not work. I can create a flatpage in
> the admin-interface, but when I go to it, I always see a "page not
> found" message from HelpIM: https://testchat4.e-hulp.nl/test/
> Maybe this page needs to go "out of the way". But how?
>
> In the documentation I cannot find something what's not correct:
> https://docs.djangoproject.com/en/dev/ref/contrib/flatpages/
>
> I am using the development version of Django (1.4), because HelpIM needs
> some new features from it.
>
> When I turn debug on, I see this:
> 
> Page not found (404)
> Request Method: GET
> Request URL:https://testchat4.e-hulp.nl/test/
> Using the URLconf defined in helpim.urls, Django tried these URL
> patterns, in this order:
> ^admin/translate/
> ^$ [name='client_join_chat']
> ^admin/
> ^admin/doc/
> ^admin/threadedcomments/
> ^admin/rooms/join/one2oneroom/$ [name='staff_join_next_available_chat']
> ^admin/rooms/join/one2oneroom/(\d+)/$ [name='staff_join_specific_chat']
> ^jsi18n/$
> The current URL, test/, didn't match any of these.
> You're seeing this error because you have DEBUG = True in your Django
> settings file. Change that to False, and Django will display a standard
> 404 page.
> --
>
> What I miss here is /var/www/testchat4/templates/flatpages/ , there is
> my default.html. And I don't know where to configure "helpim.urls".
>
> With regards,
> Paul van der Vlis.
>
> --
> Linux systeembeheer Groningen
> http://www.vandervlis.nl
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Flatpages do not work

2011-07-06 Thread Paul van der Vlis
Hallo!

I am a real beginner in Django, I try to install a new chat application
called HelpIM, you will not know it.

My problem is that the flatpages do not work. I can create a flatpage in
the admin-interface, but when I go to it, I always see a "page not
found" message from HelpIM: https://testchat4.e-hulp.nl/test/
Maybe this page needs to go "out of the way". But how?

In the documentation I cannot find something what's not correct:
https://docs.djangoproject.com/en/dev/ref/contrib/flatpages/

I am using the development version of Django (1.4), because HelpIM needs
some new features from it.

When I turn debug on, I see this:

Page not found (404)
Request Method: GET
Request URL:https://testchat4.e-hulp.nl/test/
Using the URLconf defined in helpim.urls, Django tried these URL
patterns, in this order:
^admin/translate/
^$ [name='client_join_chat']
^admin/
^admin/doc/
^admin/threadedcomments/
^admin/rooms/join/one2oneroom/$ [name='staff_join_next_available_chat']
^admin/rooms/join/one2oneroom/(\d+)/$ [name='staff_join_specific_chat']
^jsi18n/$
The current URL, test/, didn't match any of these.
You're seeing this error because you have DEBUG = True in your Django
settings file. Change that to False, and Django will display a standard
404 page.
--

What I miss here is /var/www/testchat4/templates/flatpages/ , there is
my default.html. And I don't know where to configure "helpim.urls".

With regards,
Paul van der Vlis.

-- 
Linux systeembeheer Groningen
http://www.vandervlis.nl

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: flatpages templatetags missing

2011-01-31 Thread Adi
I had my settings.py exactly like you suggested.

I realized that the template tag loadflatpages is available in the
Trunk, and not available in 1.2.3 or 1.2.4

I was confused because the documentation for 1.2.3 talks about the
load flatpages tag (and there is a disclaimer there that says
"available in development version", which I didn't pay attention to)

On Jan 31, 2:21 am, GSV <svyatoslav.zhurov...@gmail.com> wrote:
> MIDDLEWARE_CLASSES = (
>     'django.middleware.common.CommonMiddleware',
>     'django.contrib.sessions.middleware.SessionMiddleware',
>     'django.middleware.csrf.CsrfViewMiddleware',
>     'django.contrib.auth.middleware.AuthenticationMiddleware',
>     'django.contrib.messages.middleware.MessageMiddleware',
>     'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',
> )
>
> INSTALLED_APPS = (
>     'django.contrib.auth',
>     'django.contrib.contenttypes',
>     'django.contrib.sessions',
>     'django.contrib.sites',
>     'django.contrib.messages',
>     # Uncomment the next line to enable the admin:
>     'django.contrib.admin',
>     # Uncomment the next line to enable admin documentation:
>     'django.contrib.admindocs',
>     'django.contrib.flatpages',
> )
>
> TEMPLATE_DIRS = (
>         '/var/www/html/tamada2/templates',
> )
>
> template for flatpages: /var/www/html/tamada2/templates/flatpages/
> default.html
>
> ###
> {% extends "base.xhtml" %}
>
> {% block content %}
> {{flatpage.content}}
>
> {% endblock %}
>
> On 31 янв, 08:10, Adi <aditya.rus...@gmail.com> wrote:
>
> > Hi:
> > I am trying to use flatpages in my app, and i set up the settings.py
> > correct, and I am able to create the flatpages using the admin site.
>
> > However, when in my app I try to load the template tags for flatpages
> > using:
> > {% load flatpages %}
>
> > I get a
> > TemplateSyntaxError
> > Exception Value:
>
> > 'flatpages' is not a valid tag library: Template library flatpages not
> > found, tried
> > django.templatetags.flatpages,django_extensions.templatetags.flatpages,django.contrib.admin.templatetags.flatpages,django.contrib.webdesign.templatetags.flatpages
>
> > I then looked to see the django distribution installed (1.2.3 final)
> > on my computer and noticed that django.contrib.flatpages did not have
> > a templatetags module under that.
>
> > I looked up the code repository for 1.2.3 and 1.2.4 and both don't
> > have the templatetags directory.
>
> > What am I doing wrong ? What is missing ?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: flatpages templatetags missing

2011-01-31 Thread GSV
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',
)


INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
# Uncomment the next line to enable the admin:
'django.contrib.admin',
# Uncomment the next line to enable admin documentation:
'django.contrib.admindocs',
'django.contrib.flatpages',
)

TEMPLATE_DIRS = (
'/var/www/html/tamada2/templates',
)

template for flatpages: /var/www/html/tamada2/templates/flatpages/
default.html

###
{% extends "base.xhtml" %}

{% block content %}
{{flatpage.content}}

{% endblock %}


On 31 янв, 08:10, Adi <aditya.rus...@gmail.com> wrote:
> Hi:
> I am trying to use flatpages in my app, and i set up the settings.py
> correct, and I am able to create the flatpages using the admin site.
>
> However, when in my app I try to load the template tags for flatpages
> using:
> {% load flatpages %}
>
> I get a
> TemplateSyntaxError
> Exception Value:
>
> 'flatpages' is not a valid tag library: Template library flatpages not
> found, tried
> django.templatetags.flatpages,django_extensions.templatetags.flatpages,django.contrib.admin.templatetags.flatpages,django.contrib.webdesign.templatetags.flatpages
>
> I then looked to see the django distribution installed (1.2.3 final)
> on my computer and noticed that django.contrib.flatpages did not have
> a templatetags module under that.
>
> I looked up the code repository for 1.2.3 and 1.2.4 and both don't
> have the templatetags directory.
>
> What am I doing wrong ? What is missing ?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



flatpages templatetags missing

2011-01-30 Thread Adi
Hi:
I am trying to use flatpages in my app, and i set up the settings.py
correct, and I am able to create the flatpages using the admin site.

However, when in my app I try to load the template tags for flatpages
using:
{% load flatpages %}

I get a
TemplateSyntaxError
Exception Value:

'flatpages' is not a valid tag library: Template library flatpages not
found, tried
django.templatetags.flatpages,django_extensions.templatetags.flatpages,django.contrib.admin.templatetags.flatpages,django.contrib.webdesign.templatetags.flatpages

I then looked to see the django distribution installed (1.2.3 final)
on my computer and noticed that django.contrib.flatpages did not have
a templatetags module under that.

I looked up the code repository for 1.2.3 and 1.2.4 and both don't
have the templatetags directory.

What am I doing wrong ? What is missing ?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Adding a new collapsed form in Flatpages

2011-01-22 Thread TheRedRabbit
Thank you sooo much :)

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Adding a new collapsed form in Flatpages

2011-01-22 Thread creecode
Hello TheRedRabbit,

On Jan 22, 12:02 pm, TheRedRabbit  wrote:

> Instead of one form it displayed 3, is there a way to default it to
> display only one
> form?

Perhaps this will do the trick <
http://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.InlineModelAdmin.extra
>.  Lots of useful information in the docs.

Toodle-l.
creecode

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Adding a new collapsed form in Flatpages

2011-01-22 Thread TheRedRabbit
Hi Daniel
Thanks for the response. I actually tried that and the only issue I
had
with stacked inline was it made the admin page look real ugly.

Instead of one form it displayed 3, is there a way to default it to
display only one
form?

Thanks again.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Adding a new collapsed form in Flatpages

2011-01-22 Thread Daniel Roseman
On Saturday, January 22, 2011 6:57:46 PM UTC, TheRedRabbit wrote:
>
> Im getting this error when I run syncdb: 
>
> Error: One or more models did not validate: 
> flatpages.flatpage: Accessor for m2m field 'sites' clashes with 
> related m2m field 'Site.flatpage_set'. Add a related_name argument to 
> the definition for 'sites'. 
> my_flatpages.flatpage: Accessor for m2m field 'my_sites' clashes with 
> related m2m field 'Site.flatpage_set'. Add a related_name argument to 
> the definition for 'my_sites'. 
>
>
> Im not sure whats wrong here. I copied the flatpages app to my python 
> path so I can modify it 
> and now this is where Im at??? ;/


You haven't uninstalled the old flatpages model, so there are now two 
foreign keys pointing from a flatpages model to Site. As the error message 
clearly states, you need to add a related_name argument to the foreign key 
definition.

However, IMO you're going about this completely the wrong way. There's no 
need to copy and hack the flatpages model. If you just want to add a related 
model that you can edit in the admin, then do that: create a new model with 
a ForeignKey pointing to the original Flatpage, and register a new admin 
class for Flatpages which includes an inline for your new model (you'll need 
to call `admin.site.unregister(Flatpage)` first to get rid of the original 
admin.)
--
DR.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Adding a new collapsed form in Flatpages

2011-01-22 Thread TheRedRabbit
Im getting this error when I run syncdb:

Error: One or more models did not validate:
flatpages.flatpage: Accessor for m2m field 'sites' clashes with
related m2m field 'Site.flatpage_set'. Add a related_name argument to
the definition for 'sites'.
my_flatpages.flatpage: Accessor for m2m field 'my_sites' clashes with
related m2m field 'Site.flatpage_set'. Add a related_name argument to
the definition for 'my_sites'.


Im not sure whats wrong here. I copied the flatpages app to my python
path so I can modify it
and now this is where Im at??? ;/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Adding a new collapsed form in Flatpages

2011-01-22 Thread TheRedRabbit
I found this

http://groups.google.com/group/django-users/browse_thread/thread/865e1d3b52f18bb6

It explains that you would have to copy the flatpages module and
modify it, instead of
modifying the actual flatpage in the django installation.

The link does not work so Il post my solution once I get it working.

In the meantime any help or pointers would be appreciated

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Adding a new collapsed form in Flatpages

2011-01-22 Thread TheRedRabbit
I want to add a new form to the admin interface of the Flatpages app.

The only way I can think of doing this is by hacking the actual django
flatpages app.

What Im trying to add is an optional form that can be filled in from
the admin interface
of the flatpages app and it will display an advert on the side of the
page.

I initially started writing a stand alone app but the problem is with
100 pages I have to
go through a list of all my flatpages to associate an ad with one of
them. So Im thinking the better
way is to add the form to the actual flatpages app so if I want to
display an ad on a certain flatpage
Il just uncollapse that form and fill in the details for an ad to
appear on that flatpage Im editing.

Any help is appreciated.
Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Flatpages incorrect 302 to 404

2010-09-27 Thread Josh
As far as I know I constructed the urls properly.  For example one of
them was /policy/ (that's how it looked in flatpages).  I did find
another work around though.
I removed the flatpages middleware from my settings.  And then I added
this to my urls:

urlpatterns += patterns('',
(r'^(?Ppages/(.*)/)$',
'django.contrib.flatpages.views.flatpage'),
)

Now as long as I make a flatpage of the pattern /pages/whatever/ it
finds it and otherwise the proper 404 is returned.
I got the idea here, just modified it a bit.
http://thisweekindjango.com/screencasts/episode/5/mapping-flatpage-urls/

-Josh

On Sep 27, 10:27 am, Piotr Kilczuk <kilc...@gmail.com> wrote:
> 2010/9/27 Josh <josh...@gmail.com>:
>
> > bump.  Does anyone have any ideas?
>
> Trailing slash issue?
>
> Just look into the middleware and see when the response code is modified.
>
> Regards,
> Piotr

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Flatpages incorrect 302 to 404

2010-09-27 Thread Piotr Kilczuk
2010/9/27 Josh :
> bump.  Does anyone have any ideas?

Trailing slash issue?

Just look into the middleware and see when the response code is modified.

Regards,
Piotr

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Flatpages soft 404

2010-09-27 Thread Josh
bump.  Does anyone have any ideas?

On Sep 24, 3:56 pm, Josh <josh...@gmail.com> wrote:
> I have a django project, its a satchmo store.  I have noticed that
> when the flatpages middleware is in my settings.py 404s seem to be
> handled incorrectly.  i.e. if a page really does not exist the server
> first sends a 302 response, then a 404.  When google crawls it only
> sees the 302 so it thinks that something is there even tho nothing is
> there.  Because of this combined with the fact that the structure of
> the site recently significantly changed google has a lot of broken
> links and none of them get fixed because the initial 302 makes google
> think something is there.
> I think this happens because the flatpages middleware intercepts 404s
> to see if there is a flatpage, but it seems incorrect.  If I remove
> the flatpages middleware 404 function correctly.  Has anyone else
> noticed this or does anyone know of a workaround?  I need flatpages,
> but I need 404s to behave correctly.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Flatpages incorrect 302 to 404

2010-09-27 Thread Josh
bump.  Does anyone have any ideas?

On Sep 24, 3:56 pm, Josh <josh...@gmail.com> wrote:
> I have a django project, its a satchmo store.  I have noticed that
> when the flatpages middleware is in my settings.py 404s seem to be
> handled incorrectly.  i.e. if a page really does not exist the server
> first sends a 302 response, then a 404.  When google crawls it only
> sees the 302 so it thinks that something is there even tho nothing is
> there.  Because of this combined with the fact that the structure of
> the site recently significantly changed google has a lot of broken
> links and none of them get fixed because the initial 302 makes google
> think something is there.
> I think this happens because the flatpages middleware intercepts 404s
> to see if there is a flatpage, but it seems incorrect.  If I remove
> the flatpages middleware 404 function correctly.  Has anyone else
> noticed this or does anyone know of a workaround?  I need flatpages,
> but I need 404s to behave correctly.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Flatpages incorrect 302 to 404

2010-09-24 Thread Josh
I have a django project, its a satchmo store.  I have noticed that
when the flatpages middleware is in my settings.py 404s seem to be
handled incorrectly.  i.e. if a page really does not exist the server
first sends a 302 response, then a 404.  When google crawls it only
sees the 302 so it thinks that something is there even tho nothing is
there.  Because of this combined with the fact that the structure of
the site recently significantly changed google has a lot of broken
links and none of them get fixed because the initial 302 makes google
think something is there.
I think this happens because the flatpages middleware intercepts 404s
to see if there is a flatpage, but it seems incorrect.  If I remove
the flatpages middleware 404 function correctly.  Has anyone else
noticed this or does anyone know of a workaround?  I need flatpages,
but I need 404s to behave correctly.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



flatpages and views on home page

2010-09-11 Thread Bobby Roberts
hi group.

Got an issue I need some help with asap.  I have flatpages installed
and a url at / for my home page.

I've also got a form on my home page powered by a view.

my urls portion for this view is:

rr'^$','DoNewsLetter'),


my issue is this... the view executes perfectly, but the flatpage
doesn't execute.  Is there anyway to get the flatpage to show AND the
view to execute successfully?


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Overriding flatpages class meta

2010-08-31 Thread Owen Nelson
Actually, I would *avoid* modifying the flatpages source, but that does
raise a good point -- look at the source and copy/paste the Meta defined
inside the class, making the overrides you need in your subclass (redefine
the Meta).
You'll have to watch for changes if/when you switch django versions, but hey
-- if it works, it works.

Owen Nelson



On Tue, Aug 31, 2010 at 12:38 PM, Karim Gorjux <lemieli...@gmail.com> wrote:

> Try to modify the flatpages source! You can find it directly in your
> django installation.
>
>
> --
> Karim Gojux
> www.karimblog.net
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com<django-users%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: How to create a gerarchical list in admin for flatpages?

2010-08-31 Thread Karim Gorjux
On Tue, Aug 31, 2010 at 14:11, Karim Gorjux  wrote:
> I would like to
> realize a easy admin page for my flat pages that in Django-CMS is
> called "site map".

I found what I need. Is here: http://code.google.com/p/django-mptt/

-- 
Karim Gojux
www.karimblog.net

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Overriding flatpages class meta

2010-08-31 Thread Karim Gorjux
Try to modify the flatpages source! You can find it directly in your
django installation.


-- 
Karim Gojux
www.karimblog.net

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Overriding flatpages class meta

2010-08-31 Thread Owen Nelson
The meta class instance is accessed through ClassName._meta -- not
ClassName.meta
I tried this when I got back last night and had (other) issues myself, so
this might not be the right approach anyway.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Overriding flatpages class meta

2010-08-31 Thread Goran
Thanks Owen but is doesn't work. The similar Error message:

contribute_to_class
if self.meta:
AttributeError: 'Options' object has no attribute 'meta'

On Aug 30, 8:03 pm, Owen Nelson  wrote:
> Sorry to be guessing here, but I was looking at something similar recently.
> My attempt (untested at this point) would be something like:
>
> from copy import copy
> class NewFlatpage(FlatPage):
>     _meta = copy(FlatPage._meta)
>     _meta.verbose_name_plural = "foo"

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



How to create a gerarchical list in admin for flatpages?

2010-08-31 Thread Karim Gorjux
Hi all! I'm working to create my CMS on Django, I would like to
realize a easy admin page for my flat pages that in Django-CMS is
called "site map". How I can do that? Are there any tutorial or how to
about that? Have you any advice?

Thanks!

The site map in Django-CMS:
http://www.django-cms.org/media/uploads/cms_page_media/2/3_pagelist___.png

-- 
Karim Gojux
www.karimblog.net

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Overriding flatpages class meta

2010-08-30 Thread Owen Nelson
Sorry to be guessing here, but I was looking at something similar recently.
My attempt (untested at this point) would be something like:

from copy import copy
class NewFlatpage(FlatPage):
_meta = copy(FlatPage._meta)
_meta.verbose_name_plural = "foo"

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Overriding flatpages class meta

2010-08-30 Thread Goran
I was try

class Meta(FlatPage.Meta):

but when runserver there is following error:

AttributeError: type object 'FlatPage' has no attribute 'Meta'

any other solution to try?

Thanks




On Aug 30, 12:53 am, Steve Holden  wrote:
> On 8/29/2010 6:51 PM, Goran wrote:
>
> > Thanks for the answer Steve. I'm Django and Python novice and here is
> > what I was try. But it doesn't work.
>
> > from django.contrib.flatpages.models import FlatPage
>
> >classNewFlatpage(FlatPage):
>
> >    classMeta:
>
> TheMetaclasswould need to subclass FlatPage.Meta, otherwise it won't
> have the necessary FlatPage special sauces. I don't guarantee even that
> will work, but try
>
> classNewFlatpage(FlatPage):
>
>    classMeta(FlatPage.Meta):
>         verbose_name_plural = "New_name"
>
> regards
>  Steve
>
>
>
> >         verbose_name_plural = "New_name"
>
> > On Aug 26, 4:39 am, Steve Holden  wrote:
> >> On 8/25/2010 8:26 PM, Goran wrote:> I need another verbose_name_plural for 
> >> Flat pages so i need to
> >>> overrideclassmetafor it right? How can I do that?
>
> >> [Caveat: this is a guess from general Python knowledge]
>
> >> Have you tried creating a subclass of Flatpage, whose body simply
> >> declares aMetaclasswhich is a subclass of Flatpage.Meta?
>
> >> regards
> >>  Steve
> >> --
> >> DjangoCon US 2010 September 7-9http://djangocon.us/
>
> --
> DjangoCon US 2010 September 7-9http://djangocon.us/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Overriding flatpages class meta

2010-08-29 Thread Steve Holden
On 8/29/2010 6:51 PM, Goran wrote:
> Thanks for the answer Steve. I'm Django and Python novice and here is
> what I was try. But it doesn't work.
> 
> from django.contrib.flatpages.models import FlatPage
> 
> class NewFlatpage(FlatPage):
> 
> class Meta:

The Meta class would need to subclass FlatPage.Meta, otherwise it won't
have the necessary FlatPage special sauces. I don't guarantee even that
will work, but try

class NewFlatpage(FlatPage):

class Meta(FlatPage.Meta):
verbose_name_plural = "New_name"

regards
 Steve

> verbose_name_plural = "New_name"
> 
> 
> 
> On Aug 26, 4:39 am, Steve Holden  wrote:
>> On 8/25/2010 8:26 PM, Goran wrote:> I need another verbose_name_plural for 
>> Flat pages so i need to
>>> overrideclassmetafor it right? How can I do that?
>>
>> [Caveat: this is a guess from general Python knowledge]
>>
>> Have you tried creating a subclass of Flatpage, whose body simply
>> declares aMetaclasswhich is a subclass of Flatpage.Meta?
>>
>> regards
>>  Steve
>> --
>> DjangoCon US 2010 September 7-9http://djangocon.us/
> 


-- 
DjangoCon US 2010 September 7-9 http://djangocon.us/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Overriding flatpages class meta

2010-08-29 Thread Goran
Thanks for the answer Steve. I'm Django and Python novice and here is
what I was try. But it doesn't work.

from django.contrib.flatpages.models import FlatPage

class NewFlatpage(FlatPage):

class Meta:
verbose_name_plural = "New_name"



On Aug 26, 4:39 am, Steve Holden  wrote:
> On 8/25/2010 8:26 PM, Goran wrote:> I need another verbose_name_plural for 
> Flat pages so i need to
> > overrideclassmetafor it right? How can I do that?
>
> [Caveat: this is a guess from general Python knowledge]
>
> Have you tried creating a subclass of Flatpage, whose body simply
> declares aMetaclasswhich is a subclass of Flatpage.Meta?
>
> regards
>  Steve
> --
> DjangoCon US 2010 September 7-9http://djangocon.us/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Overriding flatpages class meta

2010-08-25 Thread Steve Holden
On 8/25/2010 8:26 PM, Goran wrote:
> I need another verbose_name_plural for Flat pages so i need to
> override class meta for it right? How can I do that?
> 
[Caveat: this is a guess from general Python knowledge]

Have you tried creating a subclass of Flatpage, whose body simply
declares a Meta class which is a subclass of Flatpage.Meta?

regards
 Steve
-- 
DjangoCon US 2010 September 7-9 http://djangocon.us/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Overriding flatpages class meta

2010-08-25 Thread Goran
I need another verbose_name_plural for Flat pages so i need to
override class meta for it right? How can I do that?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: flatpages and menu

2010-08-24 Thread Alec Shaner
You could use a context processor to read the flatpage table to build the
menu. If you want more control over the menu then create a Menu model and
store the flatpage links there and again build the menu in a context
processor. You would probably want to use some level of caching if you don't
want to hit the database for every page view.

On Tue, Aug 24, 2010 at 3:00 AM, OliverMarchand
<oliver.march...@gmail.com>wrote:

> Dear all,
>
> I am thinking of creating a website that displays "mostly" database
> content, but for special content I am using flatpages. Now somehow I
> must put a link to the flatpages somewhere, most likely in a menu. If
> I put the menu in my base template, then there is no way to insert
> this link by editing.
>
> Do you have a good design idea to make the menu editable as well?
>
> thanks and cheers,
> Oliver
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com<django-users%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



flatpages and menu

2010-08-24 Thread OliverMarchand
Dear all,

I am thinking of creating a website that displays "mostly" database
content, but for special content I am using flatpages. Now somehow I
must put a link to the flatpages somewhere, most likely in a menu. If
I put the menu in my base template, then there is no way to insert
this link by editing.

Do you have a good design idea to make the menu editable as well?

thanks and cheers,
Oliver

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: setting DEBUG=False disables flatpages

2010-06-08 Thread Michael
On Tue, Jun 8, 2010 at 2:56 PM, adrian <adrian.imm...@gmail.com> wrote:

> tracked the problem more down...
>
> the problem appeared when using own handler404/handler500 views and
> returning the invalid HttpResponse instead of HttpResponseNotFound/
> HttpResponseServerError. This is not documented and needs doc
> improvement ...
>
>
Directly from http://docs.djangoproject.com/en/dev/ref/contrib/flatpages/:

> The middleware only gets activated for 404s – not for 500s or responses of
> any other status code.


It really is not good practice to convert a 404 or 500 error to a proper
response. Google just recently released a tool on web master tools that
shows you what they call soft 404s. These are urls that should return a
different response than 200, but yet still do.

If this is what you need to do you should look at the
FlatPageFallBackMiddleware and change the times that is activated.

Hope that helps,

Michael

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: setting DEBUG=False disables flatpages

2010-06-08 Thread Dan Harris
You need to have a 500.html and a 404.html defined when DEBUG=False.

See: http://code.djangoproject.com/ticket/3335

Hope this helps!

Dan Harris
dih0...@gmail.com

On Jun 8, 2:56 pm, adrian  wrote:
> tracked the problem more down...
>
> the problem appeared when using own handler404/handler500 views and
> returning the invalid HttpResponse instead of HttpResponseNotFound/
> HttpResponseServerError. This is not documented and needs doc
> improvement ...

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: setting DEBUG=False disables flatpages

2010-06-08 Thread adrian
tracked the problem more down...

the problem appeared when using own handler404/handler500 views and
returning the invalid HttpResponse instead of HttpResponseNotFound/
HttpResponseServerError. This is not documented and needs doc
improvement ...

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: setting DEBUG=False disables flatpages

2010-06-08 Thread Mike Dewhirst

On 8/06/2010 4:58pm, adrian wrote:

Hello Guys,

on all my projects I have the problem that setting DEBUG=False in
settings.py disables flatpages (404 Pages are displayed).
This also applies to newly created projects. This happens with Django
version 1.2.1. Can someone confirm this with his deployments?


I just changed to DEBUG = False and had a look at a flatpage with the 
dev server and it works fine for me.


Python 2.6.5, django 1.2.x (head)

Mike



Additionally if running the "manage.py runserver" or as fcgi with
DEBUG=False the return codes are always 200 (even if the page
displayed is my 404 page). Is also in this case someone able to
confirm this?

I have found a ticket with number  "http://code.djangoproject.com/
ticket/13673" where the behavior is also mentioned - but it is still
unreviewed since more than a week.


Best Regards,

Adrian



--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



setting DEBUG=False disables flatpages

2010-06-08 Thread adrian
Hello Guys,

on all my projects I have the problem that setting DEBUG=False in
settings.py disables flatpages (404 Pages are displayed).
This also applies to newly created projects. This happens with Django
version 1.2.1. Can someone confirm this with his deployments?

Additionally if running the "manage.py runserver" or as fcgi with
DEBUG=False the return codes are always 200 (even if the page
displayed is my 404 page). Is also in this case someone able to
confirm this?

I have found a ticket with number  "http://code.djangoproject.com/
ticket/13673" where the behavior is also mentioned - but it is still
unreviewed since more than a week.


Best Regards,

Adrian

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: don't work Flatpages

2010-06-01 Thread gerram
I decided this problem. The matter of it was SITE_ID in settings.py.
The facto of the matter that Flatpages from box has default site
example.com as default. If you create new your site before deleting
example.com you get SITE_ID: 2 and etc for your site. After that you
can delete example.com but your site will be still with ID:2 and more.
However in settings.py you get as default SITE_ID:1. You have to be
carefully with SITE_ID if you are going to work with Flatpages.
Regards, George.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



don't work Flatpages

2010-05-31 Thread gerram
Hi, everybody!  I tried to set Flatpages about 3 days but I could  get
only "404" error in browser. If someone had a few time look at my
settings: http://files.mail.ru/JXHUOU

Enter for admin part: user:Django, pass:Django

Regards.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Providing flatpages initial data

2010-02-19 Thread Timothy Kinney
pen('provdata.json', 'w')
f.flush()
f.write(buff)
f.write("]")
f.close()
*** / code ***

This yields a provdata.json flatpage which I copy into
myproject/myapp/fixtures
Then I run manage.py loaddata provdata.json and all of the provinces for my
game get loaded.

MUCH easier than coding them all by hand. And now that I have the general
method I can apply it to all my database tables.

Hope this helps someone.

-Tim


On Fri, Feb 19, 2010 at 1:09 PM, Timothy Kinney <timothyjkin...@gmail.com>wrote:

> I started playing with this last night and got about as far as you
> mentioned here. What I want to be able to do, though, is write a python
> script that writes an authentic json flatpage that I can import into the
> database. I have a large textfile full of names, items, and province
> information (for a game) and I want to shove all this into the database.
>
> I tried adding some provinces to the database, dumpdata, and then looked at
> the json file to see if I could copy the syntax it was using. This hasn't
> quiet worked yet, but I will keep trying.
>
> Has anyone tried what I want to do?
>
> -Tim
>
>
>
> On Fri, Feb 19, 2010 at 11:13 AM, Rick Caudill <cau0...@gmail.com> wrote:
>
>> Hi all,
>>
>> I just came across a need to provide initial data for flatpages.  I have
>> read before that people have asked to do this.  It is easier than thought
>> :)
>>
>> 1. Create your content via the admin interface
>> 2. Run  'python manage.py dumpdata flatpages > data.json'
>> 3. When you want to provide the data run 'python manage.py loaddata
>> data.json'
>>
>>
>> I hope this helps someone that needs to do this sort of thing.
>>
>>
>> --
>> Rick Caudill
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-us...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com<django-users%2bunsubscr...@googlegroups.com>
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Providing flatpages initial data

2010-02-19 Thread Timothy Kinney
I started playing with this last night and got about as far as you mentioned
here. What I want to be able to do, though, is write a python script that
writes an authentic json flatpage that I can import into the database. I
have a large textfile full of names, items, and province information (for a
game) and I want to shove all this into the database.

I tried adding some provinces to the database, dumpdata, and then looked at
the json file to see if I could copy the syntax it was using. This hasn't
quiet worked yet, but I will keep trying.

Has anyone tried what I want to do?

-Tim


On Fri, Feb 19, 2010 at 11:13 AM, Rick Caudill <cau0...@gmail.com> wrote:

> Hi all,
>
> I just came across a need to provide initial data for flatpages.  I have
> read before that people have asked to do this.  It is easier than thought
> :)
>
> 1. Create your content via the admin interface
> 2. Run  'python manage.py dumpdata flatpages > data.json'
> 3. When you want to provide the data run 'python manage.py loaddata
> data.json'
>
>
> I hope this helps someone that needs to do this sort of thing.
>
>
> --
> Rick Caudill
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com<django-users%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Providing flatpages initial data

2010-02-19 Thread Rick Caudill
Hi all,

I just came across a need to provide initial data for flatpages.  I have
read before that people have asked to do this.  It is easier than thought
:)

1. Create your content via the admin interface
2. Run  'python manage.py dumpdata flatpages > data.json'
3. When you want to provide the data run 'python manage.py loaddata
data.json'


I hope this helps someone that needs to do this sort of thing.


-- 
Rick Caudill

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: comments in flatpages

2010-02-16 Thread shaner
got some of this working, i'll leave this here so the next guy that
searches can find some info

install flatpages and comments, that much is easily found in the
django docs

flatpages comes with a field for enabling comments per flatpage, I'm
not sure how that control works yet this info below seems to ignore
that checkbox...

I just added these tags to my flatpage default.html template and then
flatpages show comments, adds a form to post a comment, that's all i
need for the moment i'm not doing this on a public site anyway

loads tags so you can use them

{% load comments %}

loads comments for the flatpage

{% get_comment_list for flatpage as comment_list %}
{% for comment in comment_list %}
{{ comment }}
{% endfor %}

loads a form to submit new comments

{% render_comment_form for flatpage %}


On Feb 16, 6:43 pm, shaner <shane.n...@gmail.com> wrote:
> anyone setup comments with flatpages?
>
> doesn't appear to be documented anywhere other than each individually,
> maybe nobody wants it to be too easy

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



comments in flatpages

2010-02-16 Thread shaner
anyone setup comments with flatpages?

doesn't appear to be documented anywhere other than each individually,
maybe nobody wants it to be too easy

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Cannot add inlines to Flatpages

2010-01-30 Thread Rodrigo
Ok, just restarted (I actually restarted many times) and it magically
started working.

On Jan 31, 12:47 am, Rodrigo <kewl...@gmail.com> wrote:
> I'm following the tutorial on the book "Practical Django Projects",
> and I just can't inline the SearchKeywords to Flatpages, maybe the
> problem lays in the fact that I'm using the development version of
> django. It doesn't output any error, it just shows the flatpages
> standard admin page, without any inline. This is the code I'm using:
>
> #admin.py
> from django.contrib import admin
> from cms.search.models import SearchKeyword
>
> from django.contrib.flatpages.models import FlatPage
> from django.contrib.flatpages.admin import FlatPageAdmin
>
> class SearchKeywordInline(admin.StackedInline):
>     model = SearchKeyword
>
> class CustomFlatPageAdmin(FlatPageAdmin):
>     inlines = [SearchKeywordInline]
>
> #unregister the default FlatPage admin and register
> CustomFlatPageAdmin.
> admin.site.unregister(FlatPage)
> admin.site.register(FlatPage, CustomFlatPageAdmin)

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Cannot add inlines to Flatpages

2010-01-30 Thread Rodrigo
I'm following the tutorial on the book "Practical Django Projects",
and I just can't inline the SearchKeywords to Flatpages, maybe the
problem lays in the fact that I'm using the development version of
django. It doesn't output any error, it just shows the flatpages
standard admin page, without any inline. This is the code I'm using:

#admin.py
from django.contrib import admin
from cms.search.models import SearchKeyword

from django.contrib.flatpages.models import FlatPage
from django.contrib.flatpages.admin import FlatPageAdmin

class SearchKeywordInline(admin.StackedInline):
model = SearchKeyword

class CustomFlatPageAdmin(FlatPageAdmin):
inlines = [SearchKeywordInline]

#unregister the default FlatPage admin and register
CustomFlatPageAdmin.
admin.site.unregister(FlatPage)
admin.site.register(FlatPage, CustomFlatPageAdmin)

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



hi.. supress the flatpages' fields' help texts

2010-01-06 Thread Ali Rıza Keleş
Hi all,

How can I supress help_texts of flatpages' fields without modifying core
code of django contrib. 

Thanks.

--
Ali Rıza Keleş


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.




Storing flatpages outside the database?

2009-12-14 Thread Boris Schäling
I wonder if it's possible to store flatpages outside the database? It would
be great if eg. the path to a title file and content file could be put into
the flatpage database table (instead of entering the title and content
directly). While I can simply copy files from a development computer to a
production server changes in the flatpages must be copied manually from one
database to another? 

Boris 


--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.




Re: FlatPages return 404 when attempting to edit.

2009-12-06 Thread TheLastBookworm
Correction: I meant fork and not "port".

On Dec 6, 3:36 pm, TheLastBookworm <bookworm.producti...@gmail.com>
wrote:
> Hi,
>
> I'm getting a error when attempting to edit a flatpage.
>
> "Http404 at /admin/flatpages/flat/
>
> App u'flatpages', model u'flat', not found. "
>
> This is the same error I get when I try to edit a non-existent
> flatpage.
>
> After some googling I discovered that site ID issues are a common
> cause of this error. I've checked my site IDs and they are correct,
> now i'm lost as to what direction to head in and google is no help.
>
> Is there some other middleware that can cause the flatpage middleware
> to fail and not return a item?  Can someone who has had the same issue
> provide an answer or point me in the right direction for debugging and
> fixing this issue?
>
> My settings file is located herehttp://dpaste.com/130113/.
>
> Note: This project is a port of 
> mingushttp://github.com/montylounge/django-mingus/tree
> . Mingus itself works fine with flatpages. Hopefully that extra
> information helps others help me.

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.




FlatPages return 404 when attempting to edit.

2009-12-06 Thread TheLastBookworm
Hi,

I'm getting a error when attempting to edit a flatpage.

"Http404 at /admin/flatpages/flat/

App u'flatpages', model u'flat', not found. "

This is the same error I get when I try to edit a non-existent
flatpage.

After some googling I discovered that site ID issues are a common
cause of this error. I've checked my site IDs and they are correct,
now i'm lost as to what direction to head in and google is no help.

Is there some other middleware that can cause the flatpage middleware
to fail and not return a item?  Can someone who has had the same issue
provide an answer or point me in the right direction for debugging and
fixing this issue?

My settings file is located here http://dpaste.com/130113/ .


Note: This project is a port of mingus 
http://github.com/montylounge/django-mingus/tree
. Mingus itself works fine with flatpages. Hopefully that extra
information helps others help me.

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.




Re: multilingual flatpages

2009-12-01 Thread Jani Tiainen
On Mon, 2009-11-30 at 16:36 -0800, Nev wrote:
> Hey,
> 
> Today I did a bunch of searching and reading to find what is the best
> way to have flatpages presented in multiple languages. Flatpages
> apparently don't support internationalization and I went down several
> avenues looking for the recommended way, and finding various things
> that appeared way over the top for my simple requirement - present the
> translated version of my flat page according to the current
> 'django_language'.

There also exists django-multilingual pluggable app that has (among
other features), multilingual flatpages application.

-- 

Jani Tiainen


--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.




Re: multilingual flatpages

2009-12-01 Thread andreas schmid
hi,

i didnt work on that yet but i will in the next weeks because ill need
the content translated on flatpages.
wouldnt it be easier to subclass the flatpages model or to get the
flatpages package and make the modifications there to get a
custom_flatpages app?

im thinkin that because im already using transmeta for all my other apps.

Nev wrote:
> Hey,
>
> Today I did a bunch of searching and reading to find what is the best
> way to have flatpages presented in multiple languages. Flatpages
> apparently don't support internationalization and I went down several
> avenues looking for the recommended way, and finding various things
> that appeared way over the top for my simple requirement - present the
> translated version of my flat page according to the current
> 'django_language'.
>
> So I thought I'd share it... (It's really only five lines added to
> your templates, and links to the pages updated).
>
> In my base template I have the usual forms for changing the languages,
> which are presented as clickable flags. The addition is the next_input
> block.
>
> 
>   {% for lang in languages %}
> 
>   
>   {% block next_input %}
>   {% endblock %}
> type="image"
>  src="/images/{{ lang.0 }}.png"
>  alt="{{ lang.1 }}"/>
> 
>   {% endfor %}
> 
>
> In my flatpage template which extends the base template I supply that
> block, which supplies a input tag which supplies the next value for
> the form.
>
> {% block next_input %}
>   
> {% endblock %}
>
> The key is that the urls of the flatpages are as such...
>
> /welcome/en/
> /welcome/es/
> /welcome/pt/
>
> The form therefore, after going to /i18n/setlang, returns to the same
> page, but in the new language by removing the trailing slash and
> language code and replacing it with the new currently selected
> language.
>
> Click on the flags for non-flatpages works as normal.
>
> And links to these flat pages within other templates are thus
> supplied... (where 'language' is supplied by the view as the value of
> 'django_language' or an appropriate default if it's not yet been
> selected, 'en' in my case).
>
> {% trans "Welcome" %}
>
> Hope this helps someone. It's extremely easy, does what I need, along
> with the django internationalization, without installing anything
> extra or getting complicated.
>
> Cheers,
>
> Nev
>
> --
>
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
>
>
>
>   

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.




multilingual flatpages

2009-11-30 Thread Nev
Hey,

Today I did a bunch of searching and reading to find what is the best
way to have flatpages presented in multiple languages. Flatpages
apparently don't support internationalization and I went down several
avenues looking for the recommended way, and finding various things
that appeared way over the top for my simple requirement - present the
translated version of my flat page according to the current
'django_language'.

So I thought I'd share it... (It's really only five lines added to
your templates, and links to the pages updated).

In my base template I have the usual forms for changing the languages,
which are presented as clickable flags. The addition is the next_input
block.


  {% for lang in languages %}

  
  {% block next_input %}
  {% endblock %}
  

  {% endfor %}


In my flatpage template which extends the base template I supply that
block, which supplies a input tag which supplies the next value for
the form.

{% block next_input %}
  
{% endblock %}

The key is that the urls of the flatpages are as such...

/welcome/en/
/welcome/es/
/welcome/pt/

The form therefore, after going to /i18n/setlang, returns to the same
page, but in the new language by removing the trailing slash and
language code and replacing it with the new currently selected
language.

Click on the flags for non-flatpages works as normal.

And links to these flat pages within other templates are thus
supplied... (where 'language' is supplied by the view as the value of
'django_language' or an appropriate default if it's not yet been
selected, 'en' in my case).

{% trans "Welcome" %}

Hope this helps someone. It's extremely easy, does what I need, along
with the django internationalization, without installing anything
extra or getting complicated.

Cheers,

Nev

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.




Re: CSRF Flatpages

2009-11-29 Thread rebus_
2009/11/28 John Leith <leith.j...@gmail.com>:
> I have a problem with the CSRF framework, and i'm just checking here
> to see if anyone else ran into this problem and hopefully found a
> solution. Here is my problem:
>
> I have a login form on the base template of my site. The home page is
> just a flatpage. My login processor is csrf protected. I have the
> middleware and the {% csrf_token %} is set in the template.
>
> The problem is that there is no output from the template tag, it
> dosen't contribute anything at all to the rendered HTML. So naturally,
> I can't login from the homepage.
>
> I poked around in the code, and i planning on digging some more.
> However, if someone else has encountered this, i sure would appreciate
> some guidance.
>
> --
>
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
>
>
>

Flat pages are used to store plain HTML [1], you can't use filter nor
templatetags in them (perhaps you could with some weird middleware or
something but it would not be good solution).

Create custom HTML template for you login view, pass the template name
to your login url pattern (if you don't need custom view) and
everything should work out fine i think.

 url(r'^login/$', 'login',
{'template_name': 'registration/login.html'},
name='login'),

[1] 
http://docs.djangoproject.com/en/dev/ref/contrib/flatpages/#module-django.contrib.flatpages

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.




CSRF Flatpages

2009-11-28 Thread John Leith
I have a problem with the CSRF framework, and i'm just checking here
to see if anyone else ran into this problem and hopefully found a
solution. Here is my problem:

I have a login form on the base template of my site. The home page is
just a flatpage. My login processor is csrf protected. I have the
middleware and the {% csrf_token %} is set in the template.

The problem is that there is no output from the template tag, it
dosen't contribute anything at all to the rendered HTML. So naturally,
I can't login from the homepage.

I poked around in the code, and i planning on digging some more.
However, if someone else has encountered this, i sure would appreciate
some guidance.

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.




Re: Admin not looking in templates/admin/flatpages/flatpage for change_form.html

2009-11-20 Thread Nev
An update.

The correct behaviour occurs when the site is served via apache and
fcgi from my A Small Orange account. But the incorrect behaviour
occurs when the site is served locally using 'manage.py runserver'.

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=.




Re: flatpages not finding site_media

2009-11-11 Thread neridaj

I figured it out, thanks.

On Nov 11, 12:00 pm, neridaj  wrote:
> sorry, I'm just trying to use the dev server and added that url:
>
>     (r'^site_media/(?P.*)$', 'django.views.static.serve',
>             {'document_root': '/Users/neridaj/django-templates/
> neridaj/'}),
>
> the url for static_media is being appended to the flatpage i.e.,
> Failed to load source 
> for:http://127.0.0.1:8000/about/site_media/css/blueprint/screen.css
>
> On Nov 11, 10:52 am, Daniel Roseman  wrote:
>
> > On Nov 11, 3:48 pm, neridaj  wrote:
>
> > > On Nov 11, 12:07 am, Daniel Roseman  wrote:
>
> > > > Have you set anything up to serve media files?
> > > I have a symbolic link named site_media in my project directory.
>
> > How does that answer the question? What is serving the media 
> > files?http://docs.djangoproject.com/en/dev/howto/static-files/
> > --
> > DR.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: flatpages not finding site_media

2009-11-11 Thread neridaj

sorry, I'm just trying to use the dev server and added that url:

(r'^site_media/(?P.*)$', 'django.views.static.serve',
{'document_root': '/Users/neridaj/django-templates/
neridaj/'}),

the url for static_media is being appended to the flatpage i.e.,
Failed to load source for: 
http://127.0.0.1:8000/about/site_media/css/blueprint/screen.css

On Nov 11, 10:52 am, Daniel Roseman  wrote:
> On Nov 11, 3:48 pm, neridaj  wrote:
>
> > On Nov 11, 12:07 am, Daniel Roseman  wrote:
>
> > > Have you set anything up to serve media files?
> > I have a symbolic link named site_media in my project directory.
>
> How does that answer the question? What is serving the media 
> files?http://docs.djangoproject.com/en/dev/howto/static-files/
> --
> DR.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: flatpages not finding site_media

2009-11-11 Thread Daniel Roseman

On Nov 11, 3:48 pm, neridaj  wrote:

> On Nov 11, 12:07 am, Daniel Roseman  wrote:
> >
> > Have you set anything up to serve media files?

> I have a symbolic link named site_media in my project directory.

How does that answer the question? What is serving the media files?
http://docs.djangoproject.com/en/dev/howto/static-files/
--
DR.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: flatpages not finding site_media

2009-11-11 Thread neridaj

I have a symbolic link named site_media in my project directory.

On Nov 11, 12:07 am, Daniel Roseman <dan...@roseman.org.uk> wrote:
> On Nov 11, 7:50 am, neridaj <neri...@gmail.com> wrote:
>
>
>
>
>
> > I'm trying to use some flatpages for static content and I don''t
> > understand why they keep failing to load media files. I have my
> > template_dirs defined, media_root and media_url - when used in
> > template does not resolve to media_root i.e., template contains:
>
> > 
>
> > results in:
>
> > Failed to load source for:http://127.0.0.1:8000/about/css/base.css
>
> > MEDIA_ROOT = '/Users/neridaj/django-templates/neridaj/'
> > MEDIA_URL = '/site_media/'
> > TEMPLATE_DIRS = (
> >     '/Users/neridaj/django-templates/neridaj/'
> > )
>
> > The default template renders but without any of the css.
>
> > Thanks,
>
> > J
>
> Have you set anything up to serve media files?
> --
> DR.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: flatpages not finding site_media

2009-11-11 Thread Daniel Roseman

On Nov 11, 7:50 am, neridaj <neri...@gmail.com> wrote:
> I'm trying to use some flatpages for static content and I don''t
> understand why they keep failing to load media files. I have my
> template_dirs defined, media_root and media_url - when used in
> template does not resolve to media_root i.e., template contains:
>
> 
>
> results in:
>
> Failed to load source for:http://127.0.0.1:8000/about/css/base.css
>
> MEDIA_ROOT = '/Users/neridaj/django-templates/neridaj/'
> MEDIA_URL = '/site_media/'
> TEMPLATE_DIRS = (
>     '/Users/neridaj/django-templates/neridaj/'
> )
>
> The default template renders but without any of the css.
>
> Thanks,
>
> J

Have you set anything up to serve media files?
--
DR.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



flatpages not finding site_media

2009-11-10 Thread neridaj

I'm trying to use some flatpages for static content and I don''t
understand why they keep failing to load media files. I have my
template_dirs defined, media_root and media_url - when used in
template does not resolve to media_root i.e., template contains:



results in:

Failed to load source for: http://127.0.0.1:8000/about/css/base.css

MEDIA_ROOT = '/Users/neridaj/django-templates/neridaj/'
MEDIA_URL = '/site_media/'
TEMPLATE_DIRS = (
'/Users/neridaj/django-templates/neridaj/'
)

The default template renders but without any of the css.

Thanks,

J
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Admin not looking in templates/admin/flatpages/flatpage for change_form.html

2009-11-04 Thread Nev

I've still not managed to get this to do the documented behaviour.
Anyone? Please.

On Oct 27, 1:38 am, Nev <nevde...@gmail.com> wrote:
> Hello,
>
> I have done the tinymce thing for my flatpages, but it only works if I
> put mychange_form.htmlunder templates/admin. If I put it under
> templates/admin/flatpages or templates/admin/flatpages/flatpage it is
> ignored. I am using django 1.1.1. Can anyone tell me what I've missed.
> Do I have to turn on that behaviour?
>
> (I'm looking at page 24 of Practical Django Projects 2nd Ed. and
> various web pages)
>
> Cheers.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Admin not looking in templates/admin/flatpages/flatpage for change_form.html

2009-10-27 Thread Nev

Hello,

I have done the tinymce thing for my flatpages, but it only works if I
put my change_form.html under templates/admin. If I put it under
templates/admin/flatpages or templates/admin/flatpages/flatpage it is
ignored. I am using django 1.1.1. Can anyone tell me what I've missed.
Do I have to turn on that behaviour?

(I'm looking at page 24 of Practical Django Projects 2nd Ed. and
various web pages)

Cheers.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Problem with conflicting flatpages between vhosts

2009-10-24 Thread Adam Olsen

I've got a problem with flatpages.  I've got a single apache instance
running mod_python, and two different django sites that it's serving.
Both django sites have completely different databases... different
database engines even (one is postgres, one is sqlite3), but the
flatpages are conflicting.  site1.com/about/ and site2.com/about/ are
both showing the flatpage from site1.com, even though both sites
define their own /about/ flatpage.

I can't really switch to wsgi, is there another way around this?  Even
if I renamed the flatpage on site2.com to /someotherabout/,
site2.com/about/ would still load the flatpage from site1.com.


-- 
Adam Olsen
SendOutCards.com
http://www.vimtips.org
http://last.fm/user/synic

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Extending Django's Flatpages

2009-10-02 Thread Shawn Milochik

If you're trying to add template tags, check this out: 
http://docs.djangoproject.com/en/dev/howto/custom-template-tags/

Your custom tags go in a directory named "templatetags" in your app  
directory.

Shawn

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Extending Django's Flatpages

2009-10-02 Thread When ideas fail

Hello, i've been having a look at this post on overmortal about
Extending Django's Flatpages:

http://www.overmortal.com/blog/post/17-extending-django-s-flatpages

specifically this section "

Finally, in order to continue using the flatpages/default.html
template file as the singular file for handling flatpage content, we
need to create helper tags to bring out the keywords and description:"

Would that part of the code go in the views.py because I get a 505
error and the error log tells me that it is an invalid tag:

[Fri Oct 02 22:40:11 2009] [error] [client 127.0.0.1]
TemplateSyntaxError: Invalid block tag: 'meta_keywords'

Thanks

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Flatpages - what am I missing to make these work (advice, please)?

2009-08-20 Thread allenh

Hi,

I had the same problem with the SITE_ID mismatched. I also found you
can just recognize the SITE_ID from the admin page by editing the site
form and checking the URL like (http://localhost:8000/admin/sites/site/
1/). The last number on URL is exactly the SITE_ID of your site name.
Just a tip!

On Aug 19, 3:42 pm, gegard  wrote:
> Thank you! That has resolved my problem.
>
> The admin shell does not show the site id number by default, so I
> supposed that removing the default 'example.com' and adding 'mysite'
> would enable Django to reuse id 1. I should have assumed otherwise -
> the new site was id == 2, of course. I should have edited
> 'example.com' rather than removing it.
>
> Geoff
>
> > ... my site.id was not 1 but 2 as I
> > discovered with
> > the shell...
>
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Flatpages - what am I missing to make these work (advice, please)?

2009-08-19 Thread gegard

Thank you! That has resolved my problem.

The admin shell does not show the site id number by default, so I
supposed that removing the default 'example.com' and adding 'mysite'
would enable Django to reuse id 1. I should have assumed otherwise -
the new site was id == 2, of course. I should have edited
'example.com' rather than removing it.

Geoff

> ... my site.id was not 1 but 2 as I
> discovered with
> the shell...

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



  1   2   3   4   >