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 8796983
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:45:00+00:00 2026-06-13T23:45:00+00:00

The thing is that I have a django project installed in a subdomain in

  • 0

The thing is that I have a django project installed in a subdomain in localhost and at the same time I have the localhost for other stuff without Django.

Whenever I access a1.localhost it displays my django welcome page ok, but when I want to access just localhost it also displays the same django welcome page instead of the index.html.

So far this is what I have:

Hosts:
127.0.0.1       localhost
127.0.0.1       a1.localhost

vhosts.conf:
#-- a1.localhost
<VirtualHost *:80>
    ServerName a1.localhost
    WSGIScriptAlias / "C:/workspace/website1/apache/django.wsgi"
    <Directory "C:/workspace/website1/apache">
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>

#-- localhost
<VirtualHost *:80>
    ServerName localhost
    DocumentRoot "C:/workspace/website1/django_project"
</VirtualHost>


django.wsgi

import os
import sys

path = "C:/workspace/website1/apache/django_project"
if path not in sys.path:
    sys.path.append(path)


os.environ['DJANGO_SETTINGS_MODULE'] = 'django_project.settings'

import django.core.handlers.wsgi

What I want to achieve is to display my normal index.html file in localhost and my django project in a1.localhost.

Thanks.

  • 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-06-13T23:45:01+00:00Added an answer on June 13, 2026 at 11:45 pm

    I think what’s happening here is the first virtual host accepts all traffic to port 80 and redirects it to the django app. The second virtual host is not receiving traffic at all. The whole thing works when they’re different ports, because in that case apache knows which virtualhost should receive the traffic.

    You might need to add a line before these declarations to set up the virtualhost naming, as Kay Zhu mentioned:

    NameVirtualHost *:80

    See this article for more information:
    http://digitalpbk.blogspot.com/2007/01/making-subdomains-on-localhost.html

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

Sidebar

Related Questions

In my current django project I have a model that stores very long strings
I have a django 1.4 project with 2 apps: RemoteStorage and WeShouldServer (that one
I've got a django project working on a development server(ubuntu) that we have been
I have a Django project, that has a Address model. This is used in
We have a small project that involves automatically parsing some server/mail logs (among other
I have an existing Django project that has several models using concrete inheritance of
I have a client's Django project that I'm developing locally, using Mercurial for version
The thing is that I have a very large JS file, with more than
I don't know if the title is right. The thing is that I have
I have this thing that i need to do and some advices will be

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.