Re: Displaying contrast of a queryset

2024-04-26 Thread Muhammad Juwaini Abdul Rahman
You're looking for `product`, but the model that you queried is `Task`.

On Fri, 26 Apr 2024 at 17:40, Abdou KARAMBIZI 
wrote:

> Hello,
> *I have 2 models :*
>
> class Product(models.Model):
> product_id = models.AutoField(primary_key=True)
> product_name = models.CharField(max_length=200)
> price = models.IntegerField()
> image =
> models.ImageField(upload_to='images/products_images/',null=True,blank=True)
>
>
> def __str__(self):
> return self.product_name
>
>
> class Task(models.Model):
> task_id = models.AutoField(primary_key=True)
> user = models.ForeignKey(User,on_delete = models.CASCADE)
> product = models.ForeignKey(Product,on_delete=models.CASCADE)
> performed_at = models.DateTimeField(auto_now_add=True)
>
> def __int__(self):
> return self.task_id
>
> *and I have following view with queryset  :*
>
> def product_task (request):
> product = Task.objects.select_related().all()
> for p in product:
> print(p.product.product_name)
>
>
> *I want to get products don't appear in task model*
>
>
> --
> 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/CABnE44ztqCOVMkfDXHMVDAA0b3DpiyuSDKbQw7SNR9ybUvVLhA%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/CAFKhtoQjP901DjuG0_2ULS4GeO8dBa-1RjC9_Ccj8hUWDq2weQ%40mail.gmail.com.


Re: Creating my first test case, failing.

2024-03-27 Thread Muhammad Juwaini Abdul Rahman
Obviously. You need to know how your routers generate the URL endpoint.

After reading DRF, my best guess would be either 'courses-list' or 
'course-list'.

On Tuesday 26 March 2024 at 19:33:07 UTC+8 Filbert wrote:

> *sigh* same error:
> django.urls.exceptions.NoReverseMatch: Reverse for* 'courses-create' *not 
> found. 'courses-create' is not a valid view function or pattern name.
>
> On Tuesday, March 26, 2024 at 7:28:45 AM UTC-4 Muhammad Juwaini Abdul 
> Rahman wrote:
>
>> It's not reverse('courses') alone. Probably reverse('courses-create') or 
>> something like that.
>>
>> On Tue, 26 Mar 2024 at 18:55, Filbert  wrote:
>>
>>> Consider this what seems to be a simple Django/DRF API which works:
>>>
>>> class CourseViewSet(viewsets.ModelViewSet):
>>>   queryset = Course.objects.all()
>>>   serializer_class = CourseSerializer
>>>
>>> router = DefaultRouter()
>>> router.register(r'courses', CourseViewSet)
>>>
>>> urlpatterns = [
>>>path('', include(router.urls)),
>>> ]
>>>
>>> POST to: *http://localhost:9000/courses/ 
>>> <http://localhost:9000/courses/>* works from cURL
>>>
>>> But this code:
>>> class CourseAPITest(TestCase):
>>>   def setUp(self):
>>> self.client = APIClient()
>>> self.course_data = {'description': 'course number 1', 'name': 'intro 
>>> to something'}
>>> self.response = self.client.post(reverse('courses'),  
>>> self.course_data, 
>>> format='json')
>>>
>>> Gives me the error:
>>>
>>> *django.urls.exceptions.NoReverseMatch: Reverse for 'courses' not found. 
>>> 'courses' is not a valid view function or pattern name.*
>>>
>>> -- 
>>> 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/21615aab-a01a-4a1c-bc79-ed88908cafbbn%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/django-users/21615aab-a01a-4a1c-bc79-ed88908cafbbn%40googlegroups.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/8b46d66f-d08b-4f6f-ba41-8204126d49b3n%40googlegroups.com.


Re: Creating my first test case, failing.

2024-03-26 Thread Muhammad Juwaini Abdul Rahman
It's not reverse('courses') alone. Probably reverse('courses-create') or
something like that.

On Tue, 26 Mar 2024 at 18:55, Filbert  wrote:

> Consider this what seems to be a simple Django/DRF API which works:
>
> class CourseViewSet(viewsets.ModelViewSet):
>   queryset = Course.objects.all()
>   serializer_class = CourseSerializer
>
> router = DefaultRouter()
> router.register(r'courses', CourseViewSet)
>
> urlpatterns = [
>path('', include(router.urls)),
> ]
>
> POST to: *http://localhost:9000/courses/ *
> works from cURL
>
> But this code:
> class CourseAPITest(TestCase):
>   def setUp(self):
> self.client = APIClient()
> self.course_data = {'description': 'course number 1', 'name': 'intro
> to something'}
> self.response = self.client.post(reverse('courses'),  
> self.course_data,
> format='json')
>
> Gives me the error:
>
> *django.urls.exceptions.NoReverseMatch: Reverse for 'courses' not found.
> 'courses' is not a valid view function or pattern name.*
>
> --
> 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/21615aab-a01a-4a1c-bc79-ed88908cafbbn%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/CAFKhtoQZb1G4LDN_X-7nXJ2JMB9e%3Dz909y%3DLtNa%3D6410kmo%3DOA%40mail.gmail.com.


Re: Agricultural and livestock marketplace plus social network as a whole

2024-03-15 Thread Muhammad Juwaini Abdul Rahman
In summary, you're looking for free labour?

On Sat, 16 Mar 2024 at 03:49, Jorge Bueno 
wrote:

> Good evening everyone, I need help in my personal project to create an
> agricultural and livestock marketplace and an agricultural and livestock
> social network as a whole.Longer explanation:Farmers and ranchers leave
> their products in our logistics centers and we publish on the web the
> products they have brought us, then the customer orders the products with a
> minimum purchase value to make it profitable and I take care of the
> storage, packaging and shipping to customers. That is the part of getting
> the products to the customer. In addition, we also have the part where the
> producers can talk about the whole process behind it, the tasks they
> perform daily, anecdotes and they can do it in video format apart from the
> message if they wish. Currently, the project is in its initial phase. I
> have created a detailed backlog and configured the repositories for the
> backend and frontend. Here are the links to the repositories:
>
> Backend: https://github.com/Programacionpuntera/Marketplace-again
>
> Frontend: https://github.com/Programacionpuntera/Marketplace-Frontend
>
> In addition, I have created a WhatsApp group for the project where we are
> discussing ideas and coordinating efforts. We currently have backend
> developers and are looking for frontend developers as well, but the more
> developers we have, the better.
>
> However, I am facing a challenge: I have no programming experience. I am
> looking for someone who is willing to collaborate on this project, using
> Python and Django for the backend, and Next.js and React for the frontend.
>
> Please feel free to take a look at the repositories and backlog. Any
> comments, suggestions or contributions will be greatly appreciated.
>
> Thanks for your time and I look forward to working with you on this
> exciting project!
> PS: I've had people say they will collaborate on the project but then they
> don't collaborate on the project, please don't be that kind of person.
>
> Best regards,
>
> Jorge
>
> --
> 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/d160dccf-6582-4b1e-b9fe-186e10342b13n%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/CAFKhtoRgr6bKS892SV%3DUOFindVschuzdWnooLBE8QdLgN1aqsA%40mail.gmail.com.


Re: facial recognition

2024-03-09 Thread Muhammad Juwaini Abdul Rahman
I worked with the same (kinda) project before. So yeah, it's possible.

On Sun, 10 Mar 2024 at 00:35, Iza kim  wrote:

> we already have a materials for the facial recognition and codes for that,
> the only problem right now is how to code for the website where the facial
> recognition will be shown for the students
>
> On Saturday 9 March 2024 at 23:17:13 UTC+8 Muhammad Juwaini Abdul Rahman
> wrote:
>
>> Based on my experience, that's not a trivial task, technically.
>>
>> First and foremost, can you create a website?
>>
>> Secondly, do you have an engine for facial recognition?
>>
>> On Sat, 9 Mar 2024 at 23:13, Iza kim  wrote:
>>
>>> does anyone knows how to create a website for facial recognition?
>>
>>
>>> --
>>> 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/f8232a3d-d8e2-4605-8b66-148265188292n%40googlegroups.com
>>> <https://groups.google.com/d/msgid/django-users/f8232a3d-d8e2-4605-8b66-148265188292n%40googlegroups.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/3d206f6c-bae1-4c5f-bd1c-bfa5009adfa5n%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/3d206f6c-bae1-4c5f-bd1c-bfa5009adfa5n%40googlegroups.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/CAFKhtoThcOaAmZQ8fT1t1VKGepFWsiOR34uHVwmyOcayF%3Dxr9Q%40mail.gmail.com.


Re: facial recognition

2024-03-09 Thread Muhammad Juwaini Abdul Rahman
Based on my experience, that's not a trivial task, technically.

First and foremost, can you create a website?

Secondly, do you have an engine for facial recognition?

On Sat, 9 Mar 2024 at 23:13, Iza kim  wrote:

> does anyone knows how to create a website for facial recognition?
>
> --
> 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/f8232a3d-d8e2-4605-8b66-148265188292n%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/CAFKhtoS%2BqpbnzH0%2B4qN-0vtRYZ%2BaotWV3WfrrFAQH%2BPVOHyn7w%40mail.gmail.com.


Re: Help on Django_allauth Login Page

2024-03-08 Thread Muhammad Juwaini Abdul Rahman
It's part of LoginForm in django_allauth:
https://github.com/pennersr/django-allauth/blob/main/allauth/account/forms.py#L146

You can subclass LoginForm and omit that part.

On Fri, 8 Mar 2024 at 22:34, ALINDA Fortunate 
wrote:

> Hello colleagues, I have the following code for my login page using
> django_allauth but it outputs the *forgot password?* link. How do I edit
> this?
>
> 
> {% extends "_base.html" %}
>
> {%load crispy_forms_tags%}
>
> {% block title %}Log In{% endblock title %}
> {% block content %}
> Log In
> {% csrf_token%}
> {{form | crispy}}
>
> Log In
>
> 
> {% endblock content %}
>
>
> And the output has f*orgot** password? link.* How do I remove it or style
> it?
>
> Below is the output.
>
>
> [image: image.png]
>
> --
> ALINDA Fortunate
> Graduate Of Computer Science
> Gulu University
> Passionate about Software Development in Python
> If you can't explain it simply, you don't understand it well enough.
> alindafortuna...@gmail.com .
> +256 774339676 / +256 702910041
> Kagadi.
>
> --
> 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/CAPifpCtpktOM0dRwGceOd2jP5xGRso6xwey7SvDNv%3DSMsZm0yA%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/CAFKhtoSgoD0y_fom1K_pr3w1esm3N3Cj5%2BybqDemv%2BzA7vqeXg%40mail.gmail.com.


Re: Django web site is not opened though runserver us running

2024-03-06 Thread Muhammad Juwaini Abdul Rahman
Why do you need to use a non-standard port such as 4000 when deployed on a
server?

On Thu, 7 Mar 2024 at 13:18, ram.mu...@gmail.com 
wrote:

> Thank you both. I deployed the same site twice on DO droplets without any
> issues and the site was running fine for a year, but it stopped working
> lately. I did not find any clue so far.
>
> 1. Before deployment
>
> $ ps -ef | grep runserver rmbl 1424 1414 0 05:02 pts/0 00:00:00 grep
> --color=auto runserver ---
>
> $ $ sudo nmap -p 4000, 22 > 136.189.5.1 -Pn Starting Nmap 7.94SVN (
> https://nmap.org ) at 2024-02-29 05:03 UTC Nmap scan report for 22
> (0.0.0.22) Host is up. PORT STATE SERVICE 4000/tcp filtered remoteanything
> Nmap scan report for rmbl-s-1vcpu-2gb-ams3-01 (136.189.5.1) Host is up
> (0.82s latency). PORT STATE SERVICE 4000/tcp closed remoteanything Nmap
> done: 2 IP addresses (2 hosts up) scanned in 2.15 seconds  $ $
> sudo ufw status Status: active To Action From -- --  OpenSSH ALLOW
> Anywhere 8080 ALLOW Anywhere 8000 ALLOW Anywhere 5432 ALLOW Anywhere 4000
> ALLOW Anywhere OpenSSH (v6) ALLOW Anywhere (v6) 8080 (v6) ALLOW Anywhere
> (v6) 8000 (v6) ALLOW Anywhere (v6) 5432 (v6) ALLOW Anywhere (v6) 4000 (v6)
> ALLOW Anywhere (v6) --
>
>
> 2. After successful deployment:
>
>
> $ $ sudo netstat -lanp | grep 4000 $ $ sudo nmap -p 4000, 22 136.189.5.1
> -Pn Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-02-29 05:07 UTC
> Nmap scan report for 22 (0.0.0.22) Host is up. PORT STATE SERVICE 4000/tcp
> filtered remoteanything Nmap scan report for rmbl-s-1vcpu-2gb-ams3-01
> (136.189.5.1) Host is up(0.82s latency). PORT STATE SERVICE 4000/tcp
> closed remoteanything Nmap done: 2 IP addresses (2 hosts up) scanned in
> 2.14 seconds $ $ ps -ef | grep runserver jenkins 1679 1 1 05:05 ? 00:00:00
> /var/lib/jenkins/workspace/dev-rmbl-project/env/bin/python manage.py
> runserver 0.0.0.0:4000 jenkins 1691 1679 1 05:05 ? 00:00:01
> /var/lib/jenkins/workspace/dev-rmbl-project/env/bin/python manage.py
> runserver 0.0.0.0:4000 rmbl 1727 1414 0 05:07 pts/0 00:00:00 grep
> --color=auto runserver $ $ sudo nmap -p 4000, 22 136.189.5.1 -Pn Starting
> Nmap 7.94SVN ( https://nmap.org ) at 2024-02-29 05:08 UTC Nmap scan
> report for 22 (0.0.0.22) Host is up. PORT STATE SERVICE 4000/tcp filtered
> remoteanything Nmap scan report for rmbl-s-1vcpu-2gb-ams3-01 (136.189.5.1)
> Host is up (0.78s latency).
>
> PORT STATE SERVICE 4000/tcp closed remoteanything Nmap done: 2 IP
> addresses (2 hosts up) scanned in 2.13 seconds $ $ $wget
> http://136.189.5.1:4000 --2024-02-29 13:44:39-- http://136.189.5.1:4000/
> Connecting to 136.189.5.1:4000... failed: Connection refused.
>
>
> 3. DO support answer:
>
> Upon checking the issue you are facing with the Django application, I can
> see port 4000 is showing as closed on your Droplet. Please refer to the
> snippet for the details:
>
> nmap -p 4000,22 136.189.5.1 -Pn
> Starting Nmap 7.94 ( https://nmap.org ) at 2024-02-28 13:45 IST
> Nmap scan report for 136.189.5.1
> Host is up (0.23s latency).
> PORT STATE  SERVICE
> 22/tcp   open   ssh
> 4000/tcp closed http-alt
>
> A closed result means, no active service is listening to that port.  In
> this situation, you would need to check the application status that's
> configured to run on this port and proceed further with its result. If it's
> not active, try restarting the service. If it is still failing to start,
> you might have to troubleshoot further to check what is preventing the
> services from starting.  If it shows any error please check the logs and
> proceed accordingly.
>
> Best Regards,
> ~Ram
>
> On Wednesday, March 6, 2024 at 9:40:40 PM UTC-7 Muhammad Juwaini Abdul
> Rahman wrote:
>
>> I always follow the following steps to deploy my site on DO.
>>
>> https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu
>>
>> Countless attempts and 0 fail.
>>
>> Maybe you can try this. If you want to keep trying with your way, also no
>> problem.
>>
>> On Thu, 7 Mar 2024 at 12:02, ram.mu...@gmail.com 
>> wrote:
>>
>>> Hi,
>>>
>>> Hoping someone can provide some clue on this?
>>>
>>> Best regards,
>>> ~Ram
>>>
>>> On Tuesday, March 5, 2024 at 1:32:51 AM UTC-7 ram.mu...@gmail.com wrote:
>>>
>>>> Hi,
>>>>
>>>> Could someone look at this post and help me understand what is missing?
>>>> We think there is no issue in our Django application but Digital Ocean
>>>> concluded that the issue is from our application.
>>>>
>>>

Re: Django web site is not opened though runserver us running

2024-03-06 Thread Muhammad Juwaini Abdul Rahman
I always follow the following steps to deploy my site on DO.
https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu

Countless attempts and 0 fail.

Maybe you can try this. If you want to keep trying with your way, also no
problem.

On Thu, 7 Mar 2024 at 12:02, ram.mu...@gmail.com 
wrote:

> Hi,
>
> Hoping someone can provide some clue on this?
>
> Best regards,
> ~Ram
>
> On Tuesday, March 5, 2024 at 1:32:51 AM UTC-7 ram.mu...@gmail.com wrote:
>
>> Hi,
>>
>> Could someone look at this post and help me understand what is missing?
>> We think there is no issue in our Django application but Digital Ocean
>> concluded that the issue is from our application.
>>
>>
>> https://serverfault.com/questions/1155482/django-site-is-not-opening-up-on-digital-ocean-ubuntu-droplet
>>
>> 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/573034cd-fd0a-4a31-97a5-e551416331den%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/CAFKhtoRm0endKn3cwm0dC7ny2yiJej%2BtGEyhcxa3OTAGw5zuKg%40mail.gmail.com.


Re: Why would a deployed site shows up with distorted layout

2024-02-29 Thread Muhammad Juwaini Abdul Rahman
Most probably your nginx doesn't serve endpoint 'static'.

On Thu, 29 Feb 2024 at 14:24, Ram  wrote:

> Hi,
>
> We are able to deploy our pre-production site successfully using jenkins
> deployment and as part of the deployment we do the following:
>
> 1. Django application with runserver
> 2. Gunicorn restart
> 3. Nginx restart
>
> But our web application loads with distorted layout and we have this
> setting for staticfiles
>
> STATIC_URL = '/static/'
> STATIC_ROOT = os.path.join(BASE_DIR, 'static')
>
> We are wondering what is missing?
>
> 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%2BOi5F2xrz-hiJphYeuGX56hU26wWJGduUZHNibTUXVs-KtjeA%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/CAFKhtoTp8M2S5iOqtYB1OQSG0g-GpaKg6KziZGFsptEaTkczXA%40mail.gmail.com.


Re: counting issue i use mongodb why show always 0

2024-02-19 Thread Muhammad Juwaini Abdul Rahman
How do you connect django to mongodb?

On Mon, 19 Feb 2024 at 17:29, Armaan Alam  wrote:

> queryset = Notification.objects.filter(is_seen__in=[False]).count()
>
> --
> 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/CAO5R%2BOsiVoOyr_cfwEUgt4PyjcK4qF6VOTVwJyAo692auyhayw%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/CAFKhtoQLk6PWntg_Hj4d01KpPQxYnfiYcf7wmgW-sUsXUP8uug%40mail.gmail.com.


Re: Looking for collaborators for an online marketplace project with Python, Django, React.js and Next.js

2024-02-10 Thread Muhammad Juwaini Abdul Rahman
You're looking for people's help but you use non universal language in your
project.

On Sun, 11 Feb 2024 at 00:54, Jorge Bueno 
wrote:

> The project:
>
> I am working on an exciting project that I think you might be interested
> in. It's about an online marketplace similar to the US farmers and
> livestock markets, but with an online focus. The project is already half
> done, with a well-defined requirements list and backlog that will allow you
> to learn a lot while contributing to a real project.
>
> Technologies:
>
> We are using Python and Django for the backend, Next.js and React for the
> frontend.
>
> What we are looking for:
>
> We need help to get django working making python manage.py runserver and
> also all the procedures to check it works well as unit tests right now we
> have the following functionalities programmed the MVP:
> 1.User Registration
> User Profiles
> Product Listing
> 4.Search and Filters
>  5.Shopping Cart
>  6.Payment System
> 7.Ratings and Reviews
> 8.Messaging
>  Notification system
> 10.User management
> Why collaborate:
>
> You will learn a lot: The project is well organized and will allow you to
> work with modern and relevant technologies.
> You will contribute to a real project: Your work will have a direct impact
> on the success of the project.
> You will be part of a community: We are a passionate team committed to the
> success of the project.
> How can you participate?
>  You can access my public GitHub repository here:
> https://github.com/Programacionpuntera/Marketplace-Supremo
>
> --
> 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/153e4e9d-4453-4280-8b06-27c8cbd1f72fn%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/CAFKhtoS7906zTeyeL7Xt%2BiC%3DA0j451f72buqaSLwXwXnE9R8ow%40mail.gmail.com.


Re: URGENT: DJANGO & COPYRIGHT

2024-02-01 Thread Muhammad Juwaini Abdul Rahman
I think the later. However, I'm not a lawyer so might want to appoint one.
A legit one.

On Thu, 1 Feb 2024 at 23:03, Lightning Bit <
thelegendofearthretu...@gmail.com> wrote:

> Can one copyright an entire Django Project if it contains licensed code
> from APIs? Or, does the copyrightable code only apply to exclusive
> algorithms developed on the backend?
>
> --
> 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/97fee261-b381-4be7-821a-52df3600087fn%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/CAFKhtoQpi6BXLxT%3DT5m4yi3GBhCe9etr0QT_Hdou1L0q9yK5mQ%40mail.gmail.com.


Re: Web redirection

2024-01-23 Thread Muhammad Juwaini Abdul Rahman
Can you show the screenshot of your terminal?

On Tue, 23 Jan 2024 at 23:34, Raymond Nsubuga 
wrote:

> Am working on a django react project but everytime i run my django server
> at port 8000, it instead redirects to port 3000 belonging to react
> automatically, what is the issue that can be causing this ?. And how am i
> able to solve it ?
>
> --
> 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/CAJpDcBTvmMd94%2BBnr3aN3c7VGv3m80opQDm7kiA83YxkZpEkHA%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/CAFKhtoSA2ZeyUgQr4iJD41zbT8Zq-9kiJwzQbGKuE-faz8Jqgw%40mail.gmail.com.


Re: Encrypt entire Django project and decrypt in ram to start server.

2023-11-13 Thread Muhammad Juwaini Abdul Rahman
Don't use a shared server.

A dedicated server is not that expensive anyway and 'cheaper' than having
to encrypt (and decrypt on the fly) your code.

On Mon, 13 Nov 2023 at 21:54, Om Khade  wrote:

> I want to save my Django project on a shared server in encrypted format
> and build a script that decrypts the Django project files in ram and start
> the server so that code is not leaked or anyone is not able to tamper with
> it.
>
> Is there a way to do this?
>
> --
> 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/d53bd68b-9a3d-4bb8-a56a-c2092808b903n%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/CAFKhtoQOiN4DxCNRCgR8sq3d6q5fs0WP1FbzWx%3D9kz8Gt-cj%2BQ%40mail.gmail.com.


Re: Django hosting

2023-10-16 Thread Muhammad Juwaini Abdul Rahman
Based on django documentation, your syntax is correct. Are you sure that
the field name is correct?

On Mon, 16 Oct 2023 at 19:13, Mansour Abdullahi Abdirahman <
mansuurtech...@gmail.com> wrote:

> We have a DatetimeField in our modal , when we want to filter the month (
> only the month ) we could do something like this:
>
> *MyModal.objects.filter(date_field__month=10)*
>
> But it did not work for so many as I remember, while I did some research
> still that problem stands and it's tiddling around.
>
> Anyone who got the solution.
>
> iIf you do, share for all of us.
>
> Thanks. *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/CAET2c59RBbpiuWKkh2i38vk3z5vzPh69f5%3Db6XxpcMP%2Bteaa3g%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/CAFKhtoRjRTO_cdej_hLWyyfghS89MZ_EFfF5do6q%2Bk%3DuaUMeKQ%40mail.gmail.com.


Re: Unit test to make sure correct template is returned from a specific URL?

2023-09-25 Thread Muhammad Juwaini Abdul Rahman
Use assertTemplateUsed.

https://docs.djangoproject.com/en/dev/topics/testing/tools/#django.test.SimpleTestCase.assertTemplateUsed

On Sun, 24 Sept 2023 at 22:37, 'Simon Connah' via Django users <
django-users@googlegroups.com> wrote:

> I can write a unit test which checks say the title on a page and compares
> it to a string but that is really prone to breakage. What I want to do
> instead is to check that the template that is returned by the URL is the
> same one that is expected in the unit test. Is there an easy way to do this?
>
> --
> 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/MnCVU2YvJzLiFdMPPAVBwMY7SMosqS5wvqopbySnD05i7BTc375v_Bo5GB4VlUQSd5K2OwsiblAbxsfsz7in96L4_Ou4RTRm0jwVN3aMp54%3D%40protonmail.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/CAFKhtoRiz4mr69ZLu7_wCxVFXgjnvmAW3JCoYdcDrx%2Bwu94vrw%40mail.gmail.com.


Re: Connect::: frontend react and backend django

2023-08-23 Thread Muhammad Juwaini Abdul Rahman
Please delete this. You just exposed your DB host, name, and password.

On Wed, 23 Aug 2023 at 17:58, Kani Sbt  wrote:

> HI sir ,
> Please Help me to how to solve this problem ,
>
>
> this is settings.py :
> import os
> from pathlib import Path
> from datetime import timedelta
>
> BASE_DIR = Path(__file__).resolve().parent.parent
>
>
> SECRET_KEY =
> 'django-insecure-ihofv8tmht)!q**8efqqr1t+#(a$71s080zs^x*s#w5#sx!4'
>
> DEBUG = True
>
> ALLOWED_HOSTS = ['*']
>
>
> # Application definition
> THIRD_PARTY_APPS = (
> 'django.contrib.admin',
> 'django.contrib.auth',
> 'django.contrib.contenttypes',
> 'django.contrib.sessions',
> 'django.contrib.messages',
> 'django.contrib.staticfiles',
> 'rest_framework',
> 'corsheaders',
> 'rest_framework.authtoken',
> 'rest_framework_simplejwt.token_blacklist',
> 'drf_yasg',
> 'import_export', # import and export db data
>
> 'django_crontab', # periodical task trigger
> 'dbbackup',  # django-dbbackup
> 'django_celery_beat',
> 'django_extensions',
> # 'storages',
> # 'gdstorage'
>
>
> )
>
> OUR_APPS = (
> 'employee',
> 'configuration',
> 'attendance',
> 'audit',
> 'master',
> )
>
> INSTALLED_APPS = OUR_APPS + THIRD_PARTY_APPS
>
> MIDDLEWARE = [
> 'server.middleware.UserIpMiddleware',
> 'django.middleware.security.SecurityMiddleware',
> 'django.contrib.sessions.middleware.SessionMiddleware',
> "corsheaders.middleware.CorsMiddleware",
> 'django.middleware.common.CommonMiddleware',
> 'django.middleware.csrf.CsrfViewMiddleware',
> 'django.contrib.auth.middleware.AuthenticationMiddleware',
> 'django.contrib.messages.middleware.MessageMiddleware',
> 'django.middleware.clickjacking.XFrameOptionsMiddleware',
> ]
>
> ROOT_URLCONF = 'server.urls'
>
> TEMPLATES = [
> {
> 'BACKEND': 'django.template.backends.django.DjangoTemplates',
> 'DIRS': [BASE_DIR / 'templates'],
> 'APP_DIRS': True,
> 'OPTIONS': {
> 'context_processors': [
> 'django.template.context_processors.debug',
> 'django.template.context_processors.request',
> 'django.contrib.auth.context_processors.auth',
> 'django.contrib.messages.context_processors.messages',
> ],
> },
> },
> ]
>
> # WSGI_APPLICATION = 'server.wsgi.application'
> ASGI_APPLICATION = 'server.asgi.application'
>
> DATABASES = {
> 'default': {
> 'ENGINE': 'django.db.backends.sqlite3',
> 'NAME': 'sbthrmodule_y0ltln',
>  'USER': 'sbthrmodule_mmsv7',
> 'PASSWORD': '17mBxjt6sercIAyw',
> 'HOST': 'localhost',
> 'PORT': '3306',
> },
> 'attendance_db': {
> 'ENGINE': 'django.db.backends.mysql',
> 'NAME': 'skylab',
> 'USER': 'admin',
> 'PASSWORD': 'kJsgwek8488!ghf^$%',
> 'HOST': 'spt-hrm-db.cdhbi944avx7.ap-south-1.rds.amazonaws.com',
> 'PORT': '3306',
> },
> }
>
>
> AUTH_PASSWORD_VALIDATORS = [
> {
> 'NAME':
> 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
> },
> {
> 'NAME':
> 'django.contrib.auth.password_validation.MinimumLengthValidator',
> },
> {
> 'NAME':
> 'django.contrib.auth.password_validation.CommonPasswordValidator',
> },
> {
> 'NAME':
> 'django.contrib.auth.password_validation.NumericPasswordValidator',
> },
> ]
>
>
>
> LANGUAGE_CODE = 'en-us'
>
> TIME_ZONE =  'UTC'
>
> USE_I18N = True
>
> USE_TZ = True
>
>
>
> STATIC_URL = '/static/'
> MEDIA_URL = '/media/'
> # STATICFILES_DIRS = os.path.join(BASE_DIR, "static"),
>
> if DEBUG:
> STATIC_ROOT = os.path.join(BASE_DIR,'static')
> MEDIA_ROOT =  os.path.join(BASE_DIR, 'media')
> else:
> STATIC_ROOT = '/var/www/server/static/'
> MEDIA_ROOT =  '/var/www/server/media/'
>
> DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
> AUTH_USER_MODEL = 'configuration.User'
>
> CORS_ORIGIN_ALLOW_ALL = True
> CORS_ORIGIN_WHITELIST = (
> 'http://localhost:3000',
> 'http://127.0.0.1:3000',
> 'https://sbthrmodule.in',
> "https://sbthrmodule.in;,
> 'http://hrmodule.sbthrmodule.in:8084',
>'http://hrmodule.sbthrmodule.in:8084',
> 'http://127.0.0.1:8000',
> )
> # CORS_ALLOW_CREDENTIALS = True
>
> CSRF_TRUSTED_ORIGINS = ['http://127.0.0.1:8000',"http://localhost:3000;,'
> https://sbthrmodule.in',
> "https://sbthrmodule.in;,
> 'http://hrmodule.sbthrmodule.in/',
> "http://hrmodule.sbthrmodule.in/","http://127.0.0.1:3000;]
>
> REST_FRAMEWORK = {
> 'DEFAULT_AUTHENTICATION_CLASSES': [
> 'rest_framework.authentication.TokenAuthentication',
> ],
> 'DEFAULT_RENDERER_CLASSES': [
> "rest_framework.renderers.JSONRenderer",
> "rest_framework.renderers.BrowsableAPIRenderer",
> ],
> 'DEFAULT_PAGINATION_CLASS':
> 'rest_framework.pagination.PageNumberPagination',
> 'PAGE_SIZE': 10,
> }

CreateView for non default database

2023-07-25 Thread Muhammad Juwaini Abdul Rahman
Hi all,

I have two different databases as below:

DATABASES = {
'tvet': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3',
},
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'jpk',
'USER': 'jpkuser',
'PASSWORD': 'jpkpassword',
'HOST': 'localhost', # Or an IP Address that your DB is hosted on
'PORT': '3306',
}
}

When I want to create a CreateView, I am unable to save it.

This is my CreateView:

class BiodataCreateView(CreateView):
template_name = 'bio_create.html'

# model = Biodata.objects.using('tvet').all()
def get_queryset(self):
return Biodata.objects.using('tvet').all()

fields = 'name', 'hobby'

def get_success_url(self):
return reverse('biodata-list')

Any idea on how to do it?

-- 
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/4985efd7-437c-432e-86c8-9a902430513fn%40googlegroups.com.


Re: AttributeError at /auth/users/

2023-07-01 Thread Muhammad Juwaini Abdul Rahman
What's your code in urls.py for `/auth/user`?

On Sunday, 2 July 2023 at 01:14:53 UTC+8 arun n wrote:

> Hello, 
>
> I am new to Django.  I am getting the below error. Can someone help.
>
> from django.db import models
> from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin, 
> BaseUserManager, UserManager
>
>
> class UserAccountManager(BaseUserManager):
> def create_user(self, email, name, password=None):
> if not email:
> raise ValueError('Email address required')
>
> email = self.normalize_email(email)
> user = self.model(email=email, name=name)
> user.set_password(password)
> user.save()
> return user
>
> AttributeError at /auth/users/'Manager' object has no attribute 
> 'create_user'
> Request Method:
> POST
> Request URL:
> http://127.0.0.1:8000/auth/users/
> Django Version:
> 4.2.2
> Exception Type:
> AttributeError
> Exception Value:
> 'Manager' object has no attribute 'create_user'
> Exception Location:
>
> C:\Users\Arun\.virtualenvs\nc-backend-zDgCjJYE\Lib\site-packages\djoser\serializers.py,
>  
> line 48, in perform_create
> Raised during:
> djoser.views.UserViewSet
> Python Executable:
> C:\Users\Arun\.virtualenvs\nc-backend-zDgCjJYE\Scripts\python.exe
> Python Version:
> 3.11.4
> Python Path:
> ['C:\\Users\\Arun\\Documents\\GitHub\\nc-backend', 
> 'C:\\Users\\Arun\\AppData\\Local\\Programs\\Python\\Python311\\python311.zip',
>  
> 'C:\\Users\\Arun\\AppData\\Local\\Programs\\Python\\Python311\\DLLs', 
> 'C:\\Users\\Arun\\AppData\\Local\\Programs\\Python\\Python311\\Lib', 
> 'C:\\Users\\Arun\\AppData\\Local\\Programs\\Python\\Python311', 
> 'C:\\Users\\Arun\\.virtualenvs\\nc-backend-zDgCjJYE', 
> 'C:\\Users\\Arun\\.virtualenvs\\nc-backend-zDgCjJYE\\Lib\\site-packages']
> Server time:
> Fri, 30 Jun 2023 18:48:41 +
>

-- 
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/280c8a92-940c-48f2-9e89-b47351e3d79fn%40googlegroups.com.


Re: Dashboard with plotting graph

2023-06-20 Thread Muhammad Juwaini Abdul Rahman
For simple cases, matplotlib should be enough.

For more advanced cases, probably you can explore thousands of js tools out
there.

On Wed, 21 Jun 2023 at 08:53, DieHardMan 300 
wrote:

> Hello, I hope everyone have a good day. I want to start building dashboard
> with the plotting graph in my Django 4.2 web application. So I want some
> recommendations of what libraries should I use or what libraries work best
> for you guys.
>
> --
> 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/996f9141-d514-41f4-8658-7deb9c7c041an%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/CAFKhtoQMOu_JNYJLv2M3uA-aA7j0JUTK2jjs1i9TarWSJSBnWg%40mail.gmail.com.


Re: associate Developers for Google

2023-06-17 Thread Muhammad Juwaini Abdul Rahman
Be careful folks. Seems like a scam. 

On Sat, 17 Jun 2023 at 23:18, Mz Gz  wrote:

> Dear Black,
>
> Kindly check you inbox or spam folder.
>
> Regards,
>
> On Sat, 17 Jun 2023, 5:59 pm John Ayodele, 
> wrote:
>
>> Yes, I'm here!
>> Check out my Github profile
>> github.com/techie-john
>>
>> On Sat, Jun 17, 2023 at 3:09 PM Lucifer Black 
>> wrote:
>>
>>> Is there anyone that wants a job at google developer at home looking for
>>> three people
>>>
>>>
>>> Get Outlook for Android 
>>>
>>> --
>>> 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/DB9P193MB15964FB814BFEBE1A8A33AEFF45BA%40DB9P193MB1596.EURP193.PROD.OUTLOOK.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/CAP7pJ3jYQ-AnJrOFyhqacOwgNLONMwzDzKK5VUwRd_juoYXn3A%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/CAHV4E-eA5MXpwPGrFoxaMTAdRYzUeA5F5f%2BfaVGqvibxH9AAVw%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/CAFKhtoRC2huuQe8H_rc-0bS_BRudX474SUWMB3bU7VAcVaj54A%40mail.gmail.com.


Re: CSV file

2023-06-09 Thread Muhammad Juwaini Abdul Rahman
Probably you need to show the code snippet on where you generate the csv
file.

On Fri, 9 Jun 2023 at 13:51, Percy Masekwameng <
percymasekwameng...@gmail.com> wrote:

> It depends on the data in the database
>
> Explain more about workers settings and provide me with an example
>
> On Fri, 9 Jun 2023, 02:24 Muhammad Juwaini Abdul Rahman, <
> juwa...@gmail.com> wrote:
>
>> How big is the file?
>>
>> I don't think a mere 2K records can kill an 8GB RAM machine.
>>
>> Probably something to do with your workers' settings?
>>
>> On Fri, 9 Jun 2023 at 03:02, Percy Masekwameng <
>> percymasekwameng...@gmail.com> wrote:
>>
>>> Hi
>>>
>>> I have web app survey that collect data and generate a CSV file,
>>> I'm using railway to deploy my web app, running on 8GB RAM and each time
>>> I generate a file, the server goes down and display "Application failed to
>>> respond" the database table has over 2k records
>>> Is there any way to improve the performance so that I can be able to
>>> download large dataset from the web app?
>>>
>>> --
>>> 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/CANfc-pBoutR0kD%3DcqwRHGSQ8gac%2B_YLMyCQoFK--%3DD54TZpotA%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/django-users/CANfc-pBoutR0kD%3DcqwRHGSQ8gac%2B_YLMyCQoFK--%3DD54TZpotA%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/CAFKhtoTkSsNMcvOZgP%2BWw2U2%3DMkfpD4%3DFLiNUL-Ftd1xzAi4uA%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAFKhtoTkSsNMcvOZgP%2BWw2U2%3DMkfpD4%3DFLiNUL-Ftd1xzAi4uA%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/CANfc-pBv8u_sGNP%3DZhJL6sG3RHvXRuHXn0M17_vvPa8f2UYkjQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CANfc-pBv8u_sGNP%3DZhJL6sG3RHvXRuHXn0M17_vvPa8f2UYkjQ%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/CAFKhtoQypbdPf9k1w9LM1wgZWSOqbs7d8XwRqdVm%3D3xm-kYtEQ%40mail.gmail.com.


Re: CSV file

2023-06-08 Thread Muhammad Juwaini Abdul Rahman
How big is the file?

I don't think a mere 2K records can kill an 8GB RAM machine.

Probably something to do with your workers' settings?

On Fri, 9 Jun 2023 at 03:02, Percy Masekwameng <
percymasekwameng...@gmail.com> wrote:

> Hi
>
> I have web app survey that collect data and generate a CSV file,
> I'm using railway to deploy my web app, running on 8GB RAM and each time I
> generate a file, the server goes down and display "Application failed to
> respond" the database table has over 2k records
> Is there any way to improve the performance so that I can be able to
> download large dataset from the web app?
>
> --
> 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/CANfc-pBoutR0kD%3DcqwRHGSQ8gac%2B_YLMyCQoFK--%3DD54TZpotA%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/CAFKhtoTkSsNMcvOZgP%2BWw2U2%3DMkfpD4%3DFLiNUL-Ftd1xzAi4uA%40mail.gmail.com.


Re: Template doesn't run in browser

2023-06-02 Thread Muhammad Juwaini Abdul Rahman
Folder `projects` should be inside `templates`.

Right now the folder is named 'templates/projects`. Please fix that first.

On Friday, 2 June 2023 at 22:04:03 UTC+8 Safaet Jaman wrote:

>
> [image: Screenshot 2023-06-02 105157.png][image: Screenshot 2023-06-02 
> 105348.png]

-- 
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/bf4e0749-bb37-4d1b-aedf-0fe2233f286dn%40googlegroups.com.


Re: how to convert to Django 3 or 4

2023-06-02 Thread Muhammad Juwaini Abdul Rahman
I think Django 4 still have backward compatibility with `url`
although `path` is preferable.

You can try to `runserver` in your local, upgrade your django version in
your virtualenv to version 4 and troubleshoot the error messages (if any)
one by one.

On Sat, 3 Jun 2023 at 05:20, john fabiani  wrote:

> Hi everyone,
>
> I am tasked with updating/upgrading a very old Django web site - I believe
> it is 1.7.  I need convert and need what is required.
> Thanks in advance.
>
>
> I need to convert the following:
>
> from django.conf.urls import patterns, include, url
> from django.contrib import admin
> from django.conf import settings
> from django.conf.urls.static import static
>
> urlpatterns = patterns('',
> # Examples:
> url(r'reg4/$', 'register.views.reg4', name='reg4'),
> url(r'reg3/$', 'register.views.reg3', name='reg3'),
> url(r'reg2/$', 'register.views.reg2', name='reg2'),
> #url(r'reg1/$', 'register.views.reg1', name='reg1'),
> url(r'reg1/$', 'register.views.reg1', name='reg1'),
> #url(r'^$', 'register.views.home', name='home'),
> url(r'reg/$', 'register.views.home', name='home'),
> url(r'get_courts/(\d+)$', 'register.views.get_courts',
> name='get_courts'),
> url(r'get_courses/(\d+)$', 'register.views.get_courses',
> name='get_courses'),
> url(r'autoschedule/', 'register.views.autoschedule',
> name='autoschedule'),
> url(r'get_cities/(\d+)$', 'register.views.get_cities',
> name='get_cities'),
> url(r'get_classes/(\d+)$', 'register.views.get_classes',
> name='get_classes'),
> url(r'get_cities2/(\d+)/(\d+)/$', 'register.views.get_cities2',
> name='get_cities2'),
> url(r'get_classes2/(\d+)/(\d+)/$', 'register.views.get_classes2',
> name='get_classes2'),
> url(r'rejected/$', 'register.views.rejected', name='rejected'),
> url(r'finished/$', 'register.views.finished', name='finished'),
>
> ##url(r'^$', 'profiles.views.home', name='home'),
> #url(r'^contact/$', 'register.views.home', name='contact'),
> #url(r'^about/$', 'register.views.about', name='about'),
> #url(r'^profile/$', 'register.views.user_profile', name='profile'),
> #url(r'^checkout/$', 'checkout.views.checkout', name='checkout'),
> # url(r'^blog/', include('blog.urls')),
>
> url(r'^admin/', include(admin.site.urls)),
> ) + static(settings.STATIC_URL, document_root = settings.STATIC_ROOT)
>
> What is required?
>
> --
> 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/8f8a68b4-a3c5-a10d-8246-2ef41635b406%40jfcomputer.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/CAFKhtoSO2XrckAe6uqpYoHYxKnqSm4sm3GkaNZXfUeXGs90Ftw%40mail.gmail.com.


Re: Finding Help in getting started in Django

2023-05-30 Thread Muhammad Juwaini Abdul Rahman
Getting started by doing. Django official site have their own tutorial that
you can follow line by line.

On Tue, 30 May 2023 at 22:55, Veronica Ndemo 
wrote:

> Hi guys I need help.I am just getting started in using Django and I would
> love to get guidance on how to go about the Django framework
>
> --
> 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/0ef756ca-5641-4cbe-9da5-056e5ed08c0fn%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/CAFKhtoTs-9HsbSHf5gwzaWR4Oiqfxdz5A4CjrbLb%3Dfd92cGjUg%40mail.gmail.com.


Re: importing ultralytics in Django rest framework

2023-05-24 Thread Muhammad Juwaini Abdul Rahman
Google search on the error message returned this:
https://stackoverflow.com/questions/48428415/importerror-libcublas-so-9-0-cannot-open-shared-object-file

On Thu, 25 May 2023 at 09:20, Mahmoud Aboelsoud <
mahmoudabooelso...@gmail.com> wrote:

> Hello, how are you?
>
> I'm trying to import and use ultralytics library in my Django rest
> framework app and I receive this error *ValueError: libcublas.so.*[0-9]
> not found in the system path *does anybody know how to solve this error?
>
> --
> 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/b124d7a2-4ea5-4537-85f8-1e4d1f1f67a3n%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/CAFKhtoRgFRdT8ERFYUxu2K9xDSDgGWTceF0nLFo1f4S%2BT2Dvuw%40mail.gmail.com.


Re: group by "project"

2023-05-24 Thread Muhammad Juwaini Abdul Rahman
Do you realize what 'Count' do?

On Thu, 25 May 2023 at 09:20, 'Mohamed Yahiya Shajahan' via Django users <
django-users@googlegroups.com> wrote:

> def list(self, request, *args, **kwargs):
> project_id = self.request.query_params.get('project_id')
> if project_id:
> queryset = RegistrationDatesSlots.objects.values('date').
> annotate(project=Count('project')).filter(project=project_id)
> # queryset =
> RegistrationDatesSlots.objects.filter(project=project_id).query.group_by=['project']
> else:
> queryset = RegistrationDatesSlots.objects.all().values(
> 'project', 'date')
>
> serialized_data = []
> for item in queryset:
> serialized_item = {
> 'date': item['date'],
> 'project': item['project']
> }
> serialized_data.append(serialized_item)
> return Response(serialized_data)
>
>
> this is my views i want to group by "project" but shows only one record,
> i know there are multiple records there
>
>
>
>  The content of this email is confidential and intended for the recipient
> specified in message only. It is strictly forbidden to share any part of
> this message with any third party, without a written consent of the sender.
> If you received this message by mistake, please reply to this message and
> follow with its deletion, so that we can ensure such a mistake does not
> occur in the future.
>
> SAVE PAPER | Good for your planet | Good for your Business
>
> --
> 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/016aad73-74fc-49c3-80e7-c8d68ea0a6ddn%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/CAFKhtoRK8pazHODO6z5mVjNBaToJhz8%2BuBSu%3DVph7jwfor5u1g%40mail.gmail.com.


Re: Run Python Code on Front-End

2023-05-22 Thread Muhammad Juwaini Abdul Rahman
You might want to try pyscript for this.

Natively, there's no way you can run python on browser.

On Tue, 23 May 2023 at 07:52, Lightning Bit <
thelegendofearthretu...@gmail.com> wrote:

> Hello all,
>
> I've created an accessibility app where the *speech_recognition* package
> is utilized and triggered upon running a Python function. I can
> successfully run the Python code in Jupyter Lab - no problems. However, it
> seems impossible to activate the *speech_recognition* package on the
> front-end from my views in the Django application.
>
> How can one run Python code from the backend that triggers on the
> front-end upon clicking a button on a certain page?
>
> Thanks all
>
> --
> 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/ca5edbef-3244-4d67-ad32-3cd9741c8ccdn%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/CAFKhtoTry3Zo06Xpvqssgh9mdCUv_VD2yP%2B_B7ZtqruoTkFf7Q%40mail.gmail.com.


Re: Django urls error

2023-04-14 Thread Muhammad Juwaini Abdul Rahman
In your urls.py you use '/hello' but in your browser you type '/home'.

On Sat, 15 Apr 2023 at 06:07, lalit upadhyay 
wrote:

> *I have copied my code here. Plz fix this error:*
>
>
> view.py
> from django.http import HttpResponse
>
>
> def hello_delhi_capitals(request):
> return HttpResponse('Hello Delhi Capitals!')
>
>
>
> myproject/urls.py
>
> from django.contrib import admin
> from django.urls import path, include
>
> urlpatterns = [
> path('admin/', admin.site.urls),
> path('hello/', include('myapp.urls')),
> ]
>
>
>
> myapp/urls.py
>
>
>
> from django.urls import path
> from .views import hello_delhi_capitals
>
> urlpatterns = [
> path('hello/', hello_delhi_capitals, name='hello_delhi_capitals'),
> ]
>
> --
> 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/b157258f-6697-4bd7-81c7-48e425b4a1edn%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/CAFKhtoTQB506MC1OwxvHhT23R5kK-0uC5cxcDm3YS3Q6SYM-Pg%40mail.gmail.com.


Re: Migration running in shell, but no change in DB

2023-04-01 Thread Muhammad Juwaini Abdul Rahman
Try running:
```
./manage.py makemigrations 
```

If there are no changes detected by makemigrations, something wrong with 
your app. Check INSTALLED_APPS in settings.py for any error.

On Friday, 31 March 2023 at 22:17:06 UTC+8 Martin Heitmann wrote:

> Hello everyone
>
> I have a project with multiple apps in it. As database I use MariaDB. Have 
> not touched it for a while, but now I had to add a field to the models of 
> one app. makemigrations and migrate run without any indication of an error. 
> But no change occurs in the db. Tested it with an altered models.py in 
> another app and the result is the same. Do you have any advice how to 
> narrow this down?
>
> Best regards
> Martin
>

-- 
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/3df9a5a4-657b-4bef-a124-a146b71d5882n%40googlegroups.com.


Re: Reverse for 'submit_review' with no arguments not found. 1 pattern(s) tried: ['submit_review/(?P[0-9]+)/\\Z']

2023-03-28 Thread Muhammad Juwaini Abdul Rahman
You need to have game_id in your url.

On Wed, 29 Mar 2023 at 07:56, Byansi Samuel 
wrote:

> I got an error when trying to create a review form in Django and it
> returned to that title as the error in my browser.
>
> I have included a text file containing my codes and l would like to
> request assistance on how l can solve that issue, tanks, I'm Samuel
>
> --
> 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/CAGQoQ3xXmF%2BVkyKQk6JTtGnSwOEuG%2BKPv8JCUCOLVo%2Bz1_zNkg%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/CAFKhtoTQC7EGhdoa6ifkvVVHFgMCP4zK1P4RQR4k5278uVwSDA%40mail.gmail.com.


Re: Django Hosting on HTTPS with nginix AWS

2023-03-28 Thread Muhammad Juwaini Abdul Rahman
If you're using nginx and gunicorn in Ubuntu 22.04, you can follow the
instructions in this article:
https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-22-04

To add HTTPS, you can use let's encrypt:
https://letsencrypt.org/getting-started/

On Tue, 28 Mar 2023 at 17:52, Himanshu Shekhar Mohapatra <
himanshu.mohapatr...@gmail.com> wrote:

> Hi all,
>
> Please help me with any curated list of steps using which I can host
> Django application in aws ubuntu with https certificate.
>
> Tried a lot of tutorials but something is missing somewhere.
>
> Thanks a lot!
> --
> Sent from Gmail Mobile
>
> --
> 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/CAHF%2BW75vReP2Wsucc_j1ES1N_Fu4Q2GVu%3DM7B%2BKWoDYzPTpkVg%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/CAFKhtoRbsferkN_UAbW6RfVKfts_4OF6DndLvCcm_V2aKrEjYQ%40mail.gmail.com.


Re: Stuck with Django Tutorial Part 4

2023-03-14 Thread Muhammad Juwaini Abdul Rahman
question_id=question.id

On Tue, 14 Mar 2023 at 21:22, Nithin Kumar  wrote:

> Hi,
>
> Stuck with this problem
>
> https://docs.djangoproject.com/en/4.1/intro/tutorial04/
>
> NoReverseMatch at /polls/2/Reverse for 'vote' with arguments '(2,)' not
> found. 1 pattern(s) tried: ['polls/
> My detail.html is like this and it is failing at Line 1.
> I checked all solutions online but no luck.
>
> 
> {% csrf_token %}
> 
> {{ question.question_text }}
> {% if error_message %}{{ error_message }}{%
> endif %}
> {% for choice in question.choice_set.all %}
> 
> {{
> choice.choice_text }}
> {% endfor %}
> 
> 
> 
>
> --
> 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/d6c40407-64a0-4418-ba9a-39db89b1c1dcn%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/CAFKhtoQ1tfqUempakxY7DHy26utEt3QN1iBbLBM78r5neYM3QQ%40mail.gmail.com.


Re: Django Admin

2023-03-13 Thread Muhammad Juwaini Abdul Rahman
In my previous case, I only use this:

CSRF_TRUSTED_ORIGINS = ['https://your site url',]


On Tue, 14 Mar 2023 at 04:33, Prosper Lekia  wrote:

> This is how I deal with all csrf related issues.
>
> Make sure csrf MiddleWare is in your MiddleWare list
>
> 'django.middleware.csrf.CsrfViewMiddleware'
>
> Add the settings below in your settings.py to prevent all csrf related
> issues
>
> CSRF_TRUSTED_ORIGINS = ['https://your site url',]
> SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'http')
> CSRF_USE_SESSIONS = False
> CSRF_COOKIE_SECURE = True
> SECURE_BROWSER_XSS_FILTER = True
>
> CORS_ALLOW_CREDENTIALS = True
> CORS_ORIGIN_ALLOW_ALL = True
>
>
> SECURE_CONTENT_TYPE_NOSNIFF = True
> SECURE_FRAME_DENY = True
> SECURE_HSTS_SECONDS = 2592000
> SECURE_HSTS_INCLUDE_SUBDOMAINS = True
> SECURE_HSTS_PRELOAD = True
> X_FRAME_OPTIONS = 'SAMEORIGIN'
> SECURE_REFERRER_POLICY = 'same-origin
>
> On Saturday, March 11, 2023 at 7:04:40 PM UTC+1 James Hunt wrote:
>
>> Hi there. I am fairly new to Django but have had previous success with
>> creating an app and being able to access the Admin page.
>> Recently, if I attempt to access the admin page of a new Django app it
>> throws the CSRF error upon trying to log in!!!
>>
>> I have attempted several ways to bypass this error including adding
>> allowed hosts but I cant seem to get past this issue.
>>
>> Can someone please provide me with the definitive way of stopping CSRF
>> error when simply trying to access the admin part of Django? I mean there
>> are no post functions that really apply to this feature so I cant
>> understand the CSRF token.
>>
>> I cant get past this issue which means I can never access the admin page!!
>>
>> Please help.
>>
>> Regards
>>
>> James
>>
> --
> 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/3f7e8ff3-3619-4ddf-8517-0ee3a613ed20n%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/CAFKhtoSMJcDx5bDfd3bXUsdt5a1x%2BFBaX%3D7KYk5H8wbCHvQT%2Bw%40mail.gmail.com.


Re: Django Admin

2023-03-12 Thread Muhammad Juwaini Abdul Rahman
Have you tried my suggestion?

On Sun, 12 Mar 2023 at 20:32, James Hunt  wrote:

> I have literally set this up today just to prove that it happens for every
> Django project setup!!!
>
> So this is my settings :
>
>
>  """
> Django settings for DjangoTest project.
>
> Generated by 'django-admin startproject' using Django 4.1.7.
>
> For more information on this file, see
> https://docs.djangoproject.com/en/4.1/topics/settings/
>
> For the full list of settings and their values, see
> https://docs.djangoproject.com/en/4.1/ref/settings/
> """
>
> from pathlib import Path
>
> # Build paths inside the project like this: BASE_DIR / 'subdir'.
> BASE_DIR = Path(__file__).resolve().parent.parent
>
>
> # Quick-start development settings - unsuitable for production
> # See https://docs.djangoproject.com/en/4.1/howto/deployment/checklist/
>
> # SECURITY WARNING: keep the secret key used in production secret!
> SECRET_KEY = 'django-insecure-zb-=l4$q!2t@wjwt
> !@cp#rz=16v0l)#uai#7h(u4n8eie@ddt%'
>
> # SECURITY WARNING: don't run with debug turned on in production!
> DEBUG = True
>
> ALLOWED_HOSTS = []
>
>
> # Application definition
>
> INSTALLED_APPS = [
> 'django.contrib.admin',
> 'django.contrib.auth',
> 'django.contrib.contenttypes',
> 'django.contrib.sessions',
> 'django.contrib.messages',
> 'django.contrib.staticfiles',
> ]
>
> MIDDLEWARE = [
> 'django.middleware.security.SecurityMiddleware',
> 'django.contrib.sessions.middleware.SessionMiddleware',
> 'django.middleware.common.CommonMiddleware',
> 'django.middleware.csrf.CsrfViewMiddleware',
> 'django.contrib.auth.middleware.AuthenticationMiddleware',
> 'django.contrib.messages.middleware.MessageMiddleware',
> 'django.middleware.clickjacking.XFrameOptionsMiddleware',
> ]
>
> ROOT_URLCONF = 'DjangoTest.urls'
>
> TEMPLATES = [
> {
> 'BACKEND': 'django.template.backends.django.DjangoTemplates',
> 'DIRS': [],
> 'APP_DIRS': True,
> 'OPTIONS': {
> 'context_processors': [
> 'django.template.context_processors.debug',
> 'django.template.context_processors.request',
> 'django.contrib.auth.context_processors.auth',
> 'django.contrib.messages.context_processors.messages',
> ],
> },
> },
> ]
>
> WSGI_APPLICATION = 'DjangoTest.wsgi.application'
>
>
> # Database
> # https://docs.djangoproject.com/en/4.1/ref/settings/#databases
>
> DATABASES = {
> 'default': {
> 'ENGINE': 'django.db.backends.sqlite3',
> 'NAME': BASE_DIR / 'db.sqlite3',
> }
> }
>
>
> # Password validation
> #
> https://docs.djangoproject.com/en/4.1/ref/settings/#auth-password-validators
>
> AUTH_PASSWORD_VALIDATORS = [
> {
> 'NAME':
> 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator'
> ,
> },
> {
> 'NAME':
> 'django.contrib.auth.password_validation.MinimumLengthValidator',
> },
> {
> 'NAME':
> 'django.contrib.auth.password_validation.CommonPasswordValidator',
> },
> {
> 'NAME':
> 'django.contrib.auth.password_validation.NumericPasswordValidator',
> },
> ]
>
>
> # Internationalization
> # https://docs.djangoproject.com/en/4.1/topics/i18n/
>
> LANGUAGE_CODE = 'en-us'
>
> TIME_ZONE = 'UTC'
>
> USE_I18N = True
>
> USE_TZ = True
>
>
> # Static files (CSS, JavaScript, Images)
> # https://docs.djangoproject.com/en/4.1/howto/static-files/
>
> STATIC_URL = 'static/'
>
> # Default primary key field type
> # https://docs.djangoproject.com/en/4.1/ref/settings/#default-auto-field
>
> DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
>
>
> On Sunday, March 12, 2023 at 9:46:04 AM UTC Muhammad Juwaini Abdul Rahman
> wrote:
>
>> I think you need to add the following in settings.py:
>>
>> CSRF_TRUSTED_ORIGIN = ('')
>>
>>
>>
>> On Sun, 12 Mar 2023 at 02:04, James Hunt  wrote:
>>
>>> Hi there. I am fairly new to Django but have had previous success with
>>> creating an app and being able to access the Admin page.
>>> Recently, if I attempt to access the admin page of a new Django app it
>>> throws the CSRF error upon trying to log in!!!
>>>
>>> I have attempted several ways to bypass this error including adding
>>> allowed hosts but I cant seem to get past this issue.
>>>
>>> Can someone please provide me with the definitive way of stopping CSRF
>>> er

Re: Django Admin

2023-03-12 Thread Muhammad Juwaini Abdul Rahman
I think you need to add the following in settings.py:

CSRF_TRUSTED_ORIGIN = ('')



On Sun, 12 Mar 2023 at 02:04, James Hunt  wrote:

> Hi there. I am fairly new to Django but have had previous success with
> creating an app and being able to access the Admin page.
> Recently, if I attempt to access the admin page of a new Django app it
> throws the CSRF error upon trying to log in!!!
>
> I have attempted several ways to bypass this error including adding
> allowed hosts but I cant seem to get past this issue.
>
> Can someone please provide me with the definitive way of stopping CSRF
> error when simply trying to access the admin part of Django? I mean there
> are no post functions that really apply to this feature so I cant
> understand the CSRF token.
>
> I cant get past this issue which means I can never access the admin page!!
>
> Please help.
>
> Regards
>
> James
>
> --
> 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/e13c7765-831e-45c5-b091-c8fcfbed19c5n%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/CAFKhtoRactd%2Bhg-3_m8d5MOKSYb0gp9J9m%2BjNM7naykJ8r3Kww%40mail.gmail.com.


Re: Getting 4 four latest objects from django model

2023-02-27 Thread Muhammad Juwaini Abdul Rahman
latest_action= [ActionGame.objects.filter (os='windows',
category='action').latest ('published_date')[:4]]


On Mon, 27 Feb 2023 at 16:52, Byansi Samuel 
wrote:

> I got a problem with my queryset. Am trying to get 4 latest objects from
> my model but it returns  1 objects  the top latest.
>
> Below is my code. Any support and guidance is appreciated.
>
> #action/views.py
>
> from  Action.models import ActionGame
>
> latest_action= [ActionGame.objects.filter (os='windows',
> category='action').latest ('published_date')][:4]
>
> Buy the problem is that it returns 1 object yet l need 4 objects
>
> What  can I do to solve it?
>
> --
> 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/CAGQoQ3yN19LF0s2y-tiMYyyXuRnxfFA_UuCo6982_XpNpuCKRg%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/CAFKhtoS_Tsrz00iGCAb3OUNzGeR0b5AAQgyj6ZbHxgg8-taqeQ%40mail.gmail.com.


Re: error

2022-11-05 Thread Muhammad Juwaini Abdul Rahman
It's literally there.

Vpziew in your middleware settings.

On Sat, 5 Nov 2022 at 23:07, Balogun Awwal  wrote:

> everything was working perfectly befor until i installed django debug
> toolbar
> Exception in thread django-main-thread:
> Traceback (most recent call last):
>   File
> "/home/leo/Documents/storefront/env/lib/python3.10/site-packages/django/utils/module_loading.py",
> line 30, in import_string
> return cached_import(module_path, class_name)
>   File
> "/home/leo/Documents/storefront/env/lib/python3.10/site-packages/django/utils/module_loading.py",
> line 16, in cached_import
> return getattr(module, class_name)
> AttributeError: module 'django.middleware.csrf' has no attribute
> 'CsrfVpziewMiddleware'. Did you mean: 'CsrfViewMiddleware'?
>
> The above exception was the direct cause of the following exception:
>
> Traceback (most recent call last):
>   File
> "/home/leo/Documents/storefront/env/lib/python3.10/site-packages/django/core/servers/basehttp.py",
> line 47, in get_internal_wsgi_application
> return import_string(app_path)
>   File
> "/home/leo/Documents/storefront/env/lib/python3.10/site-packages/django/utils/module_loading.py",
> line 30, in import_string
> return cached_import(module_path, class_name)
>   File
> "/home/leo/Documents/storefront/env/lib/python3.10/site-packages/django/utils/module_loading.py",
> line 15, in cached_import
> module = import_module(module_path)
>   File "/usr/lib/python3.10/importlib/__init__.py", line 126, in
> import_module
> return _bootstrap._gcd_import(name[level:], package, level)
>   File "", line 1050, in _gcd_import
>   File "", line 1027, in _find_and_load
>   File "", line 1006, in
> _find_and_load_unlocked
>   File "", line 688, in _load_unlocked
>   File "", line 883, in exec_module
>   File "", line 241, in
> _call_with_frames_removed
>   File "/home/leo/Documents/storefront/storefront/wsgi.py", line 16, in
> 
> application = get_wsgi_application()
>   File
> "/home/leo/Documents/storefront/env/lib/python3.10/site-packages/django/core/wsgi.py",
> line 13, in get_wsgi_application
> return WSGIHandler()
>   File
> "/home/leo/Documents/storefront/env/lib/python3.10/site-packages/django/core/handlers/wsgi.py",
> line 125, in __init__
> self.load_middleware()
>   File
> "/home/leo/Documents/storefront/env/lib/python3.10/site-packages/django/core/handlers/base.py",
> line 40, in load_middleware
> middleware = import_string(middleware_path)
>   File
> "/home/leo/Documents/storefront/env/lib/python3.10/site-packages/django/utils/module_loading.py",
> line 32, in import_string
> raise ImportError(
> ImportError: Module "django.middleware.csrf" does not define a
> "CsrfVpziewMiddleware" attribute/class
>
> The above exception was the direct cause of the following exception:
>
> Traceback (most recent call last):
>   File "/usr/lib/python3.10/threading.py", line 1009, in _bootstrap_inner
> self.run()
>   File "/usr/lib/python3.10/threading.py", line 946, in run
> self._target(*self._args, **self._kwargs)
>   File
> "/home/leo/Documents/storefront/env/lib/python3.10/site-packages/django/utils/autoreload.py",
> line 64, in wrapper
> fn(*args, **kwargs)
>   File
> "/home/leo/Documents/storefront/env/lib/python3.10/site-packages/django/core/management/commands/runserver.py",
> line 157, in inner_run
> handler = self.get_handler(*args, **options)
>   File
> "/home/leo/Documents/storefront/env/lib/python3.10/site-packages/django/contrib/staticfiles/management/commands/runserver.py",
> line 31, in get_handler
> handler = super().get_handler(*args, **options)
>   File
> "/home/leo/Documents/storefront/env/lib/python3.10/site-packages/django/core/management/commands/runserver.py",
> line 78, in get_handler
> return get_internal_wsgi_application()
>   File
> "/home/leo/Documents/storefront/env/lib/python3.10/site-packages/django/core/servers/basehttp.py",
> line 49, in get_internal_wsgi_application
> raise ImproperlyConfigured(
> django.core.exceptions.ImproperlyConfigured: WSGI application
> 'storefront.wsgi.application' could not be loaded; Error importing module.
>
> --
> 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/CAJ434RuxkK0nO%3D5%3D1PJEm2%2B0-becZxqsmFZwOzC%2BWA9uY6_yYw%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 

Re: page html

2022-10-31 Thread Muhammad Juwaini Abdul Rahman
Someone is not even doing basic django tutorial...

On Mon, 31 Oct 2022 at 18:04, Ammar Mohammed  wrote:

> Hello
>
> Have you added your index page view to your project's urlpatterns ?
>
> Regards
>
> On Mon, 31 Oct 2022, 11:33 AM REMY TOUITOU,  wrote:
>
>> Hello , thanks you , I try to connect , what is you Telefon number , mine
>> is 0033687798426
>>
>> Le dimanche 30 octobre 2022, Adebileje Nurudeen  a
>> écrit :
>>
>>> Can we chat on WhatsApp for more help on that??
>>>
>>> On Sun, Oct 30, 2022 at 8:46 PM REMY TOUITOU 
>>> wrote:
>>>
 hELLO , when i launch , in visual studio code ,i can't found the page
 index.html,

 i launch http//localhost:8000 AND I SEE the first page created with
 Django

 and i want to see the page index.HTML ;

 Thanks you for your help

 --
 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/64e889fc-de5e-4696-9366-54ec049b91ben%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/CAOfwBVgsV1RihLOydb%2BUdEzBeBqBrhHZn04sudWWXqeKB-KMQw%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/CAD9WEx0-hwAtMOczTc6AZTz4WoCKuiYJz6AVeSnGt-qkbG%2BZ8Q%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/CAHs1H7sCpZUuEoDa60gR3_3giUw88Dm-Va9zkZOj3e1v5SzNsw%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/CAFKhtoRwL0jyF19S7XzjJLJo5-FfU2EAn_RZqMYwxkN18%2B%2BjZw%40mail.gmail.com.


Re: secret api keys

2022-10-26 Thread Muhammad Juwaini Abdul Rahman
People can't see it straight away.

However, let's say if you forgot to set debut = False, they can see it. Not
straight away, but very trivial.

It is advisable to put your secret keys in external file (.env for example)
and use library like django-environ to get the value.

On Wed, 26 Oct 2022 at 23:09, john fabiani  wrote:

> Hi,
>
> Maybe a dumb question but if I add secret keys in my settings.py file
> (or should it be placed) will they be protected from the front end side
> (the part that is displayed to the user of the website).
>
> For example I have a secret key to access Authorize Net.  Will it be
> protected from someone opening the website and using chrome to see the
> source?
>
> Johnf
>
> --
> 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/eeb82d0a-f18d-c253-a613-24c685307f41%40jfcomputer.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/CAFKhtoSOzw7DcJmnXOrszXrv5OZ9Dt%2BJ%3D%2BAQaJhGczGL3-e%3DQQ%40mail.gmail.com.


Re: User model override and authentication

2022-10-24 Thread Muhammad Juwaini Abdul Rahman
I never tried this, but maybe you can.

Inherit the User model, then add two new lines:

class DerivedUser(User):
.
sr_usuario = username
sr_password = password

On Tue, 25 Oct 2022 at 05:14, Rafael Noronha 
wrote:

> Hello guys,
> I'm not advanced in Django and would like to know how and if it's possible
> to do it.
>
> I need to override Django's user model, and change the fields "username"
> to "sr_usuario" and "password" to "sr_password", but I would like to
> continue using all Django's default authentication scheme and permissions.
> I want not only to change the description in the database or a label, I
> want to change the name of the field in the model, for when for example I
> needed to make a query, I would use
> User.objects.filter(sr_usuario="user_name") and everything would work
> usually.
>
> It's possible? I couldn't find anything in the documentation or on forums
> I've searched.
>
> Thank you very much 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/101d09bb-b076-4e54-9cbc-776ff93c979fn%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/CAFKhtoSA87sYcO8_0X%2BpW1Qj%3DOjBu43N08KcpPe7AtHkG19sNQ%40mail.gmail.com.


Re: Django call_command from Admin

2022-10-20 Thread Muhammad Juwaini Abdul Rahman
https://docs.djangoproject.com/en/4.1/ref/django-admin/#running-management-commands-from-your-code

I think it's quite straightforward. Just add call_command(command) after
(or before the save() line) in your code.

Depending on whether you're using FBV or CBV, you need to pinpoint where
exactly the save() function resides in your code.

On Fri, 21 Oct 2022 at 00:05, Aziz Mek  wrote:

> Hi All,
>
> I was wondering  if you have come across the following:
>
> I have a field in the model that's empty, when the user fills it up and
> clicks Save, it
> should trigger/call a management Command (This command is already build
> that sends emails ), Django docs say i can use call_command but not sure
> how to implement it with the save
>
> I am just after the trigger really when the save takes place
>
> Many thanks in advance
>
> Kind regards
> Aziz
>
>
> --
> 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/a0ca69f0-6065-4b86-a977-cfb6dcab8fd7n%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/CAFKhtoR2mPPMVD%3DpALF1oB%3DiKZqFL93NCodm3k3J9C%2BBdAkgjQ%40mail.gmail.com.


Re: Anyone help?

2022-10-16 Thread Muhammad Juwaini Abdul Rahman
You can try ./manage.py shell

Then you can run:

from abcd.models import Person

On Mon, 17 Oct 2022 at 06:37, It's ShAdAn  wrote:

>
>
> how i run model through manage.py
>
> On Saturday, 15 October 2022 at 16:48:23 UTC-7 Thomas wrote:
>
>> You don’t run model files directly, but rather through manage.py which
>> references your settings.py file.
>>
>> ./manage.py
>>
>> hth
>>
>> - Tom
>>
>> On Oct 15, 2022, at 1:07 PM, It's ShAdAn  wrote:
>>
>>   Got error
>>
>>
>> /usr/bin/python3.9
>> /home/user/PycharmProjects/pythonProject4/mycham/abcd/models.py
>> Traceback (most recent call last):
>>   File "/home/user/PycharmProjects/pythonProject4/mycham/abcd/models.py",
>> line 4, in 
>> class Person(models.Model):
>>   File "/usr/lib/python3/dist-packages/django/db/models/base.py", line
>> 108, in __new__
>> app_config = apps.get_containing_app_config(module)
>>   File "/usr/lib/python3/dist-packages/django/apps/registry.py", line
>> 253, in get_containing_app_config
>> self.check_apps_ready()
>>   File "/usr/lib/python3/dist-packages/django/apps/registry.py", line
>> 135, in check_apps_ready
>> settings.INSTALLED_APPS
>>   File "/usr/lib/python3/dist-packages/django/conf/__init__.py", line 82,
>> in __getattr__
>> self._setup(name)
>>   File "/usr/lib/python3/dist-packages/django/conf/__init__.py", line 63,
>> in _setup
>> raise ImproperlyConfigured(
>> django.core.exceptions.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.
>>
>> Process finished with exit code 1
>>
>>
>>
>> --
>> 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/591dc7a3-2a13-4bc5-9ecb-b939a5688f34n%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/db3bb2da-59a7-44c4-938a-d790e0a31c9cn%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/CAFKhtoT7AtZr76DfXoRhWAxxBMFvqsuSR-qdiqwv3SddZxWg1Q%40mail.gmail.com.


Re: my admin django not correct: NoReverseMatch à /admin/login/

2022-09-29 Thread Muhammad Juwaini Abdul Rahman
There's no 'index' in your urls.py.

On Tue, 20 Sept 2022 at 21:38, Nicodem Laurore 
wrote:

> Hello guys,
> I no longer have access to my Django admin, this in all my projects, I
> know what I did to get there, but getting out would be fine in order to
> continue my projects, if you know any way to handle this, it would be good
> for me, thank you
>
>
>
> Environment:
>
>
> Request Method: GET
> Request URL: http://localhost:8000/admin/login/?next=/admin/
>
> Django Version: 4.1
> Python Version: 3.8.10
> Installed Applications:
> ['django.contrib.admin',
>  'django.contrib.auth',
>  'django.contrib.contenttypes',
>  'django.contrib.sessions',
>  'django.contrib.messages',
>  'django.contrib.staticfiles']
> Installed Middleware:
> ['django.middleware.security.SecurityMiddleware',
>  'django.contrib.sessions.middleware.SessionMiddleware',
>  'django.middleware.common.CommonMiddleware',
>  'django.middleware.csrf.CsrfViewMiddleware',
>  'django.contrib.auth.middleware.AuthenticationMiddleware',
>  'django.contrib.messages.middleware.MessageMiddleware',
>  'django.middleware.clickjacking.XFrameOptionsMiddleware']
>
>
> Template error:
> In template
> /home/nicodem-laurore/PycharmProjects/Djangopro/tpenv/lib/python3.8/site-packages/django/contrib/admin/templates/admin/base_site.html,
> error at line 6
>Reverse for 'index' not found. 'index' is not a valid view function or
> pattern name.
>1 : {% extends "admin/base.html" %}
>2 :
>3 : {% block title %}{% if subtitle %}{{ subtitle }} | {% endif %}{{
> title }} | {{ site_title|default:_('Django site admin') }}{% endblock %}
>4 :
>5 : {% block branding %}
>6 : {{
> site_header|default:_('Django administration') }}
>7 : {% endblock %}
>8 :
>9 : {% block nav-global %}{% endblock %}
>10 :
>
> Traceback (most recent call last):
>   File
> "/home/nicodem-laurore/PycharmProjects/Djangopro/tpenv/lib/python3.8/site-packages/django/core/handlers/exception.py",
> line 55, in inner
> response = get_response(request)
>   File
> "/home/nicodem-laurore/PycharmProjects/Djangopro/tpenv/lib/python3.8/site-packages/django/core/handlers/base.py",
> line 220, in _get_response
> response = response.render()
>   File
> "/home/nicodem-laurore/PycharmProjects/Djangopro/tpenv/lib/python3.8/site-packages/django/template/response.py",
> line 114, in render
> self.content = self.rendered_content
>   File
> "/home/nicodem-laurore/PycharmProjects/Djangopro/tpenv/lib/python3.8/site-packages/django/template/response.py",
> line 92, in rendered_content
> return template.render(context, self._request)
>   File
> "/home/nicodem-laurore/PycharmProjects/Djangopro/tpenv/lib/python3.8/site-packages/django/template/backends/django.py",
> line 62, in render
> return self.template.render(context)
>   File
> "/home/nicodem-laurore/PycharmProjects/Djangopro/tpenv/lib/python3.8/site-packages/django/template/base.py",
> line 175, in render
> return self._render(context)
>   File
> "/home/nicodem-laurore/PycharmProjects/Djangopro/tpenv/lib/python3.8/site-packages/django/template/base.py",
> line 167, in _render
> return self.nodelist.render(context)
>   File
> "/home/nicodem-laurore/PycharmProjects/Djangopro/tpenv/lib/python3.8/site-packages/django/template/base.py",
> line 1005, in render
> return SafeString("".join([node.render_annotated(context) for node in
> self]))
>   File
> "/home/nicodem-laurore/PycharmProjects/Djangopro/tpenv/lib/python3.8/site-packages/django/template/base.py",
> line 1005, in 
> return SafeString("".join([node.render_annotated(context) for node in
> self]))
>   File
> "/home/nicodem-laurore/PycharmProjects/Djangopro/tpenv/lib/python3.8/site-packages/django/template/base.py",
> line 966, in render_annotated
> return self.render(context)
>   File
> "/home/nicodem-laurore/PycharmProjects/Djangopro/tpenv/lib/python3.8/site-packages/django/template/loader_tags.py",
> line 157, in render
> return compiled_parent._render(context)
>   File
> "/home/nicodem-laurore/PycharmProjects/Djangopro/tpenv/lib/python3.8/site-packages/django/template/base.py",
> line 167, in _render
> return self.nodelist.render(context)
>   File
> "/home/nicodem-laurore/PycharmProjects/Djangopro/tpenv/lib/python3.8/site-packages/django/template/base.py",
> line 1005, in render
> return SafeString("".join([node.render_annotated(context) for node in
> self]))
>   File
> "/home/nicodem-laurore/PycharmProjects/Djangopro/tpenv/lib/python3.8/site-packages/django/template/base.py",
> line 1005, in 
> return SafeString("".join([node.render_annotated(context) for node in
> self]))
>   File
> "/home/nicodem-laurore/PycharmProjects/Djangopro/tpenv/lib/python3.8/site-packages/django/template/base.py",
> line 966, in render_annotated
> return self.render(context)
>   File
> "/home/nicodem-laurore/PycharmProjects/Djangopro/tpenv/lib/python3.8/site-packages/django/template/loader_tags.py",
> line 157, in render
> return 

Re: How do django Field type hints work?

2022-09-25 Thread Muhammad Juwaini Abdul Rahman
My pycharm shows DecimalField as type Any.

On Sat, 24 Sept 2022 at 07:09, Justin Black 
wrote:

> Hello there,
>
> If I have a model:
>
> class Money(models.Model):
> price = models.DecimalField()
>
> m = Money(...)
> pycharm knows that m.price is of type Decimal but when I read through the
> django code base, I don't see DecimalField or Field subclassing
> decimal.Decimal
> And I don't see any registration code that registers DecimalField as type
> Decimal
>
> How does django do this?
>
> --
> 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/2b1d5103-7aa4-4882-b1a8-f88ec43293d2n%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/CAFKhtoTkTffxmHNj6SayrCGs6LwD0Ct%2BLpFZszKEvU%2Bii6oqbQ%40mail.gmail.com.


Re: django datetime field and timefield provide different times....

2022-09-20 Thread Muhammad Juwaini Abdul Rahman
Check your timezone in settings.py.

On Tue, 20 Sep 2022 at 21:38, Kenn_ Kiragu  wrote:

> django datetime field and timefield provide different times when set to
> auto_now. The datetime field is three hrs behind.. Anyone know what could
> be causing this?
>
> --
> 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/46104a05-fe4c-4c56-8c13-1ddd244487d7n%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/CAFKhtoQmncQY02VN%2BkBuvGJ1LXi2ioRbML_Uy3HJB3hCFoLFUg%40mail.gmail.com.


Re: session id attribute error

2022-09-19 Thread Muhammad Juwaini Abdul Rahman
That was user, so probably you need request.user.id, not session.

On Mon, 19 Sept 2022 at 16:00, shiva singh  wrote:

> hello everyone please help me how can solve this problem:-[image:
> image.jpeg]
>
> --
> 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/f1b3116a-a14a-45fb-84d0-c4f95a05fdf0n%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/CAFKhtoQYy2BqXm7htomDc4nyP7RRMhtJS1NHog0JHn7yTQECGg%40mail.gmail.com.


Re: Filter by date range

2022-09-12 Thread Muhammad Juwaini Abdul Rahman
You missed one quote ".

On Mon, 12 Sept 2022 at 14:04, tech george  wrote:

> Hello,
>
> I have tried debugging as below and it returned data;
>
> search_results =
> Prescription.objects.filter(date_prescribed__range=["2022-07-01",2022-07-30"])
>
> Is there another way i can filter the dates?
>
>
> On Sun, Sep 11, 2022 at 9:47 AM Muhammad Juwaini Abdul Rahman <
> juwa...@gmail.com> wrote:
>
>> Either there's no data for that month or your query is wrongly formatted.
>> Probably you can try your query in the shell first.
>>
>> On Sun, 11 Sept 2022 at 02:12, tech george  wrote:
>>
>>> Hello Muhammad,
>>>
>>> I'm choosing dates between 2022-07-01 and 2022-07-30 which have records
>>> in the db.
>>>
>>> I hope i have answered you right.
>>>
>>>
>>> On Sat, Sep 10, 2022 at 8:41 AM Muhammad Juwaini Abdul Rahman <
>>> juwa...@gmail.com> wrote:
>>>
>>>> What's your value of 'fromdate' and 'todate'?
>>>>
>>>> On Sat, 10 Sept 2022 at 13:27, tech george 
>>>> wrote:
>>>>
>>>>> Hello Carlos,
>>>>>
>>>>> I have used the code below as you advised by when I filter the table
>>>>> comes blank:
>>>>>
>>>>> query_results = Prescription.objects.filter(date__rang
>>>>> e=[fromdate,todate])
>>>>>
>>>>> Regards,
>>>>>
>>>>>
>>>>> On Fri, Sep 9, 2022 at 6:11 PM carlos  wrote:
>>>>>
>>>>>> Hello why use raw?
>>>>>> query_results = Prescription.objects.filter(date__rang
>>>>>> e=[fromdate,todate])
>>>>>> if you have any problem with performance hit database use
>>>>>> select_related or used m2m field use prefect_related
>>>>>> https://docs.djangoproject.com/en/4.1/ref/models/querysets/
>>>>>>
>>>>>> best!
>>>>>>
>>>>>> On Fri, Sep 9, 2022 at 7:48 AM tech george 
>>>>>> wrote:
>>>>>>
>>>>>>> Hello friends!
>>>>>>>
>>>>>>> I am trying to give users an easier way to filter data by date range.
>>>>>>>
>>>>>>> My views.py code is as below, but unfortunately, it is hiding data
>>>>>>> without applying the filter whenever I try to use if, else statements.
>>>>>>>
>>>>>>> Please advise what I might be doing wrong.
>>>>>>>
>>>>>>> views.py
>>>>>>>
>>>>>>> ef referralsReports(request):
>>>>>>> if request.method=="POST":
>>>>>>> fromdate = request.POST.get('fromdate')
>>>>>>> todate = request.POST.get('todate')
>>>>>>> searchresults = Prescription.objects.raw('select 
>>>>>>> id,description,prescribe,ailment,ailment_2,ailment_3,'
>>>>>>>  
>>>>>>> 'sickOff,referral,date_precribed,nurse_id,patient_id_id,'
>>>>>>>  
>>>>>>> 'non_work_related_sickOff from pharmacy_prescription where 
>>>>>>> date_precribed '
>>>>>>>  'between 
>>>>>>> "'+str(fromdate)+'" and "'+str(todate)+'"')
>>>>>>> return render(request, 
>>>>>>> 'pharmacist_templates/reports/referrals_report.html', {"data": 
>>>>>>> searchresults})
>>>>>>>
>>>>>>> else:
>>>>>>> displaydata = 
>>>>>>> Prescription.objects.filter(nurse=request.user.pharmacist).order_by('-id')
>>>>>>> return render(request, 
>>>>>>> 'pharmacist_templates/reports/referrals_report.html', 
>>>>>>> {"data":displaydata})
>>>>>>>
>>>>>>>
>>>>>>> template
>>>>>>>
>>>>>>> [image: image.png]
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> You received this message because you are subscribed to the Google
>>>>>>

Re: Filter by date range

2022-09-11 Thread Muhammad Juwaini Abdul Rahman
Either there's no data for that month or your query is wrongly formatted.
Probably you can try your query in the shell first.

On Sun, 11 Sept 2022 at 02:12, tech george  wrote:

> Hello Muhammad,
>
> I'm choosing dates between 2022-07-01 and 2022-07-30 which have records in
> the db.
>
> I hope i have answered you right.
>
>
> On Sat, Sep 10, 2022 at 8:41 AM Muhammad Juwaini Abdul Rahman <
> juwa...@gmail.com> wrote:
>
>> What's your value of 'fromdate' and 'todate'?
>>
>> On Sat, 10 Sept 2022 at 13:27, tech george  wrote:
>>
>>> Hello Carlos,
>>>
>>> I have used the code below as you advised by when I filter the table
>>> comes blank:
>>>
>>> query_results = Prescription.objects.filter(date__rang
>>> e=[fromdate,todate])
>>>
>>> Regards,
>>>
>>>
>>> On Fri, Sep 9, 2022 at 6:11 PM carlos  wrote:
>>>
>>>> Hello why use raw?
>>>> query_results = Prescription.objects.filter(date__rang
>>>> e=[fromdate,todate])
>>>> if you have any problem with performance hit database use
>>>> select_related or used m2m field use prefect_related
>>>> https://docs.djangoproject.com/en/4.1/ref/models/querysets/
>>>>
>>>> best!
>>>>
>>>> On Fri, Sep 9, 2022 at 7:48 AM tech george 
>>>> wrote:
>>>>
>>>>> Hello friends!
>>>>>
>>>>> I am trying to give users an easier way to filter data by date range.
>>>>>
>>>>> My views.py code is as below, but unfortunately, it is hiding data
>>>>> without applying the filter whenever I try to use if, else statements.
>>>>>
>>>>> Please advise what I might be doing wrong.
>>>>>
>>>>> views.py
>>>>>
>>>>> ef referralsReports(request):
>>>>> if request.method=="POST":
>>>>> fromdate = request.POST.get('fromdate')
>>>>> todate = request.POST.get('todate')
>>>>> searchresults = Prescription.objects.raw('select 
>>>>> id,description,prescribe,ailment,ailment_2,ailment_3,'
>>>>>  
>>>>> 'sickOff,referral,date_precribed,nurse_id,patient_id_id,'
>>>>>  
>>>>> 'non_work_related_sickOff from pharmacy_prescription where date_precribed 
>>>>> '
>>>>>  'between 
>>>>> "'+str(fromdate)+'" and "'+str(todate)+'"')
>>>>> return render(request, 
>>>>> 'pharmacist_templates/reports/referrals_report.html', {"data": 
>>>>> searchresults})
>>>>>
>>>>> else:
>>>>> displaydata = 
>>>>> Prescription.objects.filter(nurse=request.user.pharmacist).order_by('-id')
>>>>> return render(request, 
>>>>> 'pharmacist_templates/reports/referrals_report.html', 
>>>>> {"data":displaydata})
>>>>>
>>>>>
>>>>> template
>>>>>
>>>>> [image: image.png]
>>>>>
>>>>>
>>>>> --
>>>>> 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/CADYG20Go5PXJRP-MGJ07M36ftSaQ6WJVjYg_p4UYB9UUWge-LA%40mail.gmail.com
>>>>> <https://groups.google.com/d/msgid/django-users/CADYG20Go5PXJRP-MGJ07M36ftSaQ6WJVjYg_p4UYB9UUWge-LA%40mail.gmail.com?utm_medium=email_source=footer>
>>>>> .
>>>>>
>>>>
>>>>
>>>> --
>>>> att.
>>>> Carlos Rocha
>>>>
>>>> --
>>>> 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/

Re: Filter by date range

2022-09-09 Thread Muhammad Juwaini Abdul Rahman
What's your value of 'fromdate' and 'todate'?

On Sat, 10 Sept 2022 at 13:27, tech george  wrote:

> Hello Carlos,
>
> I have used the code below as you advised by when I filter the table comes
> blank:
>
> query_results = Prescription.objects.filter(date__range=[fromdate,todate])
>
> Regards,
>
>
> On Fri, Sep 9, 2022 at 6:11 PM carlos  wrote:
>
>> Hello why use raw?
>> query_results = Prescription.objects.filter(date__rang
>> e=[fromdate,todate])
>> if you have any problem with performance hit database use select_related
>> or used m2m field use prefect_related
>> https://docs.djangoproject.com/en/4.1/ref/models/querysets/
>>
>> best!
>>
>> On Fri, Sep 9, 2022 at 7:48 AM tech george  wrote:
>>
>>> Hello friends!
>>>
>>> I am trying to give users an easier way to filter data by date range.
>>>
>>> My views.py code is as below, but unfortunately, it is hiding data
>>> without applying the filter whenever I try to use if, else statements.
>>>
>>> Please advise what I might be doing wrong.
>>>
>>> views.py
>>>
>>> ef referralsReports(request):
>>> if request.method=="POST":
>>> fromdate = request.POST.get('fromdate')
>>> todate = request.POST.get('todate')
>>> searchresults = Prescription.objects.raw('select 
>>> id,description,prescribe,ailment,ailment_2,ailment_3,'
>>>  
>>> 'sickOff,referral,date_precribed,nurse_id,patient_id_id,'
>>>  'non_work_related_sickOff 
>>> from pharmacy_prescription where date_precribed '
>>>  'between 
>>> "'+str(fromdate)+'" and "'+str(todate)+'"')
>>> return render(request, 
>>> 'pharmacist_templates/reports/referrals_report.html', {"data": 
>>> searchresults})
>>>
>>> else:
>>> displaydata = 
>>> Prescription.objects.filter(nurse=request.user.pharmacist).order_by('-id')
>>> return render(request, 
>>> 'pharmacist_templates/reports/referrals_report.html', {"data":displaydata})
>>>
>>>
>>> template
>>>
>>> [image: image.png]
>>>
>>>
>>> --
>>> 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/CADYG20Go5PXJRP-MGJ07M36ftSaQ6WJVjYg_p4UYB9UUWge-LA%40mail.gmail.com
>>> 
>>> .
>>>
>>
>>
>> --
>> att.
>> Carlos Rocha
>>
>> --
>> 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/CAM-7rO3UTB%2Bm7gYzfQ_RB%2BDnDWetnO3E18knFuLPJAU%2BBQrbLw%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/CADYG20F%3D3470-FCgJZ0amOHUDV%3DXvHQ6ZWKak2VjcB%2BjD26Qkg%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/CAFKhtoTAKxT%2BLrQ-VqXzsV-7Rm1Z%2BeAwJkQXKRJYYkVZTemd4A%40mail.gmail.com.


Re: ModuleNotFoundError: No module named 'tutorial.quickstart'

2022-09-03 Thread Muhammad Juwaini Abdul Rahman
Add 'tutorial' to settings.py > INSTALLED_APPS

On Fri, 2 Sept 2022 at 15:21, Pooja Kumari  wrote:

> Hello team,
> please help me with this error.
>
> --
> 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/3e46fc90-4d92-4db9-abed-7733babf7d4dn%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/CAFKhtoTfk1FEmZUnPZbL-F3EOmhp4_-6ZgYpN-JmcptfozjOzA%40mail.gmail.com.


Re: Core Python Session - Google Classroom

2022-07-18 Thread Muhammad Juwaini Abdul Rahman
*sigh* This guy keep spamming this group.

On Mon, 18 Jul 2022 at 15:41, Satyajit Barik 
wrote:

> Join using the below link.
>
> https://classroom.google.com/c/NTUwOTUwNDUwOTha?cjc=433md5r
>
> Core Python Session Google Classroom Link
> 
>
> --
> 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/CANd-%2BoB4EOXYkAqi4O9BxcOePmudU0TZ2%3D7%2BVL4GMH14QL_Kmg%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/CAFKhtoTgRdLYKv0%2BC-RfoC7n_davJPAujR3fBrDVuu8Vi3JvYA%40mail.gmail.com.


Re: Updated invitation with note: PYTHON SESSION @ Sat Jul 16, 2022 8pm - 8:30pm (IST) (Django users)

2022-07-16 Thread Muhammad Juwaini Abdul Rahman
Stop this spammy invitation.

On Sat, 16 Jul 2022 at 16:21,  wrote:

> PYTHON SESSION
> Join with Google Meet – Python notes for beginners: Introduction Syntax
> Statement, Indentation, and Comments Variables and Datatypes Operators
> Numbers Strings List, Tuple, Set, Dictionary If Else Elif Condition Error
> Handli
>
> This event has been updated with a note:
> "Guys be Available for Core Python session from scratch at 8:00 - 8:30 PM
> IST"
> Changed: description
>
> Join with Google Meet 
>
> Meeting link
> meet.google.com/oqu-zuyq-kze 
> Description
> CHANGED
> Python notes for beginners:
>
> Introduction
> Syntax
> Statement, Indentation, and Comments
> Variables and Datatypes
> Operators
> Numbers
> Strings
> List, Tuple, Set, Dictionary
> If Else Elif Condition
> Error Handling
> Loops
>
>
> Python notes for intermediates:
> Module
> Classes
> Function
> Methods
> Iterators
> Decorators
> Generators
> OOP
>
> Python notes for advanced learners:
> Data structure
> Web framework - Django
> Relational Database - MySQL, Postgresql
> WhenSaturday Jul 16, 2022 ⋅ 8pm – 8:30pm (India Standard Time - Kolkata)
> Guests
> satyajitbarik@gmail.com - organizer
> Django users 
> abdouliabba...@gmail.com
> Vogler, Thomas 
> jagades...@gmail.com
> solixzsys...@gmail.com
> kato...@gmail.com
> alonski...@gmail.com
> kasrel...@gmail.com
> aeonaspire...@gmail.com
> kadirbeya...@gmail.com
> varaganihare...@gmail.com
> letebr...@gmail.com
> vallabanenisand...@gmail.com
> xaadxheh...@gmail.com
> code4...@gmail.com
> marco.giard...@gmail.com
> mohansince1...@gmail.com
> nibeditabarik...@gmail.com
> saipragyanparida1...@gmail.com
> saipragyan...@gmail.com
> djyotsn...@gmail.com
> View all guest info
> 
> Reply for django-users@googlegroups.com
> Yes
> 
> No
> 
> Maybe
> 
> More options
> 
>
> Invitation from Google Calendar 
>
> You are receiving this email because you are an attendee on the event. To
> stop receiving future updates for this event, decline this event.
>
> Forwarding this invitation could allow any recipient to send a response to
> the organizer, be added to the guest list, invite others regardless of
> their own invitation status, or modify your RSVP. Learn more
> 
>
> --
> 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/26375d05e3e7d1cc%40google.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/CAFKhtoQCRqdRyFJPSzz9%3DXKnOfOU4ketKFn20d7GPvbiEpNEAQ%40mail.gmail.com.


Re: How to Deploy Django App on Centos server having domain secured With SSL?

2022-07-16 Thread Muhammad Juwaini Abdul Rahman
You can refer to this as guidance:
https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-20-04

I never use Centos for production, (I use Ubuntu) but the steps in those
link are probably similar with minimal modifications.

On Fri, 15 Jul 2022 at 22:29, Abhilash Singh Chauhan <
abhilashaan...@hau.ac.in> wrote:

> Hii Everyone
>
>
>
> I have a Django App which I want to deploy on a Centos Linux server having
> a global/public IP which is assigned to a domain and is secured with SSL
> 
> .
>
> The System configuration is as:
>
> centos-release-6-10.el6.centos.12.3.x86_64
>
> Apache/2.2.15 (CentOS)
>
> When I run the server using:
>
> python manage.py runserver 0.0.0.0:8000,
>
> then it is only accessible from the browser by passing a local IP say
>
> http://192.xxx.xx.xxx:8000/django_app/home
>
> But I want to access it from the public/global IP, but it gives an error
> when I replace the local IP with Global/Public IP or domain assigned to the
> public IP as:
>
> 105.168.296.58 took too long to respond.
>
> Try:
>
>
>
> Checking the connection
>
> Checking the proxy and the firewall
>
> Running Windows Network Diagnostics
>
> ERR_CONNECTION_TIMED_OUT
>
> When I simply put this public IP in the browser as https://105.168.296.58 then
> it redirects the browser to the app/website say https://mywebsite.com/home 
> which
> is running at port 80 on Apache, and shows the assigned domain instead of
> IP, so IP is working fine.
>
> in settings.py: all hosts are allowed as ALLOWED_HOSTS = ['*']
>
> Methods tried are:
>
> 1.   by using 
> django-extensions as:
>
> python manage.py runserver_plus --cert certname 0.0.0.0:8000
>
> 2.   by using 
> django-sslserver as:
>
> python manage.py runsslserver 0.0.0.0:8000
>
> The app runs from both of these methods only locally at
> http://192.xxx.xx.xxx:8000/django_app/home, but None of them worked from
> a Public IP.
>
> Kindly tell, How to deploy or configure this Django App to Run Outside the
> Local Network?
>
>
> Thanks
>
> *Dr. Abhilash Singh Chauhan*
>
> *Project Scientist-B*
>
> *Agromet Advisory Service Division (AASD)*
>
> *India Meteorological Department (IMD)*
>
>
> *Mausam Bhawan, Lodhi Road New Delhi – 110003*
>
> *Contact no: +91-9416372068*
>
>
> * 
> 
> *
>
> --
> 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/CAB0sGggcFAYwLuRpee64E1S6w8SEsu1tjzbJGyr0ZkP2SHHqMg%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/CAFKhtoT_yEiu-osP%2B27QJHBbhhhGM%3DpGv_-9hdHGi%2B0B6udfVA%40mail.gmail.com.


Re: List Field in Django Model while using SQLite

2022-06-17 Thread Muhammad Juwaini Abdul Rahman
Did you read the forum thread?

On Fri, 17 Jun 2022 at 20:21, Mukul Verma  wrote:

> Thanks but it would not work for me if you have any example code please
> share i need to use that
>
>
> On Friday, 17 June 2022 at 14:30:00 UTC+5:30 juw...@gmail.com wrote:
>
>> This could be helpful:
>> https://forum.djangoproject.com/t/use-an-array-of-fields-with-sqlite/2320
>>
>> On Fri, 17 Jun 2022 at 15:00, Mukul Verma  wrote:
>>
>>> Hii Everyone,
>>> Thanks for all the advice and suggestions.
>>> currently i got stuck with a problem i have to store list of some data
>>> in a specific field of the model may you please suggest me or if possible
>>> share code snippet.
>>>
>>> How can i store the list in the model field while using SQLite please.
>>>
>> --
>>> 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/b77e7ebc-7efc-4d40-9f48-fe21a457cf88n%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/c80ef170-eb97-4a00-8875-e24ea7dbd3b0n%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/CAFKhtoQbhtObA3mjCb2nS8JGOHu3XZiLf4KpjX-4oe9x12WsSg%40mail.gmail.com.


Re: List Field in Django Model while using SQLite

2022-06-17 Thread Muhammad Juwaini Abdul Rahman
This could be helpful:
https://forum.djangoproject.com/t/use-an-array-of-fields-with-sqlite/2320

On Fri, 17 Jun 2022 at 15:00, Mukul Verma  wrote:

> Hii Everyone,
> Thanks for all the advice and suggestions.
> currently i got stuck with a problem i have to store list of some data in
> a specific field of the model may you please suggest me or if possible
> share code snippet.
>
> How can i store the list in the model field while using SQLite please.
>
> --
> 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/b77e7ebc-7efc-4d40-9f48-fe21a457cf88n%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/CAFKhtoRCRUQvh3zN5ebUUHUMOmJ0TWFr-bV76_ChMQ9sSifkrg%40mail.gmail.com.


Re: Best approach for audit logging in Django.

2022-06-06 Thread Muhammad Juwaini Abdul Rahman
Based on my experience, this is the easiest one to start with:

https://django-auditlog.readthedocs.io/

On Mon, 6 Jun 2022 at 12:58, Mukul Verma  wrote:

> i also have the question regarding this, is that i have to create auditing
> log file for all the activities performing in the project smallest or
> biggest may you please tell how to initiate this task from beginning.
>
> *Thanks*
> *Mukul Verma*
>
> On Friday, 3 June 2022 at 23:32:04 UTC+5:30 sutharl...@gmail.com wrote:
>
>> Hi Sencer, signals will be helpful only if you are auditing on certain
>> models
>> but if you are trying to audit a set of views then middleware will be a
>> better choice since that will be more manageable
>>
>> On Fri, 3 Jun 2022 at 18:29, Jason  wrote:
>>
>>> one good source when you have a question "is there anything in django
>>> that does X?" is to go to djangopackages.org.
>>>
>>> https://djangopackages.org/grids/g/model-audit/, for example, is a list
>>> of packages for model auditing and history
>>>
>>> On Friday, June 3, 2022 at 6:33:37 AM UTC-4 sencer...@gmail.com wrote:
>>>
 Hi,

 I've been planning to add audit logging to the project.

 But, I can not decide which approach is the best;
 Using signals or creating middleware?

 Project needs to being log events on change of model object with these
 informations below:

 - If a record is inserted, updated and deleted:
- who is taking this action (ForeignKey)
- what is the action (Choice)
- which applications model object affected (ContentType)
- affected object (Generic relation)
- current data in json format
- previous data in json format


 Kind regards,
 Sencer HAMARAT

 --
>>> 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/f5586723-4e6a-4ce6-93d9-b74cd277dc91n%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/415a6eee-74b2-4cbf-b708-2ff15091aeecn%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/CAFKhtoTh3NPBa2BO%2BJ7FMZJf5zUg628K8AFDrEk5GNnkVkDszw%40mail.gmail.com.


Re: How replace "./manage.py < some_code.py" with "./some_code.py" for website scripts?

2022-06-06 Thread Muhammad Juwaini Abdul Rahman
You can add the following lines in your script:

`
import django
sys.path.append('')
os.environ.setdefault('DJANGO_SETTINGS_MODULE', '')
django.setup()
`

On Tue, 7 Jun 2022 at 04:17, Jason  wrote:

> Why?  what's the purpose behind this?
>
> On Monday, June 6, 2022 at 12:27:58 PM UTC-4 cseb...@gmail.com wrote:
>
>> How replace "./manage.py < some_code.py" with "./some_code.py" for
>> website scripts?
>>
>> There seem to be a number of imports needed to make the 2nd version work.
>>
>> cs
>>
> --
> 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/72eaa595-0d6c-44d3-a612-4776b0624c6dn%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/CAFKhtoRu-3XiM4-n5hNzKi2dE3sKfQ47kf7y%3DgzVHZZxo%3DvAoA%40mail.gmail.com.


Re: Session in Python for Login and Logout

2022-06-06 Thread Muhammad Juwaini Abdul Rahman
I think what he meant is 'session' in django.

Probably can take a look at this:
https://docs.djangoproject.com/en/4.0/ref/request-response/

For example, django app wants to know who is the current user, can use
something like:
`request.user`

On Mon, 6 Jun 2022 at 22:45, 'Kasper Laudrup' via Django users <
django-users@googlegroups.com> wrote:

> On 06/06/2022 11.16, Mukul Verma wrote:
> > Hii,
> >
> > Help me out in this stuff please, some steps for solve this out
> >
>
> Python is a programming language so there's no such thing as a "session
> for login and logout".
>
> If you want someone to help you, you should try to clarify what you
> actually need help with. I assume you mean something with Django
> sessions but it's impossible for me or anyone else to know exactly what
> kind of issue you need to solve.
>
> 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/ade6fd19-d942-f5e9-dc9e-1f921d94b648%40stacktrace.dk
> .
>

-- 
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/CAFKhtoRrvi6Y%3Dwu9rea42B7D9wSF-dOheiqXiFnUtADx4pBb%3Dg%40mail.gmail.com.


Re:

2022-05-09 Thread Muhammad Juwaini Abdul Rahman
I think it's better for you to inherit from 'User' model instead of
creating them one by one.

'User' model have column 'name', 'password', 'email' (among others) etc.

https://docs.djangoproject.com/en/4.0/ref/contrib/auth/

On Mon, 9 May 2022 at 21:18, 郑 玉婷  wrote:

> Dear django workers,
>
>First of all ,I have to appoloy for my poor English.
>
> I want to add users through admin page ,which was registed by my own model
> . How can I add users with encoding their password?
>
> These are my models and my admin.py. I’ll be grateful if you can help me!
>
>
>
> #mysite\login\admin.py
>
> from os import read
>
> from django.contrib import admin
>
> from django.contrib.auth.admin import UserAdmin
>
> from . import models
>
> from login import views
>
> # Register your models here.
>
>
>
> admin.site.register(models.Manager)
>
> admin.site.register(models.Student)
>
> admin.site.register(models.Teacher)
>
> admin.site.site_header = '真人图书馆管理后台'  # 设置header
>
> admin.site.site_title = '真人图书馆管理后台'   # 设置title
>
> admin.site.index_title = '真人图书馆主页'
>
>
>
> #mysite\login\models.py
>
> from distutils.command.upload import upload
>
> from importlib.resources import path
>
> from django.db import models
>
>
>
> # Create your models here.
>
>
>
> class Student(models.Model):
>
>
>
> gender = (
>
> ('male', "男"),
>
> ('female', "女"),
>
> )
>
>
>
> name = models.CharField(max_length=128, unique=True)
>
> password = models.CharField(max_length=256)
>
> email = models.EmailField(unique=True)
>
> sex = models.CharField(max_length=32, choices=gender, default="男")
>
> c_time = models.DateTimeField(auto_now_add=True)
>
>
>
> def __str__(self):
>
> return self.name
>
>
>
> class Meta:
>
> ordering = ["-c_time"]
>
> verbose_name = "学生"
>
> verbose_name_plural = "学生"
>
>
>
> class Manager(models.Model):
>
>
>
> name = models.CharField(max_length=128, unique=True)
>
> password = models.CharField(max_length=256)
>
> email = models.EmailField(unique=True)
>
> c_time = models.DateTimeField(auto_now_add=True)
>
>
>
> def __str__(self):
>
> return self.name
>
>
>
> class Meta:
>
>ordering = ["-c_time"]
>
> verbose_name = "管理员"
>
> verbose_name_plural = "管理员"
>
>
>
> class Teacher(models.Model):
>
>
>
> gender = (
>
> ('male', "男"),
>
> ('female', "女"),
>
> )
>
>
>
> name = models.CharField(max_length=128, unique=True)
>
> password = models.CharField(max_length=256)
>
> sex = models.CharField(max_length=31, choices=gender, default="男")
>
> image = models.ImageField(default = "",upload_to= 'media/')
>
> email = models.EmailField(unique=True)
>
> telephone = models.CharField(max_length = 11)
>
> subject = models.CharField(max_length=20)
>
> c_time = models.DateTimeField(auto_now_add=True)
>
>
>
> def __str__(self):
>
> return self.name
>
>
>
> class Meta:
>
> ordering = ["-c_time"]
>
> verbose_name = "老师"
>
> verbose_name_plural = "老师"
>
>   Best wishes!
>
>  Molly
>
>
>
>
>
>
>
> --
> 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/ME3P282MB1682636F0E189716B7A32546D2C69%40ME3P282MB1682.AUSP282.PROD.OUTLOOK.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/CAFKhtoRvF_zHjHdNSx1NWh%2BSXBPWR7BC5WW%2BLLt44MTQAyHFCQ%40mail.gmail.com.


Re: Chaining county/cites api to models

2022-05-06 Thread Muhammad Juwaini Abdul Rahman
Can you share the link of the API?

On Fri, 6 May 2022 at 17:27, Heman Okumbo  wrote:

> Thanks for the tip,i guess i have to dig deeper to get what exactly fits
> my model design.
>
> On Fri, May 6, 2022, 04:04 Muhammad Juwaini Abdul Rahman <
> juwa...@gmail.com> wrote:
>
>> Try this:
>>
>>
>> https://simpleisbetterthancomplex.com/tutorial/2018/01/29/how-to-implement-dependent-or-chained-dropdown-list-with-django.html
>>
>> On Thu, 5 May 2022 at 23:46, Heman Okumbo  wrote:
>>
>>> I need to have clients posting their products based on their
>>> countries,States and cities.I got this api that show a drop down list based
>>> on country, states and cities.How do I chain my models to this api? Any
>>> leads will be appreciated.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/CAJt9CbjDgLT-_Gj9SuWnfStwgfTnOsSCXfwK%3DNNq3DRXGQmuzQ%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/django-users/CAJt9CbjDgLT-_Gj9SuWnfStwgfTnOsSCXfwK%3DNNq3DRXGQmuzQ%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/CAFKhtoS%2BjG_nmuZea%2BpgDFRaKY9t9%2BE3rvgumK_YQL%3DN5q92gA%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAFKhtoS%2BjG_nmuZea%2BpgDFRaKY9t9%2BE3rvgumK_YQL%3DN5q92gA%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/CAJt9Cbjw2Aa8_6somCsm8vf3K9DaXOwjKPEmjDFuCEwrs6voRA%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAJt9Cbjw2Aa8_6somCsm8vf3K9DaXOwjKPEmjDFuCEwrs6voRA%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/CAFKhtoT6gOk22Hf8w1S5yuPcLfXLW-c1-ytjLQsKgotchrRaGA%40mail.gmail.com.


Re: Chaining county/cites api to models

2022-05-05 Thread Muhammad Juwaini Abdul Rahman
Try this:

https://simpleisbetterthancomplex.com/tutorial/2018/01/29/how-to-implement-dependent-or-chained-dropdown-list-with-django.html

On Thu, 5 May 2022 at 23:46, Heman Okumbo  wrote:

> I need to have clients posting their products based on their
> countries,States and cities.I got this api that show a drop down list based
> on country, states and cities.How do I chain my models to this api? Any
> leads will be appreciated.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/CAJt9CbjDgLT-_Gj9SuWnfStwgfTnOsSCXfwK%3DNNq3DRXGQmuzQ%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/CAFKhtoS%2BjG_nmuZea%2BpgDFRaKY9t9%2BE3rvgumK_YQL%3DN5q92gA%40mail.gmail.com.


Re: What's the best, most recommended way for handling model field encryption and decryption? Any python or django specific libraries?

2022-04-27 Thread Muhammad Juwaini Abdul Rahman
You need to consider a few things, for example: are you okay with the
trade-off that your app will be (much) slower?

Unlike passwords, all those data are used (get and set) frequently.

On Tue, 26 Apr 2022 at 08:45, Edchel Stephen Nini 
wrote:

> Good day everyone, What's the best/most recommended way to handle
> encryption in Model fields, like email, credit card number, etc? Also
> decrypting the said encrypted fields and presenting data back in views,
> templates, etc? What is the recommended workflow?
> Do you know of any python or django specific libraries best to use? Thanks
> in advance! Sincerely, Ed
>
> --
> 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/CAMeVmurmkP%2BVVW7Xrk5QDuSkV83i2UMKSQq4qr62j0aMapudSQ%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/CAFKhtoTNjyWkon%2BXWhV%3DCY8nusYAd1NVOwLFNFfhMdvBM25ukw%40mail.gmail.com.


Re: How to compare two image field properly

2022-02-28 Thread Muhammad Juwaini Abdul Rahman
If the image data is huge, that could take a long time.

Maybe you can just compare the checksum?

On Sun, 27 Feb 2022 at 23:31, Azzam Codes  wrote:

> one way that i know, not sure if best way to do it,
> but you could first extract the fields of your model as:
> `modelAFields =  ModelA._meta.fields`
> `modelBFields =  ModelB._meta.fields`
>
> then extract your image field eg.:
> `imageAField = modelAFields[0]`
> `imageBField = modelBFields[0]`
>
> then to display all the field's atributes and loop through them for
> comparing by :
> `vars(imageAField)`
> `vars(imageBField)`
>
> Regards, Azzam.
>
>
>
>
> On Tuesday, February 22, 2022 at 12:16:42 AM UTC+8 sencer...@gmail.com
> wrote:
>
>> Thanks but, no.
>> I didn't mean the comparing content of the files.
>>
>> 19 Şub 2022 Cmt 21:55 tarihinde  şunu yazdı:
>>
>>> OpenCV
>>>
>>> - Tom
>>>
>>> On Feb 19, 2022, at 2:27 AM, Sencer Hamarat  wrote:
>>>
>>> 
>>> Hi,
>>>
>>> I have two different models which include image fields individually.
>>>
>>> Is there a proper way to compare those imagefileds?
>>>
>>> class ModelA(models.Model):
>>> file = models.ImageField(
>>> verbose_name=_('File'),
>>> blank=False,
>>> null=False,
>>> max_length=400
>>> )
>>>
>>> class ModelB(models.Model):
>>> image = ImageField(
>>> verbose_name=_('Product Image'),
>>> max_length=400,
>>> default=static('images/default_thumbnail.png'),
>>> )
>>>
>>>
>>> Also, I need to figure out how to track any change in a single image
>>> field.
>>>
>>> Regards,
>>> Sencer HAMARAT
>>>
>>> --
>>> 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/CACp8TZhoLKhfpdn7UcrWajf%2BZ8snaNvFB8M29p4nF5eZ2f7iEg%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...@googlegroups.com.
>>>
>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/97725F33-C463-4CE5-8EDA-DEBE2A9A37FA%40gmail.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/8ab6fcee-6851-4b02-bb1f-edc02bfd2d32n%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/CAFKhtoQkdGfbvR3Q6WLj5w5u4_uTM0TAjM3mHCvFkhh1RBT0-w%40mail.gmail.com.


Re: Complete E-learning apps

2022-01-13 Thread Muhammad Juwaini Abdul Rahman
https://docs.tutor.overhang.io/index.html

Try checking this. Probably it fulfills all your requirements.

Installation-wise, tutor is much easier to install compared to edx.

On Thu, 13 Jan 2022 at 23:08, Bu Market  wrote:

> who have  built apps like this one? i need help guys!
>
> E-Learning Platform(Web App) built-in Python Django Rest Framework for
> backend  and React Native (UX/UI and Development for frontend.
> A fully functional E-Learning platform with frontend pages. Home, About,
> Blog, Login, How it Works etc
> A fully functional E-Learning web application and Android ,IOS APPS where
> users can log in, add courses to cart and checkout out, ask help for their
> Tasks ,instants Task and homeworks
> Three user types: Instructor, Student(Regular User), Admin
> Technology:
> Python Django Rest Framework
> React/Vue Js
> Postgres
> AWS (s3 for file storage and ec2 for hosting)
>
> User Types
> Regular  Users (students)
> Log in / sign up
> Search for classes
> Filter out classes by live or self-paced; date starting, certificate
> Viewing description of the class (on its own page)
> Enroll in a class by clicking “enroll”
> Filling out enrollment forms
> Once logged in, will have other classes similar to the one they enrolled in
> See their classes in the “my classes” section
> When in the class, have an area where they can see the course overview, a
> section for them to put notes while taking the class, Q that will involve
> students posting a question and other students plus instructor can answer
> it, and a resource section where students can see any resources that were
> uploaded from the instructor, and an announcement area to see any
> announcements from instructors.
> Can message instructors
> Students will be able to enroll in classes without waiting for approval
> unless it's a live class, then it will be a first-come, first-serve basis.
>
>
> 2. Instructors
> Admin Can sign up Instructors to become tutors
> Tutor can only login as tutor(no register by himself only admin can
> register him) and tutor can register a new class to the platform and upload
> the videos
> Videos will be on the draft until they are ready to publish live. That way
> they can preview the quality of their videos
> Instructors can upload a course overview
> Can view and  message their students, answer questions in Q thread, post
> announcements
> See and respond to reviews
> Can upload any course material under resources
> Will receive payment (working out the details on how or when)
> For classes that are live, instructors will need the available to limit
> the number of students that can enroll.
>
> 3. Admin
> Can view instructors and students
> Can delete, add instructors and students that break guidelines and policies
> Can update terms and policies
> Approve payouts
> Also, receive their pay ( still working on details)
>
> Other notes:
> Payment details are still being worked out (not sure whether we will have
> payment info saved on the platform or how instructors will be paid and admin
> Website will function like udemy.com but with options for live classes as
> well
> Haven't worked out whether live classes will be done directly through the
> platform or if we will need to integrate a 3rd party classroom software
> Any classes that are self-paced will need to be available at all times for
> students. videos will be live on our platform and private on youtube!
>
> --
> 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/da0912f5-584f-4e87-b062-e4efca84dad7n%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/CAFKhtoRti2NpiNuKZxqmkbp7OvENQdkEXf7nMQTYCvbMb1t_NQ%40mail.gmail.com.


Re: linebreaksbr doesn't work

2022-01-07 Thread Muhammad Juwaini Abdul Rahman
Try `linebreaks` instead of `linebreaksbr`.

On Fri, 7 Jan 2022 at 21:52, ___Maxim.Nesterov___ 
wrote:

> Hi, why linebreaksbr might not work {{somevalue | linebreaksbr}}
>
> For example, somevalue = ‘Joel\nis a slug’, and linebreaksbr doesn’t
> change \n → 
>
> --
>
> {% load static %}
>
> 
>
> 
>
>
> 
>
> 
>
> 
>
> 
>
> {{somevalue | linebreaksbr}}
>
> 
>
> 
>
> --
> 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/0d366e7f-c316-4a13-ac97-947d23326105n%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/CAFKhtoTQZZ32oTfZ%3DgNDipyMKGyCgU5%2BH659Vm6en6ui0-c6EQ%40mail.gmail.com.


Re: Permissions front end management in Django

2022-01-04 Thread Muhammad Juwaini Abdul Rahman
You can handle using conditions in template.

Or search for library for role based permission.

On Tue, 4 Jan 2022 at 19:00, Eugene TUYIZERE 
wrote:

> Derar Team,
>
> I have a django application and I want the admin to manage the permissions
> for different functions. This should be done in way way like below:
>
> [image: image.png]
>
> by editing you can allow the user access,view, create, modify or delete
> the particular view.
>
> How can I achieve this in django?
>
> Regards,
>
> * 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/CABxpZHtCPtEFRbzy2sTWfYcHoFzm-N1Ycxy4Snb-k54vtQd8ag%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/CAFKhtoQN6%3DXvpAv0ree%3Dm66OH7bD6F4bi6GQMDZTuSe_zOaKTQ%40mail.gmail.com.


Re: On django model.

2021-12-24 Thread Muhammad Juwaini Abdul Rahman
Have you checked the content of that table using dbshell?

I have suspicion that the ID in your table is not a mere bigint.

According to your error message, it is 'slice' (I don't know what it is),
so you need to investigate what kind of data stored before you can move
forward from this issue.

On Fri, 24 Dec 2021 at 21:34, Amor Zamora  wrote:

> I think he did not understand the situation, because with migrations I
> don't resolve to convert the database into the model. The process that I
> need is the other way around.
> I needs  for a table created in the database to be included in the model.
>
> El vie, 24 dic 2021 a las 14:03, Sebastian Jung (<
> sebastian.ju...@gmail.com>) escribió:
>
>> Hello,
>>
>> Insectdb is not to generate/update database. Please make it with python
>> manage.py makemigrations and after that python manage.py migrate
>>
>> Please read a tutorial https://tutorial.djangogirls.org/de/
>>
>> Regards
>>
>> Amor Zamora  schrieb am Fr., 24. Dez. 2021, 13:11:
>>
>>> Hi guys.
>>> I have an application in Django that has a database in postgresql.
>>> But a new table was added to that database.
>>> I have tried using the inspectdb (python3 manage.py inspectdb
>>> tracking_visit) command, to add that table to the DJango model, but it
>>> gives me an exception, it tells me that the ID field of the new table is
>>> not an integer and if it is, I put it as an integer and primary key and so
>>> on itself is reflected in the database.
>>> # Unable to inspect table 'tracking_visit'
>>> # The error was: sequence index must be integer, not 'slice'
>>>
>>> 1. My question is if you know any other method or application that
>>> allows me to generate the model from the database.
>>> 2. Is there any other way to include changes made from the database into
>>> the django model?
>>>
>>> Best regards
>>>
>>> --
>>> Amor Zamora
>>> Behind the distance,
>>> your mouth and mine hide,
>>> complices of a kiss, caresses, fantasies,
>>> distance as close as the sky and the sea,
>>> my piece is in your bed, in mine, is your love.
>>> Behind the distance hide love, memories,
>>> encounters, experiences, circumstances, pain and good times,
>>> it is after her, the distant ones,
>>> that we leave feelings,
>>> but if we really miss,
>>> distance,
>>> it is only your time.
>>>
>>> --
>>> 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/CAKMTbHUWN5QaAyrgrABL5GeKouU0qf2xoxkUqpg-x4WJZmocvg%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/CAKGT9myijdck4HQXjKntFrcr-EXDA5Py-By6kJOBkQx43e59Kg%40mail.gmail.com
>> 
>> .
>>
>
>
> --
> Amor Zamora
> Behind the distance,
> your mouth and mine hide,
> complices of a kiss, caresses, fantasies,
> distance as close as the sky and the sea,
> my piece is in your bed, in mine, is your love.
> Behind the distance hide love, memories,
> encounters, experiences, circumstances, pain and good times,
> it is after her, the distant ones,
> that we leave feelings,
> but if we really miss,
> distance,
> it is only your time.
>
> --
> 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/CAKMTbHUdpw9pn96Se7Ko1aJMTuxphFjfCOZwrErXeuBwsjZJVA%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/CAFKhtoSA%3DmjaFwJoCYaCyHGqSxkh0dFnniZjpsuoCEp2FcJfHA%40mail.gmail.com.


Re: On django model.

2021-12-24 Thread Muhammad Juwaini Abdul Rahman
I think you're the one who don't fully understand Amor's email.

On Fri, 24 Dec 2021 at 21:03, Sebastian Jung 
wrote:

> Hello,
>
> Insectdb is not to generate/update database. Please make it with python
> manage.py makemigrations and after that python manage.py migrate
>
> Please read a tutorial https://tutorial.djangogirls.org/de/
>
> Regards
>
> Amor Zamora  schrieb am Fr., 24. Dez. 2021, 13:11:
>
>> Hi guys.
>> I have an application in Django that has a database in postgresql.
>> But a new table was added to that database.
>> I have tried using the inspectdb (python3 manage.py inspectdb
>> tracking_visit) command, to add that table to the DJango model, but it
>> gives me an exception, it tells me that the ID field of the new table is
>> not an integer and if it is, I put it as an integer and primary key and so
>> on itself is reflected in the database.
>> # Unable to inspect table 'tracking_visit'
>> # The error was: sequence index must be integer, not 'slice'
>>
>> 1. My question is if you know any other method or application that allows
>> me to generate the model from the database.
>> 2. Is there any other way to include changes made from the database into
>> the django model?
>>
>> Best regards
>>
>> --
>> Amor Zamora
>> Behind the distance,
>> your mouth and mine hide,
>> complices of a kiss, caresses, fantasies,
>> distance as close as the sky and the sea,
>> my piece is in your bed, in mine, is your love.
>> Behind the distance hide love, memories,
>> encounters, experiences, circumstances, pain and good times,
>> it is after her, the distant ones,
>> that we leave feelings,
>> but if we really miss,
>> distance,
>> it is only your time.
>>
>> --
>> 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/CAKMTbHUWN5QaAyrgrABL5GeKouU0qf2xoxkUqpg-x4WJZmocvg%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/CAKGT9myijdck4HQXjKntFrcr-EXDA5Py-By6kJOBkQx43e59Kg%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/CAFKhtoSETve8vNi47%2Bcr5NQyewUW60a2fcpfsSWiovp1wrbqVg%40mail.gmail.com.


Re: how to calculate input form value in django

2021-12-23 Thread Muhammad Juwaini Abdul Rahman
TypeNone means there's no value has been key in into the form.

How do you want to convert an absent of value into integer/float?

On Thu, 23 Dec 2021 at 22:24, Ad Tariq  wrote:

> hi! django users how  i calculate input value from template to views where
> request fetched value is TypeNone how can i convert it into integer of
> float type
>
> --
> 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/4b2ac06d-2c3b-4224-bc46-e7e2dd65a0acn%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/CAFKhtoRw-uk2NdUHR82j_4CuM2tr4Ocy_fPCM5aGYwXLsdFqYQ%40mail.gmail.com.


Re: Django build file reg.

2021-12-23 Thread Muhammad Juwaini Abdul Rahman
If you host and 'rent' it as SaaS, no one can access your sourcecode.

But anyone can use your SaaS and replicate the website.

On Thu, 23 Dec 2021 at 22:24, kavin kumar R  wrote:

> Hi everyone,
>
>
> *I did a project in django for a business motive and I want to sold it
> with out sorce code any one can help me to build a django a project wich
> can't be reverse engineered..*
>
>
> Thankyou!!.
>
> --
> 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/49213ebe-f6e8-48f4-a0a1-9afb8dfa8537n%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/CAFKhtoREiSmKV9%2B1b5t1G2%2BZEnr2-gp3d_wMUB4rwwgkP-kK0A%40mail.gmail.com.


Re: I need orientation on what to do and how to do it (procedure)

2021-12-15 Thread Muhammad Juwaini Abdul Rahman
You can try this json api.
https://www.geoplugin.com/webservices/json

I believe there's a lot of services out there with this capability.

On Thu, 16 Dec 2021 at 10:13, Amor Zamora  wrote:

>
> Can you help me?
> I need to obtain the country of where the users access from the IP and
> insert that information into the sqlite3 database.
>
> Little description.
> I have an application that I have to do the statistics and insert into the
> sqlite3 database, the IP information, the country from which it is
> accessed, who generates the information and how many times has clicked on
> the application.
> Question 1 is that I cannot find any suitable module in DJango that allows
> me to combine the information described above.
> I am using. IP_address, os, daemonize and socket and I don't quite realize
> how to get the country from where it is accessed.
> 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/CAKMTbHVU%2BkJQw%2B8wnA7U__x7zCnrd%3DyvA%2BwmwFta2cPDwS6%2BMg%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/CAFKhtoQQ8e41eV7p_ZCsJReg%2BZqVAHR%2BUjfmwjXpYMvCZ-SEpw%40mail.gmail.com.


Re: ModuleNotFoundError: No module named [project_name]

2021-12-15 Thread Muhammad Juwaini Abdul Rahman
It seems that you don't have permission to execute your wsgi.py file or the
filepath is incorrect.

Suggestion: Why don't you use nginx + gunicorn?

On Wed, 15 Dec 2021 at 23:05, Kyle Paterson 
wrote:

> I am using django 4.0 with Apache and mod_wsgi. Whenever I try request the
> site through apache, I get the following error:
> [Wed Dec 15 14:51:59.385259 2021] [wsgi:info] [pid 15535:tid
> 140431892707072] [remote 127.0.0.1:44654] mod_wsgi (pid=15535,
> process='traveldata', application='127.0.1.1|'): Loading Python script file
> '/home/kyle/active-travel/traveldata/traveldata/wsgi.py'.
> [Wed Dec 15 14:51:59.385699 2021] [wsgi:error] [pid 15535:tid
> 140431892707072] [remote 127.0.0.1:44654] mod_wsgi (pid=15535): Failed to
> exec Python script file
> '/home/kyle/active-travel/traveldata/traveldata/wsgi.py'.
> [Wed Dec 15 14:51:59.385718 2021] [wsgi:error] [pid 15535:tid
> 140431892707072] [remote 127.0.0.1:44654] mod_wsgi (pid=15535): Exception
> occurred processing WSGI script
> '/home/kyle/active-travel/traveldata/traveldata/wsgi.py'.
> [Wed Dec 15 14:51:59.385800 2021] [wsgi:error] [pid 15535:tid
> 140431892707072] [remote 127.0.0.1:44654] Traceback (most recent call
> last):
> [Wed Dec 15 14:51:59.385828 2021] [wsgi:error] [pid 15535:tid
> 140431892707072] [remote 127.0.0.1:44654]   File
> "/home/kyle/active-travel/traveldata/traveldata/wsgi.py", line 19, in
> 
> [Wed Dec 15 14:51:59.385831 2021] [wsgi:error] [pid 15535:tid
> 140431892707072] [remote 127.0.0.1:44654] application =
> django.core.handlers.wsgi.WSGIHandler()
> [Wed Dec 15 14:51:59.385836 2021] [wsgi:error] [pid 15535:tid
> 140431892707072] [remote 127.0.0.1:44654]   File
> "/home/kyle/active-travel/venv/lib/python3.8/site-packages/django/core/handlers/wsgi.py",
> line 127, in __init__
> [Wed Dec 15 14:51:59.385838 2021] [wsgi:error] [pid 15535:tid
> 140431892707072] [remote 127.0.0.1:44654] self.load_middleware()
> [Wed Dec 15 14:51:59.385842 2021] [wsgi:error] [pid 15535:tid
> 140431892707072] [remote 127.0.0.1:44654]   File
> "/home/kyle/active-travel/venv/lib/python3.8/site-packages/django/core/handlers/base.py",
> line 39, in load_middleware
> [Wed Dec 15 14:51:59.385844 2021] [wsgi:error] [pid 15535:tid
> 140431892707072] [remote 127.0.0.1:44654] for middleware_path in
> reversed(settings.MIDDLEWARE):
> [Wed Dec 15 14:51:59.385847 2021] [wsgi:error] [pid 15535:tid
> 140431892707072] [remote 127.0.0.1:44654]   File
> "/home/kyle/active-travel/venv/lib/python3.8/site-packages/django/conf/__init__.py",
> line 84, in __getattr__
> [Wed Dec 15 14:51:59.385849 2021] [wsgi:error] [pid 15535:tid
> 140431892707072] [remote 127.0.0.1:44654] self._setup(name)
> [Wed Dec 15 14:51:59.385859 2021] [wsgi:error] [pid 15535:tid
> 140431892707072] [remote 127.0.0.1:44654]   File
> "/home/kyle/active-travel/venv/lib/python3.8/site-packages/django/conf/__init__.py",
> line 71, in _setup
> [Wed Dec 15 14:51:59.385861 2021] [wsgi:error] [pid 15535:tid
> 140431892707072] [remote 127.0.0.1:44654] self._wrapped =
> Settings(settings_module)
> [Wed Dec 15 14:51:59.385864 2021] [wsgi:error] [pid 15535:tid
> 140431892707072] [remote 127.0.0.1:44654]   File
> "/home/kyle/active-travel/venv/lib/python3.8/site-packages/django/conf/__init__.py",
> line 179, in __init__
> [Wed Dec 15 14:51:59.385866 2021] [wsgi:error] [pid 15535:tid
> 140431892707072] [remote 127.0.0.1:44654] mod =
> importlib.import_module(self.SETTINGS_MODULE)
> [Wed Dec 15 14:51:59.385869 2021] [wsgi:error] [pid 15535:tid
> 140431892707072] [remote 127.0.0.1:44654]   File
> "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
> [Wed Dec 15 14:51:59.385871 2021] [wsgi:error] [pid 15535:tid
> 140431892707072] [remote 127.0.0.1:44654] return
> _bootstrap._gcd_import(name[level:], package, level)
> [Wed Dec 15 14:51:59.385875 2021] [wsgi:error] [pid 15535:tid
> 140431892707072] [remote 127.0.0.1:44654]   File " importlib._bootstrap>", line 1014, in _gcd_import
> [Wed Dec 15 14:51:59.385878 2021] [wsgi:error] [pid 15535:tid
> 140431892707072] [remote 127.0.0.1:44654]   File " importlib._bootstrap>", line 991, in _find_and_load
> [Wed Dec 15 14:51:59.385882 2021] [wsgi:error] [pid 15535:tid
> 140431892707072] [remote 127.0.0.1:44654]   File " importlib._bootstrap>", line 961, in _find_and_load_unlocked
> [Wed Dec 15 14:51:59.385886 2021] [wsgi:error] [pid 15535:tid
> 140431892707072] [remote 127.0.0.1:44654]   File " importlib._bootstrap>", line 219, in _call_with_frames_removed
> [Wed Dec 15 14:51:59.385889 2021] [wsgi:error] [pid 15535:tid
> 140431892707072] [remote 127.0.0.1:44654]   File " importlib._bootstrap>", line 1014, in _gcd_import
> [Wed Dec 15 14:51:59.385893 2021] [wsgi:error] [pid 15535:tid
> 140431892707072] [remote 127.0.0.1:44654]   File " importlib._bootstrap>", line 991, in _find_and_load
> [Wed Dec 15 14:51:59.385896 2021] [wsgi:error] [pid 15535:tid
> 140431892707072] [remote 127.0.0.1:44654]   File " importlib._bootstrap>", line