Re: Guidepath to learn django

2023-06-27 Thread Dino P.Russe
here are some books and tutorials that can help you:
Books:
- Django 4 by Example . Antonio Mele
- Web development with Django
 Tutorials:
Python Django 7 hours courses


Le mar. 27 juin 2023 à 15:05, lewis machilika  a
écrit :

>
> Did you already tried the Django official documentation?
>
> Regards,
> Lewis
> On Tue, 27 Jun 2023 at 2:02 PM, Dilmurod Dilmurod <
> dilmuroddilmurod...@gmail.com> wrote:
>
>> https://youtu.be/xO1O0-L8ze0
>>
>> Sesh, 27-iyn, 2023, 02:00 Mohit Lamba :
>>
>>> Hello
>>>
>>> I hope this email finds you well. My name is Mohit Lamba , and I am
>>> writing to express my interest in learning Django but not getting the right
>>> course that i should follow or a roadmap. I have been an avid member of
>>> this Django group for some time now and greatly admire the knowledge and
>>> expertise shared within this community.
>>>
>>>
>>> I am a recent graduate from college and wanted to learn and improve my
>>> skillset so I could learn more about the industry.
>>>
>>> It would be grateful if someone could guide me on how and where to start
>>> and how to improve.
>>> Tech stack I am familiar with:
>>> REACTJS,  Javascript, Tailwind CSS, Bootstrap, HTML,CSS,
>>> Languages : C++, C, , PYTHON, JAVASCRIPT
>>>
>>>
>>>
>>> Thank You
>>>
>>> Mohit Lamba
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/875743ed-3d79-4ce0-a3d1-2879fb63149an%40googlegroups.com
>>> 
>>> .
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CANHuyY%2BCJXohbvWU0nbjrj_ZwPFASRAfEJ517zBwa_21JP4DWw%40mail.gmail.com
>> 
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAGRTm9H1LXVD%3Dy0%2BtWypsLqG-3iNvpK%2BTC8Mi1wCo1dZMdCkYQ%40mail.gmail.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAC3RP-Ai%2B7zCHw0%3D-5gL%2BhuZhoXx4WZ2VOy8-Ye5XQvykOJCWA%40mail.gmail.com.


Acces a l'interface d' administration

2020-05-22 Thread Dino P.Russe
J'ai deux projets sur un même ordinateur. 
Quand j'essaye de me connecter sur l'interface d'administration du 2 ème 
mon navigateur me dirige vers l'interface d'administration du 1 er projet.
Comment remédier a cela?

MERCI POUR VOTRE AIDE.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/0beebbf6-40b3-4209-84ae-70a5ce2258db%40googlegroups.com.


Demande d'aide

2020-06-09 Thread Dino P.Russe
ValueError at /cart/

Field 'id' expected a number but got 'product_id'.


cart.py 


from decimal import Decimal
from django.conf import settings
from shop.models import Product


class Cart(object):

def __init__(self, request):
"""
Initialize the cart.
"""
self.session = request.session
cart = self.session.get(settings.CART_SESSION_ID)
if not cart:
# save an empty cart in the session
cart = self.session[settings.CART_SESSION_ID] = {}
self.cart = cart

def __iter__(self):
"""
Iterate over the items in the cart and get the products
from the database.
"""
product_ids = self.cart.keys()
# get the product objects and add them to the cart
products = Product.objects.filter(id__in=product_ids)

cart = self.cart.copy()
for product in products:
cart[str(product.id)]['product'] = product

for item in cart.values():
item['price'] = Decimal(item['price'])
item['total_price'] = item['price'] * item['quantity']
yield item

def __len__(self):
"""
Count all items in the cart.
"""
return sum(item['quantity'] for item in self.cart.values())

def add(self, product, quantity=1, override_quantity=False):
"""
Add a product to the cart or update its quantity.
"""
product_id = str(product.id)
if product_id not in self.cart:
self.cart[product_id] = {'quantity': 0,
  'price': str(product.price)}
if override_quantity:
self.cart[product_id]['quantity'] = quantity
else:
self.cart[product_id]['quantity'] += quantity
self.save()

def save(self):
# mark the session as "modified" to make sure it gets saved
self.session.modified = True

def remove(self, product):
"""
Remove a product from the cart.
"""
product_id = str(product.id)
if product_id in self.cart:
del self.cart[product_id]
self.save()

def clear(self):
# remove cart from session
del self.session[settings.CART_SESSION_ID]
self.save()

def get_total_price(self):
return sum(Decimal(item['price']) * item['quantity'] for item in 
self.cart.values())

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/bb700544-fede-4a55-b5a1-f94d88ae5b19o%40googlegroups.com.


Re: FieldError at /ajouter_centre Cannot resolve keyword 'name' into field. Choices are: categorie, centredeformation, date_de_crea, id

2023-09-25 Thread Dino P.Russe
Si tu pouvais aussi envoyer le code du modèle et du formulaire,  je pense
bien que ton problème sera très rapidement

Le lun. 25 sept. 2023 à 19:44, Baye SALIOU DIAW <
bayesalioudiawt...@gmail.com> a écrit :

> def ajouterCentre(request):
> form = FormCentre()
> regions = Region.objects.all()
> centrecategories = CentreCategorie.objects.all()
> if request.method == 'POST':
>
>
> categorie_name = request.POST.get('categorie')
> categorie, created = CentreCategorie.objects.get_or_create(name=
> categorie_name)
>
> region_name = request.POST.get('region')
> region, created = Region.objects.get_or_create(name=region_name)
>
> CentreDeFormation.objects.create(
> categorie=request.categorie,
> region = region,
> nom = request.POST.get('nom'),
> description = request.POST.get('description'),
> adresse = request.POST.get('adresse'),
> telephone = request.POST.get('telephone'),
> )
>
> return redirect('home')
>
>
> context = {
> 'form': form,
> 'regions': regions,
> 'centrecategories': centrecategories,
> }
> return render(request, 'blog/ajoutercentre.html', context)
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/8a202205-cf75-4445-9642-e995fec56833n%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAC3RP-CV6qay3-QZXUY0%2BROZ9ALdVW3n3ZV5ky4D%2Bz9xJenm9Q%40mail.gmail.com.