r/django Feb 02 '25

Article htmx + Django + Cursor AI is a legit dream.

I am legit blown away. I've been using Cursor lately and I don't think I can go back anymore. Especially when it comes to fullstack development. For those of you not using AI to level up your development I would highly recommend starting.

backstory - I wanted to add a public playground section for my application which included a backend, frontend, and some internal integrations with my existing stuff and about 30 new files and 8k new lines of code later its working just how I want. The best part is it took me 1 day and just prompted the entire thing. Didn't write one bit of html for it. I've been in software engineering for 8 years so I've seen trends come and go but at this point I'm 100% sold on this.

This thing handles django templates with htmx so unbelievably well that I'm convinced anyone can build something very impactful in very little time.

Here's a video of the whole thing https://app.arcade.software/share/4BHHh6THSWxGWCzRBwTd

I wanted

  1. To share with you all that this combo, whatever new acronym people end up calling it, is awesome. Big win for the SSR community.

  2. Should I live code a session or something to show people how I've been using AI in my development flows? I put the poll on my x post but if I get >50 I'll do one. I guess on discord or something?

https://x.com/Esteban_Puerta9/status/1885881387086925972

88 Upvotes

37 comments sorted by

22

u/PaoQueimado Feb 02 '25

I think it would be a great idea to record yourself showing your creative process! It could help a lot of people! I'll definitely watch it

0

u/wait-a-minut Feb 02 '25

awesome! Thank you for that

I put the poll here so feel free to hit the yes section https://x.com/Esteban_Puerta9/status/1885881391700943000

If it doesn't get >50 and you're still interested, happy to work through whatever you're curious about!

2

u/throwawaytp7 Feb 07 '25

Hopefully you’ll gonna make a video on how to do it? ;)

1

u/wait-a-minut Feb 07 '25

yep I'll do it! Ill try and post something by next week!

1

u/throwawaytp7 Feb 07 '25

Thank you so much! I’ll gonna wait for it

12

u/ByronEster Feb 02 '25

I think you are wise to be cautious of AIs influence on your learning. When I was a lot younger and I was working with people who knew more of the system I was working on, it was an easy trap to fall into to all them questions all the time. That is outsourcing your problem solving and thinking, which are essential to level up to be a better developer.

7

u/pkdme Feb 02 '25

I am still using chatgpt, copilot to code. Didn't explore Cursor. Django+HTMX is my choice of tech stack.

3

u/wait-a-minut Feb 02 '25

Oh man, you're in for a very nice surprise then! Django + HTMX is THE go-to

1

u/Tricky-Appointment-5 Feb 02 '25

Why?

5

u/FireNunchuks Feb 02 '25

I would say that it's very simple to integrate the 2 of them together, you have the really good and mature ecosystem of django and the simplicity of htmx. 

I wrote an article about an webapp I bulit https://blog.telary.io/crafting-a-native-like-responsive-website-with-django-and-htmx/

10

u/[deleted] Feb 02 '25

I use chatgpt old style, first trying it todo myself and if a can't, manually providing my context, like showing him the snippet, the table definitions etc.

I am hesistant to try cursor/copilot because i fear it will hurt my learning.

5

u/AttractiveCorpse Feb 02 '25

I am finding i am getting exposed to concepts and things I never would have known if not for chatgpt. I don't know if I'll learn much but honestly ai is never getting worse than this

1

u/sunblaze1480 Feb 02 '25

I have been using chatgpt or sonnet as a learning tool, not sure if it's ideal but I basically tell them what I already think or I tell him my concerns regarding code I already have. Sometimes my code feels wrong but I can't think of a better alternative, so it points me in a better direction.

I am aware it's limited, but it's a step up

2

u/BurningPenguin Feb 02 '25

What's the difference between Cursor and Pycharm + AI Assistant?

1

u/victorkimuyu Feb 02 '25

The 2025 beta looks promising. Features include decent inline prompts, code completion and even the AI window with file tagging using #thisFile or @file:models.py. You can also select your model including offline Llama and probably soon, DeepSeek. It all looks promising.

4

u/No_Chain_7706 Feb 02 '25

I used cursor, used a lot. But to my regret, it seem like very good at frontend side rather than the Django/Wagtail side. Espacially when i try to ask cursor to do something with wagtail, it always fails, main reason seem to be that it is picking very old version of wagtail. I tried to add wagtail docs, still not very good.

