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.

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

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

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

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: >

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

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.

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

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

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

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

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,

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

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

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

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

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

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

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

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

Re: First DRF project.

2021-03-17 Thread Kelvin Sajere
n, 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 >

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: > >>

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

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

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

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

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

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

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

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>

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

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

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 tim

Re: Capture Content Id

2020-06-15 Thread Kelvin Sajere
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, 202

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

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. >>

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 =

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

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

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

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 >

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,

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