Code Monkey home page Code Monkey logo

django-subdomains's People

Contributors

cmsimike avatar jezdez avatar petrdlouhy avatar tkaemming avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

django-subdomains's Issues

Enhancement on Documentation: make URL configuration clearer

Hello! First of all, thank you very much for this project, which is being quite useful here at work :)

I have just a little suggestion for making the docs easier to understand. When you provide the example configuration with:

SUBDOMAIN_URLCONFS = {
    None: 'myproject.urls.frontend',  # no subdomain, e.g. ``example.com``
    'www': 'myproject.urls.frontend',
    'api': 'myproject.urls.api',
}

it took me a while to understand that I needed to replace the urls.py with a folder named urls containing frontend.py and api.py

I know I'm a noob and probably someone with more expertise on Django could get there faster but a little phrase referring this would be greatly appreciated :D

Sorry for my bad English and thanks in advance for your attention on this subject…
Keep up the good work!

Issue in Django 1.7 (at leasto on this version I'm working)

Hello,
I've spent whole day at searching for solution for problem: subdomains worked only on first request after server (re)start.
The answer is in function get_domain_for_request() - it returns 'domain.tld' on first request, but on every next request it gives 'http://domain.tld'.

Not elegant, but working quick workaround I used is to add a few lines to get_domain_for_request():

    def get_domain_for_request(self, request):
        """
        Returns the domain that will be used to identify the subdomain part
        for this request.
        """
        domain = get_domain()

        if 'https://' in domain:
            domain = domain.replace('https://', '')
        elif 'http://' in domain:
            domain = domain.replace('http://', '')

        return domain

RequestContext with named url view throws NoReverseMatch

I am able to configure the subdomain fine, however if I try to load the templates with RequestContext I get error -
NoReverseMatch at /home/
u'social' is not a registered namespace

e.g.
urls.py
urlpatterns = patterns(
'',
url(r'^home/$', 'sampleapp.views.subdomain_home', name='subdomain_home'),
)

view
def subdomain_home(request):
return render_to_response(
'subdomain_home.html',
RequestContext(request)
)

If I remove the RequestContext it works fine (though I run into issue with loading my static files). I believe I am not doing something right configuration wise.

Can someone help? happy to provide more details.

Can this project be migrated to jazzband for future maintenance

This project is popular/ was popular with the django community, please can it be migrated to the jazzband project so it may continue to be supported in the future. I have recently helped migrate the dj-database-url project to jazzband so i can lend a hand if needed.

ModuleNotFoundError: No module named 'django.core.urlresolvers'

Hi,

I just updated to django 2.0 and the import of reverse is broken

File "lib/python3.6/site-packages/subdomains/utils.py", line 8, in
from django.core.urlresolvers import reverse as simple_reverse
ModuleNotFoundError: No module named 'django.core.urlresolvers'

Now, reverse is in django.urls

Cannot pass scheme to url template tag

The subdomainurls url tag doesn't accept the scheme argument, utils.reverse accepts a scheme argument but I can't see how to pass it from the tag.
I was hoping to be able to have something like {% url 'the-url' scheme='https' %}

subdomain always None

SUBDOMAIN_URLCONFS = {
None: servers.urls',
'ololo': servers.urls.other',

}
open in browser ololo.domain.com
#~ ololo.domain.com in hosts
#~ domain.com is nginx hostname
then see error page with string:
Using the URLconf defined in servers.urls, Django tried these URL patterns, in this order:

how to fix it?


answer
check defined SIDE_ID from app Sites x_x

Retrieve URL without displaying it

django supports this syntax for url tag:

{% url 'path.to.view' arg arg2 as the_url %}
<a href="{{ the_url }}">I'm linking to {{ the_url }}</a>

https://docs.djangoproject.com/en/dev/ref/templates/builtins/#url

But if i try to use your template tag i get django.template.base.TemplateSyntaxError:

TemplateSyntaxError: 'url' received some positional argument(s) after some keyword argument(s)

This syntax is really helpful if i have to include another template snippet that's usefull on multiple pages and just pass it some predetermined values for current template context, and it's really clean way to do it.

Example:

{% url 'make_donation' fundraiser_id=fundraiser.id as donation_url %}
{% include 'fundraisers/snippets/donate_box.html' with active=fundraiser.active closed_msg=closed_msg donation_url=donation_url %}

parse_bits locals:

{'takes_context': True, 'parser': <django.template.debug.DebugParser object at 0x7f1d87cba050>, 'name': 'url', 'bits': [u"'make_donation'", u'fundraiser_id=fundraiser.id', u'as', u'donation_url'], 'args': [<django.template.base.FilterExpression object at 0x7f1d87cd0610>], 'param': u'fundraiser_id', 'varargs': 'args', 'kwarg': {}, 'params': ['view', 'subdomain'], 'value': <django.template.base.FilterExpression object at 0x7f1d87cd04d0>, 'unhandled_params': ['subdomain'], 'kwargs': {'fundraiser_id': <django.template.base.FilterExpression object at 0x7f1d87cd04d0>}, 'bit': u'as', 'varkw': 'kwargs', 'defaults': (<object object at 0x7f1d8c075290>)  }

Ability to disable subdomain exception/warning (in tests)

When I run my unit test I always get this warning. That's very annoying, because I can't just disable it, but need to provide special fixture or manually add Site to the database that's very confusing and violates DRY principle.

I think that the right solution is to add additional variable or use USE_SUBDOMAIN_EXCEPTION with 3 states: 'exception', 'warning', 'disabled'.

How to manage local development?

How can I test my subdomains locally? For example:

I want to enter test-subdomain.develop:8000 into my browser, and see my site at that subdomain. If I have 'test-subdomain' in my SUBDOMAIN_URLCONF, what else do I have to do to make this work? I tried adding a site to my django_site table, but it didn't work. I tried to add the following to the django_site table:

test-subdomain.develop
test-subdomain.develop:8000
test-subdomain.realdomain.com

Thanks for your time; it seems like I should be seeing a solution, but I'm not sure where to go for next troubleshooting steps.

Doesn't account for differing port numbers in URLs

www.foo.com:8000 isn't recognised as being a subdomain of foo.com:9000.

I ran into this problem when using port-forwarding on a Vagrant machine in which I was running a project with subdomains. The problematic code is in this method and is easily resolved by disregarding the port number.

I'd be more than happy to submit a PR for this if you think this issue is valid.

Empty string '' for subdomain

Hello!

I have the question about reverse function.

reverse have following check:

    domain = get_domain()
    if subdomain is not None:
        domain = '%s.%s' % (subdomain, domain)

But if subdomain is empty string (''), then we get domain equals to .examle.org, what completely doesn't have sense.

So maybe changing check to

    domain = get_domain()
    if subdomain:
        domain = '%s.%s' % (subdomain, domain)

will be better? If subdomain is empty string, then we use main domain. Everyone is happy!

In my code I add subdomains dynamically and sometimes I need to reverse them. Empty subdomain is my main page and I want to resolve it to main domain.

Thanks!

Make namespaced URLs work

Hey. Just started using the package. Great work so far. But! We're making heavy use of namespaced URLs which seem to be incompatible.

Traceback:

Environment:

Request Method: GET
Request URL: http://subdomain.develop:8000/

Django Version: 1.3.1
Python Version: 2.7.3
Installed Applications:
['django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'django.contrib.gis',
 'django.contrib.admin',
 'django.contrib.flatpages',
 'django.contrib.markup',
 '...',
 'subdomains',
 '...', ]
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'subdomains.middleware.SubdomainURLRoutingMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware')


