Re: Stuck

2022-03-28 Thread Kelvin Sajere
You don’t have default.jpg in your media folder. Add jpg image named
default in the media folder.

On Mon, Mar 28, 2022 at 5:34 AM 'Delvin Alexander' via Django users <
django-users@googlegroups.com> wrote:

> Hello everyone,
>
> I am trying to register a new user by watching the Django tutorial. I have
> created the new user but upon attempting to log the new user in I get an,
>
> *"FileNotFoundError at /login/[Errno 2] No such file or directory:
> 'C:\\Users\\delvi\\django_project\\media\\default.jpg'"*
>
> But on my visual code it tells me this, "Exception has occurred:
> ImproperlyConfigured
>
>-
>
> *Requested setting INSTALLED_APPS, but settings are not configured. You
> must either define the environment variable DJANGO_SETTINGS_MODULE or call
> settings.configure() before accessing settings.*
> * File "C:\Users\delvi\django_project\users\models.py", line 2, in
>  from django.contrib.auth.models import User"*
>
>
> Here is my model.py file:
>
> from django.db import models
> from django.contrib.auth.models import User
> from PIL import Image
> import os
> from django.core.asgi import get_asgi_application
>
> class Profile(models.Model):
> user = models.OneToOneField(User, on_delete=models.CASCADE)
> image = models.ImageField(default='default.jpg',
> upload_to='profile_pics')
>
> def __str__(self):
> return f'{self.user.username} Profile'
>
> def save(self, *args, **kwargs):
> super(Profile, self).save(*args, **kwargs)
>
> img = Image.open(self.image.path)
> file = open('media')
>
> if img.height > 300 or img.width > 300:
> output_size = (300, 300)
> img.thumbnail(output_size)
> img.save(self.image.path)
> And here is my views.py file for the User folder:
>
> from django.shortcuts import render, redirect
> from django.contrib import messages
> from .forms import UserRegisterForm, UserUpdateForm, ProfileUpdateForm
> from django.contrib.auth.decorators import login_required
>
>
> def register(request):
> if request.method == 'POST':
> form = UserRegisterForm(request.POST)
> if form.is_valid():
> form.save()
> username = form.cleaned_data.get('username')
> messages.success(request, f'Your Account has been created you
> are now able to log in {username}!')
> return redirect('login')
> else:
> form = UserRegisterForm()
> return render(request, 'users/register.html', {'form': form})
>
> @login_required
> def profile(request):
> if request.method == 'POST':
> u_form = UserUpdateForm(request.POST, instance=request.user)
> p_form = ProfileUpdateForm(request.POST, request.FILES,
> instance=request.user.profile)
> if u_form.is_valid() and p_form.is_valid():
> u_form.save()
> p_form.save()
> messages.success(request, f'Your Account has been updated!')
> return redirect('profile')
> else:
> u_form = UserUpdateForm(instance=request.user)
> p_form = ProfileUpdateForm(instance=request.user.profile)
>
> context = {
> 'u_form': u_form,
> 'p_form': p_form,
> }
>
> return render(request, 'users/profile.html', context)
> *Would anyone know the reason why i am getting two mistakes ?*
>
>
> --
> 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/e4caa9f7-3715-4486-9c8c-feca7ad31b2an%40googlegroups.com
> 
> .
>
-- 
KeLLs

-- 
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/CADYqDX31ZOjfBJWVkA%2B0ZxZgiFCu5S0PvxM%3DDWVpA9Yc5GbHnA%40mail.gmail.com.


Re: can Django replace PHP ?

2021-06-28 Thread Kelvin Sajere
You can create anything with both django and php, but to be fair, django
can only really be compared to laravel which is the most popular web
framework for php like django is for python. I suggest using django since
you’ve already been working with python for years. It would be easier, you
can develop projects faster and there practically nothing on the web that
can’t be built with django right now.

On Mon, Jun 28, 2021 at 20:15 'Peter van der Does' via Django users <
django-users@googlegroups.com> wrote:

> Django !== PHP
>
> Python is like PHP
>
> Django is like Laravel
>
>
> On 6/28/21 2:43 PM, Ajeet Kumar Gupt wrote:
>
> Django is a best in web development as well most secure in comparison to
> php?
>
> On Mon, Jun 28, 2021, 7:09 PM Ahmed omar miladi 
> wrote:
>
>> today django is the best for all web application
>>
>> Le lun. 28 juin 2021 à 14:17, Krishna Adhikari  a
>> écrit :
>>
>>> Hello all  my seniors
>>>
>>> I am doing Data Science programming (python) for 3 years now in my
>>> organization I also have to develop a Web Platform to deeply ML models and
>>> also to develop other web applications together.
>>>
>>> I searched a lot of information on google, but till now I did not make a
>>> decision should I learn PHP or I can handle it all with Django?
>>>
>>> *can we solve all kinds of web application problems with Django without
>>> learning PHP ?? *
>>> *or PHP also recommended.*
>>>
>>> Thank you all in advance
>>>
>>> --
>>> 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/f2007209-a90e-4a08-8d03-b2b3a1007e1en%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/CAE3Dc2N6CWH5w%3DTEpZRbh7tGv2jc06xBUO4Ym9d8cUs%2BS_eORQ%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/CA%2BTqRsvXBgYjvpArmyCx4ANUHpm49jQBr9E5N1jD51EshA8Mkg%40mail.gmail.com
> 
> .
>
> --
>
> *Peter van der Does o: **410-584-2500*
> * m: 732-425-3102 ONeil Interactive, Inc  oneilinteractive.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/34198848-2598-c928-e720-c26ad9e4bfa8%40oneilinteractive.com
> 
> .
>
-- 
KeLLs

-- 
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/CADYqDX16%3Dsc9NA2k5qJQT9Moy_eL%3DbypsueoLn%2BR0uJw_XU0Uw%40mail.gmail.com.


Re: user profile in Django

2021-06-28 Thread Kelvin Sajere
I suggest that you use the AbstractUser model that django officially
recommends.

from django.contrib.auth.models AbstractUser

class User(AbstractUser):
age : models.IntegerField(default=0)
is_student : models.BooleanField(default=False)
# extra profile information

Then also make sure in your settings file you point your auth model to this
class

AUTH_USER_MODEL = ‘app_name.User’

This is the safest and easiest way build profiles. You can equally use the
AbstractBaseUser model if you need some more flexibility, but for most use
case, the AbstractUser model would do.

On Mon, Jun 28, 2021 at 14:17 Abdoulaye Koumaré 
wrote:

> If you're new the best way to create a profile is by using django signals
> you'll get more information about that at
> https://simpleisbetterthancomplex.com/tutorial/2016/07/22/how-to-extend-django-user-model.html
> .
>
> On Sunday, 27 June 2021 at 21:46:28 UTC suabiut wrote:
>
>> You can use the user model, do something like that
>>
>> class user_register(models.Model):
>>   user = models.OneToOneField(User,on_delete=models.CASCADE)
>>   join_date = models.DateTimeField(default=timezone.now)
>>
>> To view the user profile, you can do something like this.
>>
>> def user_profile(request, username):
>> user = User.objects.get(username=username)
>> context = {
>>"user": user
>> }
>>
>>
>> return render(request, 'profile.html', context)
>>
>> profile.html
>>
>> {{user.username}}
>> {{user.first_name}}
>>
>>
>> On Mon, Jun 28, 2021 at 2:43 AM Samir Areh  wrote:
>>
>>> Hello
>>> I'm new to django. i want to create a user profile. I want to know the
>>> best way to do this. thanks
>>>
>>> --
>>> 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...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/f84c5af2-12f1-41d3-9002-f0bc96f0371fn%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/a66be5bb-fff2-4b7e-a76c-4072fc5a3586n%40googlegroups.com
> 
> .
>
-- 
KeLLs

-- 
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/CADYqDX0g6bVJ41UOA8x_3UaE6RLRu1msBRTLLt_7f8%2BKaX%2BCqg%40mail.gmail.com.


Re: Deploy Django app using cpanel

2021-06-24 Thread Kelvin Sajere
Not everyone can afford a VPS. And hosting a django website isn’t at all
difficult. I use shared cpanel hosting for hosting django websites often,
and it is easy. You just need to do it once and you never have to worry
about doing it again. You still have to know how to host on VPS right? Or
is it done automatically with you having to do anything?

On Wed, Jun 23, 2021 at 20:54 Eugene TUYIZERE 
wrote:

> Dear Jolio,
>
> can you send me step by step to host to DigitalOcean?
>
> regards,
>
> On Wed, 23 Jun 2021 at 20:52, Julio Cojom 
> wrote:
>
>> cPanel it's a pain to deploy python applications, better change to a vps
>> with digitalocean or something similar.
>>
>>
>>
>> El mié., 23 de junio de 2021 11:37 a. m., Franck Tchouanga <
>> ftchoua...@gmail.com> escribió:
>>
>>> I see.
>>>
>>> On Wed, Jun 23, 2021, 11:38 AM Eugene TUYIZERE 
>>> wrote:
>>>
 Dear Franck,

 The problem I have now is to configure the django app in cpanel so that
 users can browse it. As I said in previous email, I already have domain and
 cpanel credentials.

 On Wed, 23 Jun 2021 at 12:17, Franck Tchouanga 
 wrote:

> Hello I can assist you what is the problem.
>
>
> On Wed, Jun 23, 2021 at 9:54 AM Eugene TUYIZERE <
> eugenetuyiz...@gmail.com> wrote:
>
>> please assist
>>
>> On Tue, 22 Jun 2021 at 13:03, Eugene TUYIZERE <
>> eugenetuyiz...@gmail.com> wrote:
>>
>>> Dear Team,
>>>
>>> I have an issue. I want to make my app productive. I bought a domain
>>> and I got cpanel credentials. The problem I have now is that I do not 
>>> know
>>> how I can configure the app in cpanel so that users can start browsing 
>>> it.
>>> I tried to connect to the database and I loaded the application files. 
>>> Is
>>> there someone who can tell me all the steps I need to follow to make the
>>> app accessible? for what I have done, I am getting this error message 
>>> when
>>> browsing:
>>> [image: image.png]
>>>
>>> Please assist
>>>
>>> --
>>> *Eugene*
>>>
>>>
>>>
>>
>> --
>> *TUYIZERE Eugene*
>>
>>
>>
>> *Msc Degree in Mathematical Science*
>>
>> *African Institute for Mathematical Sciences (AIMS Cameroon)Crystal
>> Garden-Lime, Cameroon*
>>
>> Bsc in Computer Science
>>
>> *UR-Nyagatare Campus*
>>
>> Email: eugene.tuyiz...@aims-cameroon.org
>>eugenetuyiz...@gmail.com
>>
>> Tel: (+250) 7 88 26 33 38, (+250) 7 22 26 33 38
>>
>> --
>> 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/CABxpZHt5TP8LK%2ByELRcC0sZwJ4WUTw7_PAp7%3DpsS%3DKTnG8zRNw%40mail.gmail.com
>> 
>> .
>>
>
>
> --
> Best Wishes
>
> *Mr Tchouanga*
>
> --
> 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/CANRJ%3D3%3DHnyVQfMmCGpZk-cMLhZZQvqp4EHxjdh-3itcoPnFUPA%40mail.gmail.com
> 
> .
>


 --
 *TUYIZERE Eugene*



 *Msc Degree in Mathematical Science*

 *African Institute for Mathematical Sciences (AIMS Cameroon)Crystal
 Garden-Lime, Cameroon*

 Bsc in Computer Science

 *UR-Nyagatare Campus*

 Email: eugene.tuyiz...@aims-cameroon.org
eugenetuyiz...@gmail.com

 Tel: (+250) 7 88 26 33 38, (+250) 7 22 26 33 38

 --
 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/CABxpZHs4G05MtjQOyfrf2H4ZQfCWS63oxG4hFYXpCx4VYTzrpg%40mail.gmail.com
 
 .

>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To 

Re: Diploy django on DigitalOcean

2021-06-24 Thread Kelvin Sajere
I would prefer using a cloud service like AWS or Google cloud service for
your media files and host your application with Heroku.

On Thu, Jun 24, 2021 at 14:05 Sunday Iyanu Ajayi 
wrote:

> Hi
>
> You can use this link:
> https://simpleisbetterthancomplex.com/tutorial/2016/10/14/how-to-deploy-to-digital-ocean.html
> *AJAYI Sunday *
> (+234) 806 771 5394
> *sunnexaj...@gmail.com *
>
>
>
> On Thu, Jun 24, 2021 at 8:27 AM Eugene TUYIZERE 
> wrote:
>
>> Hello Team,
>>
>> I need some tutorials and steps to deploy a django app on DigitalOcean.
>> Note that I already have the domain what it remaining is only to host.
>>
>> Thank you
>>
>> --
>> *Eugene*
>>
>> --
>> 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/CABxpZHsoWK1zUBgu8a4CERk0AcK2pm3zG_pa8Kv%3D7vGtXXbr_g%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/CAKYSAw2N3%3DpuVX4LywuubbvGOR2Ld_NubBMxqJ4S5Z5tUdQ-OA%40mail.gmail.com
> 
> .
>
-- 
KeLLs

-- 
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/CADYqDX3n8ey0KagdbApJ0qWOwR2nd_PNfybLbLgsxLOpoS8hmQ%40mail.gmail.com.


Re: Deploy Django app using cpanel

2021-06-23 Thread Kelvin Sajere
I have a feeling the hosting company might have some input on how django is
deployed on their shared Cpanel hosting, but in namecheap for instance, you
would have to make sure you have imported the application in your wsgi,
configured the media and static URLs and root to where you’d like them to
be, and made sure your application is running in your terminal by trying to
run python manage.py runserver, if there are any issues you’d know from
there, turn debug to true in your settings.py file to see whatever is
happening.

On Wed, Jun 23, 2021 at 11:38 Eugene TUYIZERE 
wrote:

> Dear Franck,
>
> The problem I have now is to configure the django app in cpanel so that
> users can browse it. As I said in previous email, I already have domain and
> cpanel credentials.
>
> On Wed, 23 Jun 2021 at 12:17, Franck Tchouanga 
> wrote:
>
>> Hello I can assist you what is the problem.
>>
>>
>> On Wed, Jun 23, 2021 at 9:54 AM Eugene TUYIZERE 
>> wrote:
>>
>>> please assist
>>>
>>> On Tue, 22 Jun 2021 at 13:03, Eugene TUYIZERE 
>>> wrote:
>>>
 Dear Team,

 I have an issue. I want to make my app productive. I bought a domain
 and I got cpanel credentials. The problem I have now is that I do not know
 how I can configure the app in cpanel so that users can start browsing it.
 I tried to connect to the database and I loaded the application files. Is
 there someone who can tell me all the steps I need to follow to make the
 app accessible? for what I have done, I am getting this error message when
 browsing:
 [image: image.png]

 Please assist

 --
 *Eugene*



>>>
>>> --
>>> *TUYIZERE Eugene*
>>>
>>>
>>>
>>> *Msc Degree in Mathematical Science*
>>>
>>> *African Institute for Mathematical Sciences (AIMS Cameroon)Crystal
>>> Garden-Lime, Cameroon*
>>>
>>> Bsc in Computer Science
>>>
>>> *UR-Nyagatare Campus*
>>>
>>> Email: eugene.tuyiz...@aims-cameroon.org
>>>eugenetuyiz...@gmail.com
>>>
>>> Tel: (+250) 7 88 26 33 38, (+250) 7 22 26 33 38
>>>
>>> --
>>> 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/CABxpZHt5TP8LK%2ByELRcC0sZwJ4WUTw7_PAp7%3DpsS%3DKTnG8zRNw%40mail.gmail.com
>>> 
>>> .
>>>
>>
>>
>> --
>> Best Wishes
>>
>> *Mr Tchouanga*
>>
>> --
>> 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/CANRJ%3D3%3DHnyVQfMmCGpZk-cMLhZZQvqp4EHxjdh-3itcoPnFUPA%40mail.gmail.com
>> 
>> .
>>
>
>
> --
> *TUYIZERE Eugene*
>
>
>
> *Msc Degree in Mathematical Science*
>
> *African Institute for Mathematical Sciences (AIMS Cameroon)Crystal
> Garden-Lime, Cameroon*
>
> Bsc in Computer Science
>
> *UR-Nyagatare Campus*
>
> Email: eugene.tuyiz...@aims-cameroon.org
>eugenetuyiz...@gmail.com
>
> Tel: (+250) 7 88 26 33 38, (+250) 7 22 26 33 38
>
> --
> 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/CABxpZHs4G05MtjQOyfrf2H4ZQfCWS63oxG4hFYXpCx4VYTzrpg%40mail.gmail.com
> 
> .
>
-- 
KeLLs

-- 
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/CADYqDX2fDxnwTSrpQ64%3DPvif0TE-p85spXANu6R9Jur2M%3DnBaw%40mail.gmail.com.


Re: kindly i need a help

2021-06-23 Thread Kelvin Sajere
I see three errors in your views and templates. First, the kvc variable in
your view holds a list of all objects in your Aboutus table and all objects
in your Services table, and I don’t think that’s what you want.

If I understand what you want to achieve, then your view should look like
this.

def index(request):
Abt = Aboutus.objects.all()
service = Services.objects.all()
kvc = {“Abt” : Abt,
“service” : service}
return render(request, "index.html", kvc)

Then in your template, loop over Abt to get all about us objects, then over
services to get services objects. You can’t just call Abt or services cos
they are lists of objects.

On Wed, Jun 23, 2021 at 17:04 Richard Dushime 
wrote:

> i am making a website using  django  and postgresql the  when i made a
> migration and i created the tables then i i went  in the admin (django
> administration ) everything was okay  the user and the data i can add and
> manipulate all the data and get effect into the database  but  on my
> webpages i am not seeing anything it is deseapiring
>  this is my index.html file
>   
> 
>   
>
> 
>   {{Abt.name}}
>   {{Abt.desc}}
> 
>
> 
>   
> 
>   
> 
>   
>   
> 
>   {{Abt.title}}
>   
> {{Abt.desc2}}
>   
>   
> 
>  Ullamco laboris nisi ut aliquip ex ea commodo consequat.
> 
>  Duis aute irure dolor in reprehenderit in voluptate velit.
> 
>  Ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure 
> dolor in reprehenderit in voluptate trideta storacalaperda mastiro dolore eu 
> fugiat nulla pariatur.
> 
>   
>   
>
> Ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis 
> aute irure dolor in reprehenderit in voluptate
>
> velit esse cillum dolore eu fugiat nulla pariatur. Excepteur 
> sint occaecat cupidatat non proident, sunt in
> culpa qui officia deserunt mollit anim id est laborum
>   
> 
>   
> 
>
>   
> 
>
> 
> 
>   
>
> 
>   {{service.title}}
>   {{service.description}}
> 
>
> 
>   
> 
>   
>   {{service.name}}
>   {{service.description1}}
> 
>
>
> --
> 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/CAJCm56LnoLUsxp-NSZuopNchdG7wAd5UOHxdyfjsfCR7RmMD3w%40mail.gmail.com
> 
> .
>
-- 
KeLLs

-- 
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/CADYqDX0MZiC3s0TqwPEFeJr9EgxttiaY9b%2BkgNbrPeaLjP0RVw%40mail.gmail.com.


Re: django cron Job Functionality

2021-06-11 Thread Kelvin Sajere
What I would do in such case, is to write a function somewhere that checks
if a user applied for a leave, then check if the leave time is within a
day, then do whatever you want, like setting is_active to False. Then set
the cron job to run this function every day, every hour, or however you'd
like.
On Fri, Jun 11, 2021 at 15:10 Chetan Ganji  wrote:

> This will help you
>
> https://pypi.org/project/django-celery-beat/
>
>
> On Fri, Jun 11, 2021, 5:34 PM Eugene TUYIZERE 
> wrote:
>
>> Dear Team,
>>
>> In my application, I want a user to set for example a leave plan in the
>> system and the system notify the user by email for example one day before
>> the start leave date. At the same time the system disables the user in the
>> system. Here I have a field *is_active *and I want the system to set it
>> to False from the leave date to the end date. And also to set Ongoing
>> status on the leave plan user list. I heard somewhere that Django Cron Job
>> can do this but I never use it and I do not know how to use it in the
>> application.
>> If someone has used  it for some time please I need help.
>>
>> Thank you
>>
>> --
>> *Eugene*
>>
>> --
>> 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/CABxpZHt2hqPgNU%2BvyDb8Eua%2B6_OMM8H6xsMzTgJ-73-0erfmKw%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/CAMKMUjvErhZDkdA1ZYPOxHq4yuEWk%3DKUsbrgSyX3LOm7FBhFyw%40mail.gmail.com
> 
> .
>
-- 
KeLLs

-- 
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/CADYqDX1WdmhhS_Jk0xrqz%2Bid81ETth3-%2Bt%2B7THsEUcqY%2B9hXYw%40mail.gmail.com.


Re: Best way to deal with members registration in Django apps

2021-05-25 Thread Kelvin Sajere
If your app just sends email upon registration or just configured to send
mail generally and you would like to use an email with your production
domain like in a production setting, then you only need to change the email
configuration in your settings.py file to reflect your domain email. For
example, get your production domain, www.example.com, create an email
account under that domain name, e.g supp...@example.com, then use this as
your default email in your settings.py file. Typically your Email Host
would just be your domain name, the port for HTTPS would be the same, but
the settings would most likely be shown to you from wherever you are
hosting the domain from.

On Tue, May 25, 2021 at 07:18 Antonis Christofides <
anto...@antonischristofides.com> wrote:

> using Sendmail code that we added in our Django project
>
> You really added sendmail code to your Django project? Or did you
> configure your Django project to use sendmail?
>
> There is no single answer to what you are asking. What I do, and I also
> propose to people to do
> , is:
>
>- Use a small forward-only local name server, namely the DragonFly
>Mail Agent or dma.
>- Use an external service like Runbox or mailbox.org as a mail server.
>I think that paid Google mail accounts will also work.
>
> As for regularly emailing members, again I'd use an external service such
> as mailchimp, but I have no experience integrating such a service with a
> Django app.
>
> Antonis Christofides
> +30-6979924665 (mobile)
>
>
> On 25/05/2021 08.02, Ram wrote:
>
> Hi,
>
> We have members registration module where members will enter email ID as a
> login name. Upon submitting the Sign Up form, we generate an email to the
> given email address using Sendmail code that we added in our Django
> project.
>
> So far we used a personal gmail account as an admin email account to
> generate and send emails to registered members ( as shown below)
>
> EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'  # added by
>> me
>> EMAIL_HOST = 'smtp.gmail.com'
>> EMAIL_PORT = 587
>> EMAIL_HOST_USER = 'xxad...@gmail.com'
>> EMAIL_HOST_PASSWORD = '122hhhlll'
>> EMAIL_USE_TLS = True
>>
>
> but we need to move on to next step on our development and production
> servers to have a real time admin email to handle member registrations and
> further communication with members, like sending newsletters and some
> important security notifications.
>
> Could you please suggest what you been using with zero issues in your
> Django application?
>
> Best regards,
> ~Ram
>
>
> --
> 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/CA%2BOi5F0C17vnf4vEvZgMYha0b2XB49iZpJ4UzqKb56-Tmar-cQ%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/e8186cd2-9a0e-899c-227f-489ae74cf227%40antonischristofides.com
> 
> .
>
-- 
KeLLs

-- 
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/CADYqDX0-cE-aogajOdeQCWZ0NfL929gp7pz1OnoceE2Zwg%3DzwA%40mail.gmail.com.


Re: In need of immediate help from Django community

2021-05-24 Thread Kelvin Sajere
Import the User model in your forms.py and use it instead of Profile. As
the error clearly states, the Profile model does not have a username field.
Django actually recommends using the AbstractUser, or the AbstractBaseUser
to extend the default User model if you wish to create something like a
profile.

On Mon, May 24, 2021 at 9:31 PM Omkar Parab  wrote:

> Error is in forms.py file.
>
> "model = User" not profile.
>
> Default "User" model comes with username, email filed.
>
> Why you're creating another email field in the Profile model?
>
> Just fetch it using {{ user.email }}
>
>
> On Tue, May 25, 2021, 1:38 AM Aritra Ray  wrote:
>
>> Hi,
>>
>> I've been facing a problem recently in creating a Django Profile model
>> for an E-commerce website.
>> Error: FieldError(message) django.core.exceptions.FieldError: Unknown
>> field(s) (username) specified for Profile
>> Kindly help me out if possible. The screenshots have been attached below
>> and the github link for the project has been provided.
>>
>> Link: https://github.com/First-project-01/Django-ecommerce (Check out
>> the 'changes' branch)
>>
>> Regards,
>> Aritra
>>
>> --
>> 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/CAFecadvxBCa6w02%3DZ887%2BnaEdY-R6B9%2BVVFzVW5zYvkt1gA2hg%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/CAJY8mfzFT-GqqZ0YvdLKH9gKcTAv%2B1srG9973pXYfA5f_qVA7w%40mail.gmail.com
> 
> .
>


-- 
KeLLs

-- 
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/CADYqDX1dm1Y-T89W9%3DyZQs1bH04eNUj5qcCpwieOSDoY%2BDy9Kg%40mail.gmail.com.


Re: Base Template per User

2021-05-24 Thread Kelvin Sajere
I don't know why you would want users to upload their own base HTML file,
but if it's to make every user have a unique frontend view, then I think it
would be better just having the users choose layouts, styles and other
frontend properties that would be saved to the database, then use these
saved properties to dynamically alter the UI.

On Mon, May 24, 2021 at 10:05 PM sebasti...@gmail.com <
sebastian.ju...@gmail.com> wrote:

> Hello,
>
> i want that every user from website can upload a base html file that are
> then used on every views as base template. Every User have then his own
> layout...
>
> Have anyone experience with such a thing?
>
> Regards
>
> --
> 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/22701bf0-c5ad-48c5-a4e7-5bce4bc337f4n%40googlegroups.com
> 
> .
>


-- 
KeLLs

-- 
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/CADYqDX2ERE%3DY8D3qN3mD3gOY3cpOC%3D6fFy_7LuQacto%3DoJZbPQ%40mail.gmail.com.


Re: Conversion of web app to mobile app

2021-05-09 Thread Kelvin Sajere
Modern applications are built so you can from it create a web app, mobile
app, or just about anything. I'm talking about building a backend API with
Django Rest Framework or any other backend technology and then create a
frontend web app, mobile app, or whatever by calling the API.

