Danish Hasan
Danish Hasan

Reputation: 84

Django deployed app refused to connect

I am working on a URL shortening service. Deployed app on Heroku servers successfully https://kwargs.herokuapp.com This URL is getting accessed over all browsers supported via mobile phones. But on desktop it's not getting accessed each time it shows "this site can't be reached refused to connect". I am using Django hosts.

from django.conf import settings
from django.http import HttpResponseRedirect
DEFAULT_REDIRECT_URL = 
getattr(settings,"DEFAULT_REDIRECT_URL","https://kwargs.herokuapp.com")
    def wildcard_redirect(request,path=None):
        if path is not None:
            new_url = DEFAULT_REDIRECT_URL + "/" + path
        return HttpResponseRedirect(new_url)
#sttings.py
ROOT_URLCONF = 'kwargs.urls'
ROOT_HOSTCONF=  'kwargs.hosts'
DEFAULT_HOST = 'kwargs'
DEFAULT_REDIRECT_URL="https://kwargs.herokuapp.com"
PARENT_HOST = "herokuapp.com"

ALLOWED_HOSTS = ['kwargs.herokuapp.com']

#models.py 
def get_short_url(self):
    url_path = reverse("scode",kwargs={'slug':self.shortcode}, 
    host='kwargs',scheme='https')
    return url_path
#host.py file
host_patterns = patterns('',
host(r'kwargs',settings.ROOT_URLCONF,name='kwargs'),
host(r'(?!www)','kwargs.hostconf.urls',name='wildcard'),
)

This is everything that's related to url_config in my code i tried every tweak but still nothing worked. Is there any way to access it on desktop also? I also tried all sorts of things like adding browser to firewall... any help would be appreciable, thanks.

Upvotes: 0

Views: 147

Answers (1)

Danish Hasan
Danish Hasan

Reputation: 84

Solved. it seems There was a problem with my desktop's Firewall setting. it was not letting this request getting accessed.

Upvotes: 1

Related Questions