idlesign / django-siteprefs

Reusable app for Django introducing site preferences system
https://github.com/idlesign/django-siteprefs
BSD 3-Clause "New" or "Revised" License
17 stars 6 forks source link

Extra import in utils.py #2

Closed jeroenpeters1986 closed 10 years ago

jeroenpeters1986 commented 10 years ago

Hi,

In utils.py there is a line which says

import_module(get_frame_locals(3)['__package__'], PREFS_MODULE_NAME)

My Django app doesn't work with it, and it does perfectly without it. Can you explain to me what this does? It looks like it retrieves an imported package name, but at my computer it fails. Maybe you could add a try-except there?

idlesign commented 10 years ago

Hi,

This one tries to import prefs from project package. Relies on project structure introduced somewhat in Django 1.5, if I'm not mistaken (where project dir is on the same level with apps dirs).

What layout do you use, maybe we could find a proper solution for this.

jeroenpeters1986 commented 10 years ago

Dear Igor,

I do have a Python 2.7 and Django 1.5.4 installation.

My directorystructure is as follows:

root / root / manage.py root / settings.py (imports from config/settings.py) root / config / settings.py root / voip_app / init.py root / voip_app / models.py root / voip_app / and-so-on

Is this the kind of layout you are referring to?

idlesign commented 10 years ago

Yeah, and that what was expected:

/
/manage.py
/project/__init__.py
/project/settings.py
[etc]
/app1/
/app2/
[etc]

I'll see what can be done. Thank you.

idlesign commented 10 years ago

Sorry for the delay. You can now give it another try with the latest sources. If this one is fixed I'll issue 0.2.1.

idlesign commented 10 years ago

Will consider closed.

jeroenpeters1986 commented 10 years ago

Hi Igor, im sorry I missed it, my project was on hold for a while. I can't get it to work with the new version either but you can keep it closed as far as i'm concerned. When I will use it again, I'll try to see I can provide you with more details

idlesign commented 10 years ago

Deal.