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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T09:21:34+00:00 2026-06-01T09:21:34+00:00

I am using wunderground’s json api to query for weather conditions on my site.

  • 0

I am using wunderground’s json api to query for weather conditions on my site. The api gives me a nice json object with all the neccesary data, but I am limited to a number of calls per day. What would be the preferred way to store this data?

I was thinking to dump the json to a file, and check for it’s timestamp: if it’s say older than 60 minutes, then fetch the new one and overwrite, if it is not, read the file from the disk. I wouldn’t create a database table just to store weather data that I don’t essentially need. Is there some clever Django way of caching this process or should I do it manually?

  • 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-01T09:21:35+00:00Added an answer on June 1, 2026 at 9:21 am

    Yes, Django has a built in caching mechanism. If you don’t want to install a caching server, you could use the file system cache, which would be pretty much the same as what you’re talking about, but you wouldn’t have to roll it yourself.

    Here’s the documentation.

    You would put something like this in your settings.py

    CACHES = {
        'default': {
            'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache',
            'LOCATION': '/var/tmp/django_cache',
        }
    }
    

    In your app code, you could then have some logic to check the cache, and if it isn’t found, then load it from the server and cache it.

    from django.core.cache import cache
    
    weather_json_data = cache.get('weather_90210'):
    if not weather_json_data:
        weather_json_data = get_data_from_api(zip)
    
        cache.set('weather_{0}'.format(zip), weather_json_data, 60)
    
    #return the weather_json_data through HttpResponse here
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I do have a xml file located at : http://api.wunderground.com/api/adaebe40743a9ca6/geolookup/conditions/forecast/q/India/Pilani.xml Now i want to
I've checked all of the questions here about weather API's and checked every single
Using PHP, I can convert MySQL data or static table data to csv, Excel,
Using the navigator.geolocation object in JavaScript. Trying to establish accurate ranges, but wondering exactly
Using the HTML5 File API I can get the Binary String representation of a
Using NSDateComponents I know how to get the day component, but this gives me
Using Android TelephonyManager an application can obtain the state of data activity over the
using a binary search tree I need to add to a vector all int
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Diagnostics; using System.Linq; using System.ServiceProcess;
Using Java, how can I extract all the links from a given web page?

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.