Coder Social home page Coder Social logo

Comments (9)

python-force avatar python-force commented on July 3, 2024

L10n is brilliant, works great.

1 more thing, is there a way to add to admin links for languages? That editor would choose language and stays on that language entire time while editing.

from django-easymode.

specialunderwear avatar specialunderwear commented on July 3, 2024

Did you install the i18n middlewares? http://packages.python.org/django-easymode/middleware.html

I think these are obsolete though, because django ship with i18n-urls. I didn't really get to testing easymode proper with 1.4. I only managed to find time to fix very obvious bugs.

If you did use the middlewares and the issue stays, this will be fixed in the near future. As for language selection dropdowns, you need to build it yourself, easymode doesn't ship one yet.

from django-easymode.

python-force avatar python-force commented on July 3, 2024

If I add these - 1 or other or both I got this error:
'easymode.middleware.LocaleFromUrlMiddleWare',
'easymode.middleware.LocaliseUrlsMiddleware',

[Mon Apr 02 15:42:35 2012] [error] [client 127.0.0.1] self.load_middleware()
[Mon Apr 02 15:42:35 2012] [error] [client 127.0.0.1] File "/home/example/webapps/bb4/lib/python2.7/django/core/handlers/base.py", line 45, in load_middleware
[Mon Apr 02 15:42:35 2012] [error] [client 127.0.0.1] mod = import_module(mw_module)
[Mon Apr 02 15:42:35 2012] [error] [client 127.0.0.1] File "/home/example/webapps/bb4/lib/python2.7/django/utils/importlib.py", line 35, in import_module
[Mon Apr 02 15:42:35 2012] [error] [client 127.0.0.1] import(name)
[Mon Apr 02 15:42:35 2012] [error] [client 127.0.0.1] File "/home/example/lib/python2.7/easymode/middleware.py", line 46, in
[Mon Apr 02 15:42:35 2012] [error] [client 127.0.0.1] settings.ADMIN_MEDIA_PREFIX[1:]
[Mon Apr 02 15:42:35 2012] [error] [client 127.0.0.1] File "/home/example/webapps/bb4/lib/python2.7/django/utils/functional.py", line 185, in inner
[Mon Apr 02 15:42:35 2012] [error] [client 127.0.0.1] return func(self._wrapped, *args)
[Mon Apr 02 15:42:35 2012] [error] [client 127.0.0.1] AttributeError: 'Settings' object has no attribute 'ADMIN_MEDIA_PREFIX'

I know that in 1.4 'ADMIN_MEDIA_PREFIX' doesnt exist anymore, when I remove those middlewares all is fine.

from django-easymode.

specialunderwear avatar specialunderwear commented on July 3, 2024

The middlewares provide the functionality you want. Please add ADMIN_MEDIA_PREFIX = '/admin/media/' to your settings and test again.
On 2 apr. 2012, at 23:03, rentgeeen wrote:

If I add these - 1 or other or both I got this error:
'easymode.middleware.LocaleFromUrlMiddleWare',
'easymode.middleware.LocaliseUrlsMiddleware',

[Mon Apr 02 15:42:35 2012] [error] [client 127.0.0.1] self.load_middleware()
[Mon Apr 02 15:42:35 2012] [error] [client 127.0.0.1] File "/home/example/webapps/bb4/lib/python2.7/django/core/handlers/base.py", line 45, in load_middleware
[Mon Apr 02 15:42:35 2012] [error] [client 127.0.0.1] mod = import_module(mw_module)
[Mon Apr 02 15:42:35 2012] [error] [client 127.0.0.1] File "/home/example/webapps/bb4/lib/python2.7/django/utils/importlib.py", line 35, in import_module
[Mon Apr 02 15:42:35 2012] [error] [client 127.0.0.1] import(name)
[Mon Apr 02 15:42:35 2012] [error] [client 127.0.0.1] File "/home/example/lib/python2.7/easymode/middleware.py", line 46, in
[Mon Apr 02 15:42:35 2012] [error] [client 127.0.0.1] settings.ADMIN_MEDIA_PREFIX[1:]
[Mon Apr 02 15:42:35 2012] [error] [client 127.0.0.1] File "/home/example/webapps/bb4/lib/python2.7/django/utils/functional.py", line 185, in inner
[Mon Apr 02 15:42:35 2012] [error] [client 127.0.0.1] return func(self._wrapped, *args)
[Mon Apr 02 15:42:35 2012] [error] [client 127.0.0.1] AttributeError: 'Settings' object has no attribute 'ADMIN_MEDIA_PREFIX'

