Skip to main content

A simple django app to use th-icloud web platform,

Project description

thwterm is a simple web shell to connect to thhpc cluster through web

thwterm used in iframe in django template

detail documentation is in the “docs” directory

Quick start


  1. pip install django-thwterm

  2. Add “thwterm” to your INSTALLED_APPS setting like this:

    INSTALL_APPS = [
        ...
        'thwterm',
    ]
  3. Include the thwterm URLconf in your project urls.py like this:

    from thwterm import urls as thWTermUrls
    urlpatterns = [...] + thWTermUrls.urlpatterns,
  4. Add the thwterm in your html tempalte by iframe like this:

    1)、add path in project urls like this:

    path(‘xterm/’, main.xTerm),

    2)、in main views.py:

    @login_required

    def xTerm(request):

    return render(request,”xterm.html”,{})

    3)、write the xterm.html tempalte file like:

    <div class=”page-row”>

    <iframe id=”webterminaliframe” src=”/thwterm/” frameborder=”0” width=”100%” height=”100vh” style=”height: 80vh” scrolling=”no”></iframe>

    </div> …

  5. setup thuri appid and appid in settings.py like this;
    THTERMCONF = {

    ‘server’:’{ visual<shell> backend server }’, ‘appid’:’{appid}’, ‘appkey’:’{appkey}’ }

  6. add th user and cluster to session when user login like this:

    request.session[“systemUsername”] = “{thsystem user name}” request.session[“cluster] = “thcluster1”

  7. Start the development server and visit http://yourhost:port/xterm/ you will see the web term

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-thwterm-2.0.1.tar.gz (1.8 MB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page