General Question Regarding Django Password Validation differences

2020-04-19 Thread Ahmed Khairy
I have used UserCreationForm and got this result below with no validations regarding the password while there are other Usercreationforms with password validations. I am using Django 2.2 -- You received this message because you are subscribed to the Google Groups "Django users" group.

No Reverse Match Error, When creating a new user (new user application) it should direct back to home (to the core application)

2020-04-18 Thread Ahmed Khairy
For this project, I have made 2 applications: Core and Users Creating a new user is the 2nd application. I am trying to direct the new user after registration to 'home' I keep getting NoReverse Match Error This is the view.py this is the code: def register(request): if request.method ==

Testing an online payment Form using Django Keep getting Not Authenticated Error. Is it because of the Testing Credit Card numbers?

2020-04-27 Thread Ahmed Khairy
I am making a project for an online payment e-commerce I think I got everything right as am following a Tutorial Keep getting this Error: Not Authenticated Error I used the testing CC Numbers for testing purposes My question is the following codes correct and I'm getting Not Authenticated

Success Message after Submitting a form

2020-04-23 Thread Ahmed Khairy
I have created this class with the success message but I am not receiving the success message I requested, other pages are showing them but this one is not What might be wrong? In the views: class PostCreateView(LoginRequiredMixin, CreateView): model = Post fields = ['caption',

Re: Success Message after Submitting a form

2020-04-24 Thread Ahmed Khairy
> model = Post > fields = ['caption', 'design'] > template_name = "post_form.html" > success_url = '/score' > success_message = "Your Design has been submitted for Review" > > > > it will work > > On Friday, 24 April 2

Re: save() got an unexpected keyword argument 'force_insert'

2020-04-21 Thread Ahmed Khairy
Model Form UserCreationForm On Tuesday, April 21, 2020 at 11:02:13 PM UTC-4, Motaz Hejaze wrote: > > what kind of forms is this ? regular form or model form ? > > > On Wed, Apr 22, 2020 at 4:57 AM Ahmed Khairy > wrote: > >> Hi all, >> >> Got this unexp

Re: save() got an unexpected keyword argument 'force_insert'

2020-04-21 Thread Ahmed Khairy
Thank you so much it is realyy helpfull. Fixed it On Tuesday, April 21, 2020 at 11:23:10 PM UTC-4, Motaz Hejaze wrote: > > check this out > > https://wsvincent.com/django-allauth-tutorial-custom-user-model/ > > On Wed, Apr 22, 2020 at 5:18 AM Ahmed Khairy > wrote:

save() got an unexpected keyword argument 'force_insert'

2020-04-21 Thread Ahmed Khairy
Hi all, Got this unexpected error all of a sudden, how to fix it. save() got an unexpected keyword argument 'force_insert' def register(request): if request.method == 'POST': form = UserRegisterForm(request.POST) if form.is_valid(): form.save()

Re: save() got an unexpected keyword argument 'force_insert'

2020-04-21 Thread Ahmed Khairy
Thank you so much it realyy helpfull. Fixed it On Tuesday, April 21, 2020 at 11:23:10 PM UTC-4, Motaz Hejaze wrote: > > check this out > > https://wsvincent.com/django-allauth-tutorial-custom-user-model/ > > On Wed, Apr 22, 2020 at 5:18 AM Ahmed Khairy > wrote:

Getting approval from Admin first before posting a blog in Django

2020-04-21 Thread Ahmed Khairy
Hi all, I have made a blog as a project and I have set users to submit posts for the blog directly but i want to direct this post to the admin first for approval before showing on the website. here is the Post Create View Class. class PostCreateView(CreateView): model = Post fields =

Re: save() got an unexpected keyword argument 'force_insert'

2020-04-21 Thread Ahmed Khairy
What do you mean ? On Tuesday, April 21, 2020 at 11:13:16 PM UTC-4, Motaz Hejaze wrote: > > did you define managers ? > > On Wed, Apr 22, 2020 at 5:06 AM Ahmed Khairy > wrote: > >> Model Form >> >> UserCreationForm >> >> On Tuesday, April 2

How to get previously uploaded Images in Django

2020-05-03 Thread Ahmed Khairy
I am using Django 2.2 to make a project where designers upload designs and when I want to post them from admin, I want to choose their names and after I choose their names only their designs appear in the drop down list. So far I have reach the reach the designer name in a drop down list but

Re: NoReverseMatch at , I have Recently a class from one app and added it to a new app and I revised everything but keep receiving this Error, what did i miss?

2020-04-24 Thread Ahmed Khairy
I tried to include the urls originally it was path('score/new/', PostCreateView.as_view(), name='post-create'), but both didn't work On Friday, April 24, 2020 at 11:29:41 PM UTC-4, Ahmed Khairy wrote: > > I have created a new app in a project and moved one of the classes from >

Re: NoReverseMatch at , I have Recently a class from one app and added it to a new app and I revised everything but keep receiving this Error, what did i miss?

2020-04-24 Thread Ahmed Khairy
create' > ), PostCreateView.as_view(), name='post-create'), > > explain this line ? > > On Sat, Apr 25, 2020 at 5:30 AM Ahmed Khairy > wrote: > >> I have created a new app in a project and moved one of the classes from >> one app to the new app >> >> I check

NoReverseMatch at , I have Recently a class from one app and added it to a new app and I revised everything but keep receiving this Error, what did i miss?

2020-04-24 Thread Ahmed Khairy
I have created a new app in a project and moved one of the classes from one app to the new app I checked every step but I keep getting No Reverse match I wrote the name of the app before the namespace but still HTML : Upload Designs URLS from django.urls import include, path from

Re: NoReverseMatch at , I have Recently a class from one app and added it to a new app and I revised everything but keep receiving this Error, what did i miss?

2020-04-24 Thread Ahmed Khairy
>> you don't need the include part because you already copied the class to >> the new app >> >> On Sat, Apr 25, 2020 at 6:16 AM Ahmed Khairy > > wrote: >> >>> I tried to include the urls >>> >>> originally it was >>> >>>

Re: NoReverseMatch at , I have Recently a class from one app and added it to a new app and I revised everything but keep receiving this Error, what did i miss?

2020-04-24 Thread Ahmed Khairy
Yes i tried other urls from other models it worked but anything related to the new app is not linked On Saturday, April 25, 2020 at 12:42:14 AM UTC-4, Motaz Hejaze wrote: > > did you try to change the name 'post-create' to something else ? > > On Sat, Apr 25, 2020 at 6:34 AM

Re: NoReverseMatch at , I have Recently a class from one app and added it to a new app and I revised everything but keep receiving this Error, what did i miss?

2020-04-24 Thread Ahmed Khairy
I added the new app urls to the main project URLs I think this was the mistake but now I have to change the URLs location as I'm getting 404 error score/score/ Thank you, your first question is what made me find the issue On Saturday, April 25, 2020 at 1:13:08 AM UTC-4, Ahmed Khairy wrote

Adding a default Variation when creating a new Item

2020-05-12 Thread Ahmed Khairy
I have created this code for defining a default everytime I create a new product, It is working fine and whenever I create a new Item a new variable (size) is create I want to check whether this code is correct or not as I have had help from someone and I think we could have created an

How to over ride the get context data method in view

2020-05-12 Thread Ahmed Khairy
I am currently trying to create a like button for my posts in Django I have reached to the part where I can add a like but I am facing difficulty writing the code related to the view which linking the PostListView if there is user who liked it or not. I am getting an error: page Error 404

Re: How to over ride the get context data method in view

2020-05-13 Thread Ahmed Khairy
t.title}} > > {% csrf_token %} > {% if is_like %}type="submit">Unlike > > {% else %} > Like > {% endif %}{% endfor %} {% endblock content %} > > Something like this should give you the functionality you want - however > it's still a bit cumbersome. &

Re: How to over ride the get context data method in view

2020-05-13 Thread Ahmed Khairy
= post.likes.filter(user=request.user).exists() > > > Le mer. 13 mai 2020 à 19:22, Ahmed Khairy > a écrit : > >> Hi There, >> >> I have rewritten the get_context_data method to be like this but I am >> getting name 'user' is not defined: >> >>

Re: how to write Ajax for a Like button in Django

2020-05-17 Thread Ahmed Khairy
get that functionality in Django". No one could demostrate with >> example code. >> If you find something, please send me the code. >> >> Thanks >> >> >> Gabriel Araya Garcia >> GMI - Desarrollo de Sistemas Informáticos >> >&

how to write Ajax for a Like button in Django

2020-05-17 Thread Ahmed Khairy
Hi all, I need some help writing the ajax for a like button instead of refreshing every time a like is posted here is the template: {% csrf_token %} {% if user.is_authenticated %} {% if liked

Template Variations title not showing

2020-05-05 Thread Ahmed Khairy
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 =

Messages not appearing after creating an app for it in Django

2020-05-09 Thread Ahmed Khairy
I created an app called marketing app which customizes messages to be written on top of website page. My problem is that these messages are not showing when everything is configured and I don't know why is that might be the template because {{ marketing_message.message}} is only not showing

Re: pip not working

2020-05-15 Thread Ahmed Khairy
Did you try pip install -r requirements.txt? On Friday, May 15, 2020 at 10:16:52 AM UTC-4, Akorede Habeebullah wrote: > > Hi guys, I need help with my pip. It was working fine until I upgraded it. > now its not working fine anymore. I tried running all pip commands that I > know its still not

How to write a Get_Context_method

2020-05-13 Thread Ahmed Khairy
Hi, I have the following context and I am trying to write it correctly in a function This is context data : def post_view(request): qs= Post.objects.all() user= request.user context= { 'qs':qs, 'user':user, } I am trying to define it in a class

Re: how to write Ajax for a Like button in Django

2020-05-18 Thread Ahmed Khairy
020, 3:53 am Ahmed Khairy, > wrote: > >> Hi Motaz, >> >> When I added your code it disabled the function of the button nothing >> happened >> >> On Sunday, May 17, 2020 at 9:30:38 PM UTC-4, Motaz Hejaze wrote: >>> >>> In your like button

Re: Exception Value: Related Field got invalid lookup: value

2020-05-14 Thread Ahmed Khairy
.user) & Q( On Thursday, May 14, 2020 at 10:07:25 PM UTC-4, Motaz Hejaze wrote: > > Where does this exception happen ? > In which file , which line ? > > On Fri, 15 May 2020, 12:51 am Ahmed Khairy, > wrote: > >> Hi all >> >> I am adding a lik

Exception Value: Related Field got invalid lookup: value

2020-05-14 Thread Ahmed Khairy
Hi all I am adding a like/unlike button for Posts in a Listview, I am getting an error: Exception Value: Related Field got invalid lookup: value here is the Model: class Post(models.Model): designer = models.ForeignKey(User, on_delete=models.CASCADE) title =

Re: How to over ride the get context data method in view

2020-05-13 Thread Ahmed Khairy
are trying to get the absolut url for your post, but aren't showing > any post detail view. > > Regards, > > Andréas > > > Den ons 13 maj 2020 kl 06:46 skrev Ahmed Khairy >: > >> I am currently trying to create a like button for my posts in Django >> >>

How to create variables for an e-commerce website

2020-05-06 Thread Ahmed Khairy
Hi am looking for resources to create variables such as size and color to an e-commerce website -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to

Can't Fix the No Reverse Error in Ajax

2020-05-19 Thread Ahmed Khairy
I am trying to use Ajax to submit a like button, I believe everything is in order but I keep getting django.urls.exceptions.NoReverseMatch: Reverse for 'like_post' with arguments '('',)' not found. 1 pattern(s) tried: ['score/like/(?P[0-9]+)$'] I am not sure what is the reason. Need help to

Re: Template Variations title not showing

2020-05-22 Thread Ahmed Khairy
{{ item.name }} option> > {% 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 >

Re: Template Variations title not showing

2020-05-24 Thread Ahmed Khairy
Helloo, Check my views in this question link, it might be useful On Saturday, May 23, 2020 at 1:35:32 AM UTC-4, oldtimer wrote: > > I cannot get variations or I tried model forms for options as well and > cannot get either to add to the cart. I can get both to display as options > on the

Re: Template Variations title not showing

2020-05-24 Thread Ahmed Khairy
here is the link https://groups.google.com/forum/#!topic/django-users/5SckOumQLQM On Sunday, May 24, 2020 at 10:38:18 PM UTC-4, Ahmed Khairy wrote: > > Helloo, > > Check my views in this question link, it might be useful > > On Saturday, May 23, 2020 at 1:35:32 AM UTC-4, oldti

Changing in the Quantity of variants reflecting in the wrong item in Order Summary

2020-05-24 Thread Ahmed Khairy
Helloo, I have a problem with the variations and the quantity related to it in the order summary page. It was working perfectly and all of a sudden (this is an example to simplify): when I add to the cart 2 items: - Item X with a size small - Item X with a size medium When I change the

AttributeError when returning post.title in a comment model

2020-05-29 Thread Ahmed Khairy
I was working on a comment section for post and was getting an AttributeError when I return return '{}-{}'.format(self.post.title, str(self.user.username)) in the comment model I am trying to link users and posts to the comment I am getting the same error Here is the Models.py class

Re: Can't Fix the No Reverse Error in Ajax

2020-05-19 Thread Ahmed Khairy
Do you mean that this line should be changed? No ! Don't Print it On Tuesday, May 19, 2020 at 11:11:12 PM UTC-4, Hella Nick wrote: > > button标签中的type属性设置为button, > > Ahmed Khairy > 于2020年5月20日周三 上午1:54写道: > >>

Need Help Fixing an Issue in my E-commerce Project

2020-08-05 Thread Ahmed Khairy
Hi all, I have been battling with this issue for quite a long time and I haven't been able to find a solution to fix it. So, I have an E-commerce Project and The issue is related to the product Variations and the quantity related to it in the order summary page. Example with the sequence

How to create a link between Posts List View and Items List View of the same User

2020-07-28 Thread Ahmed Khairy
I am creating a project where there are Posts and Items, 2 different models in 2 different apps and each has a user who can be the same. I have created a page for each user to post all related posts called Userpost List view, and I want to add an if statement or a queryset to show a button