Re: Exciting Opportunity: Join Our Django WhatsApp Bulk Messaging Project!

2024-02-18 Thread Hamza Bilal
Yes i Want to join this project

On Sun, 18 Feb 2024 at 21:47, SURAJ TIWARI  wrote:

>  Join Our Django WhatsApp Bulk Messaging Project!
>
>  Hello everyone,
>
> Are you looking for an exciting opportunity to gain hands-on experience in
> Django development? Do you want to work on a meaningful project that
> leverages WhatsApp for bulk messaging? We're thrilled to invite you to join
> our dynamic team!
>
>  Benefits:
>
>- Get hands-on experience working on a real-world Django project.
>- Learn how to leverage WhatsApp for bulk messaging, a valuable skill
>in today's digital landscape.
>- Opportunities for hybrid work, allowing flexibility in your schedule.
>- Collaborate with experienced developers and gain valuable mentorship.
>- Access to cutting-edge tools and technologies.
>
>  Opportunities Available:
>
>- Django developers
>- Frontend developers
>- UI/UX designers
>- Quality assurance testers
>
> 欄 How to Join: Simply reply to this message expressing your interest,
> and we'll provide you with all the necessary details to get started on our
> project.
>
> Let's work together to create something amazing and gain valuable
> experience along the way! ✨
>
> Best regards,
>
> Suraj Tiwari
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from 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/e8a705fd-10d9-4c1a-b4ba-0a7b896dbfean%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/CAB%2BRyv5%2B8TbpSYL7-TVT-yKxB3rBftBXr1HDCeEhn5%3DCEUo6KA%40mail.gmail.com.


I Want To Create An Api of notification In Django Rest API

2023-12-01 Thread Hamza Bilal
I Want To Create An Api of notification In Django Rest API
![Screenshot from 2023-11-30 
03-30-39|690x388](upload://6RwAUFNKt3TWKgrocOu2t4k2TeJ.png)
I Created AN Notification App By Using The Django Channels, Websockt and 
Successfully Sending Notification To The `Webscoketking.com`, Now I Want To 
Create The API of This App For Sending The Notifications Of the Website
models.py
```
from django.db import models
from django.contrib.auth.models import AbstractUser
from channels.layers import get_channel_layer
from asgiref.sync import async_to_sync
import json
# Create your models here.

class CustomUser(AbstractUser):

"""Model class for users"""

USER_CHOICES = [
('expert', 'Expert'),
('business', 'Business'),
('admin', 'Admin'),
]

username = models.CharField(max_length=40, null=True, blank=True)
full_name = models.CharField(max_length=40)
email = models.EmailField(unique=True)
password = models.CharField(max_length=40, null=False, blank=False)
confirm_password = models.CharField(max_length=40, null=False, 
blank=False)
user_choices = models.CharField(max_length=30, choices=USER_CHOICES, 
default='expert')

USERNAME_FIELD = 'email'
REQUIRED_FIELDS = ['username']

def __str__(self) -> str:
return f"{self.email}"


class Notification(models.Model):
account_user = models.ForeignKey(CustomUser, on_delete=models.CASCADE)
message = models.TextField()
is_read = models.BooleanField(default=False)
created_at = models.DateTimeField(auto_now_add=True)

def save(self, *args, **kwargs):
print('saving notification')
channel_layer = get_channel_layer()
notification_objs = 
Notification.objects.filter(is_read=False).count()
data = {'count': notification_objs, 'current_notification': 
self.message}
async_to_sync(channel_layer.group_send)(
"test_group", {
"type": "send_notification",
"value": json.dumps(data)
}
)
super(Notification, self).save(*args, **kwargs)


class AccountApproval(models.Model):
account_user = models.ForeignKey(CustomUser, on_delete=models.CASCADE)
approved = models.BooleanField(default=False)
approval_message = models.TextField(blank=True, null=True)

```
COnsumers.py
```
from channels.generic.websocket import WebsocketConsumer
from asgiref.sync import async_to_sync
import json

class TestConsumer(WebsocketConsumer):
def connect(self):
self.room_name = "test"
self.room_group_name = "test_group"
async_to_sync(self.channel_layer.group_add)(
self.room_group_name,
self.channel_name,
)
self.accept()
print("connected")
self.send(text_data=json.dumps({'status': 'connected Through Django 
Channels'}))

def receive(self, text_data):
print(text_data)
self.send(text_data=json.dumps({'status': 'We Got You'}))

def disconneted(self, *args, **kwargs):
print("disconnected")

def send_notification(self, event):
print('Send Notification: ')
data = json.loads(event.get('value'))
self.send(text_data=json.dumps({'status': data}))

print('Send Notification: ')



```
asgi.py
```
"""
ASGI config for hamza project.

It exposes the ASGI callable as a module-level variable named 
``application``.

For more information on this file, see
https://docs.djangoproject.com/en/4.2/howto/deployment/asgi/
"""
from channels.routing import ProtocolTypeRouter, URLRouter
from django.urls import path
from bilal.consumers import TestConsumer
import os
from django.core.asgi import get_asgi_application

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'hamza.settings')

asgiapplication = get_asgi_application()

ws_pattern = [
path('ws/test/', TestConsumer.as_asgi())
]

application = ProtocolTypeRouter({
'http': get_asgi_application(),
'websocket': URLRouter(ws_pattern)
})
```

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from 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/6e2c0bdf-b67f-4167-9236-ac310f1a4a52n%40googlegroups.com.


I Want To Save The Data In My Database Depending On The Catgory Of Data Chosen by User Like I Have 4 Lisitings Like APparetements, Food And Life, Car And Travelling if User Selects Appartements Then A

2023-08-20 Thread Hamza Bilal
{% extends 'home.html' %}
{% load static %}
{% block content %}



  

  
Add Plots In Your Listing
If You Want To Buy The Plot Then Add It In Your Listing
  

  





  

  

  
  

  
{% csrf_token %}

Listing Type
{{ form.listing_type }}
Area
{{ form.area }}
Location
{{ form.location }}

Price
{{ form.price }}
Title
{{ form.title }}
Upload An Image
{{ form.image }}



  
Add Your Listing!
  

  

  

  

  









{% endblock content %}

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from 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/c48d35c9-9dcb-4aaf-a478-822deb83a324n%40googlegroups.com.


Django Async support

2023-07-03 Thread 'Hamza Pervez' via Django users
Hi,

We have been trying to use Django with Uvicorn via ASGI interface. As our 
use case is that our service acts as a wrapper for a 3rd party API service 
so using ASGI was a better choice because most of the time our service will 
be waiting on 3rd party service. 

Now the problem, I was assuming that if all middlewares are async and the 
view is async then uvicorn will have one thread to handle multiple 
requests. But when I simulate the traffic by a script, about 200 requests 
then uvicorn starts creating new threads. So it seems that django is using 
one request per thread. BTW To see the number of active thread I'm tracking 
them via the Activity monitor in Mac. To debug this I've started a new 
projects with empty list of middlewares and a view of 2 lines which just 
defines the function in one and sleeps in second. Sleep function is 
imported from asyncio.


Isn't Uvicorn supposed to use one tread for all the requests.

Regards

-- 


The content of this email and attachment(s) are confidential and intended 
solely for the recipient(s) specified in the message. If you received this 
email by error, please alert the sender by replying to this email and 
follow with its deletion, so that we can ensure such an error does not 
occur in future. If you are not the intended recipient, you are strictly 
prohibited to use, copy, disseminate or store this email or its 
attachment(s).

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from 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/1c57aad5-21c6-40b3-962a-876a05320118n%40googlegroups.com.


Re: django

2023-03-01 Thread Hamza Shahid
Override get_queryset method or use models.objects.filter(user=request.user)

On Wed, Mar 1, 2023, 5:45 PM Ikrombek  wrote:

> How to make a user's post visible only to that user using Django
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/4e825c08-b0d6-4104-8d4c-3b1e09fe851cn%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/CAE38QZST98%2Bq%2BFmhCXbEhKC9xQjVY3nX-d%2BJgZ0a4UP37jt5SQ%40mail.gmail.com.


remplir automatiquement les champs du formulaire

2023-02-22 Thread Hamza Sinon
dans mon projet je veux une méthode de saisie automatique j'explique : j'ai 
créé un nouveau champ dans mon formulaire Donneur qui s'appelé numero_cnib, 
je souhaite que si je saisisse dans le champs le numero_cnib qu'il me fasse 
une recherche du Donneur, qui est déjà enregistrée dans ma base de données 
et fait une saisie automatique des autres champs de mon formulaire avec les 
informations du Donneur en question

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from 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/9d854d19-36aa-4bbd-bedd-d051d6260ac2n%40googlegroups.com.


Django admin Ordering the display

2022-04-02 Thread Ali Hamza
How i Order this field descending order. i want completeorders show first 
then completemodules
[image: DeepinScreenshot_select-area_20220402171316.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/bd45879f-9f72-478e-9cf6-0b5a1bad0b55n%40googlegroups.com.


The session doesn't seem to expire after the browser is closed

2022-03-08 Thread Hamza Khyara
I'm trying to clear the expired sessions which are set to be expired after 
the browser is closed but they don't seem to expire.

[image: code.PNG]
The output:
get_expire_at_browser_close: True
All sessions: (A QuerySet contains all the sessions including the ones that 
are changed after the browser is closed)

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from 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/81594e21-bfb2-4c1b-aa10-0243d6e812c2n%40googlegroups.com.


Re: Looking to join a team in a Django Project to gain Experience

2020-09-22 Thread Hamza Mirchi
interested

On Tue, Sep 22, 2020 at 5:39 AM ahmed.he...@gmail.com <
ahmed.heshamel...@gmail.com> wrote:

> Hi all,
>
> I am looking for a team of developers to join them in a project to enhance
> my skills and add to my portfolio.  I am available part time.
>
> 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/6e15411d-b25d-40c8-a987-e65da9b3c297n%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/CAM3bVN%3DGKTLVTAUNrmvgqF48RJuTU%3DMr8FuoBjptbCMvc7veJg%40mail.gmail.com.


Re: I need django project

2020-07-14 Thread Hamza Mirchi


On Tuesday, July 14, 2020 at 11:07:20 PM UTC+5, Hamza Mirchi wrote:
>
> Hi, I'm HamzaLachi
>
> I worked on Django, celery
>
> and also I developed an API in Django, I can also make your Django website 
> more secure
>
> I have also done some project
>
> I need some Django paid task or project
>
> contact:
> itshamzamir...@gmail.com
>

I need remote work
 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from 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/300f43fe-fe1e-4204-a491-99a03fe02d22o%40googlegroups.com.


I need django project

2020-07-14 Thread Hamza Mirchi
Hi, I'm HamzaLachi

I worked on Django, celery

and also I developed an API in Django, I can also make your Django website 
more secure

I have also done some project

I need some Django paid task or project

contact:
itshamzamir...@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/a154fccd-9b82-46c9-9e67-3d728c0a4663o%40googlegroups.com.


Re: Project Collaboration Team

2020-06-25 Thread Hamza Mirchi
interested

On Tuesday, June 23, 2020 at 8:20:37 AM UTC-4, Ali Murtuza wrote:
>
> I am intrested 
>
> On Tue, 23 Jun 2020 at 9:14 AM, Shubhanshu Arya  > wrote:
>
>> Hello Everyone, 
>> I want to make a team in which we will make some very good level projects 
>> together. These projects will be very helpful in our interview as well. 
>> Must have prior knowledge about Django/Python. We will do daily meetings 
>> and discuss our project and we will use Github to team collaborations . If 
>> someone is interested to join this team please email me on 
>> shubhans...@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...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/53b14968-ae6f-428a-be58-5edd290f2487o%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/8eec9a75-e76d-4899-93ab-9672645befcfo%40googlegroups.com.


How Can i integerate 2checkout with django / python3

2020-06-25 Thread Hamza Mirchi
How Can i integerate 2checkout with django / python3

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from 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/760c0d3b-2ddd-464c-8446-ac7a5630e6c0o%40googlegroups.com.


Re: Django Package Website is not opening

2020-05-05 Thread Hamza Mirchi
Hi Mike!

What is the issue here

sometimes it opened and sometimes it's not opening

I'm from pakistan

Thanks

On Monday, May 4, 2020 at 4:31:49 AM UTC-4, Mike Dewhirst wrote:
>
> On 4/05/2020 6:21 pm, Mike Dewhirst wrote: 
> > On 4/05/2020 6:14 pm, Hamza Mirchi wrote: 
> >> Hi Everyone, 
> >> 
> >> Please Fix This issue 
> >> 
> >> This website is not opening 
> >> https://djangopackages.org/ 
> >> I need to check packages for my Django app but it's not opening 
> >> please fix that 
> > 
> > Works for me 
>
> Further to that, it might not be working depending on your geographic 
> location. See ... 
>
> https://robertheaton.com/2020/04/27/how-does-a-tcp-reset-attack-work/ 
>
> As it happens I'm in Australia and one of my projects does a bit of web 
> scraping looking for specific data. It works perfectly when running on 
> my dev or staging server here. However, on the production server running 
> on a DigitalOcean droplet in Singapore, there are certain sites in 
> Europe which cannot be reached. 
>
> It is definitely not the software so I'm left with a puzzle. I suspect 
> the internet or the web is being interfered with as per the great 
> firewall of China. I don't know whether the interference is European or 
> Singaporean but it is definitely there. 
>
> Cheers 
>
> Mike 
>
> > 
> >> -- 
> >> You received this message because you are subscribed to the Google 
> >> Groups "Django users" group. 
> >> To unsubscribe from this group and stop receiving emails from it, 
> >> send an email to django...@googlegroups.com  
> >> <mailto:django-users+unsubscr...@googlegroups.com >. 
> >> To view this discussion on the web visit 
> >> 
> https://groups.google.com/d/msgid/django-users/5b84cacf-b1ef-43b2-aaf3-e4320e33ceff%40googlegroups.com
>  
> >> <
> https://groups.google.com/d/msgid/django-users/5b84cacf-b1ef-43b2-aaf3-e4320e33ceff%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/3a847d76-1e69-486c-bb80-9a861c17259b%40googlegroups.com.


Re: Django Package Website is not opening

2020-05-04 Thread Hamza Mirchi
If I use VPN it works but without VPN it's not working

On Monday, May 4, 2020 at 4:22:37 AM UTC-4, Mike Dewhirst wrote:
>
> On 4/05/2020 6:14 pm, Hamza Mirchi wrote: 
> > Hi Everyone, 
> > 
> > Please Fix This issue 
> > 
> > This website is not opening 
> > https://djangopackages.org/ 
> > I need to check packages for my Django app but it's not opening please 
> > fix that 
>
> Works for me 
>
> > -- 
> > You received this message because you are subscribed to the Google 
> > Groups "Django users" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> > an email to django...@googlegroups.com  
> > <mailto:django-users+unsubscr...@googlegroups.com >. 
> > To view this discussion on the web visit 
> > 
> https://groups.google.com/d/msgid/django-users/5b84cacf-b1ef-43b2-aaf3-e4320e33ceff%40googlegroups.com
>  
> > <
> https://groups.google.com/d/msgid/django-users/5b84cacf-b1ef-43b2-aaf3-e4320e33ceff%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/9b0de8f3-6be6-4704-ac76-61588ba9b24c%40googlegroups.com.


Django Package Website is not opening

2020-05-04 Thread Hamza Mirchi
Hi Everyone,

Please Fix This issue

This website is not opening
https://djangopackages.org/
I need to check packages for my Django app but it's not opening please fix 
that

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from 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/5b84cacf-b1ef-43b2-aaf3-e4320e33ceff%40googlegroups.com.


Re: ValueError: The database backend does not accept 0 as a value for AutoField.

2020-04-06 Thread Hamza Mirchi
How Can I Fix That Via Django?

On Mon, Apr 6, 2020 at 10:16 AM Simon Charette  wrote:

> Hello there,
>
> By default MySQL interprets providing 0 for an AUTO_INCREMENT PRIMARY KEY
> as NULL which defaults to increment the field.
>
> CREATE TABLE foo (id int auto_increment primary key);
> INSERT INTO foo (id) VALUES(0);
> INSERT INTO foo (id) VALUES(0);
> SELECT * FROM foo;
> ++
> | id |
> ++
> | 1  |
> | 2  |
> ++
>
> This ORM level check is to prevent you from shooting yourself in the foot
> by expecting that providing a zero will assign this value.
>
> Cheers,
> Simon
>
> Le lundi 6 avril 2020 09:35:22 UTC-4, Hamza Mirchi a écrit :
>>
>> Hi Everyone,
>>
>> I'm Saving My Mail Model but i can't but i get that error again and again
>>
>> This is my model:
>>
>> class Mail(models.Model):
>>  choices = (('Valid','Valid'),('InValid','InValid'),('Unknown','Unknown'
>> ),('Extracted','Extracted',))
>>  providers = (('Gmail','Gmail'),('Yahoo','Yahoo'),('Hotmail','Hotmail'),(
>> 'Outlook','Outlook'),('Live','Live'),('Aol','Aol'),('Protonmail',
>> 'Protonmail'),('Other','Other'),)
>>  user = models.ForeignKey(User,on_delete=models.CASCADE,blank=True,null=
>> True)
>>  email = models.EmailField(blank=False,null=False)
>>  status = models.CharField(max_length=100,choices=choices)
>>  type = models.CharField(max_length=100,choices=providers)
>>
>>
>>  def __str__(self):
>>  return self.email
>>
>>
>>
>> This is my Code:
>>
>> mail = Mail.objects.create(user=request.user,email=str(g),status='Valid',
>> type='Gmail')
>> mail.save()
>>
>>
>> Here is The Error:
>>
>>
>> Traceback (most recent call last):
>>   File "/usr/lib/python3.7/multiprocessing/process.py", line 297, in
>> _bootstrap
>> self.run()
>>   File "/usr/lib/python3.7/multiprocessing/process.py", line 99, in run
>> self._target(*self._args, **self._kwargs)
>>   File "/media/lenovo/Local
>> Disk/Learning/Scripts/Django/emailv3/src/validator/views.py", line 703,
>> in g6
>> mail.save()
>>   File
>> "/home/lenovo/.local/lib/python3.7/site-packages/django/db/models/base.py"
>> , line 746, in save
>> force_update=force_update, update_fields=update_fields)
>>   File
>> "/home/lenovo/.local/lib/python3.7/site-packages/django/db/models/base.py"
>> , line 784, in save_base
>> force_update, using, update_fields,
>>   File
>> "/home/lenovo/.local/lib/python3.7/site-packages/django/db/models/base.py"
>> , line 887, in _save_table
>> results = self._do_insert(cls._base_manager, using, fields,
>> returning_fields, raw)
>>   File
>> "/home/lenovo/.local/lib/python3.7/site-packages/django/db/models/base.py"
>> , line 926, in _do_insert
>> using=using, raw=raw,
>>   File
>> "/home/lenovo/.local/lib/python3.7/site-packages/django/db/models/manager.py"
>> , line 82, in manager_method
>> return getattr(self.get_queryset(), name)(*args, **kwargs)
>>   File
>> "/home/lenovo/.local/lib/python3.7/site-packages/django/db/models/query.py"
>> , line 1204, in _insert
>> return query.get_compiler(using=using).execute_sql(returning_fields)
>>   File
>> "/home/lenovo/.local/lib/python3.7/site-packages/django/db/models/sql/compiler.py"
>> , line 1390, in execute_sql
>> for sql, params in self.as_sql():
>>   File
>> "/home/lenovo/.local/lib/python3.7/site-packages/django/db/models/sql/compiler.py"
>> , line 1335, in as_sql
>> for obj in self.query.objs
>>   File
>> "/home/lenovo/.local/lib/python3.7/site-packages/django/db/models/sql/compiler.py"
>> , line 1335, in 
>> for obj in self.query.objs
>>   File
>> "/home/lenovo/.local/lib/python3.7/site-packages/django/db/models/sql/compiler.py"
>> , line 1334, in 
>> [self.prepare_value(field, self.pre_save_val(field, obj)) for field
>> in fields]
>>   File
>> "/home/lenovo/.local/lib/python3.7/site-packages/django/db/models/sql/compiler.py"
>> , line 1275, in prepare_value
>> value = field.get_db_prep_save(value, connection=self.connection)
>>   File
>> "/home/lenovo/.local/lib/python3.7/site-packages/django/db/models/fields/__init__.py"
>> , line 821, in get_db_prep_save
>> return self.get_db_prep_value(value, connection=connection, prepared=
>> False)
>>   File
>> "/ho

OperationalError:no such table

2017-05-07 Thread hamza bouissi


after I add new model and delete all  other models and their migration 
files I ran makemigrations followed by migrate command, Unfortunately, I 
got OperationalError: no such table






-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/07639bc2-df9e-487e-9fdd-5cc2c98bc44d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


connect Django to MySQL and i get this error

2017-03-11 Thread gaieb hamza
Unhandled exception in thread started by .wrapper at 0x7f0047a0c510>
Traceback (most recent call last):
  File 
"/home/whomi/demo/lib/python3.5/site-packages/django/db/backends/mysql/base.py",
 
line 24, in 
import MySQLdb as Database
ImportError: No module named 'MySQLdb'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File 
"/home/whomi/demo/lib/python3.5/site-packages/django/utils/autoreload.py", 
line 229, in wrapper
fn(*args, **kwargs)
  File 
"/home/whomi/demo/lib/python3.5/site-packages/django/core/management/commands/runserver.py",
 
line 107, in inner_run
autoreload.raise_last_exception()
  File 
"/home/whomi/demo/lib/python3.5/site-packages/django/utils/autoreload.py", 
line 252, in raise_last_exception
six.reraise(*_exception)
  File "/home/whomi/demo/lib/python3.5/site-packages/django/utils/six.py", 
line 685, in reraise
raise value.with_traceback(tb)
  File 
"/home/whomi/demo/lib/python3.5/site-packages/django/utils/autoreload.py", 
line 229, in wrapper
fn(*args, **kwargs)
  File "/home/whomi/demo/lib/python3.5/site-packages/django/__init__.py", 
line 18, in setup
apps.populate(settings.INSTALLED_APPS)
  File 
"/home/whomi/demo/lib/python3.5/site-packages/django/apps/registry.py", 
line 108, in populate
app_config.import_models(all_models)
  File 
"/home/whomi/demo/lib/python3.5/site-packages/django/apps/config.py", line 
198, in import_models
self.models_module = import_module(models_module_name)
  File "/home/whomi/demo/lib/python3.5/importlib/__init__.py", line 126, in 
import_module
return _bootstrap._gcd_import(name[level:], package, level)
  File "", line 986, in _gcd_import
  File "", line 969, in _find_and_load
  File "", line 958, in _find_and_load_unlocked
  File "", line 673, in _load_unlocked
  File "", line 665, in exec_module
  File "", line 222, in 
_call_with_frames_removed
  File 
"/home/whomi/demo/lib/python3.5/site-packages/django/contrib/auth/models.py", 
line 41, in 
class Permission(models.Model):
  File 
"/home/whomi/demo/lib/python3.5/site-packages/django/db/models/base.py", 
line 139, in __new__
new_class.add_to_class('_meta', Options(meta, **kwargs))
  File 
"/home/whomi/demo/lib/python3.5/site-packages/django/db/models/base.py", 
line 324, in add_to_class
value.contribute_to_class(cls, name)
  File 
"/home/whomi/demo/lib/python3.5/site-packages/django/db/models/options.py", 
line 250, in contribute_to_class
self.db_table = truncate_name(self.db_table, 
connection.ops.max_name_length())
  File 
"/home/whomi/demo/lib/python3.5/site-packages/django/db/__init__.py", line 
36, in __getattr__
return getattr(connections[DEFAULT_DB_ALIAS], item)
  File "/home/whomi/demo/lib/python3.5/site-packages/django/db/utils.py", 
line 241, in __getitem__
backend = load_backend(db['ENGINE'])
  File "/home/whomi/demo/lib/python3.5/site-packages/django/db/utils.py", 
line 112, in load_backend
return import_module('%s.base' % backend_name)
  File "/home/whomi/demo/lib/python3.5/importlib/__init__.py", line 126, in 
import_module
return _bootstrap._gcd_import(name[level:], package, level)
  File "", line 986, in _gcd_import
  File "", line 969, in _find_and_load
  File "", line 958, in _find_and_load_unlocked
  File "", line 673, in _load_unlocked
  File "", line 665, in exec_module
  File "", line 222, in 
_call_with_frames_removed
  File 
"/home/whomi/demo/lib/python3.5/site-packages/django/db/backends/mysql/base.py",
 
line 27, in 
raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: 
No module named 'MySQLdb'

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a671d32c-47d5-40ed-816a-d94425f7e905%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Any solution as DjangoKit but for windows ?!

2009-08-10 Thread Hamza

Hello ,
i have been searching for a week now about a solution making it easy
to deploy django projects as desktop application , somehow i found
some detailed articles and tutorials ( 3 ) for making this happen for
windows , but with DjangoKit its pretty much easier and simpler , the
question is as in this message subject , any solution like DjangoKit
but for windows ?!

I came cross dbuilder.py  http://www.methods.co.nz/django/dbuilder.html
but somehow , no much details or tutorials more than the manual ! .
Also i tried to check the blogs stream and check if anyone tried it
before and no luck so far .

The other question : is there any other successful tryout for
deploying django projects on windows other than silverstripe`s  ?!
with tutorials explanation if possible ?!

Best regards :
H M
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Admin Customisations

2009-07-25 Thread Hamza

That is the answer to my Question , Thank you both :)



On Jul 24, 10:56 am, Daniel Roseman  wrote:
> On Jul 24, 8:27 am, StevenC  wrote:
>
>
>
> > Hey,
>
> > Im new to Django and have create an online application system.
>
> > I need to know is it possible to customise the List Display and have a
> > customn link next to EVERY entry which points to a nother URL with its
> > ID within.
>
> > For example,
>
> > If i have a student application. Their ID being 1. I need a link next
> > to it which points to ../application/1/
>
> > Does anyone have any ideas?
>
> > Cheers
>
> Sure. Just create a custom method on your ModelAdmin subclass which
> returns the HTML of the link you want.
>
>     class MyAdmin(admin.ModelAdmin):
>         list_display = ('name', 'my_link')
>         class Meta:
>              model = MyModel
>
>         def my_link(self, obj):
>             return 'My Link' % obj.id
>         my_link.allow_tags = True
>
> --
> DR.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Djang-admin : Display link to object info page instead of edit form , in records change list ?

2009-07-23 Thread Hamza

Hello ,

I am customizing Django-admin for an application am working on . so
far the customization is working file , added some views . but I am
wondering how to change the records link in change_list display to
display an info page instead of change form ?!

in this blog post :http://www.theotherblog.com/Articles/2009/06/02/
extending-the-django-admin-interface/ Tom said :

" You can add images or links in the listings view by defining a
function then adding my_func.allow_tags = True "


which i didn't fully understand !!

right now i have  profile function , which i need when i click on a
member in the records list i can display it ( or adding another button
called - Profile - ) , also how to add link for every member ( Edit :
redirect me to edit form for this member ) .

How i can achieve  that ?!

Regards





--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Django-admin {{ root_path }} problem !

2009-07-22 Thread Hamza

Hello ,

i have an issue in Django-Admin , when i click on logout and change
password , it add /admin/logout and /admin/change_password/ to the
current path as in http://localhost:8000/admin/posts/admin/logout/ and
does the same to password_change .

when trying to manually override this by adding /admin/logout/ and /
admin/password_change/ it redirect to /admin/password_change/admin/
password_change/done/

How can i fix this issue ?!

am using django RC 1.1 !

Regards
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Images dose not upload , unless it the admin !

2009-04-01 Thread Hamza

got it fixed it mins ago , Thanks Alex ,
( I need to slp 38 hours so far )

On Apr 2, 7:49 am, Alex Gaynor <alex.gay...@gmail.com> wrote:
> On Thu, Apr 2, 2009 at 1:38 AM, Hamza <dr.hamzam...@gmail.com> wrote:
>
> > Hello
>
> > am having a problem in uploading images , which i set ImageField to
> > upload the image to /Photo/ directory , however it works , and
> > uploaded the photos as expected , but now its not working : and
> > display a message :
> > This field is required.  ,
> > when i submit a photo in it , it repeat the message as nothing
> > submitted !!
>
> > Though as i go to the admin , i notice the submitted item there
> > without a photo , so i submit the Photo with the admin form and its
> > working perfectly !!!
>
> > i don't know exactly what is wrong , which display this error :
>
> > " Caught an exception while rendering: The  +attribute has no file
> > associated with it. "
>
> > Any help !
>
> > Regards
>
> Are you properly setting the enctype on the HTML form and passing
> request.FILES to the form object?
>
> Alex
>
> --
> "I disapprove of what you say, but I will defend to the death your right to
> say it." --Voltaire
> "The people's good is the highest law."--Cicero
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Images dose not upload , unless it the admin !

2009-04-01 Thread Hamza

Hello

am having a problem in uploading images , which i set ImageField to
upload the image to /Photo/ directory , however it works , and
uploaded the photos as expected , but now its not working : and
display a message :
This field is required.  ,
when i submit a photo in it , it repeat the message as nothing
submitted !!

Though as i go to the admin , i notice the submitted item there
without a photo , so i submit the Photo with the admin form and its
working perfectly !!!

i don't know exactly what is wrong , which display this error :

" Caught an exception while rendering: The  +attribute has no file
associated with it. "

Any help !

Regards


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Auto-populate fields in django?

2009-03-31 Thread Hamza

Thanks alot , i already figured out the user one
using  "request.user"  , at the view function .

Thanks alot for the recent article .

I just know the default datetime value , thank you .



On Mar 31, 4:58 am, Andy Mckay <a...@clearwind.ca> wrote:
> Try this more recent one:
>
> http://www.b-list.org/weblog/2008/dec/24/admin/
>
> On 30-Mar-09, at 7:29 PM, Dr.Hamza Mousa wrote:
>
> > Hello , am wondering , how to auto-populate fields as ( User field ,  
> > and current datetime filed ) , i follow up those tips , and created  
> > a custom manager / and manipulator  
> > http://www.b-list.org/weblog/2006/nov/02/django-tips-auto-populated-f...
> >  , though am wondering if there is another way around !!!
>
> > --
> > Hamza
>
> --
>    Andy McKay
>    Clearwind Consulting:www.clearwind.ca
>    Blog:www.agmweb.ca/blog/andy
>    Twitter: twitter.com/clearwind
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Generic View for create , update and delete !

2009-03-28 Thread Hamza

Hello ,

am trying to use Generic view instead of using the old view way ,
however am a django newbie , i tried several tutorials , documentation
and non seems works with me yet . can anyone point me an example
( full working good example )  of using generic view 

Regards

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---