Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Photologue without SITE_ID setting attribute #172

Open
urtzai opened this issue Feb 21, 2017 · 1 comment
Open

Photologue without SITE_ID setting attribute #172

urtzai opened this issue Feb 21, 2017 · 1 comment
Labels

Comments

@urtzai
Copy link
Contributor

urtzai commented Feb 21, 2017

I'm trying to develop a multisite web in just one Django instance using sites framework. I don't need the SITE_ID attribute because I just route each subsite using get_current_site(request) call from my views. So, how can I avoid this error? Any workaround solution?

Thank you very much!

File "/var/csmant/downloads/eggs/django_photologue-3.6-py2.7.egg/photologue/views.py", line 16, in <module>
    class GalleryListView(ListView):
  File "/var/csmant/downloads/eggs/django_photologue-3.6-py2.7.egg/photologue/views.py", line 17, in GalleryListView
    queryset = Gallery.objects.on_site().is_public()
  File "/var/csmant/downloads/eggs/Django-1.10.5-py2.7.egg/django/db/models/manager.py", line 85, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/var/csmant/downloads/eggs/django_photologue-3.6-py2.7.egg/photologue/managers.py", line 15, in on_site
    return self.filter(sites__id=settings.SITE_ID)
  File "/var/csmant/downloads/eggs/Django-1.10.5-py2.7.egg/django/conf/__init__.py", line 54, in __getattr__
    return getattr(self._wrapped, name)
AttributeError: 'Settings' object has no attribute 'SITE_ID'
@richardbarran
Copy link
Owner

It sounds like the SITE_ID attribute could be replaced by a call to get_current_site(request) in the Photologue source code.
If you want to modify the source code and raise a pull request, I'll be happy to take a look at it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants