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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T16:28:02+00:00 2026-06-06T16:28:02+00:00

I’m stuck with migrating my Django project to a production server. Here is the

  • 0

I’m stuck with migrating my Django project to a production server. Here is the situation.
My final result page (HTML source) looks something like this:

Number of exponentials: 1 <br /><br />
Function: 98.919106*2.71828182845905**(-0.014026249*t) <br /><br />
Parameters of exponentials: {&#39;a&#39;: [98.919105999999999], &#39;k&#39;: [0.014026248999999999], &#39;c&#39;: [0]} <br /><br />
Non physical solution:  False <br /><br />

<img src="plots/data_2e_03.png" alt="some_text"/> 

It is a template populated by data from my Django app. The template looks like:

Number of exponentials: {{rp.user_choice.number_of_exponentials}} <br /><br />
Function: {{rp.user_choice.function}} <br /><br />
Parameters of exponentials: {{rp.user_choice.parameters_of_exponentials}} <br /><br />
Non physical solution:  {{rp.user_choice.non_physical_solution}} <br /><br />

<img src="plots/{{rp.input_file_name}}.png" alt="some_text"/> 

The problem is that the image isn’t showing. Only the alt is printed out. When i check the html source (pasted above) it shows plots/data_2e_03.png as a link (yes, in the HTML source). When i click on it takes me to another page’s source.

<html><head>
<title>500 Internal Server Error</title>
</head><body>
<h1>Internal Server Error</h1>
<p>The server encountered an internal error or
misconfiguration and was unable to complete
your request.</p> 
<p>Please contact the server administrator,
[no address given] and inform them of the time the error occurred,
and anything you might have done that may have
caused the error.</p>
<p>More information about this error may be available
in the server error log.</p>
<hr>
<address>Apache/2.2.16 (Debian) Server at bioinformatika.djangoserver Port 80</address>
</body></html>

Here is my apache site configuration:

<VirtualHost *:80>

ServerName bioinformatika.djangoserver
DocumentRoot /home/user/bioinformatika/Server/bioinformatika/apache

Alias /plots/ /home/user/bioinformatika/Server/bioinformatika/bioinformatika/plots/

<Directory /home/user/bioinformatika/Server/bioinformatika/bioinformatika/plots>
Order deny,allow
Allow from all
</Directory>


<Directory /home/user/bioinformatika/Server/bioinformatika/apache>
    Order allow,deny
    Allow from all
</Directory>

WSGIDaemonProcess bioinformatika.djangoserver processes=2 threads=15 display-name=%{GROUP}
WSGIProcessGroup bioinformatika.djangoserver

WSGIScriptAlias / /home/user/bioinformatika/Server/bioinformatika/apache/django.wsgi

For the purpose of letting apache handle my media files, i added the:

Alias /plots/ /home/user/bioinformatika/Server/bioinformatika/bioinformatika/plots/

<Directory /home/user/bioinformatika/Server/bioinformatika/bioinformatika/plots>
Order deny,allow
Allow from all
</Directory>

Other parts are about setting apache, mod_wsgi and Django, and are working.

Once i remove the Debug in Django settings.py. The page (with Internal server error) whose source was shown is now rendered and showed in the browser.
/etc/log/apache2/error.log gives the following:

[Sun Jun 24 11:22:15 2012] [error] [client 192.168.0.14]     return callback(request, **param_dict)
[Sun Jun 24 11:22:15 2012] [error] [client 192.168.0.14]   File "/home/user/bioinformatika/virtual_bio/lib/python2.6/site-packages/Django-1.4-py2.6.egg/django/utils/decorators.py", line 91, in _wrapped_view
[Sun Jun 24 11:22:15 2012] [error] [client 192.168.0.14]     response = view_func(request, *args, **kwargs)
[Sun Jun 24 11:22:15 2012] [error] [client 192.168.0.14]   File "/home/user/bioinformatika/virtual_bio/lib/python2.6/site-packages/Django-1.4-py2.6.egg/django/views/defaults.py", line 32, in server_error
[Sun Jun 24 11:22:15 2012] [error] [client 192.168.0.14]     t = loader.get_template(template_name) # You need to create a 500.html template.
[Sun Jun 24 11:22:15 2012] [error] [client 192.168.0.14]   File "/home/user/bioinformatika/virtual_bio/lib/python2.6/site-packages/Django-1.4-py2.6.egg/django/template/loader.py", line 145, in get_template
[Sun Jun 24 11:22:15 2012] [error] [client 192.168.0.14]     template, origin = find_template(template_name)
[Sun Jun 24 11:22:15 2012] [error] [client 192.168.0.14]   File "/home/user/bioinformatika/virtual_bio/lib/python2.6/site-packages/Django-1.4-py2.6.egg/django/template/loader.py", line 138, in find_template
[Sun Jun 24 11:22:15 2012] [error] [client 192.168.0.14]     raise TemplateDoesNotExist(name)
[Sun Jun 24 11:22:15 2012] [error] [client 192.168.0.14] TemplateDoesNotExist: 500.html

Any advice is appreciated. I’m thinking the odd behavior could have something to do with my server settings, and my turn out not to be default, easy solvable problem, if that is the case I would appreciate if someone could please check if my apache configuration is correct.

UPDATE:

It was i miss configured paths problem. The meaning of STATIC_URL, STATIC_ROOT, MEDIA_URL, and MEDIA_ROOT were unclear to me which yielded the problem in the question on deployment which i couldn’t fully diagnose.

However, the way to avoid it is to have a working conceptual knowledge of how files are served on a development and production server.

  • 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-06T16:28:04+00:00Added an answer on June 6, 2026 at 4:28 pm

    In your projectname/templates folder you need to create a file called 500.html for the server to display when in non-DEBUG mode. (you should create a 404.html file for a similar purpose).

    You also need to make sure settings.TEMPLATE_DIRS includes the absolute path to your projectname/templates folder.. on the server.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I would like my Web page http://www.gmarks.org/math_in_e-mail.txt on my Apache 2.2.14 server to display
That's pretty much it. I'm using Nokogiri to scrape a web page what has
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have this code to decode numeric html entities to the UTF8 equivalent character.
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 &#8217; in it. SimpleXML turns this
I'm parsing an XML file, the creators of it stuck in a bunch social
I have thousands of HTML files to process using Groovy/Java and I need to

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.