Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 712577
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T04:51:49+00:00 2026-05-14T04:51:49+00:00

I am running my django project from subfolder of a website. Lets say the

  • 0

I am running my django project from subfolder of a website. Lets say the address where my project is meant to open from is.

http://example.com/myproject/

the myproject folder is root folder for my user account. In that folder i have fcgi script that starts my project. The .htaccess file in the folder contains this:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ mysite.fcgi/$1 [QSA,L]

The trouble is, that at some cases, instead of redireting user to page like

http://example.com/myproject/social/someurl/

it redirects to

http://example.com/social/someurl/

which does not work. What i want to know is how to fix this problem.

Redirects in django-socialauth (github.com/uswaretech/Django-Socialauth), socialauth.views.py line 177 redirects without /myproject/, similar to the generic example above. I also use django cms2.0 in the project and it redirects user at admin auth to example.com/en/myproject/admin/, not example.com/myproject/en/admin. But that could be django cms’s problem.

Is this kind of behaviour django problem and i should change it with urconf and add myproject to all urls, or should i do this with .htaccess? I found similar question, which, sadly, remains unanswered:
How to write .htaccess if django project is in subfolder and subdomain?

Alan.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T04:51:49+00:00Added an answer on May 14, 2026 at 4:51 am

    It’s seems that django-cms-2.0 add the locale prefix to the url using the middleware level. Very well indeed.

    But what’s more interesting is that they prefix all of the url using resolve(‘pages-root’)

    So, you might be able to do this in the urls.py instead…

    if not settings.DEBUG:
        urlpatterns += patterns('',
           url(r'^myproject/$', details, {'slug':''}, name='pages-root')
        )
    

    Just make sure that you append the above urlpatterns before the cms.urls.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm running Django 1.2 beta and trying out the new feature: message framework. http://docs.djangoproject.com/en/dev/ref/contrib/messages/
I'm currently running a Django project on my school's webserver with FCGI. I did
I'm running a django project on Centos 5.4 and serving it with httpd/mod_wsgi. I
I have a Django-project which was running fine, until I made some changes I
I'm working on a django-nonrel project running on Google's AppEngine. I want to create
I am creating a small commercial web project running Apache/WSGI/Django/MySQL. I have a development
I am trying to get my Django project running on the production server. I
I have a Django project that uses Celery for running asynchronous tasks. I'm doing
I'm using the Django nonrel project on a google app engine project running locally
I am using Python 2.7 and trying to get a Django project running on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.