You would want to include that line in a method, not as a class attribute.
For example:
def get(self, request):
user = request.user.username
...
return render(...
On Sat, Nov 14, 2020 at 9:37 AM Kasper Laudrup
wrote:
> Hi Barbara,
>
> On 13/11/2020 22.46, Barbara Leonar
Python has the enumerate function for these situations.
for i, item in enumerate(items):
#your print statement here
'i' will give you the index of the list/iterable, and item will give you
the item.
On Sat, 14 Nov 2020 at 11:57, paidjoo indo wrote:
> Hello I'm newbie in python, I'm learni
https://www.youtube.com/watch?v=kt3ZtW9MXhw&list=PL-osiE80TeTtoQCKZ03TU5fNfx2UY6U4p&index=16
This whole django tutorial is pretty good on basics, and worth a watch.
On Wed, 18 Nov 2020 at 09:45, Siddharth Nahata
wrote:
> Hi All,
>
> I have been learning for 2 months now and i have created a eco
https://simpleisbetterthancomplex.com/tutorial/2016/07/22/how-to-extend-django-user-model.html
This is a nice reference that goes over the pros/cons of the different
approaches to your problem.
On Mon, 23 Nov 2020 at 08:41, Neeraj Rana wrote:
> I am trying to create two different types of users
Does anyone know of any good resources walking you through writing tests
for django? I've read through their documentation, and I've written a few,
but I'm wondering if there's someone out there with a tutorial that really
spells out a good approach.
Thank you!
--
You received this message becau
This is perfect, thank you.
On Wed, 2 Dec 2020 at 12:15, Shishir Jha wrote:
> You can look for obey the testing goat book in python. It covers tdd with
> python and django
>
> On Wed, 2 Dec 2020, 10:12 pm mike vickers, wrote:
>
>> Does anyone know of any good resource
I was having a similar issue after setting up https with certbot.
After searching around, I found adding this to settings worked.
CSRF_TRUSTED_ORIGINS = ["https://yourdomain.com";, "https://www.yourdomain.com";]
I'd be curious to hear from others, because I'm *not *an expert in how
to best set up
7 matches
Mail list logo