@josh@joshthomas.dev avatar

josh

@josh@joshthomas.dev

Husband
Father
Programmer, mostly #Python :python: and #Django :django: (sometimes JS :javascript: / TS :typescript: 😈)
#DSF :django: Member
#OSS :oss: contributor/maintainer
University of #Alabama :alabama: alum, #RollTide!

This profile is from a federated server and may be incomplete. Browse more on the original instance.

josh, to random
@josh@joshthomas.dev avatar

Hey look! A legit blog post that made it out of the drafts!

@webology ‘s weekly Office Hours is great fodder for potential blog posts. Yesterday Jeff asked how everyone handles their Django project’s static files. I decided to write about my approach, which takes inspiration from how some JS frameworks approach it.

“How I organize staticfiles in my Django projects”

https://joshthomas.dev/blog/2024/how-i-organize-staticfiles-in-my-django-projects/

programmylife, to random
@programmylife@fosstodon.org avatar

https://programmingmylife.com/2024-04-25-til-docker-commands.html # I've been using Docker a bit more at work the last couple of weeks and learned a few new commands for helping debug setup issues.

josh,
@josh@joshthomas.dev avatar

@programmylife highly recommend using something like a Justfile to collect these common commands - saves typing, mental space, and easier to onboard others

https://github.com/westerveltco/django-twc-project/blob/4d4489a9a8627bab688baf3bb16aa4e9f6740ab7/examples/default/Justfile#L136-L210

josh,
@josh@joshthomas.dev avatar

@programmylife CC: @webology since they were a collab with him (I will die on the hill that the final command should be echoed out! 😄)

josh,
@josh@joshthomas.dev avatar

@programmylife and if you want a namespace, there are modules for just as well, though I haven’t used them. Think just build vs just docker build https://github.com/casey/just?tab=readme-ov-file#modules1190

josh,
@josh@joshthomas.dev avatar

@webology @programmylife If there was a way to toggle the echo via a setting in the Justfile or an environment variable I would be all over that. After onboarding some noobs who were unfamiliar with just, Docker, and Django this year to our codebases, I found the echoing helped them demystify what was going on under the hood. As for me, I tend to like seeing the final command as well as a sanity check.

josh,
@josh@joshthomas.dev avatar

@webology @programmylife it does, but just a boolean. I tried a couple of different ways of setting it from the environment but couldn't figure it out. looks like it may be coming as a feature though soon - https://github.com/casey/just/issues/1979

josh,
@josh@joshthomas.dev avatar
josh,
@josh@joshthomas.dev avatar

@webology @programmylife just being thorough

webology, to random
@webology@mastodon.social avatar

Has anyone else noticed that some READMEs on GitHub have been broken recently?

I thought it was just me, but the pattern seems to be like code blocks in rst files no longer get formatted.

josh,
@josh@joshthomas.dev avatar

@webology for the life of me I could not get that project to work recently. Read the README, source dove, couldn’t figure it out

josh,
@josh@joshthomas.dev avatar

@webology also yes, I’ve noticed the same thing re: the underlining

jacob, to random
@jacob@jacobian.org avatar

🏀 ugh, UConn/Purdue, the match nobody wanted 💤💤💤

josh,
@josh@joshthomas.dev avatar
josh, to random
@josh@joshthomas.dev avatar

Spent the morning playing with HTMX and Alpine.js to replace the React component currently handling search in a work app. What a breath of fresh air! One view with template partials and it feels so much snappier than before. I even enabled a Ctrl K shortcut for focusing the search input as a treat, even though my users will undoubtedly never use that feature.

josh,
@josh@joshthomas.dev avatar

After suffering through migrating this old ColdFusion app to DRF + React — because that’s what the agency we were using recommended — and slowly realizing that it’s way overkill for the app, it’s been a relief to slowly start to simplify it.

webology, to random
@webology@mastodon.social avatar

