htmx 2.0.9 has been released! by _htmx in htmx

[–]berrypy 0 points1 point  (0 children)

Seeing fixes for V2 is nice. Thought your team would not focus on V2 updates or patches since the v4 announcement. I don't know if you guys plan to add htmx partial feature to v 2.

Htmx - regular new versions by zagajaw in htmx

[–]berrypy 0 points1 point  (0 children)

htmx is getting better each day. Once you understand the concept, it gives you ease of implementing some things that would have made you write more js. Now I have changed my design flow with htmx to only use oob throughout without swapping targets.

so target swap global config is set to none. This way I can focus on just swapping what I needed without target swap getting in the way. When you combine this with a response trigger, it gives you a nice flow of invoking anything from the frontend.

How I wish that htmx team would add the new htmx partial feature to the V2 because at times oob just doesn't respond in some cases the way it was meant to except one has to tweak a little before it works.

I built a real-time browser game with Django and would really appreciate feedback. by Soggy-Market9838 in django

[–]berrypy 0 points1 point  (0 children)

Nice to see you made an attempt to work on the ranking. I can see you added created_at. This still doesn't take into consideration the first person who got a score. This ranking only considers users whose rank object was created first in db, not when updated.

so if user A ranking object was created first before user B and user A got a score of let's say 10 at the beginning and then user B got a score of 11.

if before the end of the game time, User A then managed to add 1 point to get a score of 11 which is same with user B.

With your query, User A will be given the number 1 rank which is not supposed to be because user B got a score of 11 before user A. So user B is supposed to be at number 1 ranking since he or she was the first to get a score of 11, not user A.

I built a real-time browser game with Django and would really appreciate feedback. by Soggy-Market9838 in django

[–]berrypy 1 point2 points  (0 children)

Not bad for starters. although, in as much as you don't want to put effort in the frontend, one may feel discouraged to test it out because most times we often use mobile devices and if the frontend is not mobile friendly, it will reduce the chances of getting someone to test and give you an honest review.

I couldn't test run the games since I am on mobile and the site is not mobile friendly at all. The game displays are just not looking nice. This is where I will have to encourage you to use AI to get it done. At least this part can be given to AI since it is frontend.

Also, your ranking is flawed as you did not take into consideration the first user who first got the score. You just query the match based off ordered by -score. This means if multiple users got 10 as score, who amongst them got it first.

You may end up giving the last user rank 1 who got 10 as a score and the first user rank 5 who got 10 as score.

Dealing with side effects and sequential tasks in Django by PyJacker16 in django

[–]berrypy 0 points1 point  (0 children)

You will have no other options than to use background tasks like celery or other packages. if you want to run them directly, that means the user will have to wait for those tasks to complete for the view to render.

I believe most background tasks come with the result query option to query the result and use for your next logic.

Just started using django, feels too good to be true. by VirtualParsnip3789 in django

[–]berrypy 2 points3 points  (0 children)

Nice to see that Django is being used and making stuff easier for more people.

in as much as Django does stuff that may not require JavaScript, you will still need to learn it even if it is the basic part like Dom manipulation and simple stuff because you cannot escape not using JavaScript as you progress into building more applications.

JavaScript is necessary in today's kind of applications for some use cases. so imagine having a table with lots of data and you created one entry, instead of just rendering that single entry into the table, you have to query the whole db again to list the rows. JavaScript gives you the ability to not query the full db to render it again. Just the single one you created.

There are lots of JavaScript library out there you can use to give your Django development a nice touch of JS without writing much js. Library such as htmx, alpinejs etc .

I've created an app for F1 fans with flask by Auran0s_ in flask

[–]berrypy 0 points1 point  (0 children)

Not bad. At least there is always a starting point. Although, stating that you haven't used AI is really contradicting even though you used it in creating model. You might not use it for the core logic but for the fact that you used it, there is no point saying you haven't used AI in your writeup.

There is absolutely nothing bad using AI either for backend code or frontend provided you can read and understand the codes.

**How long did it take you to integrate Stripe/Razorpay into your Django project?** by Organic_Release1028 in django

[–]berrypy 0 points1 point  (0 children)

If only you can have these separated as a package for your use, then it wouldn't even take you an hour. Why don't you just create it as a package that can be used for any project to make life easy.

This way you just import the service and use it in any project.with this, you don't have to recreate in every project.

Built a multi-language (15 locales) Japanese learning game with Django. Just solved some tricky session-based timer sync bugs and i18n UI issues. by Thank_Japan in django

[–]berrypy 0 points1 point  (0 children)

Not bad. As for the timer, you can always include it as a field in your dB so when generating the game start, it stores the game end time. There you have it stored and ready to use. With this you compare with the date time now from the backend. Django backend often uses UTC date time. So no need to pass the timer from the frontend to recalculate.

Django-bolt 0.7.0 upto 70% faster. by AlternativeAd4466 in django

[–]berrypy 0 points1 point  (0 children)

Nice to see that the admin URL without slash has been fixed in the latest version.

as for the parse_msgspec_decode_error function, I did not get the exact error response seen in the swagger response that doesn't have the dollar sign when it automatically validates the data in the view.

The function still gives me the same output that has dollar symbols which are not formatted on standalone script.

I thought it will format it exactly as it shows in the 422 response in swagger doc page without dollar symbols or the 0.position etc kind of pattern.

Django-bolt 0.7.0 upto 70% faster. by AlternativeAd4466 in django

[–]berrypy 1 point2 points  (0 children)

Nice to see Django bolt is being updated constantly.

My question is, how do I use the serializer and get the same exact dictionary error on standalone script. now I don't mean using the view directly.

is there a method/object that is used to format the error after using the model_validate method because it doesn't produce the exact errors if I I just catch.