Template error:
In template /vagrant/.../footer.html, error at line 7
   Could not parse the remainder: ':about' from 'offline:about'
   1 : {% load subdomainurls %}
   2 : <div class="footer mini">
   3 :   <div class="inner-wrap">
   4 :     <ul class="copyright">
   5 :       <li>&copy; ...</li>
   6 :       <li><a href="{% url index %}" title="Home">Home</a></li>
   7 :       <li><a title="..." href=" {% url offline:about %} ">About</a></li>
   8 :       <li><a title="..." href="{% url api:index %}">API</a></li>
   9 :       <li><a title="..." href="{% url offline:terms %}">Terms</a></li>
   10 :       <li><a title="..." href="{% url offline:privacy %}">Privacy</a></li>
   11 :       <li><a title="..." href="{% url offline:contact %}">Contact</a></li>
   12 :     </ul>

Traceback:
File "/home/vagrant/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
  136.                     response = response.render()
File "/home/vagrant/local/lib/python2.7/site-packages/django/template/response.py" in render
  97.             self._set_content(self.rendered_content)
File "/home/vagrant/local/lib/python2.7/site-packages/django/template/response.py" in rendered_content
  73.         template = self.resolve_template(self.template_name)
File "/home/vagrant/local/lib/python2.7/site-packages/django/template/response.py" in resolve_template
  49.             return loader.select_template(template)
