Re: RUNSERVER SERIOUS PROBLEM! Please help me pls

2020-08-04 Thread Jatin Agrawal
It seems like your directoy structure is not proper after you moved some 
files/folders. So, if you can send the screenshot of your directory 
structure, it might be helpful for others to help you.

On Tuesday, August 4, 2020 at 10:12:32 AM UTC+5:30, Phan Nguyen wrote:
>
> *So I was be able to work with Django very well the past weeks. But 
> certainly, I manually moved a 'src' folder(contain manage.py) which is 
> originally in a Dev folder. And it turns out to be not working anymore.Now, 
> all the admin site and other urls path cannot be run. I am using Mac OS. 
> (error picture attached) please tell me if you need more screenshot to 
> clarify. I appreciate any help. Thank you so much!*
>
> [image: Screen Shot 2020-08-04 at 11.36.30.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/f0ba9e64-10e3-47c4-9f06-b3a41cdbcd51o%40googlegroups.com.


Django 3.1 Released

2020-08-04 Thread Mariusz Felisiak

Details are available on the Django project weblog:

https://www.djangoproject.com/weblog/2020/aug/04/django-31-released/

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/001b3256-3624-26f8-a3c9-6ff1cb348eba%40gmail.com.


Re: Udemy Clone

2020-08-04 Thread Venkata Penumatsa
Hi Vedant,

Is this a hobby project or organization project? Is there any budget for
this project? If so how much is the budget?


On Sun, 2 Aug 2020 at 13:45, Kasper Laudrup  wrote:

> Hi Yedant,
>
> On 02/08/2020 17.54, vedant mehta wrote:
> > I m facing many problems. Video player , forum for qna, creating
> assignment page, stars for the instructor, generating certificate.
> >
>
> So far we can gather that you want to do something, but have no idea how
> to do any of it and therefore need some help.
>
> Nothing wrong with that, but it would greatly improve your chances of
> getting help if you try to clarify which kind of help you are looking for.
>
> Do you have any programming experience at all and do you have some code
> you are willing to share so someone can have a look at it?
>
> Are you looking for a mentor and would you be willing to pay someone to
> help you learning Python/Django development?
>
> Do you have any specific problems that you would like anyone to help you
> with?
>
> So far, no one knows but you, so you'll probably not get any relevant
> help before you make it clear what you're looking for.
>
> 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/ff1b0da0-0b14-02ce-74fe-e564fd0f69aa%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/CAPROKTc6UqYbDVXs0ts6qmgEHX915sKc%3DA12yJ_OnEN0z9idaA%40mail.gmail.com.


Re: Django 3.1 release candidate 1 released

2020-08-04 Thread 'Nikhilanj Venkata Pelluri (Software Development)' via Django users
Hi,
Has the final version for v3.1 been released ?

On Monday, July 20, 2020 at 12:13:27 PM UTC+5:30 Mariusz Felisiak wrote:

> Details are available on the Django project weblog:
>
>
> https://www.djangoproject.com/weblog/2020/jul/20/django-31-release-candidate-1-released/
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f29faf93-d26e-491b-81b3-9e7fd8107bf8n%40googlegroups.com.


bug bulk_create

2020-08-04 Thread nima salemahim


Traceback (most recent call last):
  File "/usr/lib/python3.7/code.py", line 90, in runcode
exec(code, self.locals)
  File "", line 1, in 
  File 
"/home/nima/.virtualenvs/behtarino/lib/python3.7/site-packages/django/db/models/fields/related_descriptors.py",
 
line 946, in add
through_defaults=through_defaults,
  File 
"/home/nima/.virtualenvs/behtarino/lib/python3.7/site-packages/django/db/models/fields/related_descriptors.py",
 
line 1150, in _add_items
])
TypeError: bulk_create() got an unexpected keyword argument 
'ignore_conflicts'

hi i have three models

when i try to add on deal to one a category 

like : deal.categories.add(category)

i face error above can you help me about what the problem is ?

class Deal(ModificationLogMixin, models.Model):
title = models.CharField(max_length=160, blank=True, null=True)
description = models.TextField(blank=True, null=True)
initial_price = models.IntegerField(blank=True)
discounted_price = models.IntegerField(blank=True)
categories = models.ManyToManyField(
'deal.DealCategory',
related_name='deals',
blank=True,
through='DealCategoryThrough',
through_fields=('deal', 'dealcategory')
)

class DealCategory(OrderedModel):
business = models.ForeignKey(Business, related_name='deal_categories',
 on_delete=deletion.CASCADE)
name = models.CharField(max_length=100, blank=True, null=True)
order_with_respect_to = 'business'

class DealCategoryThrough(OrderedModel):
deal = models.ForeignKey('deal.Deal', on_delete=models.deletion.CASCADE,
 related_name='ordered_deals')
dealcategory = models.ForeignKey(DealCategory, 
on_delete=models.deletion.CASCADE,
 related_name='ordered_deals')
order_with_respect_to = 'dealcategory'

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/2051380a-62b9-4afc-be91-f264cdf3e38eo%40googlegroups.com.


Re: Udemy Clone

2020-08-04 Thread nima salemahim
i am backend developer of an organization and faced to this problem i have
an OrderdModel class (DealCategory) and i wanted to make my (Deal) model
also OrderdModel
so i tried this way and faced this problem while adding a deal to
dealcategory i am not share that it is django problem or django-order-model
module problem do you have any idea to help me ?

On Tue, Aug 4, 2020 at 2:15 PM Venkata Penumatsa  wrote:

> Hi Vedant,
>
> Is this a hobby project or organization project? Is there any budget for
> this project? If so how much is the budget?
>
>
> On Sun, 2 Aug 2020 at 13:45, Kasper Laudrup  wrote:
>
>> Hi Yedant,
>>
>> On 02/08/2020 17.54, vedant mehta wrote:
>> > I m facing many problems. Video player , forum for qna, creating
>> assignment page, stars for the instructor, generating certificate.
>> >
>>
>> So far we can gather that you want to do something, but have no idea how
>> to do any of it and therefore need some help.
>>
>> Nothing wrong with that, but it would greatly improve your chances of
>> getting help if you try to clarify which kind of help you are looking for.
>>
>> Do you have any programming experience at all and do you have some code
>> you are willing to share so someone can have a look at it?
>>
>> Are you looking for a mentor and would you be willing to pay someone to
>> help you learning Python/Django development?
>>
>> Do you have any specific problems that you would like anyone to help you
>> with?
>>
>> So far, no one knows but you, so you'll probably not get any relevant
>> help before you make it clear what you're looking for.
>>
>> 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/ff1b0da0-0b14-02ce-74fe-e564fd0f69aa%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/CAPROKTc6UqYbDVXs0ts6qmgEHX915sKc%3DA12yJ_OnEN0z9idaA%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/CAHyNETR500QODsppZn9Qknb%2BcCeX4y2-2KdZ2CLFnn9PF%3D6Y0g%40mail.gmail.com.


Re: field for html

2020-08-04 Thread Yemin Sajid
I would suggest you to only put the *video id* in the charfield and use
that to render the * *in the template. Otherwise, there can be
security issues if the content from the charfield is rendered safely as
HTML.

So in your template could it would be something like
*https://www.youtube.com/embed/{{
video_id }} " frameborder="0"
allow="accelerometer; autoplay; encrypted-media; gyroscope;
picture-in-picture" allowfullscreen>*

On Mon, Aug 3, 2020 at 11:16 PM neeraj garg  wrote:

> Try to use django *safe *filter to render this as html.
>
> On Mon, Aug 3, 2020 at 8:35 PM Kovy Jacob  wrote:
>
>> Hi, is there a type of field for django data models that's for html? I
>> want to have youtube embed links, which is a bunch of html fo putting a
>> youtube video on your site. Itlooks like this: "> height="360" src="https://www.youtube.com/embed/Rj_vssRaZlQ";
>> frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope;
>> picture-in-picture" allowfullscreen>". I stored it in a charfield,
>> but it gets shown on the website as text.
>> What should I do?
>> Thanks,
>> Kovy
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CACMwF3VTKYF3Zjm9fQMFwtjvxYXdsUA1JV6mXFTrD0XBW5bDdw%40mail.gmail.com
>> 
>> .
>>
>
>
> --
> Thanks,
> Neeraj
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAGR%2Bspcu_xgOgVLiStZEd2O0ePPCYnt_oYoSCm2D37FRYwGSqw%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/CAFzgvyFVTg%2BAkPDbS6idkWERPx7ZpNg%3DXdU38qy1Z-4ua_ua9g%40mail.gmail.com.


bug in bulk_create

2020-08-04 Thread nima salemahim


Traceback (most recent call last):
  File "/usr/lib/python3.7/code.py", line 90, in runcode
exec(code, self.locals)
  File "", line 1, in 
  File 
"/home/nima/.virtualenvs/behtarino/lib/python3.7/site-packages/django/db/models/fields/related_descriptors.py",
 
line 946, in add
through_defaults=through_defaults,
  File 
"/home/nima/.virtualenvs/behtarino/lib/python3.7/site-packages/django/db/models/fields/related_descriptors.py",
 
line 1150, in _add_items
])
TypeError: bulk_create() got an unexpected keyword argument 
'ignore_conflicts'

hi i have three models

when i try to add on deal to one a category 

like : deal.categories.add(category)

i face error above can you help me about what the problem is ?

i dont know exactly it is django problem or django-ordered-model module 
problem

class Deal(ModificationLogMixin, models.Model):
title = models.CharField(max_length=160, blank=True, null=True)
description = models.TextField(blank=True, null=True)
initial_price = models.IntegerField(blank=True)
discounted_price = models.IntegerField(blank=True)
categories = models.ManyToManyField(
'deal.DealCategory',
related_name='deals',
blank=True,
through='DealCategoryThrough',
through_fields=('deal', 'dealcategory')
)

class DealCategory(OrderedModel):
business = models.ForeignKey(Business, related_name='deal_categories',
 on_delete=deletion.CASCADE)
name = models.CharField(max_length=100, blank=True, null=True)
order_with_respect_to = 'business'

class DealCategoryThrough(OrderedModel):
deal = models.ForeignKey('deal.Deal', on_delete=models.deletion.CASCADE,
 related_name='ordered_deals')
dealcategory = models.ForeignKey(DealCategory, 
on_delete=models.deletion.CASCADE,
 related_name='ordered_deals')
order_with_respect_to = 'dealcategory'

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d8e04200-2f6f-4cf8-a315-30bb33ea761bo%40googlegroups.com.


Django 3.1 release ?

2020-08-04 Thread 'Nikhilanj Venkata Pelluri (Software Development)' via Django users
Hi,
I'm looking to upgrade my production system from Django v2.1 to the 
latest version. I see that the estimated release date for v3.1 is Aug 3, 
2020. This page -- https://django.readthedocs.io/en/latest/releases/3.1.html 
still 
shows v3.1 as "UNDER DEVELOPMENT". 

Is there an official page I can check for updates about the 3.1 release ?

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/e5c758ca-3473-48ec-9921-904ddafda677n%40googlegroups.com.


Udemy Clone

2020-08-04 Thread Kshitij Kotasthane
You should try to identify the features and break them down into manageable 
chunks. Udemy is huge app and and a Django (if you were to use one) is just a 
part of it. There would be a million things to consider. If you specify what 
you want help with, that makes things much more simple. So let's say that you 
have problems with making the comment section APIs or the rating feature for 
instructos, it seems more doable, rather than asking how you can copy a 
successful product. The question just seems too vague. 

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


Re: RUNSERVER SERIOUS PROBLEM! Please help me pls

2020-08-04 Thread Phan Nguyen
*To add up, There are also 2 manage.py and 2 setting.py, some of the files 
may be repetitive because I accidentally copied code from one to another so 
it was duplicated.*

On Tuesday, August 4, 2020 at 9:22:36 PM UTC+7, Phan Nguyen wrote:
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f3e5dffa-098a-494e-9ee7-faeff966658do%40googlegroups.com.


Install -r 309 traceback

2020-08-04 Thread Roberto Melucci
Non sono riuscito ad installare django 3 0 9, con pip install -r 
Django-3.0.9-py3-none-any.whl 
... mi segnala ben 11 traceback, di cui l'ultimo è in
lib/encodings/cp1252.py, line 15, in decode return 
codecs.charmap_decode(input,errors,decoding_table)
Non ho internet sul pc, e deve scaricare i files sullo smart.
Come posso fare?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/0058b99b-3347-4036-9a2d-7eef09afdb65o%40googlegroups.com.


Problem in user creation

2020-08-04 Thread sonam pankaj
   

  Hi,
  there is a problem when doing profile model using contrib.auth , 
sometimes profile is created without user so they went out of sync. How to 
make sure that user_id and Profile_id remain in sync. 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/c08a9b60-25a3-40d4-9fb6-e1d4a40e4038o%40googlegroups.com.


Re: Problem in user creation

2020-08-04 Thread neeraj garg
You could use django signals which will keep the models in sync.

On Tue, Aug 4, 2020, 9:16 PM sonam pankaj  wrote:

>
>
>   Hi,
>   there is a problem when doing profile model using contrib.auth ,
> sometimes profile is created without user so they went out of sync. How to
> make sure that user_id and Profile_id remain in sync. 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/c08a9b60-25a3-40d4-9fb6-e1d4a40e4038o%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/CAGR%2BspeEyGRKjcuGphNGA%2B57zSh5WxOpttHsAbCZv4-tyTRnWQ%40mail.gmail.com.


Re: Problem in user creation

2020-08-04 Thread sonam pankaj
We have already used signals. still it escaped to make one of the user

On Tue, Aug 4, 2020 at 9:35 PM neeraj garg  wrote:

> You could use django signals which will keep the models in sync.
>
> On Tue, Aug 4, 2020, 9:16 PM sonam pankaj  wrote:
>
>>
>>
>>   Hi,
>>   there is a problem when doing profile model using contrib.auth
>> , sometimes profile is created without user so they went out of sync. How
>> to make sure that user_id and Profile_id remain in sync. 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/c08a9b60-25a3-40d4-9fb6-e1d4a40e4038o%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/CAGR%2BspeEyGRKjcuGphNGA%2B57zSh5WxOpttHsAbCZv4-tyTRnWQ%40mail.gmail.com
> 
> .
>


-- 
Sonam
Lead Software Engineer
Solinas Integrity
IIT Madras

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAEUYDiTp6oAUx1X%3DjhB%2B4x9dBhejDBhF9yk85LqYe2Q%3Di7BOqQ%40mail.gmail.com.


Install -r 309 traceback

2020-08-04 Thread Roberto Melucci
I was unable to install django 3 0 9, with pip install -r 
Django-3.0.9-py3-none-any.whl
... shows me 11 tracebacks, of which the last is in
lib / encodings / cp1252.py, line 15, in decode return codecs.charmap_decode 
(input, errors, decoding_table)
I don't have internet on the pc, and it must download the files to the smart.
How can I do?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/055f65eb-ae20-44d9-a845-8526cef62371o%40googlegroups.com.


Understanding Baseinlineformset and inlineformset_factory.

2020-08-04 Thread NIKHIL RAJGARHIA
Hi All,

I am unable to understand the below logic for '*BaseInlineFormSet*' and '
*inlineformset_factory*'.

1. What is the use of 'formset' in 'inlineformset_factory'?
2. What is the use of validation inside 'BaseInlineFormSet'? How it works? 
I haven't seen any implementation like this validation in normal forms.

As I have only worked with general forms, I was exploring on 'formset', 
but, couldn't understand this piece of example. I know 'formset' is used to 
create multiple forms on the same page.

AnswerFormSet = *inlineformset_factory*( #this will be an instance of the 
form
Question,  # parent model
Answer,  # base model or child model
formset=*BaseAnswerInlineFormSet*,
fields=('text', 'is_correct'),
min_num=2,
validate_min=True,
max_num=10,
validate_max=True
)

class *BaseAnswerInlineFormSet*(forms.BaseInlineFormSet):
def clean(self):
super().clean()

has_one_correct_answer = False
for form in self.forms:
if not form.cleaned_data.get('DELETE', False):
if form.cleaned_data.get('is_correct', False):
has_one_correct_answer = True
break

if not has_one_correct_answer:
raise ValidationError('Mark at least one answer as correct.', 
code='no_correct_answer')

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/73b5c181-be5b-48c7-a0aa-cb4e1648d80do%40googlegroups.com.


Re: Django storing byte string for image

2020-08-04 Thread را نيا
Good evening
I want to import photos and PDF files from desktop app and display them in 
web app, how can I do it without using binary format?

Le jeudi 4 janvier 2018 10:44:53 UTC+1, Shem Ogumbe a écrit :
>
> Maybe try the conversion then save the path to MongoDb, but not the 
> bytsetring itself
>
> On Wednesday, January 3, 2018 at 3:03:36 PM UTC+3, chern...@gmail.com 
> wrote:
>>
>> What field should i use to store byte string so that i can later use it 
>> for ByteIO to convert it into image ?
>>
>> As this is my first time doing on byte string to image, i am pretty lost 
>> on what i need to do.
>>
>> I tried using BinaryField for the image model but when checking the field 
>> out on Django admin, it gave me this error
>> 'image' cannot be specified for MyUser model form as it is a non-editable 
>> field
>> i also tried setting BinaryField(editable=True) but it still doesnt work.
>>
>> May i have some guidance on how to store the byte string ? 
>>
>

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


IntegrityError - null value in column "email" violates not-null constraint

2020-08-04 Thread Francisco André
Hey guys.

I'm developing a new project and creating a custom user model, extending 
the AbstractBaseUser class, but when add a new user in admin interface or 
modelform I get the error: IntegrityError at /null value in column "email" 
violates not-null constraint.

The field email is necessary and I inform in the form, it's used to login 
too.

It's necessary create a "custom modelform" too? I followed many  tutorials 
by web, including documentation. Links bellow.

https://docs.djangoproject.com/en/3.0/topics/auth/customizing/#custom-users-admin-full-example
https://simpleisbetterthancomplex.com/tutorial/2016/07/22/how-to-extend-django-user-model.html#abstractbaseuser

And, this my gist code of model, form and admin file.

https://gist.github.com/fandrefh/ff6d8bbe047654174aa699072589539a

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/2a69ebc6-cf63-4e67-8178-973b29818ac7o%40googlegroups.com.


Undefined HTML controls

2020-08-04 Thread Telly George
I have this problem where I navigate from my home page (index.html)  to 
another page 
new_page.html) but the data input on new_page.html is not being read by 
Python. It seems as if at that point the HTML controls do not exist or are 
not being rendered and so I am unable to read the values in the text box 
and text area control.

Can someone help. Here are my source files

File name: layout.html
Comment: This is a template HTML page

{% load static %}





{% block title %}{% endblock %}
https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"; 
integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh"
 
crossorigin="anonymous">





Wiki

{% csrf_token %}
  

Home


Create New Page


Random Page

{% block nav %}
{% endblock %}


{% block body %}
{% endblock %}






File name: index.html
Comment: default home page

{% extends "encyclopedia/layout.html" %}

{% block title %}
Encyclopedia
{% endblock %}

{% block body %}

{% endblock %}

File name: new_page.html
Comments: This is the page with the controls where I cannot read the 
information typed by the user

{% extends "encyclopedia/layout.html" %}

{% block title %}
Encyclopedia
{% endblock %}

{% block body %}
New Wiki Entry
Entry Title:  
Markdown Text for entry: 
 
 Add Entry
 Add Entry 
{% endblock %}

File name: urls.py

from django.urls import path

from . import views

urlpatterns = [
path("", views.index, name="index"),
path("new_page",views.new_page,name="new_page"),
path("add_entry",views.add_entry,name="add_entry") 
]


File name: views.py

from django.shortcuts import render
from django.http import HttpResponse



def index(request):
return render(request, "encyclopedia/index.html")


def new_page(request):
return render(request,"encyclopedia/new_page.html")


def add_entry(request):
 #entry_title = request.POST.get('title_box')
 #entry_contents = request.POST.get('entry_details')
 #entry_title = request.GET["title_box"]
 #entry_contents = request.GET["entry_details"]
 entry_title = "Title"
 entry_contents = "Contents"
 
 if 'title_box' in request.GET:
  entry_title = request.GET.get('title_box')
  print("Found in GET...")
 if 'title_box' in request.POST:
  entry_title = request.POST.get('title_box')
  print("Found in POST...")
 
 
 print(f"entry_title: {entry_title}")
 print(f"entry_contents: {entry_contents}")
 
 
 return HttpResponse("Add Wiki Entry")

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/472d845b-6bf8-463c-999a-4209a9fcaf80n%40googlegroups.com.


Re: Udemy Clone

2020-08-04 Thread vedant mehta
No budget
Making for myself
Just need help in making teacher dashboard where teacher can upload course
and visible to students and they can enroll.
Also want the feature of giving ratings to instructors

On Tue, Aug 4, 2020, 3:15 PM Venkata Penumatsa  wrote:

> Hi Vedant,
>
> Is this a hobby project or organization project? Is there any budget for
> this project? If so how much is the budget?
>
>
> On Sun, 2 Aug 2020 at 13:45, Kasper Laudrup  wrote:
>
>> Hi Yedant,
>>
>> On 02/08/2020 17.54, vedant mehta wrote:
>> > I m facing many problems. Video player , forum for qna, creating
>> assignment page, stars for the instructor, generating certificate.
>> >
>>
>> So far we can gather that you want to do something, but have no idea how
>> to do any of it and therefore need some help.
>>
>> Nothing wrong with that, but it would greatly improve your chances of
>> getting help if you try to clarify which kind of help you are looking for.
>>
>> Do you have any programming experience at all and do you have some code
>> you are willing to share so someone can have a look at it?
>>
>> Are you looking for a mentor and would you be willing to pay someone to
>> help you learning Python/Django development?
>>
>> Do you have any specific problems that you would like anyone to help you
>> with?
>>
>> So far, no one knows but you, so you'll probably not get any relevant
>> help before you make it clear what you're looking for.
>>
>> 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/ff1b0da0-0b14-02ce-74fe-e564fd0f69aa%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/CAPROKTc6UqYbDVXs0ts6qmgEHX915sKc%3DA12yJ_OnEN0z9idaA%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/CAC21hZKY8Fydu4ZS_-8PwimsVEgySeYw3nE8q68GWjvM8j-pwg%40mail.gmail.com.


NoReverseMatch

2020-08-04 Thread Haris Ahmad
Hello everyone, I'm getting this error,
*Reverse for 'create_order' with no arguments not found. 1 pattern(s) 
tried: ['create_order/(?P[^/]+)/$']  *

I'm getting this error when I use
*path('create_order//', views.createOrder, name="create_order"),*

but there is no such error when path is..
*path('create_order', views.createOrder, name="create_order"),*

*urls.py*

   1. from django.urls import path
   2.  from . import views
   3.  urlpatterns = [ 
   4.  path('', views.home, name="home"),
   5. path('products/', views.products, name='products'),
   6. 
   7. path('customer//', views.customer, name="customer"), 
   path('create_order//', views.createOrder, name="create_order"), 
   path('update_order//', views.updateOrder, name="update_order"), 
   path('delete_order//', views.deleteOrder, name="delete_order"), 
   8.]
   

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


Re: NoReverseMatch

2020-08-04 Thread vedant mehta
In createOrder function in views.py
u need to pass pk as well

createOrder(request,pk)

On Wed, Aug 5, 2020, 2:11 AM Haris Ahmad  wrote:

> Hello everyone, I'm getting this error,
> *Reverse for 'create_order' with no arguments not found. 1 pattern(s)
> tried: ['create_order/(?P[^/]+)/$']  *
>
> I'm getting this error when I use
> *path('create_order//', views.createOrder, name="create_order"),*
>
> but there is no such error when path is..
> *path('create_order', views.createOrder, name="create_order"),*
>
> *urls.py*
>
>1. from django.urls import path
>2.  from . import views
>3.  urlpatterns = [
>4.  path('', views.home, name="home"),
>5. path('products/', views.products, name='products'),
>6.
>7. path('customer//', views.customer, name="customer"),
>path('create_order//', views.createOrder, name="create_order"),
>path('update_order//', views.updateOrder, name="update_order"),
>path('delete_order//', views.deleteOrder, name="delete_order"),
>8.]
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/e523abbe-b2dd-4935-b051-e56b310137ddn%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/CAC21hZK5ZDKODizeNRWcxLP6Ont-bJ-iARYGqeFSq14sXZ03dw%40mail.gmail.com.


Re: Django 3.1 release candidate 1 released

2020-08-04 Thread Thomas Lockhart
Mariusz announced the final release a few hours before you posted this. To this 
same email list ;)

- Tom

> On Aug 3, 2020, at 10:14 PM, 'Nikhilanj Venkata Pelluri (Software 
> Development)' via Django users  wrote:
> 
> Hi,
> Has the final version for v3.1 been released ?
> 
> On Monday, July 20, 2020 at 12:13:27 PM UTC+5:30 Mariusz Felisiak wrote:
> Details are available on the Django project weblog: 
> 
> https://www.djangoproject.com/weblog/2020/jul/20/django-31-release-candidate-1-released/
>  
> 
>  
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com 
> .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/f29faf93-d26e-491b-81b3-9e7fd8107bf8n%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/A7B3321A-B7F3-49D4-AA19-1E249CC1DCFA%40gmail.com.


social_django.models.UserSocialAuth.DoesNotExist in unit test

2020-08-04 Thread Roy Smith
I have both model and social backends configured in settings.py:

> AUTHENTICATION_BACKENDS = (
> 'django.contrib.auth.backends.ModelBackend',
> 'social_core.backends.mediawiki.MediaWiki',
> )


When I run this test:

> from django.test import TestCase, Client
> from django.contrib.auth.models import User
> 
> 
> class UserActivitiesViewTest(TestCase):
> def test_mainspace_title_contains_colon(self):
> user_fred = User.objects.create_user('Fred', 'f...@example.com', 
> 'password')
> client = Client()
> client.force_login(user_fred, 
> backend='django.contrib.auth.backends.ModelBackend')
> response = client.get('/spi/spi-user-activities/Foo', {'count': 10, 
> 'main': 1}, follow=True)


The view that's being tested is:

> class UserActivitiesView(LoginRequiredMixin, View):
> def get(self, request, user_name):
>   .


I get a social_django.models.UserSocialAuth.DoesNotExist exception in the 
client.get() call.  Why is it doing any kind of query on UserSocialAuth if I'm 
telling force_login() to use ModelBackend?

I'm running django 2.2, python 3.7

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/F63F152D-91BE-41DA-A13D-F54D1D708AD8%40panix.com.


Re: RUNSERVER SERIOUS PROBLEM! Please help me pls

2020-08-04 Thread Phan Nguyen
[image: aaa.png]
Here are the 4 screenshots I have for the structure. At first, it worked 
perfectly fine when the 'src' folder was in Dev/trydjango/'src'. After I 
moved 'src' to the another folder on Desktop and put it inside the 
webserver folder. The files path is on top of my screen FYI. At the 
beginning I usually ran 'python3 manage.py runserver' only when I do 'cd 
src' successfully, and it worked at that time.
Thank you!
(4 screenshots attached)

[image: bbb.png]
[image: ccc.png]
[image: Screen Shot 2020-08-04 at 20.48.23.png]


On Tuesday, August 4, 2020 at 2:21:44 PM UTC+7, Jatin Agrawal wrote:
>
> It seems like your directoy structure is not proper after you moved some 
> files/folders. So, if you can send the screenshot of your directory 
> structure, it might be helpful for others to help you.
>
> On Tuesday, August 4, 2020 at 10:12:32 AM UTC+5:30, Phan Nguyen wrote:
>>
>> *So I was be able to work with Django very well the past weeks. But 
>> certainly, I manually moved a 'src' folder(contain manage.py) which is 
>> originally in a Dev folder. And it turns out to be not working anymore.Now, 
>> all the admin site and other urls path cannot be run. I am using Mac OS. 
>> (error picture attached) please tell me if you need more screenshot to 
>> clarify. I appreciate any help. Thank you so much!*
>>
>> [image: Screen Shot 2020-08-04 at 11.36.30.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/490a1689-adaf-457a-9bce-a56ff69a7884o%40googlegroups.com.


Re: Problem in user creation

2020-08-04 Thread 'Amitesh Sahay' via Django users
Post your signal here to check




On Tuesday, 4 August, 2020, 11:07:56 pm IST, sonam pankaj 
 wrote:  
 
 We have already used signals. still it escaped to make one of the user

On Tue, Aug 4, 2020 at 9:35 PM neeraj garg  wrote:

You could use django signals which will keep the models in sync.
On Tue, Aug 4, 2020, 9:16 PM sonam pankaj  wrote:

   

  Hi,  there is a problem when doing profile model using 
contrib.auth , sometimes profile is created without user so they went out of 
sync. How to make sure that user_id and Profile_id remain in sync. 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/c08a9b60-25a3-40d4-9fb6-e1d4a40e4038o%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/CAGR%2BspeEyGRKjcuGphNGA%2B57zSh5WxOpttHsAbCZv4-tyTRnWQ%40mail.gmail.com.



-- 
Sonam 
Lead Software EngineerSolinas IntegrityIIT Madras


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAEUYDiTp6oAUx1X%3DjhB%2B4x9dBhejDBhF9yk85LqYe2Q%3Di7BOqQ%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/636724511.78164.1596601179749%40mail.yahoo.com.


Re: Problem in user creation

2020-08-04 Thread sonam pankaj








  Snapshot for the models 


 Snapshots for signals














On Wednesday, August 5, 2020 at 9:50:52 AM UTC+5:30, Amitesh Sahay wrote:
>
> Post your signal here to check
>
>
>
> On Tuesday, 4 August, 2020, 11:07:56 pm IST, sonam pankaj <
> sonamp...@gmail.com > wrote: 
>
>
> We have already used signals. still it escaped to make one of the user
>
> On Tue, Aug 4, 2020 at 9:35 PM neeraj garg  > wrote:
>
> You could use django signals which will keep the models in sync.
>
> On Tue, Aug 4, 2020, 9:16 PM sonam pankaj  > wrote:
>
>
>
>   Hi,
>   there is a problem when doing profile model using contrib.auth , 
> sometimes profile is created without user so they went out of sync. How to 
> make sure that user_id and Profile_id remain in sync. 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...@googlegroups.com .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/c08a9b60-25a3-40d4-9fb6-e1d4a40e4038o%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/CAGR%2BspeEyGRKjcuGphNGA%2B57zSh5WxOpttHsAbCZv4-tyTRnWQ%40mail.gmail.com
>  
> 
> .
>
>
>
> -- 
> Sonam 
> Lead Software Engineer
> Solinas Integrity
> IIT Madras
>
> -- 
> You received this message because you are 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/CAEUYDiTp6oAUx1X%3DjhB%2B4x9dBhejDBhF9yk85LqYe2Q%3Di7BOqQ%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/1533cb9c-0524-4f64-8565-8b979dd43ba5o%40googlegroups.com.