@tobide@fosstodon.org
@tobide@fosstodon.org avatar

tobide

@tobide@fosstodon.org

Welcome to my mastodon bio. I'm a software developer, open source contributor and occasional bloguer.
Django + HTMX = 🖤

I'm currently working on https://falco.oluwatobi.dev for faster prototyping in django :)

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

anze3db, to random
@anze3db@fosstodon.org avatar

Somebody opened a PR with the title "add failing test" and the tests did in fact fail 👏

tobide,
@tobide@fosstodon.org avatar

@anze3db brilliant

phildini, to django
@phildini@wandering.shop avatar

What are the best practices / good project templates for starting a project in 2024? Things that I used to do are cargo-culted in my own brain from 5 years ago, has anyone written a good recent guide?

(🚀 for reach welcome)

tobide,
@tobide@fosstodon.org avatar

@phildini for a simple starter I recommend https://github.com/oliverandrich/django-startproject (no docker) or https://github.com/jefftriplett/django-startproject (uses docker for local dev), I am currently working on something (https://github.com/Tobi-De/falco) but it's in a somewhat messy state at the moment.

oliverandrich, to golang
@oliverandrich@fosstodon.org avatar

The more I play around with , the more I wish I had a solution to bundle a application into a single executable instead of having to deal with containers and stuff. This would be very handy for the small and mid sized webapps I built from time to time and also for some of the apps we built at work. May be I should spent some time to investigate this.

tobide, (edited )
@tobide@fosstodon.org avatar
webology, to random
@webology@mastodon.social avatar

🚚 I spent my morning working on a CSV importer that imports a few million rows of data over a dozen+ CSV files.

💪 I leveraged Django's bulk_create and fell back on the update_or_create feature and the results are impressive.

🏎️ I'm not sure when bulk_create and bulk_update changed, but I had to double-check my data a few times because everything imported SO FAST...

https://docs.djangoproject.com/en/5.0/ref/models/querysets/#bulk-create

tobide,
@tobide@fosstodon.org avatar

@webology with or without multiprocessing ?

anze3db, to random
@anze3db@fosstodon.org avatar

Google, if there is one thing I don’t want, is to watch videos based on a color.

tobide, (edited )
@tobide@fosstodon.org avatar

@anze3db I mean, who even came up with this idea? The YouTube devs must be bored at this point; they're just trying random stuff 🤣

tobide, to django
@tobide@fosstodon.org avatar