File "/home/vagrant/local/lib/python2.7/site-packages/django/template/loader.py" in select_template
  197.             return get_template(template_name)
File "/home/vagrant/local/lib/python2.7/site-packages/django/template/loader.py" in get_template
  157.     template, origin = find_template(template_name)
File "/home/vagrant/local/lib/python2.7/site-packages/django/template/loader.py" in find_template
  134.             source, display_name = loader(name, dirs)
File "/home/vagrant/local/lib/python2.7/site-packages/django/template/loader.py" in __call__
  42.         return self.load_template(template_name, template_dirs)
File "/home/vagrant/local/lib/python2.7/site-packages/django/template/loader.py" in load_template
  48.             template = get_template_from_string(source, origin, template_name)
File "/home/vagrant/local/lib/python2.7/site-packages/django/template/loader.py" in get_template_from_string
  168.     return Template(source, origin, name)
File "/home/vagrant/local/lib/python2.7/site-packages/django/template/base.py" in __init__
  108.         self.nodelist = compile_string(template_string, origin)
File "/home/vagrant/local/lib/python2.7/site-packages/django/template/base.py" in compile_string
  136.     return parser.parse()
File "/home/vagrant/local/lib/python2.7/site-packages/django/template/base.py" in parse
  239.                     compiled_result = compile_func(self, token)
File "/home/vagrant/local/lib/python2.7/site-packages/django/template/loader_tags.py" in do_extends
  214.     nodelist = parser.parse()
File "/home/vagrant/local/lib/python2.7/site-packages/django/template/base.py" in parse
  239.                     compiled_result = compile_func(self, token)
File "/home/vagrant/local/lib/python2.7/site-packages/django/template/loader_tags.py" in do_block
  192.     nodelist = parser.parse(('endblock', 'endblock %s' % block_name))
File "/home/vagrant/local/lib/python2.7/site-packages/django/template/base.py" in parse
  239.                     compiled_result = compile_func(self, token)
File "/home/vagrant/local/lib/python2.7/site-packages/django/template/loader_tags.py" in do_block
  192.     nodelist = parser.parse(('endblock', 'endblock %s' % block_name))
File "/home/vagrant/local/lib/python2.7/site-packages/django/template/base.py" in parse
  239.                     compiled_result = compile_func(self, token)
File "/home/vagrant/local/lib/python2.7/site-packages/django/template/loader_tags.py" in do_block
  192.     nodelist = parser.parse(('endblock', 'endblock %s' % block_name))
File "/home/vagrant/local/lib/python2.7/site-packages/django/template/base.py" in parse
  239.                     compiled_result = compile_func(self, token)
File "/home/vagrant/local/lib/python2.7/site-packages/django/template/loader_tags.py" in do_include
  261.                                    isolated_context=isolated_context)
