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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T23:22:51+00:00 2026-06-16T23:22:51+00:00

I am trying to create a web application as a front end to another

  • 0

I am trying to create a web application as a front end to another Python app. I have the user enter data into a form, and upon submitting, the idea is for the data to be saved in a database, and for the data to be passed to a thread object class. The thread is something that is strictly kicked-off based on a user action. My problem is that I can import threading, but cannot access threading.Thread. When the thread ends, it will update the server, so when the user views the job information, they’ll see the results.

View:

@login_required(login_url='/login')
def createNetworkView(request):
    if request.method == "POST":
        # grab my variables from POST
        job = models.MyJob()
        # load my variables into MyJob object
        job.save()
        t = ProcessJobThread(job.id, my, various, POST, inputs, here)
        t.start()
        return HttpResponseRedirect("/viewJob?jobID=" + str(job.id))
    else:
        return HttpResponseRedirect("/")

My thread class:

import threading # this works
print "About to make thread object" # This works, I see this in the log
class CreateNetworkThread(threading.Thread): # failure here
    def __init__(self, jobid, blah1, blah2, blah3):
        threading.Thread.__init__(self)

    def run(self):
        doCoolStuff()
        updateDB()

I get:

Exception Type: ImportError
Exception Value:    cannot import name Thread

However, if I run python on the command line, I can import threading and also do from threading import Thread. What’s the deal?

I have seen other things, like How to use thread in Django and Celery but that seemed overkill, and I don’t see how that example could import threading and use threading.Thread, when I can’t.
Thank you.

Edit: I’m using Django 1.4.1, Python 2.7.3, Ubuntu 12.10, SQLite for the DB, and I’m running the web application with ./manage.py runserver.

  • 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-16T23:22:52+00:00Added an answer on June 16, 2026 at 11:22 pm

    This was a silly issue I had. First, I had made a file called “threading.py” and someone suggest I delete it, which I did (or thought I did). The problem was because of me using Eclipse, the PyDev (Python) plugin for Eclipse only deleted the threading.py file I created, and hides the *.pyc file. I had a lingering threading.pyc file lingering around, even though PyDev has an option that I had enabled to delete orphaned .pyc files.

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

Sidebar

Related Questions

Trying to create a web-front end for a Python3 backed application. The application will
So i'm trying to create an offline app with AngularJS as the front-end and
I am trying to create a web application, where the user can pick a
I'm trying to create a web user interface for a Java application. The user
I'm trying to create a web application that will allow a user to post
So I have been trying to create a new RESTfull web application project in
I am trying to create, essentially, a 'kiosk' I have an web application that
I am trying to create an asp.net web application, in which when user logins
I have a web application that I'm trying to create a Web Deployment Project
I have built a web application which uses two web front end servers, the

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.