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

  • Home
  • SEARCH
  • 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 6228869
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T09:27:49+00:00 2026-05-24T09:27:49+00:00

I have two django sites that use the same database and share some of

  • 0

I have two django sites that use the same database and share some of the code. The main parent site is an extranet for staff and contractors, while the second site exposes some of the data to a few of our partners.

I have managed to set up sites to work but found that if I launched Apache and went into the main site, then the partner site wouldn’t work, returning an “Internal Server Error”. If I restarted and went into the partner site, then the main site wouldn’t work.

So I guess they are conflicting over resources.

The server log (see bottom) shows that it is a problem with the win32/lib/pywintypes.py module, line 114. Elsewhere, it’s been suggested to comment out these lines (see below). So I’ve tried this and it works.

I don’t really understand what is going on in the code and whether commenting it out is just going to cause me problems later. So the question is:

Is there something else going on that may be causing this? Is this fudge ‘safe’ to do?

# py2k and py3k differences:
# On py2k, after doing "imp.load_module('pywintypes')", sys.modules
# is unchanged - ie, sys.modules['pywintypes'] still refers to *this*
# .py module - but the module's __dict__ has *already* need updated
# with the new module's contents.
# However, on py3k, sys.modules *is* changed - sys.modules['pywintypes']
# will be changed to the new module object.
# SO: * on py2k don't need to update any globals.
#     * on py3k we update our module dict with the new module's dict and
#       copy its globals to ours.
old_mod = sys.modules[modname]
# Python can load the module
mod = imp.load_dynamic(modname, found)
# Check the sys.modules[] behaviour we describe above is true...
if sys.version_info < (3,0):
    #The fudge bit !!!!!!!!!!!!!!!!!
    #assert sys.modules[modname] is old_mod 
    #assert mod is old_mod
    pass
else:
    assert sys.modules[modname] is not old_mod
    assert sys.modules[modname] is mod
    # as above - re-reset to the *old* module object then update globs.
    sys.modules[modname] = old_mod
    globs.update(mod.__dict__)

Traceback

    mod_wsgi (pid=7164): Exception occurred processing WSGI script 'E:/Programming/django_site/extranet_site/apache/django.wsgi'.
Traceback (most recent call last):              
File "C:\\Python26\\lib\\site-packages\\django\\core\\handlers\\wsgi.py", line 241, in __call__
    response = self.get_response(request)
File "C:\\Python26\\lib\\site-packages\\django\\core\\handlers\\base.py", line 73, in get_response              
        response = middleware_method(request)               
ile "C:\\Python26\\lib\\site-packages\\django\\contrib\\sessions\\middleware.py", line 10, in process_request               
        engine = import_module(settings.SESSION_ENGINE)             
File "C:\\Python26\\lib\\site-packages\\django\\utils\\importlib.py", line 35, in import_module             
        __import__(name)                
File "C:\\Python26\\lib\\site-packages\\django\\contrib\\sessions\\backends\\db.py", line 2, in <module>                
    from django.contrib.sessions.models import Session              
File "C:\\Python26\\lib\\site-packages\\django\\contrib\\sessions\\models.py", line 4, in <module>              
    from django.db import models                
File "C:\\Python26\\lib\\site-packages\\django\\db\\models\\__init__.py", line 12, in <module>              
    from django.db.models.fields.files import FileField, ImageField             
File "C:\\Python26\\lib\\site-packages\\django\\db\\models\\fields\\files.py", line 8, in <module>              
        from django.core.files.storage import default_storage               
File "C:\\Python26\\lib\\site-packages\\django\\core\\files\\storage.py", line 7, in <module>               
    from django.core.files import locks, File               
File "C:\\Python26\\lib\\site-packages\\django\\core\\files\\locks.py", line 25, in <module>                
    import pywintypes               
File "C:\\Python26\\lib\\site-packages\\win32\\lib\\pywintypes.py", line 124, in <module>               
    __import_pywin32_system_module__("pywintypes", globals())               
File "C:\\Python26\\lib\\site-packages\\win32\\lib\\pywintypes.py", line 114, in __import_pywin32_system_module__               
    assert sys.modules[modname   is old_mod         
AssertionError              
  • 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-24T09:27:49+00:00Added an answer on May 24, 2026 at 9:27 am

    Installing pywin32 #212 solved the problem.

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

Sidebar

Related Questions

I have two closely related sites, a main site and a mobile site, hosted
I have a reasonably simple Django (1.1) site where i need some basic interface
I have a Django project that I need mounted at two different subdirectories of
I have multiple sites for the same client, on the same server, running django,
I have Boys and Toys. Two django models. Toys can be owned by more
I have two applications written in Java that communicate with each other using XML
I'm wondering if it's considered okay (particularly, in Django) to have a URL that's
Background I'm developing a django app for a vacation rental site. It will have
I have a script that appends some rows to a table. One of the
I have a website that I built using Django. Using the settings.py file, I

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.