File "/home/vagrant/local/lib/python2.7/site-packages/django/template/loader_tags.py" in __init__
  149.             t = get_template(template_path)
File "/home/vagrant/local/lib/python2.7/site-packages/django/template/loader.py" in get_template
  157.     template, origin = find_template(template_name)
File "/home/vagrant/local/lib/python2.7/site-packages/django/template/loader.py" in find_template
  134.             source, display_name = loader(name, dirs)
File "/home/vagrant/local/lib/python2.7/site-packages/django/template/loader.py" in __call__
  42.         return self.load_template(template_name, template_dirs)
File "/home/vagrant/local/lib/python2.7/site-packages/django/template/loader.py" in load_template
  48.             template = get_template_from_string(source, origin, template_name)
File "/home/vagrant/local/lib/python2.7/site-packages/django/template/loader.py" in get_template_from_string
  168.     return Template(source, origin, name)
File "/home/vagrant/local/lib/python2.7/site-packages/django/template/base.py" in __init__
  108.         self.nodelist = compile_string(template_string, origin)
File "/home/vagrant/local/lib/python2.7/site-packages/django/template/base.py" in compile_string
  136.     return parser.parse()
File "/home/vagrant/local/lib/python2.7/site-packages/django/template/base.py" in parse
  239.                     compiled_result = compile_func(self, token)
File "/home/vagrant/local/lib/python2.7/site-packages/subdomains/compat/template.py" in generic_tag_compiler
  42.         takes_context, name)
File "/home/vagrant/local/lib/python2.7/site-packages/subdomains/compat/template.py" in parse_bits
  123.                 args.append(parser.compile_filter(bit))
File "/home/vagrant/local/lib/python2.7/site-packages/django/template/base.py" in compile_filter
  314.         return FilterExpression(token, self)
File "/home/vagrant/local/lib/python2.7/site-packages/django/template/base.py" in __init__
  502.             raise TemplateSyntaxError("Could not parse the remainder: '%s' from '%s'" % (token[upto:], token))

Exception Type: TemplateSyntaxError at /
Exception Value: Could not parse the remainder: ':about' from 'offline:about'

The offending part seems to be at subdomains/compat/template.py line 123:

parser.compile_filter(bit)

I'm not sure it makes sense to compile filters on the URL name - but then again I haven't dug into the rest of the code.

How to use django-subdomains with cache properly?

I'm trying to use one Django instance for main domain and for one subdomain on it.
I've placed everything related to the subdomain in a single app.
And I've run into a critical issue: cache can't differentiate between domains. So now it's showing the same page on domain and subdomain, whichever root was visited first after caches were expired/cleared.

So far I've found several workarounds for this:

What is the best solution in your opinion? Apart from considering it being a bug, I need a workaround yesterday.

How to route to dynamic subdomains

@tkaemming Can you please tell me how I can route to dynamic subdomains. By dynamic I meant like slack use to do they give every team/organization unique subdomain. Right now I have to hard code the subdomains.??

Exception occurred processing WSGI script :: ImportError: No module named 'subdomains'

I am running an app in apache2 with wsgi, but I am getting this error:

mod_wsgi (pid=26904): Exception occurred processing WSGI script '/var/www/multidb/multidb/wsgi.py'.
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/django/core/handlers/wsgi.py", line 170, in call
self.load_middleware()
File "/usr/lib/python3/dist-packages/django/core/handlers/base.py", line 50, in load_middleware
mw_class = import_string(middleware_path)
File "/usr/lib/python3/dist-packages/django/utils/module_loading.py", line 26, in import_string
module = import_module(module_path)
File "/usr/lib/python3.5/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 986, in _gcd_import
File "", line 969, in _find_and_load
File "", line 944, in _find_and_load_unlocked
File "", line 222, in _call_with_frames_removed
File "", line 986, in _gcd_import
File "", line 969, in _find_and_load
File "", line 956, in _find_and_load_unlocked
ImportError: No module named 'subdomains'

