Re: How to send dict to template and use it

2020-05-06 Thread 'Amitesh Sahay' via Django users
Your view seems to have incorrect render. Sent from Yahoo Mail on Android On Thu, 7 May 2020 at 11:25, Mohsen Pahlevanzadeh wrote: I have the following view function: def index(request, question_id):     latest_question_list = User.objects.all() #Post.objec

How to send dict to template and use it

2020-05-06 Thread Mohsen Pahlevanzadeh
I have the following view function: def index(request, question_id): latest_question_list = User.objects.all() #Post.objects.all() template = loader.get_template('posts/index.html') context = { 'latest_question_list': latest_question_list,

Re: Create a function which fill automatically a field in my models

2020-05-06 Thread Anselme SERI
Thanks you for your answer. I know how to make a default value in charfield but I don't know how to build function which returns value for my default field. In my case this function must retrieve last id on my model and must concataned it with a string and the final result must be affected to defa

Re: Best hosting for Django Application?

2020-05-06 Thread Sherif Adigun
Now I'm very confused and my client will request for the project to be hosting in two weeks. I don't want to make a mistake about host On Wed, May 6, 2020, 11:44 PM Gabriel Araya Garcia < gabrielaraya2...@gmail.com> wrote: > I've learned Django for a year, and I have my project hosted in > PYTHON

Seeking django plugin for SAML integration for SPA application

2020-05-06 Thread suman patel
Hi All, I have a SPA in React-Django 2.2.x and we need to implement SAML for SSO. Looking for suggestion on django plugin for Authentication and authorization. Looking for stable package where user auth, permission and groups can be handled from external IDP and seamless integration with Djang

Running sync_to_async to create object, but YET raise .ASynchronous exception

2020-05-06 Thread DAVID ALEJANDRO Pineda
Hello guys! I'm stucked on this problem, i have some script to save data to database using a django object. The script is with async,so i have to use the 'sync_to_async' function. Beyond that, running the script raise the ASynchronous exception, but it's look correct. Code: ``` async def

Custom Mysql Lookup for FULLTEXT Search Returns empy on test runs

2020-05-06 Thread Gui Talarico
Hi everyone - I am sorry if this is not the right place or format to ask for this typo of help. I have been trying to solve this issue for a while but have not had any luck. I created a Custom Lookup to be able to do full text search on mysql: ``` # lookup class Search(models.Lookup): lo

Re: Best hosting for Django Application?

2020-05-06 Thread Gabriel Araya Garcia
I've learned Django for a year, and I have my project hosted in PYTHONANYWHERE, however, I never had have a problem. It's very easy, you can If you are a beginner to use the free account, or else a paid one. If you have any question, don't hesitate to ask me. Regards, Gabriel Araya Garcia GMI - D

Re: Best hosting for Django Application?

2020-05-06 Thread Sherif Adigun
Oh, thank you for that. I'm really afraid for I don't want my client to tear my hair out. How about heroku? Have you tried that ? On Wed, May 6, 2020, 7:19 PM Nomeh Uchenna Gabriel wrote: > please don't ever use "python-anywhere" for a serious project unless you > have enough tears 😭 in your ey

Re: How to create variables for an e-commerce website

2020-05-06 Thread Lunga Baliwe
maybe also check https://djangopackages.org/grids/g/ecommerce/ for django ecommerce packages On Wed, May 6, 2020 at 8:35 PM Motaz Hejaze wrote: > One solution is to make a 3 columns table , the first column is > 'property_name' , second column 'property_value' , third column is a > foriegn key t

Re: Create a function which fill automatically a field in my models

2020-05-06 Thread Motaz Hejaze
Yes you can make a normal charfield and assign its default attribute to a function you declare On Wed, 6 May 2020, 6:53 pm Anselme SERI, wrote: > Hi, > > I use Django 3.0 and I would like to create a function which fill > automatically a field in my models. > Can I do it directly in models.py ?

Re: How to create variables for an e-commerce website

2020-05-06 Thread Motaz Hejaze
One solution is to make a 3 columns table , the first column is 'property_name' , second column 'property_value' , third column is a foriegn key to the item that this property belongs to 'item_id' On Wed, 6 May 2020, 8:06 pm Ahmed Khairy, wrote: > Hi am looking for resources to create variables

