0

I have a django project that I have been developing on my localserver and it works perfectly. Recently, I tried to move my project to asmallorange's shared hosting. I have followed the guide provided by the hosting company and everything actually works great.

Please look at the bottom of this guide where it talks about modifying .htaccess and dispatch.fcgi:

https://help.asmallorange.com/index.php?/Knowledgebase/Article/View/305/3/install-django-using-virtualenv

So what's the problem? The problem is the django project only works if the .htaccess and dispatch.fcgi file are inside the public_html folder. What do I change if I want the django project to work with the URL mysite.com/myproject? Right now when I go to mysite.com it loads up the project which I hate seeing.

summerNight
  • 1,446
  • 3
  • 25
  • 52
  • 1
    you need to point to your domain mysite.com from hosting's cpanel and from domain's panel, you need to point to namespace of your hosting. putting files in public_html isn't the problem here. you need to configure your domain/hosting properly – ruddra Jul 15 '14 at 06:07

2 Answers2

1

Take a look to this answer. I think that you have to specify to your django application that it must expect the "subdirectory" in the URL.

From the alex vasi response (copy&paste):

Things to try:

  • Change current domain to "yourdomain.tld/cflow" in the "sites" framework. It's easy to do using django admin or dumpdata/loaddata manage.py commands.

  • Looks like your site is using login_required decorator. In that particular case you can add to settings.py:

    LOGIN_URL = '/cflow/accounts/login/'

Community
  • 1
  • 1
jjimenez
  • 853
  • 1
  • 7
  • 18
0

I have found the answer to my specific question. Instead of creating a sub directory create a sub domain for example, myproj.mysite.com and point it to the sub directory.

Keep everything else as it is (as shown in the guide) and it works.

Thanks both of you for taking time to help me out!

summerNight
  • 1,446
  • 3
  • 25
  • 52