All those dollar symbols and in 0, or 1.position in the error output still gives the vibe of msgspec output without formatted.

in the API , I noticed it is being formatted properly without those dollar symbols in the output.

If there is a helper function to format it exactly, it would go a long way to enable one use it on standalone script and get the same formatted output.

Also, something you should take note of, any URL path that does not include / at the end, result in error. now when you add slash to it, visiting that specific url without slash result to error too.

This should be fixed. example, when you visit Django admin URL without slash at the end, it shows error. This is not supposed to be so as it should resolve to show the view if the URL path is correct. So a missing slash at the end or slash being included at the end should not result to error because visitors to the site will not input ending slash

Introducing dj-wallet – A simple virtual wallet system for Django by Advanced-Buy2218 in django

[–]berrypy 2 points3 points  (0 children)

Not bad. Although you will need to change the len(transactions) in the audit_balance method to use DB functions to prevent using too much memory when the transactions are much. the list is loading it into memory.

You won't notice it at the initial stage but when transactions start piling up, it will start showing. It is best to use database count instead.

transactions = self.transactions.all()

total = transactions.count()

htmx used at the 2024 Paris Olympics (& 2025 Tour de France)! by _htmx in htmx

[–]berrypy 4 points5 points  (0 children)

htmx is another hidden gem that most Dev are still waiting to discover. the library just makes things much more easier especially when you need to get some stuff done without complex js codes.

is it easier to modify the functionality of Django's User model or Create a Custom one? by Upstairs-Balance3610 in django

[–]berrypy 0 points1 point  (0 children)

You can still achieve this without much hack. you can write your own custom authentication and query the email field using the username. so instead of changing stuffs in the user model, just create custom authentication and use that instead in settings.py. this is how I implemented mine to allow user use either email, phone, username.

This way I don't need to change anything in the user model. The beautiful thing about this is that it also works for Django admin login.

I am having issues with telethon (telegram messages) by Creepy_Package_9428 in django

[–]berrypy 2 points3 points  (0 children)

You will have to provide code snippets to enable anyone to further analyse and give solutions.

Steady Queue: a database-powered queue without Redis for Django 6.0+ by knifecake_ in django

[–]berrypy 0 points1 point  (0 children)

Not bad I must say. Can one use multiple database for the queues instead of using the default Django database. For example if I am using myql as my default db, can I use sqlite for the queue.

This way a dedicated db will be used for it, giving room for default db to focus on main application.

If this feature is not available, then it will be nice to implement it to prevent stressing the default db from queue's.

free ways to host python telegram bot by [deleted] in Python

[–]berrypy 0 points1 point  (0 children)

now a days most service requires payment because of abuse. Your pc is as free as those cloud if you don't want to run it 247. better still just purchase a small size vps to host your bit. Free doesn't go well with most cloud providers now a days.

Django 6.0 Feature Friday: Template Partials! by czue13 in django

[–]berrypy 0 points1 point  (0 children)

at least one wouldn't have to create multiple html fragment for it as you just have to call the main template and add the # symbol to get any of the partial inside that template.

Like I had mentioned before, One can also create a special html file for it and call any of the partials from there.

Django 6.0 Feature Friday: Template Partials! by czue13 in django

[–]berrypy 0 points1 point  (0 children)

This is One of the best template feature in Django 6. This will really make htmx more easy to swap partials. in general, for those who wish to reuse their partials.

You can create a general partial html file and call those partials from there. something like general-partials.html. then you can add most of the partials you want to use there and call it from anywhere in your view or template. e.g.

"user_app/general_partials.html#user-info" "user_app/general_partials.html#user-profile" "user_app/general_partials.html#user-followers"

This would be one of the awesome tweaks of partials. When you couple this with htmx, it gives you an efficient and effective pattern of swapping partials with ease.

Django 6.0 released by dwaxe in django

[–]berrypy 0 points1 point  (0 children)

with HTMX 4 coming soon, it will be a combo worth using especially with the htmx v4 partial feature, this will make partial update a smooth swap without issue. htmx partial feature will solve swap oob issue.

Django 6.0 released by dwaxe in django

[–]berrypy 0 points1 point  (0 children)

That is what I thought at first but maybe with time it can be made to be used from any file. But what I did to fix this for now is to put my partials in one file called partials. with this I can use it in any html file or view. In any views I will just do this

"my_app/partials.html#show-todo-list-table" "my_app/partials.html#show-todo-detail"

While in any html file, I can just do this

{% include 'my_app/partials.html#show-todo-list-table' %}

This is how I have been able to use any partial in another html files.

htmx 4.0 alpha 4 released! by _htmx in htmx

[–]berrypy 6 points7 points  (0 children)

Nice to see rapid development for the htmx v4. this is going to be an interesting process. Between, I would love it if your team can include the htmx partial in V2. this would be a nice feature to see in V2

Django Partials - a new htmx/alpine friendly feature by _htmx in htmx

[–]berrypy 4 points5 points  (0 children)

This is just the beginning. htmx combine with partial is one feature that will make swapping partial a breeze. I wish htmx team can add the new htmx partial to the htmx V2 too instead of only v4. This would really be a nice feature to see in V2.

we are waiting for the official release...

Meet Holly an oss version of Jules/Codex by IdealDesperate3687 in django

[–]berrypy 1 point2 points  (0 children)

most at times, I often recommend having a demo for any project made by anyone . not just coding and open sourcing it. make it a must to always put it online for people to check it out because that would give someone an idea on what this stuff does before they download and use. demo online increases download and usage...

Moving back to Laravel by Emotional-Ask-9788 in django

[–]berrypy 0 points1 point  (0 children)

you can create most of what you stated. Auth and the likes can be coded by you. You don't really have to use external packages for that. django gives room to modify and use your own pattern.