Re:

2020-05-06 Thread Nomeh Uchenna Gabriel
That's quite easy - ___ models.py: class num(models.Model): item = models.BigIntegerField(...) ___ views.py: from . import models def funct(request): mdl = models.num.objects.get(id__exact=1) mdl2 = models.num.objects.get(id__exact=1) add

Re: Best hosting for Django Application?

2020-05-06 Thread Nomeh Uchenna Gabriel
please don't ever use "python-anywhere" for a serious project unless you have enough tears 😭 in your eye balls to cry out when the time comes. ... I suggest "digitalocean/linode" so that the heavy problems of "SSL certificates" won't beat you up -- You received this message because you are sub

Re: A learner following a Mosh Tutorial on Django and having a problem saving a product to SQLite

2020-05-06 Thread Nomeh Uchenna Gabriel
That's great to hear! -- You received this message because you are 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

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 django-users+un

Create a function which fill automatically a field in my models

2020-05-06 Thread Anselme SERI
Hi, I use Django 3.0 and I would like to create a function which fill automatically a field in my models. Can I do it directly in models.py ? How? Thanks a lot -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group a

Re: I am building an open source School Management System

2020-05-06 Thread Sherif Adigun
Thanks. Checked. Good job. I think I've got more features than you. Latest commits now have authentications On Tuesday, May 5, 2020 at 9:37:26 PM UTC+1, Sherif Adigun wrote: > > I am currently building an open source school Management System on django > and it's currently available on GitHub. >

Re: How to make Custom User Registration and Login

2020-05-06 Thread Kushal Neupane
For you following web pages or video will help you. https://simpleisbetterthancomplex.com/tutorial/2017/02/18/how-to-create-user-sign-up-view.html https://www.youtube.com/watch?v=oZUb372g6Do https://docs.djangoproject.com/en/3.0/topics/auth/customizing/ https://testdriven.io/blog/django-custom-user

Re: How to make Custom User Registration and Login

2020-05-06 Thread Camilo Garcia
This might come in handy https://learndjango.com/tutorials/django-custom-user-model On Wednesday, May 6, 2020 at 5:09:29 AM UTC-5, Anubhav Madhav wrote: > > I am new to Django. I need to make a custom sign up and log in page. > Because, during Sign Up, I also want to get User's Address and Conta

Re: Django Media Static Files

2020-05-06 Thread Jorge Gimeno
On Wed, May 6, 2020 at 3:09 AM ilda.pedro1993 wrote: > Hello, everyone! > My name is Ilda, i'm getting a page not found when trying to load django > media files. > > My django settings file looks like below: > > [image: Captura de Tela (148).png] > > > > > > > > And saw many suggestions to concat

Re: I am building an open source School Management System

2020-05-06 Thread Milson Munakami
Thanks, now it is loading as desired. Try my repo also: https://github.com/Milstein/Student_Management_System may be this is a bit more functional what you are looking for. On Wed, May 6, 2020 at 4:39 AM Sherif Adigun wrote: > Now updated. Please confirm it's working fine now. > > -- > You recei

Re: register_converter

2020-05-06 Thread Andréas Kühne
Great - thanks also for posting the answer here as well! Regards. Andréas ‪Den ons 6 maj 2020 kl 14:37 skrev ‫אורי‬‎ :‬ > Hi, > > I checked and if I define a converter with a name of a default converter, > such as "slug" - it overrides the default converter. The line that causes > this is the

Re: Two forms in one template

2020-05-06 Thread Sherif Adigun
You are welcome. I'm happy to help -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To view this discussion on the web

Re: Two forms in one template

2020-05-06 Thread Sergei Sokov
Thank you very much!! You are best!!! среда, 6 мая 2020 г., 15:09:39 UTC+2 пользователь Sherif Adigun написал: > > https://us04web.zoom.us/j/79500561313?pwd=TnIzekVTMU0xRDNsaGpaS0kxQlhTdz09 > > > JOIN NOW > -- You received this message because you are subscribed to the Google Groups "Django

Re: How to fork LocaleMiddleware? I need to make a small change.

2020-05-06 Thread Aldian Fazrihady
You can just extend LocaleMiddleware like this: ``` class MyLocaleMiddleware(LocaleMiddleware): def process_request(self, request): super().process_request(request) # TODO: add my custom code ``` Save it to a python file, such as `middleware.py` On the django settings file, re

Re: Two forms in one template

2020-05-06 Thread Sherif Adigun
https://us04web.zoom.us/j/79500561313?pwd=TnIzekVTMU0xRDNsaGpaS0kxQlhTdz09 JOIN NOW -- You received this message because you are 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...@go

Re: How to customize the authentication system?

2020-05-06 Thread Jorge Gimeno
On Wed, May 6, 2020, 3:08 AM Camilo Garcia wrote: > I want to use the authentication system that django comes with, but the > default model doesn't work for me, so I have to implement my own user > model, the truth is that I don't know how I could do it without losing the > power that this system

Re: Two forms in one template

2020-05-06 Thread Sergei Sokov
I am ready среда, 6 мая 2020 г., 12:35:28 UTC+2 пользователь Sherif Adigun написал: > > ok. send a reply when you are available. > > On Wed, May 6, 2020 at 11:13 AM Sergei Sokov > wrote: > >> I can a little bit later, ok? >> I think in 2 hour >> >> среда, 6 мая 2020 г., 12:00:13 UTC+2 пользовател

How to fork LocaleMiddleware? I need to make a small change.

2020-05-06 Thread Oleg Barbos
When LocaleMiddleware sees the request coming in, it tries to parse the language from the request. See https://github.com/django/django/blob/92507bf3ea4dc467f68edf81a686548fac7ff0e9/django/utils/translation/trans_real.py#L46 for the regular expression used. The allowed format is: any sequence o

Re: How to glue Django and React together?

2020-05-06 Thread Aldian Fazrihady
Hi, I am using that stack for my website aldianfazrihady.com. It uses these modules: https://pypi.org/project/django-webpack-loader/ https://www.npmjs.com/package/react-router-dom On web browser, open my website, and use developer tools or view source to see how it interacts with django backend.

Re: register_converter

2020-05-06 Thread אורי
Hi, I checked and if I define a converter with a name of a default converter, such as "slug" - it overrides the default converter. The line that causes this is the line return {**DEFAULT_CONVERTERS, **REGISTERED_CONVERTERS} in get_converters() in Django. אורי u...@speedy.net On Wed, May 6, 2020

Re: register_converter

2020-05-06 Thread Andréas Kühne
Hi, You register your converter in the main urls.py file (which is usually in the main project name, alongside settings.py). That's all you need to do. I don't know about the slug converter though - I would just reregister it and see what happens :) Regards, Andréas ‪Den ons 6 maj 2020 kl 11:

How to glue Django and React together?

2020-05-06 Thread Desmond Nyamador
Hi, what you're trying to do is called server side rendering. Django does this out of the box with it's templating language , however since you want to use an SPA (React) I suggest you look into Nextjs. It's built like this out of the box. -- You received this message because you are subscr

How to glue Django and React together?

2020-05-06 Thread Abhiram P
I want to use react as front end and Django as back end. And the URL routing must be done by Django. How to do this -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email

Re:

2020-05-06 Thread Adedotun Richard
Can i see your views.py. you can create a *decorator.py* that will help you handle that something like: you create a decorator.py file then do the following: from django.http import HttpResponse from django.shortcuts import redirect def unauthenticated_user(view_func): def wrapper_func(reques

I can't catch a URL in Django

2020-05-06 Thread אורי
Hi, I'm trying to convert my website from using re_path to path. I have a URL https://en.speedy.net/about/ , and if the user types any URL which starts with /about/, such as https://en.speedy.net/about/1/ - he is redirected to https://en.speedy.net/about/ . In urls.py I have: re_path(route=r'^a

Re: Drop down dependent on two other form fields

2020-05-06 Thread Sherif Adigun
Check this https://simpleisbetterthancomplex.com/tutorial/2018/01/29/how-to-implement-dependent-or-chained-dropdown-list-with-django.html -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails f

Re: Two forms in one template

2020-05-06 Thread Sherif Adigun
ok. send a reply when you are available. On Wed, May 6, 2020 at 11:13 AM Sergei Sokov wrote: > I can a little bit later, ok? > I think in 2 hour > > среда, 6 мая 2020 г., 12:00:13 UTC+2 пользователь Sherif Adigun написал: >> >> Please join the meeting now let's quickly fix it . >> >> https://us0

Re: Two forms in one template

2020-05-06 Thread Sergei Sokov
I can a little bit later, ok? I think in 2 hour среда, 6 мая 2020 г., 12:00:13 UTC+2 пользователь Sherif Adigun написал: > > Please join the meeting now let's quickly fix it . > > https://us04web.zoom.us/j/77729655336?pwd=c1o2Q0JQOFJiYm5hTlJTYjgra0dOQT09 > > On Monday, May 4, 2020 at 4:37:39 PM UT

Re:

2020-05-06 Thread Ilda Pedro
hello fahad rasool. just try this. from django.shortcuts import redirect return redirect('userprofile) On Wed, May 6, 2020 at 9:41 AM fahad rasool wrote: > I want to ask that i am working on django platform on a project ,which is > basically an system that generates a diet plan for user.. > >

Re: Drop down dependent on two other form fields

2020-05-06 Thread shefali chudasama
Did you gor the solution.. i want to do the same.. from database On Tuesday, January 5, 2016 at 1:07:54 AM UTC-5, Arindam sarkar wrote: > > Hello, > In my project I have a from in which there is three drop down. The 3rd > drop down is depended on the selected values of the above two drop downs .

How to make Custom User Registration and Login

2020-05-06 Thread Anubhav Madhav
I am new to Django. I need to make a custom sign up and log in page. Because, during Sign Up, I also want to get User's Address and Contact Number. In Django's 'User' module, it isn't supported. So, how can I make a custom sign up and sign in page. Please Help!! -- You received this message b

Django Media Static Files

2020-05-06 Thread ilda.pedro1993
Hello, everyone! My name is Ilda, i'm getting a page not found when trying to load django media files. My django settings file looks like below: [image: Captura de Tela (148).png] And saw many suggestions to concatenate my app urls with the static one like: urlpatterns +=static(settin

How can I custom Django Admin workflow

2020-05-06 Thread Kuncheng Li
I am using Django Admin for some authentication reasons. I have a model with FileField and I need the following steps: 1-upload a excel file. 2-read the excel file and display its header. 3-user choose some of the header and record to the database. How can I finish the job in Django Admin? -- Yo

How to customize the authentication system?

2020-05-06 Thread Camilo Garcia
I want to use the authentication system that django comes with, but the default model doesn't work for me, so I have to implement my own user model, the truth is that I don't know how I could do it without losing the power that this system offers me. Any step-by-step guide you recommend? I'm a

Re: reg: User model data missing from web page

2020-05-06 Thread Chetan Ganji
Ok. Regards, Chetan Ganji +91-900-483-4183 ganji.che...@gmail.com http://ryucoder.in On Wed, May 6, 2020 at 11:42 AM 'Amitesh Sahay' via Django users < django-users@googlegroups.com> wrote: > Hello Chetan, > > I got the issue resolved. Below are the correct views: > > def userprofileview(reques

Re: Two forms in one template

2020-05-06 Thread Sherif Adigun
Please join the meeting now let's quickly fix it . https://us04web.zoom.us/j/77729655336?pwd=c1o2Q0JQOFJiYm5hTlJTYjgra0dOQT09 On Monday, May 4, 2020 at 4:37:39 PM UTC+1, Sergei Sokov wrote: > > I have two forms in one template, but one of them doesn't have data to my > database. > Why does it h

Re: I am building an open source School Management System

2020-05-06 Thread Sherif Adigun
Now updated. Please confirm it's working fine now. -- You received this message because you are 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 discus

register_converter

2020-05-06 Thread אורי
Hi, Do I have to use register_converter in any file using it? I have a project with many urls.py files, and I want to register converters which will be used in multiple files. How do I register them? Do I have to register them in all the urls.py files? And where in my project should I put the conv

Re: A learner following a Mosh Tutorial on Django and having a problem saving a product to SQLite

2020-05-06 Thread Iain Stewart
That has worked!! Thank you so much! And thank you to everyone who responded. As a learner I am so grateful to get through to the next step with this. Iain :) On Wed, 6 May 2020 at 07:31, Nomeh Uchenna Gabriel wrote: > delete the migrations again, then run this to reset the tracking: > > >>>

[no subject]

2020-05-06 Thread fahad rasool
I want to ask that i am working on django platform on a project ,which is basically an system that generates a diet plan for user.. The flow is that a user has to register and sign up after registration, a form (userinfo form )is to be filled by user,on basis of which diet plan is generated. Now

Re: Two forms in one template

2020-05-06 Thread Sergei Sokov
my zoom Sergey Sokov среда, 6 мая 2020 г., 10:37:42 UTC+2 пользователь Sergei Sokov написал: > > I can but my english is very bad. > > среда, 6 мая 2020 г., 10:08:47 UTC+2 пользователь Sherif Adigun написал: >> >> Can you come to zoom so we fix this ones and for all >> >> On Wed, May 6, 2020, 8:13

Re: Two forms in one template

2020-05-06 Thread Sergei Sokov
I can but my english is very bad. среда, 6 мая 2020 г., 10:08:47 UTC+2 пользователь Sherif Adigun написал: > > Can you come to zoom so we fix this ones and for all > > On Wed, May 6, 2020, 8:13 AM Sergei Sokov > > wrote: > >> [image: kwargs.JPG] >> But the form is empty. >> >> class SkladCreateVi

Re: I am building an open source School Management System

2020-05-06 Thread Sherif Adigun
Thank you for that. I just realized I didn't commit the static/dist folder to git. Let me commit those files and push. Then you can update your clone On Wed, May 6, 2020, 9:10 AM Sherif Adigun wrote: > From your errors, it appears the static files are not loading correctly. > > But they are all

How to dump results and progress of a script in a log file

2020-05-06 Thread Sherif Adigun
Django has the logging feature. You definitely want to log success or errors in the second option while importing data into the database. See Django logging system https://docs.djangoproject.com/en/3.0/topics/logging/ -- You received this message because you are subscribed to the Google Group

Need to work with csv file

2020-05-06 Thread Sherif Adigun
Have you checked the python csv module? You may also want to read this: https://docs.djangoproject.com/en/3.0/howto/outputting-csv/ -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from i

Re: Need to work with csv file

2020-05-06 Thread Robert Rajendra
for working with csv files you can get help from CSV module of python, you can read the documents online about it On Wed, 6 May 2020 at 13:19, sharu kuriakose wrote: > Hi guys > Iam a student... doing a project in django. > In my project i need to open an image, while clicking on that image

Re: I am building an open source School Management System

2020-05-06 Thread Sherif Adigun
>From your errors, it appears the static files are not loading correctly. But they are all working right here. Did you clone in a virtual environment? Then run pip install -r requirements.txt On Wed, May 6, 2020, 1:09 AM Milson Munakami wrote: > Hi Sherif, > > I tried to run your project but un

Re: Two forms in one template

2020-05-06 Thread Sherif Adigun
Can you come to zoom so we fix this ones and for all On Wed, May 6, 2020, 8:13 AM Sergei Sokov wrote: > [image: kwargs.JPG] > But the form is empty. > > class SkladCreateView(LoginRequiredMixin, CustomSuccessMessageMixin, > CreateView): > model = Sklad > template_name = 'sklad.html' >

Need to work with csv file

2020-05-06 Thread sharu kuriakose
Hi guys Iam a student... doing a project in django. In my project i need to open an image, while clicking on that image i need to find the color of that pixel position. So i need to work with csv file. In my views. Py file i have a function. In that function i need to open a csv file w

Re: I'm new to this django help me out

2020-05-06 Thread Robert Rajendra
state your question On Tue, 5 May 2020 at 23:02, Sherif Adigun wrote: > what is your question? > > On Tuesday, May 5, 2020 at 6:25:48 PM UTC+1, sree lekha wrote: >> >> -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from th

Re: Two forms in one template

2020-05-06 Thread Sergei Sokov
[image: kwargs.JPG] But the form is empty. class SkladCreateView(LoginRequiredMixin, CustomSuccessMessageMixin, CreateView): model = Sklad template_name = 'sklad.html' form_class = SkladForm success_url = reverse_lazy('sklad') success_msg = 'Материал сохранён' def get_co