RE: connect to mongodb

2020-05-21 Thread Vishesh Mangla
NoSQL databases vs SQL databases. What to choose? MongoDB is a NoSQL database. Features include fast searching but slow insertion deletion operations upto what I remember. You can google on “what to choose between SQL and NoSQL databases”. It depends on what kind of operations the system would be most frequently doing.Otherwise  visit https://django-mongodb-engine.readthedocs.io/en/latest/Sent from Mail for Windows 10 From: saifullah khanSent: 22 May 2020 02:34To: Django usersSubject: connect to mongodb how can integrate mongodb with django. And is it a good idea?-- You received this message because you are subscribed to the Google Groups "Django users" group.To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com.To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/77b2d9de-ef7d-4874-a0ee-a77bf450a0dd%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/5ec76727.1c69fb81.aa6cf.cfe8%40mx.google.com.


Re: Template Variations title not showing

2020-05-21 Thread oldtimer
Hello,

i was able to get the variant to show on the product page with using a form.

I cannot get the variants to display in the cart.

Only difference is my Variation model is a ManyToManyField to the item. I 
have also changed my variant options to numbers as the dict was expecting 
an integer and not a string, that is why mine shows 0 not size.

Hope this helps, maybe you can help me get the next peice.

thanks 

{% if item.variation_set.sizes %}

{% for item in item.variation_set.sizes %}

Select Size
{{ item.name }}
{% endfor %}

{% endif %}

On Tuesday, May 5, 2020 at 5:12:15 PM UTC-6, Ahmed Khairy wrote:
>
> Hello all,
>
> I have made a variation to an Item class in models.py and I think i got 
> the template syntax right but apparently there are something wrong which i 
> can't figure it out
>
> Here is the model
>
> class Item(models.Model):
> title = models.CharField(max_length=100)
> description = models.TextField()
> price = models.FloatField()
> slug = models.SlugField(unique=True)
> image = models.ImageField(blank=False, upload_to='approved designs')
>
>
> def __str__(self):
> return self.title
>
> class Meta:
> unique_together = ('title', 'slug')
> class Variation(models.Model):
> item = models.ForeignKey(Item, on_delete=models.CASCADE)
> title = models.CharField(max_length=120)
> image = models.ImageField(null=True, blank=True)
> price = models.FloatField(null=True, blank=True)
>
> def __str__(self):
> return self.title
>
> and here is the template
>
> {% if item.variation_set.all %}
> 
> {% for items in item.variation_set.all %}
>  value='{item.variation|lower}'>{{title.title|capfirst}}
> {% endfor %}
> 
> {% endif %}
>
>

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


Re: connect to mongodb

2020-05-21 Thread saifullah khan
ok thanks


On Fri, 22 May 2020 at 02:13, Vishesh Mangla 
wrote:

> NoSQL databases vs SQL databases. What to choose? MongoDB is a NoSQL
> database. Features include fast searching but slow insertion deletion
> operations upto what I remember. You can google on “what to choose between
> SQL and NoSQL databases”. It depends on what kind of operations the system
> would be most frequently doing.
>
> Otherwise  visit https://django-mongodb-engine.readthedocs.io/en/latest/
>
> Sent from Mail  for
> Windows 10
>
>
>
> *From: *saifullah khan 
> *Sent: *22 May 2020 02:34
> *To: *Django users 
> *Subject: *connect to mongodb
>
>
>
> how can integrate mongodb with django. And is it a good idea?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/77b2d9de-ef7d-4874-a0ee-a77bf450a0dd%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/5ec6eede.1c69fb81.8377.8ce9%40mx.google.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/CAO2ac0CCEM75XCUB2yHde1xGUNGfVXDqyUjbr_ZCN9mCxvXK5A%40mail.gmail.com.


RE: connect to mongodb

2020-05-21 Thread Vishesh Mangla
NoSQL databases vs SQL databases. What to choose? MongoDB is a NoSQL database. Features include fast searching but slow insertion deletion operations upto what I remember. You can google on “what to choose between SQL and NoSQL databases”. It depends on what kind of operations the system would be most frequently doing.Otherwise  visit https://django-mongodb-engine.readthedocs.io/en/latest/Sent from Mail for Windows 10 From: saifullah khanSent: 22 May 2020 02:34To: Django usersSubject: connect to mongodb how can integrate mongodb with django. And is it a good idea?-- You received this message because you are subscribed to the Google Groups "Django users" group.To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com.To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/77b2d9de-ef7d-4874-a0ee-a77bf450a0dd%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/5ec6eede.1c69fb81.8377.8ce9%40mx.google.com.


connect to mongodb

2020-05-21 Thread saifullah khan
how can integrate mongodb with django. And is it a good idea?

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


Re: Please help me out?

2020-05-21 Thread o1bigtenor
On Thu, May 21, 2020 at 2:10 PM Kasper Laudrup  wrote:
>
> Hi Meera,
>
> On 21/05/2020 14.50, meera gangani wrote:
> > Actually my Problem is that i want to mark the attendance of all the
> > employee using ip address referenced to the mac address
> > So First I turned ip into whitelisting ip(Trusted IP Addresses )
> > then what was the implementation I do?
> >
>
> It is not very clear what you are trying to achieve. What do mean by
> "mark the attendance of all the employee"?
>
> Anyway, you shouldn't attempt to trust any client based on IP address.
> That is trivial to spoof and there really isn't any way around that
> because of how HTTP works.
>
> I don't understand what you mean by "ip address referenced to the mac
> address" either. Are you talking about the ARP cache on the host running
> Django? Do you want to do ARP lookups on the local network? Why?
>
> Please be more clear on what your problem is and what exactly you want
> to achieve.
>

My guess () is that someone wants to take attendance without
physically being
in a location. The idea is to use the presence of a 'stupid' phone to mark the
physical location of its bearer. (Just imo.)

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/CAPpdf5_2sG-9FZG0jvaHd9ydp0yakbjuTGQntqpSYmXQ4LpPmQ%40mail.gmail.com.


Re: Please help me out?

2020-05-21 Thread Kasper Laudrup

Hi Meera,

On 21/05/2020 14.50, meera gangani wrote:
Actually my Problem is that i want to mark the attendance of all the 
employee using ip address referenced to the mac address

So First I turned ip into whitelisting ip(Trusted IP Addresses )
then what was the implementation I do?



It is not very clear what you are trying to achieve. What do mean by 
"mark the attendance of all the employee"?


Anyway, you shouldn't attempt to trust any client based on IP address. 
That is trivial to spoof and there really isn't any way around that 
because of how HTTP works.


I don't understand what you mean by "ip address referenced to the mac 
address" either. Are you talking about the ARP cache on the host running 
Django? Do you want to do ARP lookups on the local network? Why?


Please be more clear on what your problem is and what exactly you want 
to achieve.


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/8bfea02f-668d-1294-0dd0-fec79358ad01%40stacktrace.dk.


Re: help on jwt

2020-05-21 Thread Chetan Ganji
If you post the error, someone can help you better.

Did you look into authentication_classes variable of the endpoint ???

Regards,
Chetan Ganji
+91-900-483-4183
ganji.che...@gmail.com
http://ryucoder.in


On Thu, May 21, 2020 at 6:48 PM ola neat  wrote:

> halo, i'm working on implementing JWT for user registration but i'm having
> issue with that, when i make post request for signup, i get an
> authentication  detail no provided err, below is my code, hope anyone can
> help out
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAHLKn73JY3zZFQbAir-t5As%3D5VUm0Sn-AC3CqAeoPqXQ%3Dp4_zA%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/CAMKMUjvpN%3D8BuduhuGoVkE9Sikw4Xagqo8h8HeKFJQgRcOQxTg%40mail.gmail.com.


Re: HOW TO PROTECT SOURCE CODE DEPLOYED TO A REMOTE SERVER

2020-05-21 Thread Derek
No; a container is not going to hep with this - see:
https://stackoverflow.com/questions/51574618/preventing-access-to-code-inside-of-a-docker-container
(they specifically mention Python in the answer).

On Wednesday, 20 May 2020 17:20:24 UTC+2, James Shen wrote:
>
> try to deploy using a container technology like a docker , only expose 
> port 80, and keep the login to SSH to yourself.
>
> On Wed, May 20, 2020 at 4:54 PM John McClain  > wrote:
>
>> Hello Sunday,
>>
>> I wonder if you could deploy to git and use one of the licenses there to 
>> protect the code. I think they would be bound by the use the license 
>> permits. Have you looked at this as a possibility?
>>
>> John
>>
>> On Tue, 19 May 2020 at 02:35, Sunday Iyanu Ajayi > > wrote:
>>
>>> I get your point but my solution is kind of a  SaaS Application. the 
>>> client wants to host it on his controlled server  and if they get the 
>>> source code, they can replicate, modify and maybe sell it.  Is there a way 
>>> to host the compiled file or lock the directory to the project.
>>> *AJAYI Sunday *
>>> (+234) 806 771 5394
>>> *sunne...@gmail.com *
>>>
>>>
>>>
>>> On Mon, May 18, 2020 at 9:28 PM Jim Armstrong >> > wrote:
>>>
 When I work on client projects, I deploy to a test server that is under 
 my control. Once the project is complete and they have paid the invoice, I 
 deploy to the production server under their control. At that point, I 
 don't 
 care if they have access to the code - my contracts give the clients all 
 rights to the project code upon completion of the project.


 On Friday, May 15, 2020 at 9:22:33 AM UTC-4, Sunday Iyanu Ajayi wrote:
>
> I am working for a client that wants to deploy a project I am working 
> on in a remote server and I will like to project my source code when 
> deployed so that they will not be able to mess with it. 
>
> How can  I  go about it please? 
>
> *AJAYI Sunday *
> (+234) 806 771 5394
> *sunne...@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/636f0636-30df-4ce2-8629-2be8b208ec37%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...@googlegroups.com .
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/django-users/CAKYSAw3Hqjuz5rD_AsZ5Wa%2B3WBzQ9LN0GzZKHx3D-irztJ1G0A%40mail.gmail.com
>>>  
>>> 
>>> .
>>>
>>
>>
>> -- 
>> John McClain
>>
>> Cell: 085-1977-823
>> Skype: jmcclain0129
>> Email: jmccla...@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/CAN-hv_pbGUu7Qjm%2BZO7fOmT2H1W2C8Xy%2BhTk_6_BQcUcwc-XbA%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/9481e5de-a399-41c9-94e0-a3f1daecf25b%40googlegroups.com.


Re: TypeError: __init__() got an unexpected keyword argument 'Null'

2020-05-21 Thread Samsul Islam
null=True

On Thursday, May 21, 2020 at 6:27:10 AM UTC+6, jlgimeno71 wrote:
>
> Similar to keys in a dictionary, keyword argument names are case 
> sensitive.  Try to pass in the lowercase version 'null':
>
> Raison_Non_Delivery_cd = models.ForeignKey(Raison, 
> on_delete=models.CASCADE, related_name='raisonNonDelivery', null=True)
>
> -Jorge
>
> On Wed, May 20, 2020 at 5:05 PM hajar > 
> wrote:
>
>> hello django users , I hope u r doing well ! 
>>
>>
>> why can't I use Null in this case of foreign key , I hope you can see the 
>> picture below that's my class and the error 
>>
>>
>>
>> [image: err.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...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/ce736614-3ff9-47fa-885d-3f5b87160291%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/9040381d-458f-409d-acf5-208f5a78939e%40googlegroups.com.


Re: How to Insert Foreign Key into my user model with Abstractbaseuser

2020-05-21 Thread meera gangani
You Can Try this one

 user = models.ForeignKey(User, on_delete=models.CASCADE)


On Thu, May 21, 2020 at 5:41 PM 박지훈  wrote:

> class User(AbstractBaseUser):
>password = models.CharField(max_length=128)
>username = models.CharField(unique=True, max_length=150)
>is_superuser = models.IntegerField()
>last_name = models.CharField(max_length=150)
>phone = models.CharField(max_length=20)
>email = models.CharField(max_length=254)
>date_of_birth = models.DateTimeField()
>date_joined = models.DateTimeField()
>last_login = models.DateTimeField(blank=True, null=True)
>is_staff = models.IntegerField(blank=True, null=True)
>is_active = models.IntegerField(blank=True, null=True)
>first_name = models.CharField(max_length=30, blank=True, null=True)
>
>
>objects = UserManager()
>
>USERNAME_FIELD = 'username'
>REQUIRED_FIELDS = ['last_name', 'phone', 'email', 'date_of_birth']
>
>def has_perm(self, perm, obj=None):
>   return True
>
>def has_module_perms(self, app_label):
>   return True
>
>class Meta:
>   db_table = 'auth_user'
>
>
> *This is my user model in app.models.py  *
>
>
> *I want to add foreign key into Class User. but i can`t ...*
>
>
> *please help 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-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/8389b104-c5f0-4936-b8ea-0ec9a82a5460%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/CANaPPPJciGr2R%2BMDHxcg%3DKfU1RT%3D%3DEnAGGtb759EEkz-W4fVjg%40mail.gmail.com.


Re: Please help me out?

2020-05-21 Thread meera gangani
I am sorry for my behaviour actually i am not understood the message
properly. So That's why
Actually my Problem is that i want to mark the attendance of all the
employee using ip address referenced to the mac address
So First I turned ip into whitelisting ip(Trusted IP Addresses )
then what was the implementation I do?

Thanking You In Advance

On Thu, May 21, 2020 at 5:41 PM Anuroop Pendela 
wrote:

> By default there would be ip address in the request object. But the ip is
> network ip. In the case where If multiple employees connect to same network
> and mark attendance then you will see duplicate ip address entries for
> different employees. For unique and authenticity of attendance you might
> need to go for location based solution which is easy capturing from mobile
> or browser.
>
> On Thu 21 May, 2020, 10:39 AM meera gangani, 
> wrote:
>
>> I want to mark the attendance of employee using ip address or any other
>> way
>> can you please help me out of the situation?
>>
>> Thanking You,
>> Meera.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CANaPPPJY3JypYQaWbbx%3DNQe6SyUghvXXRRF4SK3iER0N0wa0OQ%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/CANJhOQ584EHKjhqpcKiKd1X%3Dgh_Gs9QJy%3DW5F79JsKFiuoh6mw%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/CANaPPPJotofLrWnr98DEbekkTGE_D8UR0pB1o4jMKBZOz%3D8qww%40mail.gmail.com.


No module named 'allauth.socialaccount.providers.keycloak'

2020-05-21 Thread 'Arno Franken' via Django users
Hello,

I have a Django app that uses Allauth (Signin through Office365 account). 
That works all fine. Now I wanted to test with the Keycloak provider, but 
for some reason it says: "ModuleNotFoundError: No module named 
'allauth.socialaccount.providers.keycloak'" It is very strange, it seems 
that the keycloak provider is not availbale in the allauth package version 
0.41.0, although it should be present according to the docs: 
https://django-allauth.readthedocs.io/en/latest/installation.html

*FULL ERROR TRACE*

File 
"/Users/arnofranken/CyberCloud/venv/lib/python3.7/site-packages/django/apps/config.py",
 
line 118, in create
cls = getattr(mod, cls_name)
AttributeError: module 'allauth.socialaccount.providers' has no attribute 
'keycloak'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "manage.py", line 21, in 
main()
File "manage.py", line 17, in main
execute_from_command_line(sys.argv)
File 
"/Users/arnofranken/CyberCloud/venv/lib/python3.7/site-packages/django/core/management/__init__.py",
 
line 401, in execute_from_command_line
utility.execute()
File 
"/Users/arnofranken/CyberCloud/venv/lib/python3.7/site-packages/django/core/management/__init__.py",
 
line 377, in execute
django.setup()
File 
"/Users/arnofranken/CyberCloud/venv/lib/python3.7/site-packages/django/__init__.py",
 
line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File 
"/Users/arnofranken/CyberCloud/venv/lib/python3.7/site-packages/django/apps/registry.py",
 
line 91, in populate
app_config = AppConfig.create(entry)
File 
"/Users/arnofranken/CyberCloud/venv/lib/python3.7/site-packages/django/apps/config.py",
 
line 136, in create
import_module(entry)
File 
"/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/importlib/__init__.py",
 
line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1006, in _gcd_import
File "", line 983, in _find_and_load
File "", line 965, in _find_and_load_unlocked
ModuleNotFoundError: No module named 
'allauth.socialaccount.providers.keycloak'


*INSTALLED APPS*

INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.sites',
'django_extensions',
'rest_framework',
'sslserver',
'allauth',
'allauth.account',
'allauth.socialaccount',
'allauth.socialaccount.providers.microsoft',
'allauth.socialaccount.providers.keycloak',
'portal.apps.PortalConfig',
'api.apps.ApiConfig',
'drf_yasg',
]


*REQUIREMENTS.TXT*

wheel>=0.34.2
iso3166>=1.0.1
Django>=3.0.6
psycopg2-binary>=2.8.5
django-allauth>=0.41.0
djangorestframework>=3.11.0
django-extensions>=2.2.9
django-sslserver>=0.22
drf-yasg>=1.17.1

*VIRTUAL ENVIRONMENT *

Within my project, I use a virtual environment. Packages have been 
installed through:

python3 -m pip install -r requirements.txt

*TREE*

*├── README.md*
*├── api*
*│   ├── __init__.py*
*│   ├── __pycache__*
*│   ├── admin.py*
*│   ├── apps.py*
*│   ├── migrations*
*│   ├── models.py*
*│   ├── serializers.py*
*│   ├── tests.py*
*│   ├── urls.py*
*│   └── views.py*
*├── azure-pipelines.yml*
*├── db.sqlite3*
*├── manage.py*
*├── portal*
*│   ├── __init__.py*
*│   ├── __pycache__*
*│   ├── admin.py*
*│   ├── apps.py*
*│   ├── migrations*
*│   ├── models.py*
*│   ├── static*
*│   ├── templates*
*│   ├── tests.py*
*│   ├── urls.py*
*│   └── views.py*
*├── project*
*│   ├── __init__.py*
*│   ├── __pycache__*
*│   ├── asgi.py*
*│   ├── settings.py*
*│   ├── urls.py*
*│   └── wsgi.py*
*├── requirements.txt*
*├── startup.txt*
*├── static*
*│   ├── admin*
*│   ├── css*
*│   ├── django_extensions*
*│   ├── fonts*
*│   ├── img*
*│   ├── js*
*│   ├── login*
*│   ├── partners*
*│   ├── rest_framework*
*│   └── vendors*
*├── staticfiles*
*│   ├── admin*
*│   ├── css*
*│   ├── django_extensions*
*│   ├── drf-yasg*
*│   ├── fonts*
*│   ├── img*
*│   ├── js*
*│   ├── login*
*│   ├── partners*
*│   ├── rest_framework*
*│   └── vendors*
*├── templates*
*│   ├── account*
*│   ├── home*
*│   ├── html*
*│   ├── openid*
*│   ├── rest_framework*
*│   └── socialaccount*
*└── venv*
*├── bin*
*├── include*
*├── lib*
*└── pyvenv.cfg*


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


How to Insert Foreign Key into my user model with Abstractbaseuser

2020-05-21 Thread 박지훈


class User(AbstractBaseUser):
   password = models.CharField(max_length=128)
   username = models.CharField(unique=True, max_length=150)
   is_superuser = models.IntegerField()
   last_name = models.CharField(max_length=150)
   phone = models.CharField(max_length=20)
   email = models.CharField(max_length=254)
   date_of_birth = models.DateTimeField()
   date_joined = models.DateTimeField()
   last_login = models.DateTimeField(blank=True, null=True)
   is_staff = models.IntegerField(blank=True, null=True)
   is_active = models.IntegerField(blank=True, null=True)
   first_name = models.CharField(max_length=30, blank=True, null=True)

   
   objects = UserManager()

   USERNAME_FIELD = 'username'
   REQUIRED_FIELDS = ['last_name', 'phone', 'email', 'date_of_birth']

   def has_perm(self, perm, obj=None):
  return True

   def has_module_perms(self, app_label):
  return True

   class Meta:
  db_table = 'auth_user'


*This is my user model in app.models.py *


*I want to add foreign key into Class User. but i can`t ...*


*please help 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-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/8389b104-c5f0-4936-b8ea-0ec9a82a5460%40googlegroups.com.


Re: Please help me out?

2020-05-21 Thread 'Arno Franken' via Django users
Plees Mera, respect the the recommendation of Vishesh as his answer is 
completely straight to me and you should be thankful. The point is, what is 
exactly your question? That's the point I do not understand, your question 
is really vague. To help you out:
- What have you already tried?
- What is your datamodel looking like?
- Etc.

Based on the answers on these questions, we can help you further.

Op donderdag 21 mei 2020 09:14:12 UTC+2 schreef meera gangani:
>
> What is the point of these message!!!
>
>
> On Thu, May 21, 2020 at 10:53 AM Vishesh Mangla  > wrote:
>
>> You need to look at the “header” of the request object for those details.
>>
>>  
>>
>> Sent from Mail  for 
>> Windows 10
>>
>>  
>>
>> *From: *meera gangani 
>> *Sent: *21 May 2020 10:39
>> *To: *django...@googlegroups.com 
>> *Subject: *Please help me out?
>>
>>  
>>
>> I want to mark the attendance of employee using ip address or any other 
>> way
>>
>> can you please help me out of the situation?
>>
>>  
>>
>> Thanking You,
>>
>> Meera.
>>
>> -- 
>> You received this message because you are 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/CANaPPPJY3JypYQaWbbx%3DNQe6SyUghvXXRRF4SK3iER0N0wa0OQ%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...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/5ec61042.1c69fb81.acd42.0c85%40mx.google.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/b8f7be57-fbb8-442a-8f0b-cd7f1abae4fa%40googlegroups.com.


Re: Please help me out?

2020-05-21 Thread Anuroop Pendela
By default there would be ip address in the request object. But the ip is
network ip. In the case where If multiple employees connect to same network
and mark attendance then you will see duplicate ip address entries for
different employees. For unique and authenticity of attendance you might
need to go for location based solution which is easy capturing from mobile
or browser.

On Thu 21 May, 2020, 10:39 AM meera gangani, 
wrote:

> I want to mark the attendance of employee using ip address or any other way
> can you please help me out of the situation?
>
> Thanking You,
> Meera.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CANaPPPJY3JypYQaWbbx%3DNQe6SyUghvXXRRF4SK3iER0N0wa0OQ%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/CANJhOQ584EHKjhqpcKiKd1X%3Dgh_Gs9QJy%3DW5F79JsKFiuoh6mw%40mail.gmail.com.


Re: Please help me out?

2020-05-21 Thread meera gangani
What is the point of these message!!!


On Thu, May 21, 2020 at 10:53 AM Vishesh Mangla 
wrote:

> You need to look at the “header” of the request object for those details.
>
>
>
> Sent from Mail  for
> Windows 10
>
>
>
> *From: *meera gangani 
> *Sent: *21 May 2020 10:39
> *To: *django-users@googlegroups.com
> *Subject: *Please help me out?
>
>
>
> I want to mark the attendance of employee using ip address or any other way
>
> can you please help me out of the situation?
>
>
>
> Thanking You,
>
> Meera.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CANaPPPJY3JypYQaWbbx%3DNQe6SyUghvXXRRF4SK3iER0N0wa0OQ%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/5ec61042.1c69fb81.acd42.0c85%40mx.google.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/CANaPPPLRgjjQzrS4d7UjM2v2c2dTAtNjTZfRAMK71rw%2B%3Dv9QNw%40mail.gmail.com.


Re: How to invoke Sub Form which have MULTIPLE OPTIONS to choose inside Django Form.

2020-05-21 Thread chaitanya orakala
wow... thanks Devansh. It was simple and easy to understand and no extra
hassle to add new language into the code.

On Thu, May 21, 2020 at 2:04 AM Devansh Chaubey 
wrote:

> Hey Chaitanya ,
> You can do something like this
> In the models.py
> CHOICES=[('Basic','Basic'), ('Standard','Standard'), ('Advanced',
> 'Advanced')] class Modelname(models.Model):
> pack=models.CharField(max_length=12,choices=CHOICES,blank=True) *Forms.py
> class Formname(forms.ModelForm): class *meta: * model=modelname
> fields=(pack,name,email) *
> widgets = { 'pack':forms.radioselect() }
>
>
>
>
> On Thu, 21 May 2020 at 11:19, chaitanya orakala 
> wrote:
>
>> Thank you for your response. I see some javascript inside the form. I am
>> not fully aware of it. is there any template which I can use in forms??
>>
>> On Thu, May 21, 2020 at 1:22 AM Vishesh Mangla 
>> wrote:
>>
>>> #template
>>>
>>> 
>>>   Volvo
>>>   Saab
>>>   Opel
>>>   Audi
>>> 
>>>
>>>
>>>
>>> 
>>>
>>> 
>>>
>>>
>>>
>>>
>>>
>>> 
>>>
>>> 
>>>
>>> 
>>>
>>> 
>>>
>>> 
>>>
>>> Document.querySelector(“select”).addEventListener(“change”,(ele)={
>>>
>>> If ele.target.textContent ==”Volvo”:
>>>
>>> ..
>>>
>>> Else if
>>>
>>> ...
>>>
>>> Else
>>>
>>> ...
>>>
>>> })
>>>
>>> 
>>>
>>>
>>>
>>> Otherwise just send a form to pick the user preference out of Basic,
>>> Standard, Advanced, get the request and based on the request’s attributes
>>> send a form back through redirect function.
>>>
>>> Sent from Mail  for
>>> Windows 10
>>>
>>>
>>>
>>> *From: *Sai 
>>> *Sent: *21 May 2020 10:00
>>> *To: *Django users 
>>> *Subject: *How to invoke Sub Form which have MULTIPLE OPTIONS to choose
>>> inside Django Form.
>>>
>>>
>>>
>>> Hi Everyone,
>>>
>>> I am pretty much familiar with Django Forms with models. I want to build
>>> a Submit Form which consists of attributes like UserName, Email, address
>>> field and 3 options to select the packages, for example, Basic, Standard,
>>> and Advanced.  I have gone through Django Docs but there is no such thing.
>>>
>>>
>>>
>>> Please let me know how to achieve this and open to ideas.
>>>
>>>
>>>
>>> Thank You 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/cb12fc88-0d5a-4ec4-a6d6-1272a0a69d9a%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/5ec6100b.1c69fb81.97f6e.083a%40mx.google.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/CAPcTzRaKzDosDCbUMR%3DHyM6bDEvk3VPmhEEcZ750Lho0uwrFjw%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/CANqZwQmvAk-ZW7U-s-c97PZmuQSmB1mnJ-LfFK8wZYqjg3DSiA%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/CAPcTzRY57XKdTQJiddo28oYTFxMdHqHdRuLtFcDPocpRZEmOjw%40mail.gmail.com.