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.

1
  • 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 Commented Jul 15, 2014 at 6:07

2 Answers 2

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/'

Sign up to request clarification or add additional context in comments.

Comments

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!

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.