this is my middleware:

MIDDLEWARE_CLASSES = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'subdomains.middleware.SubdomainURLRoutingMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]

I have installed django-subdomains using pip, and it's available in site-packages.

How to test sub-domains in my localhost?

I set up django-subdomains following this [guide][1].

I set my subdomain urlconfs as follows:

    SUBDOMAIN_URLCONFS = {
         None: 'mysite.urls',
        'www': 'mysite.urls',
        'shop': 'mysite.urls.shop',
        'blog': 'mysite.urls.blog'
    }

Everything works nicely, but I can't really test it cause when I run my app on my local host using python manage.py runserver, I can't really add the subdomains. If go to http://blog.127.0.0.1:8000, then the browser says a server cannot be found. Is there any way to set my server in such a way that allows for testing?

I also have this following line in my console:
No handlers could be found for logger "subdomains.middleware"

How can I get this working? If anyone wants, my settings.py file can be found here:

Pastebin Link

ImportError: No module named 'django.core.urlresolvers'

Calling from subdomains.utils import reverse gives the below error

Traceback (most recent call last):
File "", line 1, in
File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\site-packages\subdomains\utils.py", line 8, in
from django.core.urlresolvers import reverse as simple_reverse
ModuleNotFoundError: No module named 'django.core.urlresolvers'

Tag issue at templates with django 1.6

reverse() to a view in another subdomain?

Hi,

Thanks for the awesome work on django-subdomains. I'm trying to incorporate it in my project, but there's an issue I'm not quite sure how to handle:
Let's say I have a abc subdomain and a www subdomain, and I want my view in the abc domain to use Django's reverse() function to another view in the www subdomain. However, because the 2 URLconfs are seperated, reverse() will throw an error instead of correctly finding the view in the www urlconf.
Is there an easy way around this?

url template tag reverse-lookup error when using {% load subdomainurls %}

I am using django-subdomains to enable subdomains for two different apps in my django project, and it seems work well. The one thing I'm having trouble with is reverse-lookup urls in the template tags.