TIL you can set the environments DJANGO_SUPERUSER_EMAIL and DJANGO_SUPERUSER_PASSWORD, and then run createsuperuser in non-interactive mode (using the --no-input flag), and it will use those env variables to create a superuser for you. I built this exact feature into Falco (my CLI tool), and now I feel incredibly dumb. How did I never know this before? :(

https://docs.djangoproject.com/en/5.0/ref/django-admin/#createsuperuser

carlton, to CSS
@carlton@fosstodon.org avatar

I keep seeing all these luminaries arguing that you shouldn’t use utility-first tools, and REDACTED in particular.

Yet to see one address how useful they are for the many, or why that might be.

Plenty of moral aspersions. Unwillingness to learn and so on. Couldn’t possibly be anything about the tech.

Finally twigged, it’s the Frontend version of “You mustn’t use an ORM”. Exact same vibe.

tobide,
@tobide@fosstodon.org avatar

@carlton I read an article about this earlier today. The author made some really great points. Learning CSS over any other framework is more worth it in the long run. However, he also implied that Tailwind has no valid use case.

tobide, to random
@tobide@fosstodon.org avatar

Oh, and @josh a question about django-simple-nav: what is the advantage of this over a simple nav partial template that can be included everywhere with the {% include %} template tag or in base.html? I remember when I saw it, I asked myself: why would I ever want this? Defining my navigation in Python, that's weird. And how do I style this? A CSS file? Is that the only way? It seems like it would not work well with Tailwind, for example, and I'm saying that because I know you use tailwind

tobide,
@tobide@fosstodon.org avatar

@josh With the include, I'm incorporating an HTML template. I can easily add classes to the HTML, but here, I can't see an easy way to do so. Even if there was the possibility to pass values to a "class" attribute on instances of NavItem, I'm not sure I would want to define this in Python. Or maybe the nav generates a unique ID each time that I can target with CSS?

anze3db, to random
@anze3db@fosstodon.org avatar

ChatGPT really improved the grammar of these email scams. It's great to see progress in real-time! 🙃

tobide,
@tobide@fosstodon.org avatar

@anze3db just beautiful 😂, gpt clearly did not help with the reasoning part

tobide, to django
@tobide@fosstodon.org avatar

Are there devs out there using anything other than ? If so, what and why?

Has anyone tried and seen any benefits?

Gunicorn is perfectly fine; I'm just curious.

https://github.com/emmett-framework/granian

josh, to random
@josh@joshthomas.dev avatar

Once again I lose a night fighting with typer. I’ve got to be holding it wrong and overthinking it because I’ve heard it vouched for so much.

tobide,
@tobide@fosstodon.org avatar

@josh Building a CLI ? just a suggestion, but checkout this https://github.com/DanCardin/cappa, really nice API :)

tobide, to django
@tobide@fosstodon.org avatar

Right now I have,

Firefly III (personal finance),
GlitchTip (Sentry-like error tracking),
Plausible (privacy-focused analytics),
Uptime Kuma (uptime service),
and a few Django side projects.

All of these are running on a cheap ($5.5) VPS from Contabo using CapRover.

By the way, most of the apps described above are one-click deployable.

1/5

tobide,
@tobide@fosstodon.org avatar

There is no way, no freaking way that there is a PaaS provider out there that can offer a VPS with the specs I'm getting at this price. And if there is one, please, I want to know.
The specs :

  • 4 vCPU
  • 6 GB RAM
  • 100 GB NVMe

It's even weird that these guys can afford to be this cheap. Feels like there is something fishy going on. Maybe because of the trash UI? Anyway, I've had no issues with them for years.

2/5

tobide,
@tobide@fosstodon.org avatar

I've seen a lot of enthusiasm for Fly in the Django community lately. I've tried them once. I'm sure I was doing something wrong or had a trash setup, but I was paying more than $5 for frankly less than a third of the performance I'm getting on this $5 VPS. Platforms like Fly, Vercel, Heroku offer mainly convenience over your average VPS, but I can get 80% of the convenience with CapRover.

3/5

tobide,
@tobide@fosstodon.org avatar

@carlton Yep, I get that. I was probably less than 10 years old during those times, lol. But right now, I think for an indie hacker, a VPS + something like CapRover (Dokku, Coolify, etc.) is the best way to ship web projects.

tobide,
@tobide@fosstodon.org avatar

@jochen
I'm guessing that when you talk about real private servers, you mean fully dedicated private servers?
When I'll be able to afford a good one, that's my next step, unless I change my mind on this whole self hosted PAAS before 🤣 .

There is also something I want to experience, what it feels like to manage the real thing, a hardware you own. I'm sure it's quite challenging, and not always enjoyable, or not at all.

tobide,
@tobide@fosstodon.org avatar

@jochen But I feel like things have gotten easier and more manageable in modern days (and this will probably still improve). It's still hard, but maybe when you do it enough, you get to a point where it's completely manageable (unless you're building huge projects) and worth it in the long run.

josh, to random
@josh@joshthomas.dev avatar

Just open sourced and released the first version of django-twc-project! It’s a Copier template of the Django project structure I use at work — hard won after many iterations over the past couple of years. https://github.com/westerveltco/django-twc-project

tobide,
@tobide@fosstodon.org avatar

@josh It's interesting how the project settings.py, urls.py, and wsgi.py files are all in the module for the project. I'm used to having these in a config folder (I took that from cookiecutter-django), but I feel like I'm liking this style more.

tobide,
@tobide@fosstodon.org avatar

@josh The pro of using the config.settings approach is that it's easier to copy configurations that rely on it from one project to another.
However, the namespace approach is also interesting, especially if you have many projects. I'm going to try this for some time to see how I feel about it. Plus, it is close to the Django default layout, so that's a plus.

tobide,
@tobide@fosstodon.org avatar

@josh I'm curious, when you say "mini site," do you mean apps with a very limited and focused feature set? Or is this some kind of microservice-like thing?

tobide,
@tobide@fosstodon.org avatar

@josh Just read through the whole thing; really interesting ideas, gave me some food for thought. This topic reminded me of a talk I watched about somebody managing more than 500 apps (Django apps/package) in a single monolith. I'm planning to write a guide on dealing with huge apps on the Falco guides. This talk and the Pretix repo are my main inspirations. I especially like the Pretix way of doing this; they built some kind of plugin system around the Django app system and signals.

tobide,
@tobide@fosstodon.org avatar
tobide,
@tobide@fosstodon.org avatar

@josh @webology maybe I missed it, but I didn't see a mention on how all these small sites communicate with each other, json based apis ?

tobide,
@tobide@fosstodon.org avatar

@josh @webology Oh, this makes even more sense. If they rarely have to communicate with each other, they really make sense as separate projects. From what I've read, one of the hardest issues with microservices is the orchestration part, making them talk to each other in a reliable way.

mblayman, to python
@mblayman@mastodon.social avatar

🐍 Docker is not the only game in town when it comes to app deployment. This article explores containers and contrasts containers with other options. https://www.mattlayman.com/blog/2019/python-alternative-docker/

tobide,
@tobide@fosstodon.org avatar

@mblayman Do you have an example of a github action using shiv ?

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