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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T01:09:36+00:00 2026-05-19T01:09:36+00:00

I have a Django app we’re attempting to deploy to a Tomcat server, using

  • 0

I have a Django app we’re attempting to deploy to a Tomcat server, using django-jython.

Just to test things, I’ve created the WAR archive file for a empty Django app successfully. The test Django application is called “chair”.

Our Tomcat server apparently doesn’t like WAR archives files, so I exploded (unzipped this), and copied these files to the server.

The webserver admin has created a context for me, and a directory for that context (mediatracking).

I’ve copied the files from the WAR archive into that directory, and I’m not quite sure how to get that test app to “run” now?

\mediatracking
 - application.py 
 - application$py.class 
 \WEB-INF 
   web.xml 
   \lib 
    - jruby-extras-fileservlet.jar 
    - jython.jar 
   \lib-python 
     - Lib.pth 
     - README 
     \chair 
     \django 
     \doj 
     \Lib 

etc. (I haven’t descended lower than that in the chair/django/doj/Lib directory.)

Is there anything obvious missing from the above directory structure?

And how exactly do I get the Tomcat server to actually “run” this app? It doesn’t run automatically if you go to the context directory (and there’s only a application.py and application$py.class file there, so I’m not sure how it would).

Do I need to ask my webserver admin to do something with the web.xml file? I checked that, and there doesn’t seem to be anything in there that would help this app run either:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
  <display-name>chair</display-name>
  <description>
   chair through WSGI with modjy
  </description>
  <context-param>
    <param-name>files.prefix</param-name> <!-- Needed by fileservlet -->
    <param-value></param-value>
   </context-param>
  <servlet>
    <servlet-name>modjy</servlet-name>
    <servlet-class>com.xhaus.modjy.ModjyJServlet</servlet-class>
    <init-param>
      <param-name>reload_on_mod</param-name>
      <param-value>1</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
  </servlet>

  <servlet>
    <servlet-name>fileservlet</servlet-name>
    <servlet-class>org.jruby.webapp.FileServlet</servlet-class>
  </servlet>


  <servlet-mapping>
    <servlet-name>fileservlet</servlet-name>
    <url-pattern>/media/*</url-pattern>
  </servlet-mapping>

  <servlet-mapping>
    <servlet-name>modjy</servlet-name>
    <url-pattern>/*</url-pattern>
  </servlet-mapping>
</web-app>

Any advice at all would be greatly appreciated =).

Cheers,
Victor

  • 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-19T01:09:36+00:00Added an answer on May 19, 2026 at 1:09 am

    This is a late answer, but I hadn’t seen this question so far. Hope it still helps.
    Here are the steps I always follow (successfully).

    1) Create the war file:

    manage war --include-java-libs "...your external jars here..." --context-root=chair
    

    The name of context-root is important because Django-on-Jython will manipulate your settings.py file and modify your MEDIA_URL and ADMINMEDIA_URL to add that context (e.g. MEDIA_URL = '/chair/media/'), and it must be the same context that you deploy to in Tomcat. It will be the same name of the generated war file (in this case chair.war). In external JARs include at least your JDBC drivers.

    2) Deploy the war to Tomcat (has never been a problem in any Tomcat I used, versions 5 and 5.5). I do it manually through the HTML manager app at URL http://server:8080/manager/html – it will require authentication, use a username/password that has manager privileges in Tomcat’s conf/users.xml I think (I’m writing from memory). There are plenty ways to automate this with Ant, Maven or other tools, but manual is just fine.

    If you absolutely have to unwar the file manually, use a folder name that is exactly the same of the war file (and thus the context-root), in this case webapps/chair in the Tomcat install folder.

    3) Access your deployed app from URL http://server:8080/chair/ (plus any additional url path as defined in urls.py)

    The Modjy servlet is the one running serving your urls, as defined in:

      <servlet-mapping>
        <servlet-name>modjy</servlet-name>
        <url-pattern>/*</url-pattern>
      </servlet-mapping>
    

    If you don’t see what you expect at http://server:8080/chair/ check in the HTML manager whether the app was really started, and check your Tomcat logs for errors (typically logs/catalina.out at the tomcat installation dir).

    More info in the official doc: http://packages.python.org/django-jython/war-deployment.html

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

Sidebar

Related Questions

I'm using Google App Engine and Django templates. I have a table that I
As the title suggests, I'm using Google App Engine and Django. I have quite
I have a django app which basically is just a photo album. Right now
I have written a Django app that makes use of Python threading to create
I have configured my Django app to run under Apache+FastCGI on Linux (Ubuntu, if
I have a pretty standard django app, and am wondering how to set the
For my Django app I have Events, Ratings, and Users. Ratings are related to
Is it dangerous to have your admin interface in a Django app accessible by
Say I have a blogging app in Django. How can i re-order the posts
I'm writing a simple real-estate listing app in Django. Each property needs to have

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.