[mezzanine-users] Re: EXTRA_MODEL_FIELDS and django 1.8 migration

2015-06-12 Thread Sergey Maranchuk
Tnx! MIGRATION_MODULES helped

пятница, 12 июня 2015 г., 19:33:09 UTC+3 пользователь Mathias Ettinger 
написал:
>
> Hi Sergey,
>
> Since you’re using the development version of mezzanine, you'd better of 
> reading the development version of the documentation.
>
> Have a look at the “Field Injection Caveats” section of 
> https://github.com/stephenmcd/mezzanine/blob/master/docs/model-customization.rst
>
> Any feedback will be appreciated, especially if it doesn't seems to work 
> as expected.
>
> Mathias
>
>
> Le vendredi 12 juin 2015 18:03:57 UTC+2, Sergey Maranchuk a écrit :
>>
>> In django 1.8 migration i can't set app_label in migration file and looks 
>> like not possible create migration in app A for app B.
>> Any ideas?
>>
>

-- 
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] Enable Mezzanine multilingual site support

2015-06-12 Thread Lee H.
Thanks Mathias,

I think it must have been using the old ordering of INSTALLED_APPS, since 
my settings file came from pre-upgrade Mezzanie. On a clean Mezzanine, I no 
longer got the error.

-- 
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] Adding a third-party app to a multilingual site using modeltranslations

2015-06-12 Thread Lee H.
Hey Eduardo,

Many thanks for the reply. Yes, you are right, using the django-newsletter 
development branch from github (which has upgrades for the newer django 
migrations without south) things worked, and this error no longer occurred. 

>
>  

-- 
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] Enable Mezzanine multilingual site support

2015-06-12 Thread Mathias Ettinger
Hi Lee,

To possibilities to fix your problem.

Either you manually added modeltranslation to INSTALLED_APPS in a place 
that is too deep in the loading chain, in this case, just remove it. 
Turning on USE_MODELTRANSLATION will automatically add it to the list.

Or you used the ordering of INSTALLED_APPS provided for Mezzanine 3.1 which 
is not suitable for modeltranslation. Make sure mezzanine.pages is before 
every app that subclass the Page model (gallery, form, shop). Or use the 
list from the development project_template : 
https://github.com/stephenmcd/mezzanine/blob/master/mezzanine/project_template/project_name/settings.py#L206-L226



Le vendredi 12 juin 2015 07:45:23 UTC+2, Lee H. a écrit :
>
> Thanks for the reply Eduardo
>
> I upgraded to the master branch, pip install git+
> https://github.com/stephenmcd/mezzanine.git,  (which also upgraded django 
> to 1.8), and I now get the error:
>
> Traceback (most recent call last):
>   File "manage.py", line 29, in 
> execute_from_command_line(sys.argv)
>   File 
> "/home/lee/Desktop/pyco/compmezz/compenv/local/lib/python2.7/site-packages/django/core/management/__init__.py",
>  
> line 385, in execute_from_command_line
> utility.execute()
>   File 
> "/home/lee/Desktop/pyco/compmezz/compenv/local/lib/python2.7/site-packages/django/core/management/__init__.py",
>  
> line 354, in execute
> django.setup()
>   File 
> "/home/lee/Desktop/pyco/compmezz/compenv/local/lib/python2.7/site-packages/django/__init__.py",
>  
> line 21, in setup
> apps.populate(settings.INSTALLED_APPS)
>   File 
> "/home/lee/Desktop/pyco/compmezz/compenv/local/lib/python2.7/site-packages/django/apps/registry.py",
>  
> line 85, in populate
> app_config = AppConfig.create(entry)
>   File 
> "/home/lee/Desktop/pyco/compmezz/compenv/local/lib/python2.7/site-packages/django/apps/config.py",
>  
> line 87, in create
> module = import_module(entry)
>   File "/usr/lib/python2.7/importlib/__init__.py", line 37, in 
> import_module
> __import__(name)
>   File 
> "/home/lee/Desktop/pyco/compmezz/compenv/local/lib/python2.7/site-packages/mezzanine/conf/__init__.py",
>  
> line 209, in 
> import_module("%s.defaults" % app)
>   File 
> "/home/lee/Desktop/pyco/compmezz/compenv/local/lib/python2.7/site-packages/django/utils/importlib.py",
>  
> line 46, in import_module
> __import__(name)
>   File "/home/lee/Desktop/pyco/compmezz/theme/defaults.py", line 73, in 
> 
> label=_("Name"),
>   File 
> "/home/lee/Desktop/pyco/compmezz/compenv/local/lib/python2.7/site-packages/django/utils/translation/__init__.py",
>  
> line 75, in gettext
> return _trans.gettext(message)
>   File 
> "/home/lee/Desktop/pyco/compmezz/compenv/local/lib/python2.7/site-packages/django/utils/translation/trans_real.py",
>  
> line 319, in gettext
> return do_translate(message, 'gettext')
>   File 
> "/home/lee/Desktop/pyco/compmezz/compenv/local/lib/python2.7/site-packages/django/utils/translation/trans_real.py",
>  
> line 306, in do_translate
> _default = translation(settings.LANGUAGE_CODE)
>   File 
> "/home/lee/Desktop/pyco/compmezz/compenv/local/lib/python2.7/site-packages/django/utils/translation/trans_real.py",
>  
> line 209, in translation
> default_translation = _fetch(settings.LANGUAGE_CODE)
>   File 
> "/home/lee/Desktop/pyco/compmezz/compenv/local/lib/python2.7/site-packages/django/utils/translation/trans_real.py",
>  
> line 189, in _fetch
> "The translation infrastructure cannot be initialized before the "
> django.core.exceptions.AppRegistryNotReady: The translation infrastructure 
> cannot be initialized before the apps registry is ready. Check that you 
> don't make non-lazy g$ttext calls at import time.
>
>
> Upon running the shell or runserver. My attempts at googling suggested the 
> wsgi.py was at fault, but it looks correct: 
> http://paste.ubuntu.com/11700416/
>

