❤‍🔥 Passionate about learning new things -- both for myself and for teaching others. Great fan of 🐍 and Django 👩‍💻

Politeness pays off, even with ChatGPT 😎 I know it's a bunch of words stuck together, but it still feels nice to read it 😅
1
166
@heroku, your pricing page doesn't work correctly (:
2
137
And managers will wonder why so little work was done today 😂
2
321
Me after I googled what walrus is to understand what's with the name of walrus operator in Python 😅

ALT Ohh I Get It GIF

154
Only when you're searching for an answer to some obscure question on StackOverflow you realise how long Django has been around for 😅
1
7
It’s officialy christmas time 😁🧑‍🎄
This found me on Quora today 😅 It's modesty and realism of it is super funny 😂
2
I feel so many things people don’t do because no one tells them it’s possible. People who “know it’s possible” have no idea how hard is to figure that if you don’t know where and how to look for it.

ALT This Just This GIF

1
This mother duck takes her offspring to field trips every day 😍 I saw them swimming in a puddle, on the pump track, close to a tennis court 😂 After she deems it’s enough (or dangerous), she guides them back to the “farm” over the street and through the fence. Fascinating 😍
1
This is so funny to look at but yet so sad 🙁 There’s a scene where Zelensky has important consultations with the parlament - I hope this is the outcome of his consultations with Putin when they come 😈 piped.video/JinkCAN6Bx0
Russians living in Slovenia organized an anti-war protest today. This gives me hope 🙂 (Photo prtscr from media)
3
Replying to @vixentael
This kitty had no home and someone brought him to a birthday party where they found him home. It turned ok for him, I hope it does for you too ❤️
5
Positive lookbehind synthax: (?<=...) Let's find prices in $/£:
1
DRF tip: If you're creating an API point that returns combined models (eg. list of items), you need a nested serializer. This simply means using one serializer inside the other. If you're listing child components in the parent component, you have to set related_name in models.
2
7
Django tip: Django automatically pluralizes the name of your model by adding "s". If that's not the correct plural form, you can set it on your own by using `verbose_name_plural`.
3
9
Django tip: The best practice for creating a choice field is to keep the choices inside the class that is using it. Here's how you create a choice field:
1
1
10
Django tip: Here's how you can get only the time part of today (no date, timezone-conscious):
7
Django tip: Here's how you can get timezone-conscious today's midnight (start of today):
1
1
10
Django tip: You can filter your objects by range with "fieldname__range[start, end]":
2
6

ALT Twins Twinsies GIF

1
1
Do you remember when you joined Twitter? I do! #MyTwitterAnniversary
2
4
Python tip: Here's how you can get the last moment of the day 7 days for now: #python
2
8
Django tip: Here's how you can get timezone-conscious date-time object 30 minutes from now:
2
14
Django tip: You can create your own script that you can run with manage.py The structure needs to be: your_app > management > commands > your_command.py > class Command(BaseCommand) Run it with "python manage.py your_command" in the terminal. #python
2
15
It's so nice to read things like that 🥰
3
13
I am super excited to share that my blog has crossed ✨32169+✨ page views on @hashnode. 👉 hashnode.com/GirlThatLovesTo…

ALT Simon Golden Buzzer GIF

3
2
9
DRF jump-start: Similar to DjangoModelPermissions, DjangoModelPermissionsOrAnonReadOnly allows access to the API point if the user has permission for that particular model. But, if they don't, they can still retrieve the data.
2
DRF jump-start: Maybe you've noticed in your Django admin that you can set permission per user (see the picture). In DRF, you can use DjangoModelPermissions class for the particular view to use those permissions.
4
DRF jump-start: Some API points are meant only for admins. Use IsAdminUser for those cases.
6
DRF jump-start: There will be cases when you'll want to limit most of the access to the API point to authenticated users, but still, allow any user to view the data. That's when you can use IsAuthenticatedOrReadOnly:
5
DRF jump-start: If you want to allow only authenticated users to access the API point, you need to use IsAuthenticated class.
1
10
DRF jump-start: The most open of pre-built DRF permissions is AllowAny. This allows anyone (authenticated or not) to access the API point.
1
4
DRF jump-start: You can set DRF permissions per-view by setting the permission_classes attribute, like this:
2
8
DRF jump-start: You probably don't want just anyone to access your API points. That's when permissions come in handy. You can use prebuilt permission classes or create your own. You can set the policy globally or per-view. Globally, you do it like this:
1
5
DRF jump-start: If you want to do some sort of calculations or pass additional data, you can use SerializerMethodField. SerializerMethodField is a read-only field that gets its value by calling a method on its Serializer.
1
11
DRF jump-start: If you use the same validator multiple times, you can create a function validator instead of repeating the code.
2
8
DRF jump-start: You can add validation for any of your fields in the serializer by using validate_<field_name> method. Example:
2
9
DRF jumpstart: If you want to serialize all the data from the model, you can use fields = "__all__". However, this is not recommended. You should specify each field explicitly. That saves you from exposing too much data by accident if you change your Model.
2
1
5
DRF jump-start: Instead of a page composed of HTML, CSS, and JS, an API provides raw data in computer-readable form. DRF uses serializers for that. Many times you'd want to use it with a model and you do that like this:
1
2
18
Django jump-start: You can associate different files (eg. CSS and JS) with the forms and widgets that require those assets via the Media class. #python #Django #100DaysOfCode
3
13
Django jump-start: {% include %} tag allows you to pass additional context to the template. You can pass a string or a variable, like this:
5
Django jump-start: You don't want to repeat code in your templates. That's why extends, include, and block tags exist. extends: declares the current template's parent block: is used to define sections in your templates include: inserts a template within the current one.
2
1
10
Django jump-start: Sometimes you'll want to change a little thing inside a for-loop (eg. class) each time around. That's when cycle can be useful. cycle outputs one of the arguments each time the tag is encountered. Here's an example:
2
4
23
Django jump-start: In my opinion the most useful among Django TL tags- {% empty %} inside the for loop covers the case when you try to loop through an empty list.
1
15
Django jump-start: There's a tag in Django templating language that generates lorem ipsum for you so you get the feeling how your page will look like:
1
1
11
Django jump-start: One of the reasons that Django is so awesome is out-of-the-box-yet-highly-customizable admin interface. You can change how instances of the Model are represented in Django Admin by extending ModelAdmin in admin.py file:
2
9
Django jump-start: Each time you make changes to the model (that relate to the db), you run the migrations. But did you ever check how the migrations look like? Here's an example, so you'll better understand what's going on:
5
Django jump-start: When I started with Django, one of my most common mistakes was not to register the app in the project. If you skip that step, your project won't know about the new app:
2
3
18
Django jump-start: There are so many possibilities for the Model fields. Here are the most frequently used ones:
1
12
Django jump-start: Those are the most basic Django commands you will use each time you want to start a new Django app: (if you're like me and keep forgetting most basic stuff, you can save this picture as a cheatsheet (; )
1
2
13