Skip to main content

Posts

Showing posts with the label SQL

More Fun with QSOs, Maps, and Datasette

 Yesterday I used Datasette to make a map of the QSOs I'd made from the Pantoll Campground area, Then, I remembered that I also wanted to know how the locations of the stations on the receiving end of my POTA QSOs from there compared to W6CSN's . That map turned out to be very easy to make. I remembered that the Datasette cluster map looks for the column names 'longitude' and 'latitude'. Keeping that in mind, I renamed the columns that I'd use datasette-leaflet-freedraw to search for to 'longitude_t' and 'latitude_t', and then added two more columns containing the latitude and longitude of the receiving station. So,  select rm_rnb_history_pres.tx_lng as longitude , rm_rnb_history_pres.tx_lat as latitude, rm_rnb_history_pres.timestamp, rm_rnb_history_pres.dB, rm_rnb_history_pres.Spotter, rm_rnb_history_pres.QSL_link, photo_path.path, photo_path.uuid, json_object( 'image', '/-/media/thumbnail/' || uuid, 'title', Spotter...

Things I Learned: Django to Postgresql setup

I'm playing with Django, a really snazzy template based, database backed web app engine, again this week. I originally encountered the tool when I started making Google App Engine applications years ago. One of the last extant apps from that era is my ham radio exam practice app. This week, while ramping up another project, I did something new, I connected Django to a PostgreSQL database . I'd always used MySQL in the past. There were  steps. They weren't particularly difficult, but I couldn't find much in the way of documentation, and when I did, following the steps in order didn't work for me. Here's what did: Install psycopg2 . (You may need to install psycopg instead depending on your version of Django. Django does a good job of telling you what it actually needs later in the process. Of course, make sure PostgresSQL is already up and running. You'll need to be able to access the postgres user who's default password is in fact postgres. Setup up th...