I know that in 1.4 'ADMIN_MEDIA_PREFIX' doesnt exist anymore, when I remove those middlewares all is fine.


Reply to this email directly or view it on GitHub:
#8 (comment)

PermanentMarkers
kvk 09170823
tel 026-3704887
mob 06-24352007
[email protected]
[email protected]

from django-easymode.

python-force avatar python-force commented on July 3, 2024

ok I did that and got error:

AttributeError at /
'WSGIRequest' object has no attribute 'set_cookie'

Request Method: GET
Request URL: http://dev.example.com/en/
Django Version: 1.4
Exception Type: AttributeError
Exception Value:
'WSGIRequest' object has no attribute 'set_cookie'
Exception Location: /home/example/lib/python2.7/easymode/middleware.py in process_request, line 131
Python Executable: /usr/local/bin/python
Python Version: 2.7.1
Python Path:
['/home/example/webapps/bb4',
'/home/example/webapps/bb4/myproject',
'/home/example/webapps/bb4/lib/python2.7',
'/home/example/lib/python2.7/django_rosetta-0.6.2-py2.7.egg',
'/home/example/lib/python2.7/django_localeurl-1.5-py2.7.egg',
'/home/example/lib/python2.7/South-0.7.3-py2.7.egg',
'/home/example/lib/python2.7/sorl_thumbnail-11.12-py2.7.egg',
'/home/example/lib/python2.7/django_transmeta-0.6.7-py2.7.egg',
'/home/example/lib/python2.7',
'/usr/local/lib/python27.zip',
'/usr/local/lib/python2.7',
'/usr/local/lib/python2.7/plat-linux2',
'/usr/local/lib/python2.7/lib-tk',
'/usr/local/lib/python2.7/lib-old',
'/usr/local/lib/python2.7/lib-dynload',
'/usr/local/lib/python2.7/site-packages',
'/usr/local/lib/python2.7/site-packages/PIL']
Server time: Tue, 3 Apr 2012 14:38:23 -0500

from django-easymode.

specialunderwear avatar specialunderwear commented on July 3, 2024

Probably you did not include session middleware or the order of your middle wares is incorrect. Look at the example application to find the correct order.

from django-easymode.

python-force avatar python-force commented on July 3, 2024

Ok great now fully functional:

  1. use only 1 middleware: 'easymode.middleware.LocaliseUrlsMiddleware',
  2. ADMIN_MEDIA_PREFIX = '/admin/media/'

all works on dajngo 1.4 - brilliant

Great work love it :)

Can you explain me 1 thing why I need to put

ADMIN_MEDIA_PREFIX = '/admin/media/'

in django 1.4 is deprecated, what easymode needs to use it? Isnt it only for symbolic link for css (contrib admin)?

Even my symbolic link is pointing to somewhere else in django 1.4 because of new structure.

Anyway awsome work :)

from django-easymode.

specialunderwear avatar specialunderwear commented on July 3, 2024

Like I said, easy mode is not well tested with django 1.4. Some stuff needs to be removed, some issues might exist. Anyway, your comments are very helpful, because they show me where to look. If you find more stuff that seems weird or bugged, please make more tickets.

from django-easymode.

python-force avatar python-force commented on July 3, 2024

yes of course will test for sure so far its great :) thanks a lot

from django-easymode.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.