(I'm on Python 2.7, Django 1.6.5)

If I am using the basic {% url 'foo_view' %}, these URLs resolve fine. However, after I add the call {% load subdomainurls %} to the top of my template:

  • {% url 'foo_view' subdomain='www'%} works
  • {% url 'foo_view' %} does not, and raises a NoReverseMatch exception

Nothing else in the template or project has changed. This happens even though the django-subdomains docs state that:

If request is in the template context when rendering and no subdomain is provided, the URL will be attempt to be resolved by relative to the current subdomain. If no request is available, the URL will be resolved using the same rules as a call to subdomains.utils.reverse() without a subdomain argument value.

So, it seems like my app is demanding that I add a subdomain='foo' to the url call (it works when I add that!), even though the docs say it should handle it fine without the subdomain. Is there a reverse-lookup "helper" that I need to add somewhere? ...or is this possibly broken?

Error: No module named 'urlparse'

Hi, I am using Django 1.9 with Python 3.4 and when I try to run this library I get the following error:

File "/Users/xxx/Developer/rodolfomartinez/yyyy/py-zzzzz/env/lib/python3.4/site-packages/subdomains/utils.py", line 2, in <module>
    from urlparse import urlunparse
ImportError: No module named 'urlparse'

The solution to having this library support the missing library is to have this project import urllib and have utils.py have the following code:

try:
    from urllib.parse import urlparse
except ImportError:
    from urlparse import urlparse

Model class error

I keep getting this error

RuntimeError: Model class django.contrib.sites.models.Site doesn't declare an explicit app_label and either isn't in an application in INSTALLED_APPS or else was imported before its application was loaded.

Problem with trailing slash

I have this entry in one of my subdomains urls.py:

url(r'^register/$', SendUserProfileCreationLinkView.as_view(), name='send_userprofile_creation_link'),

When i put in my browser:

subdomain.domain/register/

i get the correct view displayed, but when i try to surf the same url without the trailing slash, like this

subdomain.domain/register

i get a Page Not Found error.

But i don't get this kind of errors in my domain urls (i get redirected to the correct url with a trailing slash). Is there any reason of why this is working like this or is it a bug?

Remove logger

Hey,

I've been using django-subdomains for a while now.
Since I'm working with different domains for my site I set the ROOT_URLCONF to a specific app knowing that all other domains that are not set in the django_sites table will go to that app.

Every time a user gets to my server from a different domain (one not in the django_site table) I get a log record like so:
WARNING:subdomains.middleware:The host does not belong to the domain <site_id Domain>, unable to identify the subdomain for this request

Is there a way to cancel this log records? I'm afraid that in scale i'll get slower results..

Best,
Guy

Middleware fails with Django 1.10

If I use the SubdomainURLRoutingMiddleware middleware with the new MIDDLEWARE = [...] setting then any view fails with:

Traceback (most recent call last):
  File "/home/username/project/test_file.py", line 353, in test_file
    HTTP_HOST='subdomain.example.com'
  File "/home/username/project/env/local/lib/python2.7/site-packages/django/test/client.py", line 541, in post
    secure=secure, **extra)
  File "/home/username/project/env/local/lib/python2.7/site-packages/django/test/client.py", line 343, in post
    secure=secure, **extra)
  File "/home/username/project/env/local/lib/python2.7/site-packages/django/test/client.py", line 409, in generic
    return self.request(**r)
  File "/home/username/project/env/local/lib/python2.7/site-packages/django/test/client.py", line 476, in request
    response = self.handler(environ)
  File "/home/username/project/env/local/lib/python2.7/site-packages/django/test/client.py", line 129, in __call__
    self.load_middleware()
  File "/home/username/project/env/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 82, in load_middleware
    mw_instance = middleware(handler)
TypeError: object() takes no parameters

I believe the middleware may need updating to be compatible with Django 1.10: https://docs.djangoproject.com/en/1.10/topics/http/middleware/#upgrading-pre-django-1-10-style-middleware

ModuleNotFoundError: No module named 'django.core.urlresolvers'

Traceback (most recent call last):
  File "/home/pc/.local/lib/python3.6/site-packages/django/core/servers/basehttp.py", line 44, in get_internal_wsgi_application
    return import_string(app_path)
  File "/home/pc/.local/lib/python3.6/site-packages/django/utils/module_loading.py", line 17, in import_string
    module = import_module(module_path)
  File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/pc/Django_Projects/femi/femi/wsgi.py", line 16, in <module>
    application = get_wsgi_application()
  File "/home/pc/.local/lib/python3.6/site-packages/django/core/wsgi.py", line 13, in get_wsgi_application
    return WSGIHandler()
  File "/home/pc/.local/lib/python3.6/site-packages/django/core/handlers/wsgi.py", line 140, in __init__
    self.load_middleware()
  File "/home/pc/.local/lib/python3.6/site-packages/django/core/handlers/base.py", line 37, in load_middleware
    middleware = import_string(middleware_path)
  File "/home/pc/.local/lib/python3.6/site-packages/django/utils/module_loading.py", line 17, in import_string
    module = import_module(module_path)
  File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/usr/local/lib/python3.6/dist-packages/subdomains/middleware.py", line 8, in <module>
    from subdomains.utils import get_domain
  File "/usr/local/lib/python3.6/dist-packages/subdomains/utils.py", line 8, in <module>
    from django.core.urlresolvers import reverse as simple_reverse
ModuleNotFoundError: No module named 'django.core.urlresolvers'

Please remove the dependency of django.core.urlresolvers and change it to django.urls to make it compatible with Django 2.0

pip install package is out of date.

pip install package is out of date. Changes made on 11-01-2014 for Python3 imports are not included when doing a pip install django-subdomains

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.