Re: [mezzanine-users] Re: Wordpress import and redirects

2017-05-29 Thread Karim
On Mon, May 29, 2017 at 12:40 PM, Stephen McDonald  wrote:

> Not sure about the second issue, but if you can create a PR with your fix
> for the first issue, that would be great thanks.


​The second issue is not an issue was my misunderstanding. I finally
deployed my blog with Mezzanine and everything works.

About the PR, I'll do that ASAP

Thank you Stephen :-)​



-- 
Karim N. Gorjux

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


Re: [mezzanine-users] Re: Wordpress import and redirects

2017-05-28 Thread Stephen McDonald
Not sure about the second issue, but if you can create a PR with your fix
for the first issue, that would be great thanks.

On Sun, May 28, 2017 at 8:05 PM, Karim  wrote:

> Hello, I found some time to work on this and I changed the
> import_wordpress.py (line 75)
>
> if entry.wp_post_type == "post":
> ​​
> post = self.add_post(title=entry.title, content=content,
> ​​
> pub_date=pub_date, tags=terms["tag"],
> ​​
> categories=terms["category"],
> *​​old_url=entry['link'])*
>
>
> ​Instead of* old_url=entry.id * I used
> *old_url=entry['link']*
>
> The result: I got ALL the redirects.​
>
> Another issue (or maybe not) is the redirects with accents. I have some
> redirects like:
>
> *old_url = /2010/05/03/la-stagione-della-luce-e-arrivata-finalmente/*
> *new_url = /blog/la-stagione-della-luce-%C3%A8-arrivata-finalmente/*
>
>
> This works because the new url is handled by mezzanine. The new_url slug
> is generated from the title (?).
>
> In this case:
>
> *old_url =
>  
> /2010/03/09/e%e2%80%99-possibile-dare-una-spintarella-a-questo-inverno-e-mandarlo-gentilmente-in-vacanza-nell%e2%80%99emisfero-australe/*
> *new_url
> = 
> /blog/e-possibile-dare-una-spintarella-a-questo-inverno-e-mandarlo-gentilmente-in-vacanza-nellemisfero-australe/*
>
>
> But actually in wordpress the original old_url is:
> */2010/03/09/e’-possibile-dare-una-spintarella-a-questo-inverno-e-mandarlo-gentilmente-in-vacanza-nell’emisfero-australe/*
>
> ​If in my local I use the old_url as in the Redirect object, the url is
> changed to: *http://127.0.0.1:8000/2010/03/09/e
> ’-possibile-dare-una-spintarella-a-questo-inverno-e-mandarlo-gentilmente-in-vacanza-nell’emisfero-australe/*
> (as in wordpress), but I get a 404.​
>
> ​I have the feeling that this is a bug.​
>
> ​Any thoughts?​
>
>
>
> --
> Karim N. Gorjux
>
> --
> You received this message because you are subscribed to the Google Groups
> "Mezzanine Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mezzanine-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Stephen McDonald
http://jupo.org

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


Re: [mezzanine-users] Re: Wordpress import and redirects

2017-05-28 Thread Karim
Hello, I found some time to work on this and I changed the
import_wordpress.py (line 75)

if entry.wp_post_type == "post":
​​
post = self.add_post(title=entry.title, content=content,
​​
pub_date=pub_date, tags=terms["tag"],
​​
categories=terms["category"],
*​​old_url=entry['link'])*


​Instead of* old_url=entry.id * I used
*old_url=entry['link']*

The result: I got ALL the redirects.​

Another issue (or maybe not) is the redirects with accents. I have some
redirects like:

*old_url = /2010/05/03/la-stagione-della-luce-e-arrivata-finalmente/*
*new_url = /blog/la-stagione-della-luce-%C3%A8-arrivata-finalmente/*


This works because the new url is handled by mezzanine. The new_url slug is
generated from the title (?).

In this case:

*old_url =
 
/2010/03/09/e%e2%80%99-possibile-dare-una-spintarella-a-questo-inverno-e-mandarlo-gentilmente-in-vacanza-nell%e2%80%99emisfero-australe/*
*new_url
= 
/blog/e-possibile-dare-una-spintarella-a-questo-inverno-e-mandarlo-gentilmente-in-vacanza-nellemisfero-australe/*


But actually in wordpress the original old_url is:
*/2010/03/09/e’-possibile-dare-una-spintarella-a-questo-inverno-e-mandarlo-gentilmente-in-vacanza-nell’emisfero-australe/*

​If in my local I use the old_url as in the Redirect object, the url is
changed to: *http://127.0.0.1:8000/2010/03/09/e
’-possibile-dare-una-spintarella-a-questo-inverno-e-mandarlo-gentilmente-in-vacanza-nell’emisfero-australe/*
(as in wordpress), but I get a 404.​

​I have the feeling that this is a bug.​

​Any thoughts?​



-- 
Karim N. Gorjux

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


Re: [mezzanine-users] Re: Wordpress import and redirects

2017-05-21 Thread Karim
On Sun, May 21, 2017 at 11:38 PM, Ken Bolton  wrote:

> Database looks good.
>
> Can you try an experiment for me? Try making a new mezzanine site exactly
> as you
> ​[...]
>

​Done. Everything seems fine. No strange characters and if I add accents
chars to the database, everything is rendered correctly.

I think is something related to the import_wordpress

​Cheers



-- 
Karim N. Gorjux

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


Re: [mezzanine-users] Re: Wordpress import and redirects

2017-05-21 Thread Ken Bolton
Database looks good.

Can you try an experiment for me? Try making a new mezzanine site exactly
as you made the one into which you are importing. The `createdb` step
should import some data into the new site. Some of the imported data will
have accent characters. When you execute the `runserver` command and
navigate to the site, some of the gallery images may break. If they do, we
know that the character encoding is a problem.

If that does result in errors, the solutions can be found in the
`fabfile.py`:
https://github.com/stephenmcd/mezzanine/blob/master/mezzanine/project_template/fabfile.py#L470-L477
and
https://github.com/stephenmcd/mezzanine/blob/master/mezzanine/project_template/fabfile.py#L506-L508

hth,
ken

On Sun, May 21, 2017 at 9:16 AM, Karim  wrote:

>
> On Sun, May 21, 2017 at 11:03 PM, Ken Bolton  wrote:
>
>> Hi Karim,
>>
>> Not at all certain, but it sounds like you may have a problem with
>> character encoding in the database,
>>
>
> ​Postgresql:
>
> # SHOW SERVER_ENCODING;
>
>  server_encoding
>
> -
>
>  UTF8
>
> (1 row)
>
>
>
>
>> the operating system, or both.
>>
>
> ​I use a mac and python3. No problem with other projects. It's not a
> confirm but I don't know how to test if my encoding it's ok.​
>
>
> ​Thank you.​
>
> --
> Karim N. Gorjux
>
> --
> You received this message because you are subscribed to the Google Groups
> "Mezzanine Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mezzanine-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: [mezzanine-users] Re: Wordpress import and redirects

2017-05-21 Thread Karim
On Sun, May 21, 2017 at 11:03 PM, Ken Bolton  wrote:

> Hi Karim,
>
> Not at all certain, but it sounds like you may have a problem with
> character encoding in the database,
>

​Postgresql:

# SHOW SERVER_ENCODING;

 server_encoding

-

 UTF8

(1 row)




> the operating system, or both.
>

​I use a mac and python3. No problem with other projects. It's not a
confirm but I don't know how to test if my encoding it's ok.​


​Thank you.​

-- 
Karim N. Gorjux

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