👀 So it's a rare Saturday when I'm working because I shifted my week to take a Monday off, and I'm getting logged out of the Django Admin (localhost + Django 5.0.4) every ~5 seconds.

My console shows:

> django.security.SuspiciousSession WARNING Session data corrupted

This issue seemed to go away after I re-ran collectstatic to fix a few broken images. (It already gets ran at least twice).

🤔 I am not sure if this is a new Django bug or if anyone else is seeing this?

josh,
@josh@joshthomas.dev avatar

@webology Oops 😬

webology, to random
@webology@mastodon.social avatar

⛳ Syncing Django Waffle feature flags: https://micro.webology.dev/2024/04/05/syncing-django-waffle.html

josh,
@josh@joshthomas.dev avatar

@webology ever used https://github.com/cfpb/django-flags ? I know I’ve looked at it in the past as an alternative to waffle, but haven’t had the opportunity to use try it out yet

shawninman, to random
@shawninman@mastodon.social avatar

How sre people addressing Celery queue visibility these days? Specifically length of queues, time spent processing, etc? I’ve heard recommendations for flower many times but we’ve had issues securing it in a prod environment. Any tips are super appreciated

josh,
@josh@joshthomas.dev avatar

@webology @shawninman @sqlliz 👋

Crunchy and Tailscale has been working really well for me, once we got everything set up. Allows me to keep my DB off the public internet and still connect to it via my Fly.io apps.

josh, to random
@josh@joshthomas.dev avatar

Roll Tide :alabama:

josh, to random
@josh@joshthomas.dev avatar

Roll Tide

josh, to random
@josh@joshthomas.dev avatar

Ya know, accessing a Django project from outside the project.. they don’t make it easy and straightforward 🙃

No wonder there isn’t already an LSP for Django

josh,
@josh@joshthomas.dev avatar

@webology Aw man now I gotta dig in to a Typescript codebase

josh,
@josh@joshthomas.dev avatar

@webology I wonder if they have that config because it’s written in TS? I was getting around it by using sys.executable and it seemed to be working — I am able to import django and get the version from the test project I was using. But when I go to call django.setup() that’s when it goes belly up.

josh,
@josh@joshthomas.dev avatar

@webology I dunno, maybe at first when I was running the lsp server over stdin, but I switched to tcp with the server running directly in the project dir which should have access to everything. I know I’m holding something wrong here but it’s hard to see what.

josh,
@josh@joshthomas.dev avatar

@webology on the bright side I’ve gotten a lot more familiar with the LSP spec and am pretty sure once I get over this hump getting a useful prototype should come fairly quickly

josh,
@josh@joshthomas.dev avatar

@webology what I can’t figure out is it doesn’t crash or error or anything else with a useful log or traceback. It just.. freezes. I should probably graduate from the print debugging and actually use a real debugger 😂

josh,
@josh@joshthomas.dev avatar

Confusingly, if I use separate terminals (I normally use tmux windows) the debug messages I put after django.setup() to send from the lsp server to the client actually show up. The setup call still hangs, but it’s at least failing in a different way now. Progress!

carlton, to django
@carlton@fosstodon.org avatar

OK, template-partials as 5.0 as_field_group() templates is my new hammer 🥰

josh,
@josh@joshthomas.dev avatar

@carlton @webology draft post has been sitting there for over a month 😬 taunting me

  • All
  • Subscribed
  • Moderated
  • Favorites
  • JUstTest
  • mdbf
  • ngwrru68w68
  • tester
  • magazineikmin
  • thenastyranch
  • rosin
  • khanakhh
  • InstantRegret
  • Youngstown
  • slotface
  • Durango
  • kavyap
  • DreamBathrooms
  • megavids
  • tacticalgear
  • osvaldo12
  • normalnudes
  • cubers
  • cisconetworking
  • everett
  • GTA5RPClips
  • ethstaker
  • Leos
  • provamag3
  • anitta
  • modclub
  • lostlight
  • All magazines