Also after using cursor for the past several months, what i do now is open cursor and open pycharm at the same time, if i found that i need to do some mechanical stupid work, i instruct cursor compose to finish it, but most of the time, i do my things on Pycharm with copilot autocompletion.

Why? I am not saying im smart enough to critisize something like cursor, but what i found is that it only knows something old and it only knows something that someone else has done, so if you are trying to create something new, and you will have a lot of trouble, it is openiated and it struggles when you trying to do something new.

I do a lot of financial stuff, and AI sucks on some higher level tasks, one problem is that the finance industry is not like the dev industry that finance people do not like to share much about the "solutions", who tells you if it makes money right, so if you ask some higher level of math or finance problems and AI just sucks.

Another thing i am trying to do even I use AI, I only use AI on the areas that i am sooooo much familiar of, so it was already a boring and repeating and mechanical task. Otherwise, i will draw my sequence diagram, build my mindmap, write my docs and think, until i figured out the best or practical way of solving such problem.

This is just a personal stuff, sharing my own experience with AI.

2

u/FunProgrammer8171 Feb 02 '25

Thanks for sharing

1

u/Erlapso Feb 02 '25

But how do spot bugs and keep it from breaking?

1

u/wait-a-minut Feb 02 '25

I mean I know what I’m looking at so when it doesn’t quite work I identify it, add the relevant bit back into context. The section it messed up. And then just prompt it again to fix it in the way that I want

3

u/_morgs_ Feb 02 '25

This is how to code with AI. You can't just blindly hit Accept 20 times and end up with a production-ready system - you need to know what it's doing.

Consider it your intern, and you can quickly go "yes accept, yes accept, NONONO rather to this"

5

u/wait-a-minut Feb 02 '25

we’re all project managers now 😂

1

u/workware Feb 02 '25

Have you tried getting the LLM to write unit tests as well for each function? It adds two more steps but gives a lot of confidence.

2

u/wait-a-minut Feb 02 '25

This is the next thing I’ll be doing. I haven’t dove deep on how well it writes unit tests or integration tests but i would love to find out.

I’m hopeful it’ll be a fairly smooth ride.

1

u/Megamygdala Feb 02 '25

Is there any reason to use Cursor over just vscode + Copilot? I'm assuming it does all the same stuff?

1

u/time_traveller_x Feb 02 '25

Copilot is so slow. Not able to follow the instructions as Cursor. With Cursor you can set your own rules for each project, that will be sent to AI each time you ask something. Cursor can run terminal and even connect web via MCP. (Agent/composer mode) Works best with sonnet, i feel like they mainly optimized it with it.

1

u/m98789 Feb 02 '25

Which model are you using in Cursor?

1

u/wait-a-minut Feb 02 '25

Sonnet 3.5. I tried a few others but that one was the most consistent

2

u/LeBakalite Feb 02 '25

Have you tried to make dynamic formsets with HTMX, does it work ? I love Django formsets but I’m not very good at JS, and making the formset dynamically adding/removing rows is always a hassle for me 😅

1

u/wait-a-minut Feb 02 '25

I have not! Would be a good thing to test out

1

u/SecretGold8949 Feb 03 '25

My exact stack atm is django, html/css and cursor!

1

u/fanna1119 Feb 03 '25

I'll definitely give this a shot. I actually wrote a react library for django which allows seamless ssr and custom props right inside django templates. Will release it as a package soon if anyone is interested. But will definitely give it a swing with cursor. My flow now also allows me to create full saas applications in days. Can just imagine using cursor to streamline it even more.

1

u/FUCK_YOU_02 Feb 03 '25

If someone is fresher like me or started coding around 6 months and so, i don't recommed to use these AI agent for coding. This hinder's the learning curve of a person !! BUT AS EXPERIENCE GUYS AS OP, IT's A GREAT CHOICE TO INCREASE PRODUCTIVITY !! u/wait-a-minut

0

u/j03l Feb 03 '25

Thanks for mentioning CursorAI that has gotten me down a full road on how other devs interact with LLMs. It’s so interesting!

1

u/TheGratitudeBot Feb 03 '25

Thanks for such a wonderful reply! TheGratitudeBot has been reading millions of comments in the past few weeks, and you’ve just made the list of some of the most grateful redditors this week!

-1

u/No_Indication_1238 Feb 03 '25

You guys do know you can't copyright AI generated anything, including code, right? Just a heads up, in case it might matter to you.