-- 
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.


[mezzanine-users] Re: error on create mezzanine Multi-Lingual Sites?

2015-06-12 Thread Mathias Ettinger
Hi,

Can you confirm that you’re using the development version of Mezzanine and 
not the version available through pip.

Also what is your version of Django and django-modeltranslation?

Even though it might not be related, you mentionned adding languages to 
settings.LANGUAGES; but do you have a settings.LANGUAGE_CODE defined?



Le vendredi 12 juin 2015 10:48:53 UTC+2, سید محمد رضا طباطبائی a écrit :
>
> i do this work to make  multi lingual Sites whit mezzanine 
> 1- 
> $ mezzanine-project test
> cd test
>
> 2- edit setting.py USE_MODELTRANSLATION = False to USE_MODELTRANSLATION = 
> True
> 3- add another languge to LANGUAGES in setting.py
> 4- run 
> $python3 manage.py createdb
>
> but show this message
>
> $ python3 manage.py createdb
> /usr/local/lib/python3.3/dist-packages/Mezzanine-3.1.10-py3.3.egg/
> mezzanine/utils/conf.py:51: UserWarning: You haven't defined the 
> ALLOWED_HOSTS settings, which Django requires. Will fall back to the 
> domains configured as sites.
>   warn("You haven't defined the ALLOWED_HOSTS settings, which "
> /usr/local/lib/python3.3/dist-packages/Mezzanine-3.1.10-py3.3.egg/mezzanine/utils/conf.py:59:
>  
> UserWarning: TIME_ZONE setting is not set, using closest match: Asia/Tehran
>   warn("TIME_ZONE setting is not set, using closest match: %s" % tz)
> /usr/lib/python3.3/importlib/_bootstrap.py:313: RemovedInDjango19Warning: 
> django.contrib.contenttypes.generic is deprecated and will be removed in 
> Django 1.9. Its contents have been moved to the fields, forms, and admin 
> submodules of django.contrib.contenttypes.
>   return f(*args, **kwds)
>
> /usr/lib/python3.3/importlib/_bootstrap.py:313: RemovedInDjango19Warning: 
> django.utils.importlib will be removed in Django 1.9.
>   return f(*args, **kwds)
>
> Traceback (most recent call last):
>   File "manage.py", line 34, in 
> execute_from_command_line(sys.argv)
>   File "/usr/local/lib/python3.3/dist-packages/django/core/management/
> __init__.py", line 338, in execute_from_command_line
> utility.execute()
>   File "/usr/local/lib/python3.3/dist-packages/django/core/management/
> __init__.py", line 312, in execute
> django.setup()
>   File "/usr/local/lib/python3.3/dist-packages/django/__init__.py", line 
> 18, in setup
> apps.populate(settings.INSTALLED_APPS)
>   File "/usr/local/lib/python3.3/dist-packages/django/apps/registry.py", 
> line 115, in populate
> app_config.ready()
>   File "/usr/local/lib/python3.3/dist-packages/modeltranslation/apps.py", 
> line 11, in ready
> handle_translation_registrations()
>   File "/usr/local/lib/python3.3/dist-packages/modeltranslation/models.py", 
> line 80, in handle_translation_registrations
> autodiscover()
>   File "/usr/local/lib/python3.3/dist-packages/modeltranslation/models.py", 
> line 17, in autodiscover
> from modeltranslation.translator import translator
>   File "/usr/local/lib/python3.3/dist-packages/modeltranslation/translator
> .py", line 12, in 
> from modeltranslation.manager import (MultilingualManager, 
> MultilingualQuerysetManager,
>   File "/usr/local/lib/python3.3/dist-packages/modeltranslation/manager.py", 
> line 12, in 
> from django.db.models.fields.related import RelatedField, RelatedObject
> ImportError: cannot import name RelatedObject
>
>
> how solve this problem???
>

-- 
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.


[mezzanine-users] Re: EXTRA_MODEL_FIELDS and django 1.8 migration

2015-06-12 Thread Mathias Ettinger
Hi Sergey,

Since you’re using the development version of mezzanine, you'd better of 
reading the development version of the documentation.

Have a look at the “Field Injection Caveats” section of 
https://github.com/stephenmcd/mezzanine/blob/master/docs/model-customization.rst

Any feedback will be appreciated, especially if it doesn't seems to work as 
expected.

Mathias


Le vendredi 12 juin 2015 18:03:57 UTC+2, Sergey Maranchuk a écrit :
>
> In django 1.8 migration i can't set app_label in migration file and looks 
> like not possible create migration in app A for app B.
> Any ideas?
>

-- 
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.


[mezzanine-users] EXTRA_MODEL_FIELDS and django 1.8 migration

2015-06-12 Thread Sergey Maranchuk
In django 1.8 migration i can't set app_label in migration file and looks 
like not possible create migration in app A for app B.
Any ideas?

-- 
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] Adding a third-party app to a multilingual site using modeltranslations

2015-06-12 Thread Eduardo Rivas
Hey Lee.

Their Readme says it's compatible up to Django 1.5. You're using 1.8 or
1.7. Could you verify against a vanilla Django project to see if you get
the same error?

https://github.com/dokterbob/django-newsletter/blob/master/README.rst#compatibility

-- 
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.


[mezzanine-users] Re: Enable Mezzanine multilingual site support

2015-06-12 Thread سید محمد رضا طباطبائی
i tested but don't work show this message 

$ python3 manage.py createdb
/usr/local/lib/python3.3/dist-packages/Mezzanine-3.1.10-py3.3.egg/mezzanine/
utils/conf.py:51: UserWarning: You haven't defined the ALLOWED_HOSTS 
settings, which Django requires. Will fall back to the domains configured 
as sites.
  warn("You haven't defined the ALLOWED_HOSTS settings, which "
/usr/local/lib/python3.3/dist-packages/Mezzanine-3.1.10-py3.3.egg/mezzanine/utils/conf.py:59:
 
UserWarning: TIME_ZONE setting is not set, using closest match: Asia/Tehran
  warn("TIME_ZONE setting is not set, using closest match: %s" % tz)
/usr/lib/python3.3/importlib/_bootstrap.py:313: RemovedInDjango19Warning: 
django.contrib.contenttypes.generic is deprecated and will be removed in 
Django 1.9. Its contents have been moved to the fields, forms, and admin 
submodules of django.contrib.contenttypes.
  return f(*args, **kwds)

/usr/lib/python3.3/importlib/_bootstrap.py:313: RemovedInDjango19Warning: 
django.utils.importlib will be removed in Django 1.9.
  return f(*args, **kwds)

Traceback (most recent call last):
  File "manage.py", line 34, in 
execute_from_command_line(sys.argv)
  File "/usr/local/lib/python3.3/dist-packages/django/core/management/
__init__.py", line 338, in execute_from_command_line
utility.execute()
  File "/usr/local/lib/python3.3/dist-packages/django/core/management/
__init__.py", line 312, in execute
django.setup()
  File "/usr/local/lib/python3.3/dist-packages/django/__init__.py", line 
18, in setup
apps.populate(settings.INSTALLED_APPS)
  File "/usr/local/lib/python3.3/dist-packages/django/apps/registry.py", 
line 115, in populate
app_config.ready()
  File "/usr/local/lib/python3.3/dist-packages/modeltranslation/apps.py", 
line 11, in ready
handle_translation_registrations()
  File "/usr/local/lib/python3.3/dist-packages/modeltranslation/models.py", 
line 80, in handle_translation_registrations
autodiscover()
  File "/usr/local/lib/python3.3/dist-packages/modeltranslation/models.py", 
line 17, in autodiscover
from modeltranslation.translator import translator
  File "/usr/local/lib/python3.3/dist-packages/modeltranslation/translator.
py", line 12, in 
from modeltranslation.manager import (MultilingualManager, 
MultilingualQuerysetManager,
  File "/usr/local/lib/python3.3/dist-packages/modeltranslation/manager.py", 
line 12, in 
from django.db.models.fields.related import RelatedField, RelatedObject
ImportError: cannot import name RelatedObject



-- 
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.


[mezzanine-users] Adding a third-party app to a multilingual site using modeltranslations

2015-06-12 Thread Lee H.
*Background*

I created a multilingual site theme for mezzanine using the new 
multi-lingual support.
I had to do two things:

1) Add translations.py file to the theme app, which defined translations 
for my custom page models that subclass Mezzanine pages.

2) Split my theme app into two apps: "fronttheme" (with templates/, static/ 
and to go high up in the INSTALLED_APPS), and "backtheme" with the rest, as 
per the note from multi-lingual-sites.rst 

 

*If your app defines both models that need to be translated and static 
content or templates that override default ones from Mezzanine, you'll need 
to split your app to distinguish between presentation and content. This is 
due to conflicting ideas with translated model inheritance, and template or 
static file overriding, in regard to the order of INSTALLED_APPS.*


*The problem*

 All well and good, but now I want to add a third-party add (specifically 
django-newsletter to allow users to sign up to a newsletter. I've used this 
in Mezzanine previously with no issues). If I just install the app, and add 
it to INSTALLED_APPS I get the error

django.core.exceptions.AppRegistryNotReady: Models aren't loaded yet.


Does anyone know how I can use a third-party app like this whilst using the 
newer version of Mezzanine with translations?

-- 
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.


[mezzanine-users] error on create mezzanine Multi-Lingual Sites?

2015-06-12 Thread سید محمد رضا طباطبائی
i do this work to make  multi lingual Sites whit mezzanine 
1- 
$ mezzanine-project test
cd test

2- edit setting.py USE_MODELTRANSLATION = False to USE_MODELTRANSLATION = 
True
3- add another languge to LANGUAGES in setting.py
4- run 
$python3 manage.py createdb

but show this message

$ python3 manage.py createdb
/usr/local/lib/python3.3/dist-packages/Mezzanine-3.1.10-py3.3.egg/mezzanine/
utils/conf.py:51: UserWarning: You haven't defined the ALLOWED_HOSTS 
settings, which Django requires. Will fall back to the domains configured 
as sites.
  warn("You haven't defined the ALLOWED_HOSTS settings, which "
/usr/local/lib/python3.3/dist-packages/Mezzanine-3.1.10-py3.3.egg/mezzanine/utils/conf.py:59:
 
UserWarning: TIME_ZONE setting is not set, using closest match: Asia/Tehran
  warn("TIME_ZONE setting is not set, using closest match: %s" % tz)
/usr/lib/python3.3/importlib/_bootstrap.py:313: RemovedInDjango19Warning: 
django.contrib.contenttypes.generic is deprecated and will be removed in 
Django 1.9. Its contents have been moved to the fields, forms, and admin 
submodules of django.contrib.contenttypes.
  return f(*args, **kwds)

/usr/lib/python3.3/importlib/_bootstrap.py:313: RemovedInDjango19Warning: 
django.utils.importlib will be removed in Django 1.9.
  return f(*args, **kwds)

Traceback (most recent call last):
  File "manage.py", line 34, in 
execute_from_command_line(sys.argv)
  File "/usr/local/lib/python3.3/dist-packages/django/core/management/
__init__.py", line 338, in execute_from_command_line
utility.execute()
  File "/usr/local/lib/python3.3/dist-packages/django/core/management/
__init__.py", line 312, in execute
django.setup()
  File "/usr/local/lib/python3.3/dist-packages/django/__init__.py", line 
18, in setup
apps.populate(settings.INSTALLED_APPS)
  File "/usr/local/lib/python3.3/dist-packages/django/apps/registry.py", 
line 115, in populate
app_config.ready()
  File "/usr/local/lib/python3.3/dist-packages/modeltranslation/apps.py", 
line 11, in ready
handle_translation_registrations()
  File "/usr/local/lib/python3.3/dist-packages/modeltranslation/models.py", 
line 80, in handle_translation_registrations
autodiscover()
  File "/usr/local/lib/python3.3/dist-packages/modeltranslation/models.py", 
line 17, in autodiscover
from modeltranslation.translator import translator
  File "/usr/local/lib/python3.3/dist-packages/modeltranslation/translator.
py", line 12, in 
from modeltranslation.manager import (MultilingualManager, 
MultilingualQuerysetManager,
  File "/usr/local/lib/python3.3/dist-packages/modeltranslation/manager.py", 
line 12, in 
from django.db.models.fields.related import RelatedField, RelatedObject
ImportError: cannot import name RelatedObject


how solve this problem???

-- 
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.