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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:34:26+00:00 2026-05-25T01:34:26+00:00

I am trying to use jQuery on a Django site. I need to include

  • 0

I am trying to use jQuery on a Django site. I need to include the jQuery.js library. I have read a lot about Django static files, but I don’t think anyone has asked this particular question. I have only three static files to serve: jquery.js, anothersmallfile.js, and styles.css. The Django docs on static file serving say:

“For small projects, this isn’t a big deal, because you can just keep the static files somewhere your web server can find it. link

I would like to “just keep them somewhere my webserver can find them” because elsewhere the Django docs clearly state (warn) that their static-files serving method is only for a development environment. I only have a few static files and I just want the simplest secure solution.

Unfortunately I can’t get it working. No matter where I put the files, Django can’t find them. Debugging through Chrome web developer console I see I’m getting a 404 error:

GET http://127.0.0.1:8000/templates/polls/jquery.js 404 (NOT FOUND)

I am new to running a server. Do I A.) need to tell my urls.py file where to find static files? or perhaps the problem is B.) that I have misunderstood this issue – Django is my webserver (for production) so right now I must use the Django static files solution?

Doesn’t seem like it ought to be very difficult to get my templates to simply recognize a .js file that’s in the same directory as they are. Am I missing something?

Edit, before I get more downvotes: I am talking about this passage from the page linked above:

///////////////////////

Django developers mostly concern themselves with the dynamic parts of web applications – the views and templates that render anew for each request. But web applications have other parts: the static files (images, CSS, Javascript, etc.) that are needed to render a complete web page.

For small projects, this isn’t a big deal, because you can just keep the static files somewhere your web server can find it. However, in bigger projects – especially those comprised of multiple apps – dealing with the multiple sets of static files provided by each application starts to get tricky.

That’s what django.contrib.staticfiles is for: it collects static files from each of your applications (and any other places you specify) into a single location that can easily be served in production.

///////////////////
Emphasis added

So if that’s what django.contrib.staticfiles is for, what’s the simpler solution? I dispute that this is a repeat of prior questions.

  • 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-25T01:34:26+00:00Added an answer on May 25, 2026 at 1:34 am

    You need to read that documentation more closely. That warning is for production. In development, you do use that static-serving method, ie putting it in your urls.py. And, that documentation will also show that the templates directory is not the right place to put them: a separate static or media directory is.

    Edit after comment I really don’t understand your comment. Either you do it in development via the static serving view, or you use your production server. But you say you don’t have a production server. When you get one, whether it’s Apache or Nginx or whatever, you put your static files in a directory and tell that server to serve files from there. That is the simple solution. The staticfiles app, exactly as in the docs you quoted, are for when you’ve got lots of files in different apps (and it simplifies the move from development to production, not complicates it as you seem to think).

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

Sidebar

Related Questions

I am trying to use the django's jQuery library as follows. domain is a
I am trying to use Django with jquery UI autocomplete but having trouble sending
I'm trying to use jquery to submit my form like so but it's not
EDITED I'm trying to use jquery/ajax to display data returned from a django method.
I'me trying to use this eventCalendar in django : http://jquery-week-calendar.googlecode.com/svn/trunk/jquery.weekcalendar/full_demo/weekcalendar_full_demo.html I suppose to write
Trying to use JQuery Easing plugin in my wordpress but its giving me following
im trying to use jquery bbq for remembering page with ajax. but i wonder,
im trying to use jquery file upload to post files to a fileserver written
I'm trying to use jQuery.post() function to retrieve some data. But i get no
I am trying to use jQuery and Asp.net Ajax library. The jQuery code is

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.