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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T05:45:24+00:00 2026-06-12T05:45:24+00:00

I’m working with django and doing facebook integration for which is needed a test

  • 0

I’m working with django and doing facebook integration for which is needed a test server. I’ve had lots of problems with Apache and its caching of .pyc files, I even asked here on stackoverflow.

That solution works but I want to know if there is an option for disabling Apache caching of such files. Server restart might be a problem for me.

EDIT:

Here is the django.wsgi code:

path = '/not/actual/path'
if path not in sys.path:
    sys.path.append(path)

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

import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
  • 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-12T05:45:25+00:00Added an answer on June 12, 2026 at 5:45 am

    How to solve your “Bytecode problem”

    You should probably figure out why those unwanted .pyc files are there in the first place (are these in your repository? They should be ignored).

    As mentionned in the comments, if you have dangling .pyc files that cause issues, you could incorporate removing all the .pyc files as part of your pull process when you deploy newer code to the server. Running the app will re-create the ones that are needed when the modules are imported.


    Now, if you really don’t want to have bytecode generated, you could use the PYTHONDONTWRITEBYTECODE environment variable, but I wouldn’t recommend that as it seems a pretty excessive solution.

    How to solve Apache seemingly pulling older versions of the code.

    Now, you have to make the difference between two problems at play here.

    • Older Bytecode files generated by python (e.g. .pyc files), which can cause an issue in specific cases like replacing a file with a module, but are not often a cause for concern.
    • Mod WSGI not reloading newer code that gets uploaded. This depends on which mode you’re running Mod WSGi in, and an usual symptom is that hitting a page seems to randomly pull the newer or older version of the code.

    To solve the first issue, you just have to remove unused bytecode files. But, again, this probably isn’t what’s causing your issue.

    To solve the second issue, you have two solutions

    • Restarting apache when you upload newer code. Using apache2ctl -k graceful, this will be transparent to your users, and I can’t see why “Server restart might be a problem”, unless you’re on shared hosting.
    • Using code reloading, you might want to have a look at the mod_wsgi documentation.

    I don’t think bytecode is your issue, and code reloading probably is.

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

Sidebar

Related Questions

I'm trying to select an H1 element which is the second-child in its group
I would like my Web page http://www.gmarks.org/math_in_e-mail.txt on my Apache 2.2.14 server to display
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am doing a simple coin flipping experiment for class that involves flipping a
I would like to run a str_replace or preg_replace which looks for certain words
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have an autohotkey script which looks up a word in a bilingual dictionary

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.