On Sat, May 8, 2021 at 22:44 Kopal Shrivastava  wrote:

> Hello,
>
> I wanted to create a mobile app using django but wanted to know if I
> should straight away work on a mobile app or work on a web app and then
> convert it into a mobile app. Also wanted to know how difficult and time
> taking is the process to convert a web app into mobile app.
>
> Thanks in advance
>
> --
> 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/132268f5-894d-4ee7-96ed-2a293feefcbfn%40googlegroups.com
> 
> .
>
-- 
KeLLs

-- 
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/CADYqDX09MF1nWcL_jnp29FVVZct3ib0HZOMxWEUv-OOL7whcpg%40mail.gmail.com.


Re: Problem with get_absolute_url()

2021-04-26 Thread Kelvin Sajere
Glad I could help.
On Mon, Apr 26, 2021 at 09:21 Mike Dewhirst  wrote:

> Many thanks Kelvin :-)
>
> M
>
>
>
> --
> (Unsigned mail from my phone)
>
>
>
> ---- Original message 
> From: Kelvin Sajere 
> Date: 26/4/21 18:12 (GMT+10:00)
> To: django-users@googlegroups.com
> Subject: Re: Problem with get_absolute_url()
>
> In your URL pattern, just indicate that the audit URL pattern must first
> go to “audit/{id}/”,and intro URL pattern to “intro/{id}/”.
>
> On Mon, Apr 26, 2021 at 03:49 Mike Dewhirst  wrote:
>
>> This code in the chemical model indicates that I'm trying to display two
>> different views of the same chemical which has certain data in a details
>> 1:1 record
>>
>>
>> class Chemical(models.Model):
>>  ...
>>  def get_absolute_url(self):
>>  detail = self.get_detail()
>>  if detail and detail.report_type == INTRO:
>> return f"/report/intro/{self.id}/"
>>  return f"/report/audit/{self.id}/"
>>
>>
>>
>>
>> But it doesn't matter what report_type is selected, the same report
>> displays. Print statements inserted indicate the correct report_type
>> branch is being executed and the correct url is being returned.
>>
>> The url which displays the report is always the first of whichever of
>> the following patterns is above the other ...
>>
>>
>>
>> from django.urls import re_path
>> from report import views as report_views
>>
>> app_name = "report"
>>
>> urlpatterns = [
>>  re_path(r"(?P\d+)/$",
>>  report_views.audit,
>>  name="audit",
>>  ),
>>  re_path(r"(?P\d+)/$",
>>  report_views.intro,
>>  name="intro",
>>  ),
>> ]
>>
>>
>>
>>
>> Both reports are identifiably different. In the above configuration the
>> audit report always shows no matter which report_type is selected.
>>
>> Where am I going wrong?
>>
>> I have tried to get reverse() working by following along with ...
>>
>>
>> https://docs.djangoproject.com/en/2.2/ref/models/instances/#get-absolute-url
>>
>> ... but to no avail. I think if I can get it working with specified urls
>> I should be able to get reverse working.
>>
>> Thanks for any hints
>>
>> Cheers
>>
>> Mike
>>
>> --
>> Signed email is an absolute defence against phishing. This email has
>> been signed with my private key. If you import my public key you can
>> automatically decrypt my signature and be sure it came from me. Just
>> ask and I'll send it to you. Your email software can handle signing.
>>
>>
>> --
>> 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/4d503dfa-5804-9e2b-a0f7-c65ef8f81847%40dewhirst.com.au
>> .
>>
> --
> KeLLs
>
> --
> 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/CADYqDX3m2tApQ8vFoz4FUrQav2Pap-ckVB2zbptCj2_VF25bHw%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CADYqDX3m2tApQ8vFoz4FUrQav2Pap-ckVB2zbptCj2_VF25bHw%40mail.gmail.com?utm_medium=email_source=footer>
> .
>
> --
> 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/6086be14.1c69fb81.48bf2.fe44SMTPIN_ADDED_MISSING%40gmr-mx.google.com
> <https://groups.google.com/d/msgid/django-users/6086be14.1c69fb81.48bf2.fe44SMTPIN_ADDED_MISSING%40gmr-mx.google.com?utm_medium=email_source=footer>
> .
>
-- 
KeLLs

-- 
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/CADYqDX2O29yoVrSLqKNmo474DXsX-zTZ6PyLKKfRS3yfsbf1nA%40mail.gmail.com.


Re: Front Camera and Sound recording

2021-04-26 Thread Kelvin Sajere
This has little to do with the backend of an application, so it’s is going
to be a JavaScript problem to solve. I would suggest using Django to write
the backend (REST API) using Django rest framework preferably, then use
some frontend framework like Vuejs, Reactjs, or Angular. I would suggest
Vuejs cos I use both Vuejs and Reactjs, but I find that the former is more
beginner-friendly and overall easier to learn and use.

On Mon, Apr 26, 2021 at 09:48 Kasper Laudrup  wrote:

> On 26/04/2021 15.11, Kushal Neupane wrote:
> > Can i inbox you?
> >
>
> No, please don't, but thanks for asking.
>
> I doubt I have the time to help you any further, I was mostly trying to
> help you getting help.
>
> If you describe what you are trying to do here in more details, it is
> very likely that someone can give you some pointers on where to look for
> information, especially if it is related to Django, but to be honest it
> doesn't sound like that.
>
> Kind regards,
>
> Kasper Laudrup
>
> --
> 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/0489478a-00bb-52fd-5db7-7b934ae976d4%40stacktrace.dk
> .
>
-- 
KeLLs

-- 
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/CADYqDX1ZYpzU7fQ0wTFgXi_9W48Rq%2BJ-FAcp6%2Bp1UA4pfumOUQ%40mail.gmail.com.


Re: Problem with get_absolute_url()

2021-04-26 Thread Kelvin Sajere
In your URL pattern, just indicate that the audit URL pattern must first go
to “audit/{id}/”,and intro URL pattern to “intro/{id}/”.

On Mon, Apr 26, 2021 at 03:49 Mike Dewhirst  wrote:

> This code in the chemical model indicates that I'm trying to display two
> different views of the same chemical which has certain data in a details
> 1:1 record
>
>
> class Chemical(models.Model):
>  ...
>  def get_absolute_url(self):
>  detail = self.get_detail()
>  if detail and detail.report_type == INTRO:
> return f"/report/intro/{self.id}/"
>  return f"/report/audit/{self.id}/"
>
>
>
>
> But it doesn't matter what report_type is selected, the same report
> displays. Print statements inserted indicate the correct report_type
> branch is being executed and the correct url is being returned.
>
> The url which displays the report is always the first of whichever of
> the following patterns is above the other ...
>
>
>
> from django.urls import re_path
> from report import views as report_views
>
> app_name = "report"
>
> urlpatterns = [
>  re_path(r"(?P\d+)/$",
>  report_views.audit,
>  name="audit",
>  ),
>  re_path(r"(?P\d+)/$",
>  report_views.intro,
>  name="intro",
>  ),
> ]
>
>
>
>
> Both reports are identifiably different. In the above configuration the
> audit report always shows no matter which report_type is selected.
>
> Where am I going wrong?
>
> I have tried to get reverse() working by following along with ...
>
>
> https://docs.djangoproject.com/en/2.2/ref/models/instances/#get-absolute-url
>
> ... but to no avail. I think if I can get it working with specified urls
> I should be able to get reverse working.
>
> Thanks for any hints
>
> Cheers
>
> Mike
>
> --
> Signed email is an absolute defence against phishing. This email has
> been signed with my private key. If you import my public key you can
> automatically decrypt my signature and be sure it came from me. Just
> ask and I'll send it to you. Your email software can handle signing.
>
>
> --
> 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/4d503dfa-5804-9e2b-a0f7-c65ef8f81847%40dewhirst.com.au
> .
>
-- 
KeLLs

-- 
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/CADYqDX3m2tApQ8vFoz4FUrQav2Pap-ckVB2zbptCj2_VF25bHw%40mail.gmail.com.


Re: Problem with get_absolute_url()

2021-04-26 Thread Kelvin Sajere
That's because both have the same path, and Django will always choose the
one it sees first, in this case, the audit. Just change the path of any of
the two will solve the problem.

On Mon, Apr 26, 2021 at 03:49 Mike Dewhirst  wrote:

> This code in the chemical model indicates that I'm trying to display two
> different views of the same chemical which has certain data in a details
> 1:1 record
>
>
> class Chemical(models.Model):
>  ...
>  def get_absolute_url(self):
>  detail = self.get_detail()
>  if detail and detail.report_type == INTRO:
> return f"/report/intro/{self.id}/"
>  return f"/report/audit/{self.id}/"
>
>
>
>
> But it doesn't matter what report_type is selected, the same report
> displays. Print statements inserted indicate the correct report_type
> branch is being executed and the correct url is being returned.
>
> The url which displays the report is always the first of whichever of
> the following patterns is above the other ...
>
>
>
> from django.urls import re_path
> from report import views as report_views
>
> app_name = "report"
>
> urlpatterns = [
>  re_path(r"(?P\d+)/$",
>  report_views.audit,
>  name="audit",
>  ),
>  re_path(r"(?P\d+)/$",
>  report_views.intro,
>  name="intro",
>  ),
> ]
>
>
>
>
> Both reports are identifiably different. In the above configuration the
> audit report always shows no matter which report_type is selected.
>
> Where am I going wrong?
>
> I have tried to get reverse() working by following along with ...
>
>
> https://docs.djangoproject.com/en/2.2/ref/models/instances/#get-absolute-url
>
> ... but to no avail. I think if I can get it working with specified urls
> I should be able to get reverse working.
>
> Thanks for any hints
>
> Cheers
>
> Mike
>
> --
> Signed email is an absolute defence against phishing. This email has
> been signed with my private key. If you import my public key you can
> automatically decrypt my signature and be sure it came from me. Just
> ask and I'll send it to you. Your email software can handle signing.
>
>
> --
> 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/4d503dfa-5804-9e2b-a0f7-c65ef8f81847%40dewhirst.com.au
> .
>
-- 
KeLLs

-- 
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/CADYqDX0f%3Dg%3DOwex7QL0bJYARga_iYZoJFEpmDgf%2BuHPZOLKS9g%40mail.gmail.com.


Re: How Choose Random User from database ?

2021-04-19 Thread Kelvin Sajere
If you just want a random user, you could just use random.choice(). You can
use it in shell, in a function or wherever you want.

Example:

import random
users = User.objects.all() #a list of all users
random_user = random.choice(users) #a random user

On Mon, Apr 19, 2021 at 20:45 Mustafa Burhani 
wrote:

> I want to Choose random user from databse is possible with django shell or
> need to create model ? for random function ?
>
>
> Thanks !
>
> --
> 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/055d5a55-ad28-4a97-b1ec-1d16369cc2a2n%40googlegroups.com
> 
> .
>
-- 
KeLLs

-- 
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/CADYqDX1275VyPJcTfnX7%2B%3DtbmMSaFTYxph0m0t%2B-PH3bTLK9Ow%40mail.gmail.com.


Re: reg: Django vs DRF

2021-03-27 Thread Kelvin Sajere
Firstly, DRF is just like any other app you would create in your project
when you use it. It's not a full-blown framework. With that said, DRF uses
the same authentication system, I only use token authentication when I am
working on a project the frontend is decoupled from the backend. If not, I
just use the regular session authentication. PS: There really isn't a
Django vs DRF.

On Fri, Mar 26, 2021 at 03:52 'Amitesh Sahay' via Django users <
django-users@googlegroups.com> wrote:

> I have a basic question.
> From all the tutorials and document that I have gone through for DRF, my
> understanding is that Token authentication is used to access the REST APIs.
>
> So, my question is, does DRF have such a user creation system, or is it
> only done through the Django User model, i.e. The way we have a Django
> user model, which is used to register/create a new user in a database and
> login with their registered account.?
>
> I hope my query is clear.
>
> Regards,
> Amitesh
>
> --
> 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/866964018.493665.1616745114708%40mail.yahoo.com
> 
> .
>
-- 
KeLLs

-- 
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/CADYqDX33xYiWzCvut5-fPpSbAaTYYE1fChEwOVWujkUO2oGn%3DQ%40mail.gmail.com.


Re: Improperly Configured at /blog/write/

2021-03-20 Thread Kelvin Sajere
Sorry, the save method isn’t supposed to be inside the _get_unique_slug()
function. That’s what happens when u type code on an iPad.






On Sat, Mar 20, 2021 at 14:08 Kelvin Sajere  wrote:

> Just adding to the previous answer, you should always make sure your slug
> field is unique when saving, as sometimes two posts can have the same title
> and that would result to an error.
>
>
>
> sorry def _get_unique_slug(self): slug = slugify(self.blog_title)
> unique_slug = slug
> num = 1
> while Blog.objects.filter(slug=unique_slug).exists():
> unique_slug = '{}-{}'.format(slug, num)
> num += 1
> return unique_slug
> def save(self, *args, **kwargs):
> if not self.slug:
> self.slug = self._get_unique_slug()
> super().save(*args, **kwargs)
> On Sat, Mar 20, 2021 at 11:05 Noyon Barman 
> wrote:
>
>> Thank you so much for helping me with this
>>
>> On Sat, 20 Mar, 2021 at 7:22 PM, Omkar Parab 
>> wrote:
>>
>>> First, import slugify 
>>>
>>> from django.template.defaultfilters import slugify
>>>
>>> then,
>>>
>>> Add this  below the "def __str__()" in your Blog model.
>>>
>>> def save(self, *args, **kwargs):
>>> if not self.slug:
>>> self.slug = slugify(self.blog_title)
>>> return super().save(*args, **kwargs)
>>>
>>> On Sat, Mar 20, 2021, 6:33 PM Noyon Barman 
>>> wrote:
>>>
>>>>
>>>>
>>>> On Sat, Mar 20, 2021 at 6:02 PM Omkar Parab 
>>>> wrote:
>>>>
>>>>> Looks like, the slug is not configured correctly. Post the screen-shot
>>>>> of the models.py file of the "App_blog" App.
>>>>>
>>>>> On Sat, Mar 20, 2021, 4:48 PM Noyon Barman 
>>>>> wrote:
>>>>>
>>>>>> Please help me what should I do now
>>>>>>
>>>>>> On Sat, Mar 20, 2021 at 12:39 PM Omkar Parab 
>>>>>> wrote:
>>>>>>
>>>>>>> Post the screen-shot of app/urls.py file.
>>>>>>>
>>>>>>> On Sat, Mar 20, 2021, 4:05 AM Noyon Barman <
>>>>>>> noyonbarman1...@gmail.com> wrote:
>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> On Sat, Mar 20, 2021 at 4:00 AM Anornymous u <
>>>>>>>> anornymou...@gmail.com> wrote:
>>>>>>>>
>>>>>>>>> Send the error displayed on the browser in red
>>>>>>>>>
>>>>>>>>> On Sat, Mar 20, 2021, 00:54 Noyon Barman <
>>>>>>>>> noyonbarman1...@gmail.com> wrote:
>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On Sat, Mar 20, 2021 at 3:31 AM Noyon Barman <
>>>>>>>>>> noyonbarman1...@gmail.com> wrote:
>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> On Sat, Mar 20, 2021 at 3:26 AM Héctor Alonso Lozada Echezuría <
>>>>>>>>>>> ima...@gmail.com> wrote:
>>>>>>>>>>>
>>>>>>>>>>>> Exactly
>>>>>>>>>>>>
>>>>>>>>>>>> El vie, 19 mar 2021 a las 15:25, Anornymous u (<
>>>>>>>>>>>> anornymou...@gmail.com>) escribió:
>>>>>>>>>>>>
>>>>>>>>>>>>> Line 17 not 14
>>>>>>>>>>>>>
>>>>>>>>>>>>> On Sat, Mar 20, 2021, 00:22 Héctor Alonso Lozada Echezuría <
>>>>>>>>>>>>> ima...@gmail.com> wrote:
>>>>>>>>>>>>>
>>>>>>>>>>>>>> Line 14: fields not feilds
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> El vie, 19 mar 2021 a las 15:17, Noyon Barman (<
>>>>>>>>>>>>>> noyonbarman1...@gmail.com>) escribió:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> What happens here? How do I solve this problem?
>>>>>>>>>>>>>>>
>>>>>>>>>>>

Re: Improperly Configured at /blog/write/

2021-03-20 Thread Kelvin Sajere
Just adding to the previous answer, you should always make sure your slug
field is unique when saving, as sometimes two posts can have the same title
and that would result to an error.



def _get_unique_slug(self): slug = slugify(self.blog_title)
unique_slug = slug
num = 1
while Blog.objects.filter(slug=unique_slug).exists():
unique_slug = '{}-{}'.format(slug, num)
num += 1
return unique_slug
def save(self, *args, **kwargs):
if not self.slug:
self.slug = self._get_unique_slug()
super().save(*args, **kwargs)
On Sat, Mar 20, 2021 at 11:05 Noyon Barman 
wrote:

> Thank you so much for helping me with this
>
> On Sat, 20 Mar, 2021 at 7:22 PM, Omkar Parab 
> wrote:
>
>> First, import slugify 
>>
>> from django.template.defaultfilters import slugify
>>
>> then,
>>
>> Add this  below the "def __str__()" in your Blog model.
>>
>> def save(self, *args, **kwargs):
>> if not self.slug:
>> self.slug = slugify(self.blog_title)
>> return super().save(*args, **kwargs)
>>
>> On Sat, Mar 20, 2021, 6:33 PM Noyon Barman 
>> wrote:
>>
>>>
>>>
>>> On Sat, Mar 20, 2021 at 6:02 PM Omkar Parab 
>>> wrote:
>>>
 Looks like, the slug is not configured correctly. Post the screen-shot
 of the models.py file of the "App_blog" App.

 On Sat, Mar 20, 2021, 4:48 PM Noyon Barman 
 wrote:

> Please help me what should I do now
>
> On Sat, Mar 20, 2021 at 12:39 PM Omkar Parab 
> wrote:
>
>> Post the screen-shot of app/urls.py file.
>>
>> On Sat, Mar 20, 2021, 4:05 AM Noyon Barman 
>> wrote:
>>
>>>
>>>
>>> On Sat, Mar 20, 2021 at 4:00 AM Anornymous u 
>>> wrote:
>>>
 Send the error displayed on the browser in red

 On Sat, Mar 20, 2021, 00:54 Noyon Barman 
 wrote:

>
>
> On Sat, Mar 20, 2021 at 3:31 AM Noyon Barman <
> noyonbarman1...@gmail.com> wrote:
>
>>
>>
>> On Sat, Mar 20, 2021 at 3:26 AM Héctor Alonso Lozada Echezuría <
>> ima...@gmail.com> wrote:
>>
>>> Exactly
>>>
>>> El vie, 19 mar 2021 a las 15:25, Anornymous u (<
>>> anornymou...@gmail.com>) escribió:
>>>
 Line 17 not 14

 On Sat, Mar 20, 2021, 00:22 Héctor Alonso Lozada Echezuría <
 ima...@gmail.com> wrote:

> Line 14: fields not feilds
>
> El vie, 19 mar 2021 a las 15:17, Noyon Barman (<
> noyonbarman1...@gmail.com>) escribió:
>
>> What happens here? How do I solve this problem?
>>
>> --
>> 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/CAL-bCoy-SMKGDhOPdrBStDtzx5a3f2LxHAj%3DfCX_5%3DyrdCXNSw%40mail.gmail.com
>> 
>> .
>>
>
>
> --
> Héctor Alonso Lozada Echezuría
>
> --
> 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/CADTS2YzWi%3D2R5AsVKEnAn_HJ3syvFxS7DanmQb%2BPqLu64qF7ug%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/CAMXTB%3DcA44t63_n4WnRtDOBq1KXMG%3DmdyLDqOBQduiAxFPqmgA%40mail.gmail.com
 
 .

>>>
>>>
>>> --
>>> Héctor Alonso Lozada Echezuría
>>>
>>> --
>>> You received this message 

Re: First DRF project.

2021-03-17 Thread Kelvin Sajere
Thanks Hasan. Looking forward to people actually using the app.

On Wed, Mar 17, 2021 at 9:10 PM Hasan Tareq 
wrote:

> Wow!
>
> looking Fresh man.
>
> On Monday, 15 March 2021 at 03:02:39 UTC+6 kells...@gmail.com wrote:
>
>> Thanks Uche.
>>
>> On Sun, Mar 14, 2021 at 15:33 Uche Kelvin  wrote:
>>
>>> Nice to hear from you.
>>>
>>> I love your app
>>>
>>> On Sun, 14 Mar 2021 at 16:58, Kelvin Sajere  wrote:
>>>
>>>> Ajay, I am currently hosting both front-end and back-end on
>>>> namecheap.com, but it's components are separate, so I can easily scale
>>>> as the needs arise. I am using MySQL for the database, so with time, I plan
>>>> to move the backend and database to Google cloud, then get a VPS or
>>>> dedicated hosting on Namecheap. I am already using AWS for the files, so
>>>> that's going to stay that way. If you need any other thing, do let me know.
>>>>
>>>>
>>>> On Fri, Mar 12, 2021 at 17:40 ajaykumar...@gmail.com <
>>>> ajaykumar...@gmail.com> wrote:
>>>>
>>>>> Thanks KeLLs for replay, I have already running website but right now
>>>>> it is developed in Wordpress. Ok can you please tell me how where you
>>>>> hosted hits front-end and back-end ?
>>>>>
>>>>> My Website URL: gotoanysite.com
>>>>>
>>>>> -Ajay Kumar
>>>>>
>>>>> On Thursday, March 11, 2021 at 4:17:40 PM UTC+5:30 kells...@gmail.com
>>>>> wrote:
>>>>>
>>>>>> Hi Ajay,
>>>>>> If you would like to build something like this, then you should look
>>>>>> into Vuejs. I also used a design framework for Vuejs called Vuetify. You
>>>>>> don’t even get to see all of the amazing features the site has until 
>>>>>> you’re
>>>>>> logged in. I would really appreciate some positive or negative feedback
>>>>>> from you all. Thanks.
>>>>>>
>>>>>> On Thu, Mar 11, 2021 at 05:37 ajaykumar...@gmail.com <
>>>>>> ajaykumar...@gmail.com> wrote:
>>>>>>
>>>>>>> Hi KeLLs, I want to develop the website like you developed...
>>>>>>>
>>>>>>> Regards,
>>>>>>> Ajay
>>>>>>>
>>>>>>> On Thursday, March 11, 2021 at 3:51:43 PM UTC+5:30
>>>>>>> kells...@gmail.com wrote:
>>>>>>>
>>>>>>>> Good day everyone,
>>>>>>>>
>>>>>>>> I’ve been developing web applications in django since late 2019, I
>>>>>>>> have done quite a number of projects, but I always felt using django 
>>>>>>>> for
>>>>>>>> just the backend and maybe a frontend framework for the frontend would
>>>>>>>> actually be better. I decided to look into vue this January, and 
>>>>>>>> developed
>>>>>>>> an app for listening, reading and sharing positivity. The backend is
>>>>>>>> developed with django and DRF, while the frontend is developed with 
>>>>>>>> Vuejs.
>>>>>>>> It’s a PWA, so it comes installable on Pc and Android devices. Check 
>>>>>>>> it out
>>>>>>>> and let me know what you think. Thanks. https://divineword.life
>>>>>>>> --
>>>>>>>> KeLLs
>>>>>>>>
>>>>>>> --
>>>>>>>
>>>>>> 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...@googlegroups.com.
>>>>>>> To view this discussion on the web visit
>>>>>>> https://groups.google.com/d/msgid/django-users/5548dae8-f614-4135-aff5-e9b3fbae4452n%40googlegroups.com
>>>>>>> <https://groups.google.com/d/msgid/django-users/5548dae8-f614-4135-aff5-e9b3fbae4452n%40googlegroups.com?utm_medium=email_source=footer>
>>>>>>> .
>>>>>>>
>>>>>> --
>>>>>> KeLLs
>>>>>>
>>>>> --
>>>>> You received this message because yo

Re: Django Tutorial Part 3 Error for Django 3.1

2021-03-16 Thread Kelvin Sajere
Simply because you haven't specified that URL path in your project, so it
would naturally not be able to find it. The path I see from your error
image, is the /admin/ path.

On Tue, Mar 16, 2021 at 10:02 Joel Goldstick 
wrote:

>
>
> On Tue, Mar 16, 2021 at 9:11 AM Ronnie Atuhaire 
> wrote:
>
>> Hello everyone, I joined this platform like a week ago not because I am
>> experienced but because I am new to Django and would like to connect with
>> like  minded people.
>>
>> I have experienced an HTTP404 Error while following this tutorial at 
>> *https://docs.djangoproject.com/en/3.1/intro/tutorial03/
>>  *
>>
>> Writing Views --I am stuck here, I can't see this page.
>>
>> """Take a look in your browser, at “/polls/34/”. It’ll run the detail() 
>> method
>> and display whatever ID you provide in the URL. Try “/polls/34/results/”
>> and “/polls/34/vote/” too – these will display the placeholder results and
>> voting pages""".
>>
>> I have been trying to figure it out but seems I have failed so far, tried
>> stack overflow but no help so far. Any one who is interested in helping me
>> out please let me know.
>> [image: image.png]
>>
>> I will be so grateful.
>>
>> Ronnie A
>>
>> --
>> 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/CAOPBWLc8Af0TtufUiV08m9djKhaodzWW35Kig%2BdrHMuHQfUNng%40mail.gmail.com
>> 
>> .
>>
>
> You haven't entered any url patterns in urls.py
> --
> Joel Goldstick
> http://joelgoldstick.com/blog
> http://cc-baseballstats.info/stats/birthdays
>
> --
> 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/CAPM-O%2BwqTTCk1gf7469Xnun0NMfahLFepOBXcMD6yeCRavnqyA%40mail.gmail.com
> 
> .
>
-- 
KeLLs

-- 
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/CADYqDX0N5hpiXUcghzVWcB6sFJGaGAiRBSdizVcdhCJ%3DVmB%2Bjw%40mail.gmail.com.


Re: First DRF project.

2021-03-14 Thread Kelvin Sajere
Thanks Uche.

On Sun, Mar 14, 2021 at 15:33 Uche Kelvin  wrote:

> Nice to hear from you.
>
> I love your app
>
> On Sun, 14 Mar 2021 at 16:58, Kelvin Sajere  wrote:
>
>> Ajay, I am currently hosting both front-end and back-end on namecheap.com,
>> but it's components are separate, so I can easily scale as the needs arise.
>> I am using MySQL for the database, so with time, I plan to move the backend
>> and database to Google cloud, then get a VPS or dedicated hosting on
>> Namecheap. I am already using AWS for the files, so that's going to stay
>> that way. If you need any other thing, do let me know.
>>
>>
>> On Fri, Mar 12, 2021 at 17:40 ajaykumar...@gmail.com <
>> ajaykumar.bit.1...@gmail.com> wrote:
>>
>>> Thanks KeLLs for replay, I have already running website but right now it
>>> is developed in Wordpress. Ok can you please tell me how where you hosted
>>> hits front-end and back-end ?
>>>
>>> My Website URL: gotoanysite.com
>>>
>>> -Ajay Kumar
>>>
>>> On Thursday, March 11, 2021 at 4:17:40 PM UTC+5:30 kells...@gmail.com
>>> wrote:
>>>
>>>> Hi Ajay,
>>>> If you would like to build something like this, then you should look
>>>> into Vuejs. I also used a design framework for Vuejs called Vuetify. You
>>>> don’t even get to see all of the amazing features the site has until you’re
>>>> logged in. I would really appreciate some positive or negative feedback
>>>> from you all. Thanks.
>>>>
>>>> On Thu, Mar 11, 2021 at 05:37 ajaykumar...@gmail.com <
>>>> ajaykumar...@gmail.com> wrote:
>>>>
>>>>> Hi KeLLs, I want to develop the website like you developed...
>>>>>
>>>>> Regards,
>>>>> Ajay
>>>>>
>>>>> On Thursday, March 11, 2021 at 3:51:43 PM UTC+5:30 kells...@gmail.com
>>>>> wrote:
>>>>>
>>>>>> Good day everyone,
>>>>>>
>>>>>> I’ve been developing web applications in django since late 2019, I
>>>>>> have done quite a number of projects, but I always felt using django for
>>>>>> just the backend and maybe a frontend framework for the frontend would
>>>>>> actually be better. I decided to look into vue this January, and 
>>>>>> developed
>>>>>> an app for listening, reading and sharing positivity. The backend is
>>>>>> developed with django and DRF, while the frontend is developed with 
>>>>>> Vuejs.
>>>>>> It’s a PWA, so it comes installable on Pc and Android devices. Check it 
>>>>>> out
>>>>>> and let me know what you think. Thanks. https://divineword.life
>>>>>> --
>>>>>> KeLLs
>>>>>>
>>>>> --
>>>>>
>>>> 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...@googlegroups.com.
>>>>> To view this discussion on the web visit
>>>>> https://groups.google.com/d/msgid/django-users/5548dae8-f614-4135-aff5-e9b3fbae4452n%40googlegroups.com
>>>>> <https://groups.google.com/d/msgid/django-users/5548dae8-f614-4135-aff5-e9b3fbae4452n%40googlegroups.com?utm_medium=email_source=footer>
>>>>> .
>>>>>
>>>> --
>>>> KeLLs
>>>>
>>> --
>>> 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/d9011de1-0572-407a-abc2-4ab540b4f0efn%40googlegroups.com
>>> <https://groups.google.com/d/msgid/django-users/d9011de1-0572-407a-abc2-4ab540b4f0efn%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>>
>> --
>> KeLLs
>>
>> --
>> 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
>> http

Re: First DRF project.

2021-03-14 Thread Kelvin Sajere
Ajay, I am currently hosting both front-end and back-end on namecheap.com,
but it's components are separate, so I can easily scale as the needs arise.
I am using MySQL for the database, so with time, I plan to move the backend
and database to Google cloud, then get a VPS or dedicated hosting on
Namecheap. I am already using AWS for the files, so that's going to stay
that way. If you need any other thing, do let me know.


On Fri, Mar 12, 2021 at 17:40 ajaykumar...@gmail.com <
ajaykumar.bit.1...@gmail.com> wrote:

> Thanks KeLLs for replay, I have already running website but right now it
> is developed in Wordpress. Ok can you please tell me how where you hosted
> hits front-end and back-end ?
>
> My Website URL: gotoanysite.com
>
> -Ajay Kumar
>
> On Thursday, March 11, 2021 at 4:17:40 PM UTC+5:30 kells...@gmail.com
> wrote:
>
>> Hi Ajay,
>> If you would like to build something like this, then you should look into
>> Vuejs. I also used a design framework for Vuejs called Vuetify. You don’t
>> even get to see all of the amazing features the site has until you’re
>> logged in. I would really appreciate some positive or negative feedback
>> from you all. Thanks.
>>
>> On Thu, Mar 11, 2021 at 05:37 ajaykumar...@gmail.com <
>> ajaykumar...@gmail.com> wrote:
>>
>>> Hi KeLLs, I want to develop the website like you developed...
>>>
>>> Regards,
>>> Ajay
>>>
>>> On Thursday, March 11, 2021 at 3:51:43 PM UTC+5:30 kells...@gmail.com
>>> wrote:
>>>
 Good day everyone,

 I’ve been developing web applications in django since late 2019, I have
 done quite a number of projects, but I always felt using django for just
 the backend and maybe a frontend framework for the frontend would actually
 be better. I decided to look into vue this January, and developed an app
 for listening, reading and sharing positivity. The backend is developed
 with django and DRF, while the frontend is developed with Vuejs. It’s a
 PWA, so it comes installable on Pc and Android devices. Check it out and
 let me know what you think. Thanks. https://divineword.life
 --
 KeLLs

>>> --
>>>
>> 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...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/5548dae8-f614-4135-aff5-e9b3fbae4452n%40googlegroups.com
>>> 
>>> .
>>>
>> --
>> KeLLs
>>
> --
> 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/d9011de1-0572-407a-abc2-4ab540b4f0efn%40googlegroups.com
> 
> .
>
-- 
KeLLs

-- 
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/CADYqDX1DibpJR81hnQZ4z%3DMtFETE4yGFH%2B2cguYSk7OHbn3r5g%40mail.gmail.com.


Re: First DRF project.

2021-03-11 Thread Kelvin Sajere
Hi Ajay,
If you would like to build something like this, then you should look into
Vuejs. I also used a design framework for Vuejs called Vuetify. You don’t
even get to see all of the amazing features the site has until you’re
logged in. I would really appreciate some positive or negative feedback
from you all. Thanks.

On Thu, Mar 11, 2021 at 05:37 ajaykumar...@gmail.com <
ajaykumar.bit.1...@gmail.com> wrote:

> Hi KeLLs, I want to develop the website like you developed...
>
> Regards,
> Ajay
>
> On Thursday, March 11, 2021 at 3:51:43 PM UTC+5:30 kells...@gmail.com
> wrote:
>
>> Good day everyone,
>>
>> I’ve been developing web applications in django since late 2019, I have
>> done quite a number of projects, but I always felt using django for just
>> the backend and maybe a frontend framework for the frontend would actually
>> be better. I decided to look into vue this January, and developed an app
>> for listening, reading and sharing positivity. The backend is developed
>> with django and DRF, while the frontend is developed with Vuejs. It’s a
>> PWA, so it comes installable on Pc and Android devices. Check it out and
>> let me know what you think. Thanks. https://divineword.life
>> --
>> KeLLs
>>
> --
> 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/5548dae8-f614-4135-aff5-e9b3fbae4452n%40googlegroups.com
> 
> .
>
-- 
KeLLs

-- 
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/CADYqDX2jUax%2BbbYS8cdMaVKbOwu6nADzq5LzA%3DUhTPVCjYi%2B4A%40mail.gmail.com.


First DRF project.

2021-03-11 Thread Kelvin Sajere
Good day everyone,

I’ve been developing web applications in django since late 2019, I have
done quite a number of projects, but I always felt using django for just
the backend and maybe a frontend framework for the frontend would actually
be better. I decided to look into vue this January, and developed an app
for listening, reading and sharing positivity. The backend is developed
with django and DRF, while the frontend is developed with Vuejs. It’s a
PWA, so it comes installable on Pc and Android devices. Check it out and
let me know what you think. Thanks. https://divineword.life
-- 
KeLLs

-- 
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/CADYqDX2WkAEpsqinw%2BCfqyG_qDC8P%3DyfXYppzekYvSbyjrF32Q%40mail.gmail.com.


Re: 127.0.0.1 refused to connect.

2020-12-20 Thread Kelvin Sajere
If you use a vpn, make sure it’s not on. Some vpn blocks all other ports
when they are on.

On Sun, Dec 20, 2020 at 05:27 Parul.  wrote:

> Hy,
> I am not able to indentify the exact problem here. I tried various
> combinations like using only
> Python manage.py runserver
> Then
> Python manage.py runserver 8080 /8000
>
> Still getting the error message as
> "Refused to connect "
>
>
> This has really become an obstacle for me as I am not able to continue
> further.
> I tried all the above suggestions except uninstalling django...
> considering that as my last option ..
> Please help
>
>
> On Sat, Dec 19, 2020, 10:12 AM Frank Chukka 
> wrote:
>
>> try running the server without including the ip or port,just run "python
>> manage.py runserver" only.
>>
>> The way I tend to solve problems like this is I reduce the search space
>> by ruling out what is obviously not the issue(e.g I don't think you have to
>> reinstall your os or that it has anything to do with https since you're
>> running locally) next I look at the error message(especially the last line
>> in cmd) then I do a little bit of Googling.just keep ruling out what didn't
>> work eventually you will arrive at d solution.for example,you can startup a
>> new project in a virtual environment n run the server of the new project,if
>> you don't get the error again you can be rest assured the error has to do
>> with the specific project you're working but if you do then the next
>> suspect should probably be your os.since the server is not running at all
>> that rules out the Web browser.
>>
>> Just be patient,chop it off bit by bit and you will eventually get
>> there.best of luck
>> On 18 Dec 2020 7:11 pm, "Parul."  wrote:
>>
>>> I am using the command python manage.py runserver
>>> But it is not running the servers
>>> I tried localhost with 8000 and 8080 also
>>> The tried 0.0.0.0:8000 and with 8080
>>>
>>>
>>> I am not running any other servers.
>>>
>>> While checking the ip4 in cmd...it's showing 192.168.1.11 tried python
>>> manage.py runserver with this also but didn't work.
>>>
>>> On Fri, Dec 18, 2020, 11:27 PM Akanimoh Osutuk 
>>> wrote:
>>>
 The port is probably being used by another app. Are u running other
 development servers?

 On Fri, 18 Dec 2020, 18:34 Parul.,  wrote:

> This is the error which I am getting.
>
> On Fri, Dec 18, 2020, 10:59 PM Akanimoh Osutuk 
> wrote:
>
>> What errors are you getting?
>>
>> On Fri, 18 Dec 2020, 17:28 Parul.,  wrote:
>>
>>> i am not able to connect , i tried to use 0.0.0.0:8000 ,
>>> 0.0.0.0:8080 as well, still getting same error.
>>> used 127.0.0.1 with ports 8000 and 8080 still getting error
>>> i have put '*' in ALLOWED_HOSTS
>>>
>>> --
>>> 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/b6e49e34-46f1-4c5f-9829-358b3323d381n%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/CADA0syjmtd4q9Lfx6dzqoZTiK-FQ8zz6V22ArB-5HdzUB7azkw%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/CAHjHRFo2GOfxpcDbJJZ1LHLYUHRoguAuStvwVW0h%2Bzw2AuxvUw%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/CADA0sygCesoKDxeJxYTY%3DN61VG50ViW5bj%2Bq2nVxwvu6qYrfpQ%40mail.gmail.com
 

Re: Help!!!

2020-11-29 Thread Kelvin Sajere
I haven’t actually used repl.it, so I can’t really tell you what’s
happening. I basically just do things by creating a project, then using
manage.py to create apps for my project. But the unapplied migrations are
migrations that your project needs to be able to run. These are models that
come with django, like your user models and if you have installed any
external apps.

On Sun, Nov 29, 2020 at 14:44 Agripreneur Updates <
ogunladestephe...@gmail.com> wrote:

> HI, I'm new to django, I downloaded a youtube tutorial for django for
> beginners. The tutor used repl.it platform to create the django and then
> click on run to start the server. But following the same step, when I
> clicked on run I got the error message "You have 18 unapplied
> migration(s)". I observed that the sub folders created in the tutor's
> django template includes: main, pychache, migration, static, templates
> while in my own case, a single file was created namely mysite. attached
> here is the creenshot. I will be glad if you can help.
> Regards
>
> --
> 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/940f323c-31bc-4c43-889a-a2e0dace749bn%40googlegroups.com
> 
> .
>
-- 
KeLLs

-- 
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/CADYqDX3gHHY-ng2_qi1FnCQ0JZb5xXTQMjEuD8xeCsrb-bDH4w%40mail.gmail.com.


Re: Deploying an app on heroku

2020-11-11 Thread Kelvin Sajere
Off the bat, what I see is that your domain is not among the allowed hosts
in your settings.py file. Do that first and we'll go from there.

On Sat, Oct 31, 2020, 6:46 PM programmer 262 
wrote:

> hy guys i want to deploy my app on heroku and i having a bad time this is
> the website that i deployed
> https://khadijaoumelmouminine.herokuapp.com/
> if someone could help me on deploying it. i will be very GLADE and i will
> be very thankful if someone can talk to me on facebook
> https://www.facebook.com/achraf.chahin.3/
> thanks t everyone
>
> --
> 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/0352f07b-2d6f-4e0c-ab95-c4ce8dd32226n%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/CADYqDX0E-F556McAZiSB24Ae1-Y00XH4JVNkadLwv6cuzzzFnQ%40mail.gmail.com.


Re: can anyone help me

2020-08-31 Thread Kelvin Sajere
Apart from the answers already given, I see in your views, your form
variable didn’t include request.FILES that allows for files to be saved via
views. It should be form = PostForm(request.POST, request.FILES).

On Sat, Aug 29, 2020 at 12:48 allaberdi...@gmail.com <
allaberdi16yazha...@gmail.com> wrote:

> I can upload images from django admin panel but cannot to do same thing
> with django form ,  it saves any text but did not save images only,  anyone
> help me  please
> github 
> this is my code:
>
> models.py:
> class Posts(models.Model):
>
> Ahal = 'Ahal'
> Balkan = 'Balkan'
> Dasoguz = 'Dasoguz'
> Lebap = 'Lebap'
> Mary = 'Mary'
>
>
> CHOOSE_REGION = {
> (Ahal,'Ahal'),
> (Balkan,'Balkan'),
> (Dasoguz,'Dasoguz'),
> (Lebap,'Lebap'),
> (Mary,'Mary')
> }
>
>
> name = models.CharField(max_length=30, blank=False, verbose_name='Ady')
> image = models.ImageField(blank=True, null=True, verbose_name='surat')
> text = models.TextField(verbose_name='gosmaça maglumat')
> price = models.FloatField(verbose_name='bahasy')
> region = models.CharField(max_length=30, choices=CHOOSE_REGION,
> blank=False, verbose_name='welaýat')
> district = models.CharField(max_length=30, blank=False,
> verbose_name='etrab')
> user = models.ForeignKey(User, on_delete=models.CASCADE,
> verbose_name='eýesi')
> phone = models.CharField(max_length=50, blank=False, verbose_name='telefon
> belgisi')
> published = models.DateTimeField(auto_now=True, verbose_name='satuwa çykan
> guni')
>
>
>
> forms.py:
> class PostForm(forms.ModelForm):
> class Meta:
> model = Posts
> fields = ['name','image','text','price','region','district','user','phone']
>
>
> views.py:
> def add_post(request):
> form = PostForm(request.POST or None)
> if form.is_valid():
> form.save()
> template = 'add_post.html'
> context = {'form':form}
> return render(request,template,context)
>
> settings.py:
>
> STATIC_URL = '/static/'
> STATICFILES_DIR = [Path(BASE_DIR,'static')]
>
> MEDIA_URL = '/media/'
> MEDIA_ROOT = Path(BASE_DIR,'media')
>
>
> urls.py:
>
> from django.conf.urls.static import static
> from django.conf import settings
>
> urlpatterns = [
> path('admin/', admin.site.urls),
> path('', include('posts.urls')),
> ]
>
> urlpatterns += static(settings.MEDIA_URL,
> document_root=settings.MEDIA_ROOT)
>
>
>
> html form tag:
> {% extends 'index.html' %}
>
> {% load static %}
>
> {% block content %}
>
> 
> {% csrf_token %}
> {{form.media}}
> {{form.as_p}}
> 
> 
>
> {% endblock %}
>
> --
> 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/a403ac50-9dfb-4a48-8007-9a52579886d4n%40googlegroups.com
> 
> .
>
-- 
KeLLs

-- 
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/CADYqDX1-4P6g9G4Ss42J233aiDX8XyuFKmkzB%2BXq-K3xQ4Bnbg%40mail.gmail.com.


Re: can't find index

2020-07-17 Thread Kelvin Sajere
The error is as it is.. Django can't find a path /index

On Fri, Jul 17, 2020, 10:22 PM Ralph Barhydt  wrote:

>
> I have done the first part of the tutorial many times and suddenly, doing
> it one more time, I get this message.  I am in the right directory and I
> have checked the code in urls.py many time as well.  What is going on?
>
>
>
>
>
> ```
> Page not found (404)
> Request Method: GET
> Request URL: http://localhost:8000/index
>
> Using the URLconf defined in rbsite.urls, Django tried these URL
> patterns, in this order:
>
>1. polls/
>2. admin/
>
> The current path, index, didn't match any of these.
>
> You're seeing this error because you have DEBUG = True in your Django
> settings file. Change that to False, and Django will display a standard
> 404 page.
>
> ```
>
> --
> 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/2dae82ab-5b00-43fb-a05e-8ed2b0d79848o%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/CADYqDX117KYdjT%3DKeJWiCXUqnD2fe-H8hDszZc6UWW2DMBw6EA%40mail.gmail.com.


Re: Django Saving a form with Imagefield on shared host

2020-06-17 Thread Kelvin Sajere
If you indeed have your media folder where it’s supposed to be, then make
sure in your settings file, you have specified that folder as your root
folder for media. I don’t see your code, so this might be difficult to
determine on my end.
-- 
KeLLs

-- 
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/CADYqDX3ZtCV27BFVoZc2%3DaOnMvd0isTaqszB2_VfhA5LfHTq8g%40mail.gmail.com.


Re: Capture Content Id

2020-06-15 Thread Kelvin Sajere
On Tue, Jun 16, 2020 at 02:33 Kelvin Sajere  wrote:

>
>
> On Tue, Jun 16, 2020 at 02:00 Soumen Khatua 
> wrote:
>
>> Thank you for your response.
>>
>> On Tue 16 Jun, 2020, 6:29 AM Soumen Khatua, 
>> wrote:
>>
>>> Yeah but in this way the time complexity will be very high, just think
>>> if I'll have more than 1 million post than it will check all the field if
>>> it is available or not.
>>> However my query is different I want to fetch the data based on ID only
>>> but I want to make url as slug  name, so it means the function will take
>>> slug as a parameter not ID.
>>>
>>> On Tue 16 Jun, 2020, 1:24 AM Kelvin Sajere, 
>>> wrote:
>>>
>>>> I forgot that you need to import this
>>>>
>>>> from django.utils.text import slugify
>>>>
>>>> On Mon, Jun 15, 2020 at 6:35 PM Kelvin Sajere 
>>>> wrote:
>>>>
>>>>> I think I kinda understand what you want to achieve here. You want to
>>>>> use a slug field, but you are wondering what happens when two posts have
>>>>> the same slug name. Here is what I do. On your model.
>>>>>
>>>>> class Post(models.Model):
>>>>> title = models.CharField(max_length=50)
>>>>> slug = models.CharField(max_length=50)
>>>>>
>>>>> def _get_unique_slug(self):
>>>>> slug = slugify(self.name)
>>>>> unique_slug = slug
>>>>> num = 1
>>>>> while Category.objects.filter(slug=unique_slug).exists():
>>>>> unique_slug = '{}-{}'.format(slug, num)
>>>>> num += 1
>>>>> return unique_slug
>>>>>
>>>>> def save(self, *args, **kwargs):
>>>>> if not self.slug:
>>>>> self.slug = self._get_unique_slug()
>>>>> super().save(*args, **kwargs)
>>>>>
>>>>> This way, no two posts can have the same slug field.
>>>>>
>>>>>
>>>>> On Mon, Jun 15, 2020 at 08:03 Soumen Khatua 
>>>>> wrote:
>>>>>
>>>>>> Hi Folks,
>>>>>>
>>>>>> I have one Blog post project here user can see the blog and by
>>>>>> clicking on the blog title they can see the details of the blog, so here
>>>>>> Slug will be working here as a URL,but in the details view, How I can 
>>>>>> fetch
>>>>>> that particular content details without having the ID because slug/title 
>>>>>> is
>>>>>> the parameter of the view and it can be duplicated.
>>>>>>  Any help will be appreciated
>>>>>>
>>>>>> Thank You
>>>>>>
>>>>>> Regards,
>>>>>> Soumen
>>>>>>
>>>>>> --
>>>>>> 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/CAPUw6WYCuO9AMa7j4WxaCCZqdgE26YoUTksQptBSYtQ64K8O4g%40mail.gmail.com
>>>>>> <https://groups.google.com/d/msgid/django-users/CAPUw6WYCuO9AMa7j4WxaCCZqdgE26YoUTksQptBSYtQ64K8O4g%40mail.gmail.com?utm_medium=email_source=footer>
>>>>>> .
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>> --
>>>> KeLLs
>>>>
>>>> --
>>>> 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/CADYqDX0QVJtizHHDN0FTfr1t7nf%2B32-5VgDk%3DJe9h9rQarUSQw%40mail.gmail.com
>>>> <https://groups.google.com/d/msgid/django-users/CADYqDX0QVJtizHHDN0FTfr1t7nf%2B32-5VgDk%3DJe9h9rQarUSQw%40mail.gmail.com?utm_medium=email_source=footer>
>>>> .
>>>>
>>> --
>> You received this m

Re: Capture Content Id

2020-06-15 Thread Kelvin Sajere
On Tue, Jun 16, 2020 at 02:00 Soumen Khatua 
wrote:

> Thank you for your response.
>
> On Tue 16 Jun, 2020, 6:29 AM Soumen Khatua, 
> wrote:
>
>> Yeah but in this way the time complexity will be very high, just think if
>> I'll have more than 1 million post than it will check all the field if it
>> is available or not.
>> However my query is different I want to fetch the data based on ID only
>> but I want to make url as slug  name, so it means the function will take
>> slug as a parameter not ID.
>>
>> On Tue 16 Jun, 2020, 1:24 AM Kelvin Sajere,  wrote:
>>
>>> I forgot that you need to import this
>>>
>>> from django.utils.text import slugify
>>>
>>> On Mon, Jun 15, 2020 at 6:35 PM Kelvin Sajere 
>>> wrote:
>>>
>>>> I think I kinda understand what you want to achieve here. You want to
>>>> use a slug field, but you are wondering what happens when two posts have
>>>> the same slug name. Here is what I do. On your model.
>>>>
>>>> class Post(models.Model):
>>>> title = models.CharField(max_length=50)
>>>> slug = models.CharField(max_length=50)
>>>>
>>>> def _get_unique_slug(self):
>>>> slug = slugify(self.name)
>>>> unique_slug = slug
>>>> num = 1
>>>> while Category.objects.filter(slug=unique_slug).exists():
>>>> unique_slug = '{}-{}'.format(slug, num)
>>>> num += 1
>>>> return unique_slug
>>>>
>>>> def save(self, *args, **kwargs):
>>>> if not self.slug:
>>>> self.slug = self._get_unique_slug()
>>>> super().save(*args, **kwargs)
>>>>
>>>> This way, no two posts can have the same slug field.
>>>>
>>>>
>>>> On Mon, Jun 15, 2020 at 08:03 Soumen Khatua 
>>>> wrote:
>>>>
>>>>> Hi Folks,
>>>>>
>>>>> I have one Blog post project here user can see the blog and by
>>>>> clicking on the blog title they can see the details of the blog, so here
>>>>> Slug will be working here as a URL,but in the details view, How I can 
>>>>> fetch
>>>>> that particular content details without having the ID because slug/title 
>>>>> is
>>>>> the parameter of the view and it can be duplicated.
>>>>>  Any help will be appreciated
>>>>>
>>>>> Thank You
>>>>>
>>>>> Regards,
>>>>> Soumen
>>>>>
>>>>> --
>>>>> 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/CAPUw6WYCuO9AMa7j4WxaCCZqdgE26YoUTksQptBSYtQ64K8O4g%40mail.gmail.com
>>>>> <https://groups.google.com/d/msgid/django-users/CAPUw6WYCuO9AMa7j4WxaCCZqdgE26YoUTksQptBSYtQ64K8O4g%40mail.gmail.com?utm_medium=email_source=footer>
>>>>> .
>>>>>
>>>>
>>>>
>>>>
>>>
>>> --
>>> KeLLs
>>>
>>> --
>>> 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/CADYqDX0QVJtizHHDN0FTfr1t7nf%2B32-5VgDk%3DJe9h9rQarUSQw%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/django-users/CADYqDX0QVJtizHHDN0FTfr1t7nf%2B32-5VgDk%3DJe9h9rQarUSQw%40mail.gmail.com?utm_medium=email_source=footer>
>>> .
>>>
>> --
> 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/CAPUw6Wa6Wqk8DSgObib8fk9vnFfJrV88pDbN8hEHvoWi9ZhEMA%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAPUw6Wa6Wqk8DSgObib8fk9vnFfJrV88pDbN8hEHvoWi9ZhEMA%40mail.gmail.com?utm_medium=email_source=footer>
> .


First, I noticed my code was wrong. That line should be
Post.objects.fiter.  But then, I don’t understand what exactly you are
trying to achieve. If your view is going to take the slug parameter, then
your url must too.

>
> --
KeLLs

-- 
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/CADYqDX13afkqkiAn1t9vdONq6kbfNQ30RQZeBhb3bXUoNKwD7A%40mail.gmail.com.


Re: How to add a user ratings feature in djnago application?

2020-06-15 Thread Kelvin Sajere
On Tue, Jun 16, 2020 at 02:22 learn code  wrote:

> Hi,
>
> Thank you for your reply,sorry ,still I didn't understand how to add
> ratings.
>
> On Sat, Jun 13, 2020, 2:29 PM Gs_1001  wrote:
>
>> Hey,
>>
>> A rating feature for a peer reviewed books website would look somewhat
>> like:
>> - A books model having "no_of_reviews" and "rating" field
>>
>> Every time a user rates a book no_of_reviews field would be incremented
>> and rating field would be updated.
>>
>> If you think I somehow missed the point then please let me know.
>>
>> On Sunday, June 14, 2020 at 12:37:05 AM UTC+5:30, learn code wrote:
>>>
>>> Hello Everyone,
>>>
>>> Can anyone tell me how to add a star rating feature in Django
>>> application?
>>>
>> --
>> 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/dcce83fc-5925-4587-9ed6-d6884cd85b39o%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/CAPUBRGXuHCwuyZFzwQvdcYdYeofAjcrnwqGkigMwCj109TMnsw%40mail.gmail.com
> 
> .



It seems you would like something already done, rather than the concept of
having to construct it yourself.. If that’s the case, then just use a ready
made app. Django star ratings. Read and understand the documentation, and
you are good to go. I used this in one of my app.

>
> --
KeLLs

-- 
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/CADYqDX1-jnUUqyAwbPXOMwpL2k%2BQTxWNEVYu5jYEjeMahHopXQ%40mail.gmail.com.


Re: Capture Content Id

2020-06-15 Thread Kelvin Sajere
On Mon, Jun 15, 2020 at 08:54 Soumen Khatua 
wrote:

> Could you give me an example??
>
> On Mon, Jun 15, 2020 at 1:21 PM Kayode Oladipo 
> wrote:
>
>> There's an id field built into every Django model (aka, the primary key
>> (pk))
>>
>> Just do, ModelInstance.id and that should do the trick.
>>
>> Cheers.
>>
>> On Mon, Jun 15, 2020, 8:03 AM Soumen Khatua 
>> wrote:
>>
>>> Hi Folks,
>>>
>>> I have one Blog post project here user can see the blog and by clicking
>>> on the blog title they can see the details of the blog, so here Slug will
>>> be working here as a URL,but in the details view, How I can fetch that
>>> particular content details without having the ID because slug/title is the
>>> parameter of the view and it can be duplicated.
>>>  Any help will be appreciated
>>>
>>> Thank You
>>>
>>> Regards,
>>> Soumen
>>>
>>> --
>>> 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/CAPUw6WYCuO9AMa7j4WxaCCZqdgE26YoUTksQptBSYtQ64K8O4g%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/CA%2BARzD-870cXr41yUpGQheNUUDHZxW1GVoR5QJR%3DiV259A4K3w%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/CAPUw6WaFgP99TAJ%3D0-SSHcwdbfCJYn3x0EKk_b-cvyRRiBhDFQ%40mail.gmail.com
> 
> .



If I get you, you wrote the detail view with a slug parameter instead of
the regular pk or id parameter and you’d like to get the details of a post.
Since you are using a slug parameter, just do ModelInstance.slug

>
> --
KeLLs

-- 
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/CADYqDX23RNM13NoP_S8XwYmh4uVezGVFERFF5CcXYOo04Ugb3A%40mail.gmail.com.


Re: Capture Content Id

2020-06-15 Thread Kelvin Sajere
I think I kinda understand what you want to achieve here. You want to use a
slug field, but you are wondering what happens when two posts have the same
slug name. Here is what I do. On your model.

class Post(models.Model):
title = models.CharField(max_length=50)
slug = models.CharField(max_length=50)

def _get_unique_slug(self):
slug = slugify(self.name)
unique_slug = slug
num = 1
while Category.objects.filter(slug=unique_slug).exists():
unique_slug = '{}-{}'.format(slug, num)
num += 1
return unique_slug

def save(self, *args, **kwargs):
if not self.slug:
self.slug = self._get_unique_slug()
super().save(*args, **kwargs)

This way, no two posts can have the same slug field.


On Mon, Jun 15, 2020 at 08:03 Soumen Khatua 
wrote:

> Hi Folks,
>
> I have one Blog post project here user can see the blog and by clicking on
> the blog title they can see the details of the blog, so here Slug will be
> working here as a URL,but in the details view, How I can fetch that
> particular content details without having the ID because slug/title is the
> parameter of the view and it can be duplicated.
>  Any help will be appreciated
>
> Thank You
>
> Regards,
> Soumen
>
> --
> 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/CAPUw6WYCuO9AMa7j4WxaCCZqdgE26YoUTksQptBSYtQ64K8O4g%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/CADYqDX2ezSEf_YR-u4cJjsWFWecBpYePZ%2BSZ5yo%2BovoqrFboxA%40mail.gmail.com.


Re: Need help

2020-06-15 Thread Kelvin Sajere
On Sun, Jun 14, 2020 at 19:38 Deborah  wrote:

> good evening
> the tags that I use in the html file, appear on browsers when I launch the
> server, what to do ???
>
> --
> 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/fca60c53-040e-4f39-ab00-04bb61cc8444o%40googlegroups.com
> 
> .
>
Here is the thing. In django, you should first make sure your HTML files
are in their related app folders, and then load them via a view before
using that view to construct a urlparttern as you’d like. Another thing I
noticed is that the {% load static %} was after a line of code on your HTML
file. This should always be the very first line here except you are
extending a base HTML, then that comes first before you load static.
-- 
KeLLs

-- 
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/CADYqDX1_qDg6mH3ZK730u885yEUbc54cBDb7iJaedXA36YWOGg%40mail.gmail.com.


Re: Need your help!!

2020-06-15 Thread Kelvin Sajere
One of the main advantages of using a web framework or any framework for
that matter is that it takes away most of the stress of having to figure
out how to secure your application. Django is maintained and developed by
some of the best developers in the industry, so they already took care of
most concerns. If you are a newbie or intermediate Django developer, you
need not worry about security but rather focus on writing clean code. When
you need more security that Django doesn't already offer, by then you'd
have known what to do.

On Mon, Jun 15, 2020 at 5:59 PM meera gangani 
wrote:

> Hello ,
>
>  How to apply security in django application and  how to
> secure django applications
>
> Thanks in advance
> -Meera Gangani
>
> --
> 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/CANaPPPLr9DJstjDvYOOrddtY4fcfNLs7xgudWfJ1aFhkROL0GA%40mail.gmail.com
> 
> .
>


-- 
KeLLs

-- 
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/CADYqDX3WytdVBfvFBrbi_C9vw%3D3sEmDibeGZTjWh8rL7TJnqAA%40mail.gmail.com.


Re: Django Saving a form with Imagefield on shared host

2020-06-15 Thread Kelvin Sajere
Did you specify a folder to use for media when you deployed your app? If
so, then make sure it's where you are supposed to have your media folder.
If it's a single hosting, then it should be in the public_html folder, but
on multiple hosting, it should be in the domain-specific folder. I never
really host my media on NameCheap or any other hosting for that matter
though. I use either AWS or GOOGLE CLOUD SERVICES for that.

On Sun, Jun 14, 2020 at 2:46 PM MUGOYA DIHFAHSIH 
wrote:

> I am working on django project and now i have deployed it with Namecheap
> When i submit a form that does not have an ImageField, the form submits
> successfully on the shared host
> but when i submit a form with one of the fields ImageField, it raises 404
> error.
> but on the localhost, the forms work perfectly.
> what can i do to submit such forms on a shared host.
> Thanks.
>
> --
> 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/b79bb9b5-46b4-43eb-9ea5-3eaab14336ddo%40googlegroups.com
> 
> .
>


-- 
KeLLs

-- 
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/CADYqDX2jnwmxOFs5Vz2fnezxs2KMPLh5uh6XVNrz1U36BuBN1g%40mail.gmail.com.


Re: Capture Content Id

2020-06-15 Thread Kelvin Sajere
I forgot that you need to import this

from django.utils.text import slugify

On Mon, Jun 15, 2020 at 6:35 PM Kelvin Sajere  wrote:

> I think I kinda understand what you want to achieve here. You want to use
> a slug field, but you are wondering what happens when two posts have the
> same slug name. Here is what I do. On your model.
>
> class Post(models.Model):
> title = models.CharField(max_length=50)
> slug = models.CharField(max_length=50)
>
> def _get_unique_slug(self):
> slug = slugify(self.name)
> unique_slug = slug
> num = 1
> while Category.objects.filter(slug=unique_slug).exists():
> unique_slug = '{}-{}'.format(slug, num)
> num += 1
> return unique_slug
>
> def save(self, *args, **kwargs):
> if not self.slug:
> self.slug = self._get_unique_slug()
> super().save(*args, **kwargs)
>
> This way, no two posts can have the same slug field.
>
>
> On Mon, Jun 15, 2020 at 08:03 Soumen Khatua 
> wrote:
>
>> Hi Folks,
>>
>> I have one Blog post project here user can see the blog and by clicking
>> on the blog title they can see the details of the blog, so here Slug will
>> be working here as a URL,but in the details view, How I can fetch that
>> particular content details without having the ID because slug/title is the
>> parameter of the view and it can be duplicated.
>>  Any help will be appreciated
>>
>> Thank You
>>
>> Regards,
>> Soumen
>>
>> --
>> 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/CAPUw6WYCuO9AMa7j4WxaCCZqdgE26YoUTksQptBSYtQ64K8O4g%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAPUw6WYCuO9AMa7j4WxaCCZqdgE26YoUTksQptBSYtQ64K8O4g%40mail.gmail.com?utm_medium=email_source=footer>
>> .
>>
>
>
>

-- 
KeLLs

-- 
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/CADYqDX0QVJtizHHDN0FTfr1t7nf%2B32-5VgDk%3DJe9h9rQarUSQw%40mail.gmail.com.


Re: urls 1.11 use task how to use 3.0.6 version

2020-06-15 Thread Kelvin Sajere
You can now easily write your URL patterns like this.

from django.urls import path

urlpatterns = [
path("", someview, name="somename")
]


On Mon, Jun 15, 2020 at 5:52 PM Kayode Oladipo 
wrote:

> Use the path( ) method.
>
> from django.urls import path
>
> path('',...)
>
> On Mon, Jun 15, 2020, 2:21 PM Adya Mit  wrote:
>
>> (?P\d+)/$ django
>>
>> --
>> 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/ef4349f0-5f82-4b4d-85e9-60bc63c5ba08o%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/CA%2BARzD-%2B0qcXSsZHeeXMVBZnozkpjDHgvSH2BfqcuLkpmdUTmQ%40mail.gmail.com
> 
> .
>


-- 
KeLLs

-- 
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/CADYqDX2DXETbtMTHbhkjYgU0iohLQJQNscBJp-ccau2uTo5HKg%40mail.gmail.com.


Re: Updating the concept of Django

2020-06-15 Thread Kelvin Sajere
On Mon, Jun 15, 2020 at 14:21 temitope iyanoye  wrote:

> Hi everyone, I’m a newbie and I understand the basic syntax of python to
> some extents, I have a thing for web development so I chose to learn Django
> for backend dev but for like a week the whole thing looks strange to me, I
> following YouTube tutorials but am not getting it yet, so please I need
> suggestions, do I need to go back to python syntax from beginner to
> intermediate level? What are those things I need to know that would help me
> demystify the mystery behind Django, this is what am passionate about but
> am somehow confused at the moment.
>
> Thanks in anticipation.
>
> --
> 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/8271a202-da74-46f7-848b-51466f54efe2o%40googlegroups.com
> .
>
Two years ago, I had no idea what python programming language was and what
it could be used for. I started learning python because a friend of mine
told me about it. I got to know, and started using django after a year of
learning and working with python. Now, have successfully developed and
deployed about 5 apps. The thing is, python is a versatile programming
language and know it to a great extent before diving into django, would
really make the django learning process smooth. I suggest you learn python,
not just the syntax before going back to django or any framework written in
python for that matter.
-- 
KeLLs

-- 
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/CADYqDX215x9ZW8b8OAnT9nsmk73SC7c4U8MfWOJ92nExfpwvJw%40mail.gmail.com.