Forums

cannot import name i18n_patterns

Hello Guys,

A little help, im setting up a django-cms, everything seemed to go smoothly until i tried to check my site http://eakdev.pythonanywhere.com/ and gave me an error (kindly check on my url to see the error).

I would really love some help, thanks!!!

You appear to be using Django 1.3, but it appears that the i18n_patterns() function was added in Django 1.4. I'm not sure if this import is in your code or a library you're using, but someone is assuming Django 1.4 and it's failing on 1.3 because of the lack of this function.

Are you trying to use Django 1.4 from a virtualenv? If so, it seems something isn't set up correctly because it's using 1.3. Note that the system default Django on PA is currently 1.3.

See this tutorial for how to run webapps under Django 1.4 on PA.

Hi Cartroo

Now I know why, yes im using it in my code as import on my url.py. Since im not on a virtualenv i bet im using the default Django 1.4. Based from your answer, the solution for this is to use a virtualenv? Any suggested link on how to setup a virtualenv properly on PA?

Or, is there a way to solve this another way?

THanks

Just to clarify, the system Django is 1.3, not 1.4 as you mentioned in your reply. You need to run your code under 1.4 it seems, and the best solution to doing so is with virtualenv.

The final link in my previous post points to a tutorial on how to set up Django 1.4 in a virtualenv.

Sorry did not notice that. Thanks!!!

You're welcome. If you have any problems with the virtualenv or any other part of the tutorial, first try re-reading it again carefully and also take a look elsewhere in the forums, where other users have raised a few related issues.

Hi Cartroo,

Just want to say TY, i actually did have another problem coz i was unable to access mysql server. After reading some of the threads it turns out i just needed to use "mkvirtualenv django14 --system-site-packages" rather than "mkvirtualenv django14" only to include mysql on the virtualenv.

Anyhow so far everything is going great. Thanks....

Ok got a new problem,

url: http://eakDev.pythonanywhere.com/

if you look at my url it shows the django-cms welcome page, hence i assumed everything was working.

when i go to admin and add a page (saved and published and also reloaded), the changes (added page), im expecting the new added page to show but nothing changed. I think the problem is with my wsgi? what do you think?

Note: when i did this on a local computer, adding a new page on the admin interface shows it on the url.

UPDATE: i was reading the error log files and saw this one. "ImportError: Could not import settings 'north.settings' (Is it on sys.path?): No module named north.settings"

Looks like you need to install the north package in your virtualenv.

hi @glenn,

would you elaborate a bit please, what do you mean north package? "north" is the name of my django app i created.

Here's what i did. 1. Setup a virtualenv with django1.4 in it using this tut: http://virtualenvdemo.pythonanywhere.com/ 2. configured it to use django-cms using this: http://docs.django-cms.org/en/2.3.5/getting_started/tutorial.html

NOTE: I got through until 1.3.3 of the instruction , i was able to show the django-cms default page. But after adding some pages nothing is changing.

help would be great please thanks !!!

Ah. In that case you probably have a problem with your python path or you don't have a settings.py, or there are errors in settings that prevent it from loading. You can either post you wsgi file and your settings file here or, if you like, I can have a look at your files to work out what's happening.

Hi @glenn

I don't mind you looking at my files, how do i let you see them? sorry new here in PA. :)

Thank you

I think the north.settings error you're seeing is an old one. I can also see that there are pages in the database. I don't know django-cms well enough to help out with any specifics there. It seems that the PythonAnywhere-specific config and code that you have is working fine. Perhaps asking for help on the django-cms forums will be more useful.