Re: From and Template in Django

2020-02-25 Thread Naveen Arora
Hi ben, You can use the same form any number of times passing it through views. Also, you can create a form.html which you can include anywhere for HTML forms using include tag. Cheers Naveen Arora On Wednesday, 26 February 2020 04:25:29 UTC+5:30, ben aziz zizah wrote: > > Is that possible to

Re: Django Session KeyError

2020-02-25 Thread Naveen Arora
Hi, please post the output of debugging the above, print after and before in these views and also check is something else is working using request.session. @csrf_exempt def upload_local_dataset(request): if request.method == 'POST': dataset =

Re: allauth- signup redirect

2020-02-25 Thread Naveen Arora
Hi Tosin, The simplest way would be to override the template account/signup.html with your own copy. If you examine that template you will see the following section: {% if redirect_field_value %}{% endif %} If you remove the if/endif part and change the value inside, the signup page will

Re: 'ssl_disabled' is an invalid keyword argument for connect()

2020-02-25 Thread Naveen Arora
Hi sir, Kindly use this as below, 'OPTIONS': { 'ssl' : { 'ssl_disabled': True } } Cheers, Naveen Arora On Wednesday, 26 February 2020 04:25:29 UTC+5:30, Stephen Loughin wrote: > > The django doc >

Re: 'ssl_disabled' is an invalid keyword argument for connect()

2020-02-25 Thread Integr@te System
Hi Steve, Plz review again to take a right parameter. Welcome. On Wed, Feb 26, 2020, 05:54 Stephen Loughin wrote: > The django doc > s say I > can pass OPTIONS for the db connection here: > > DATABASES = { > > 'default': {

Re: allauth- signup redirect

2020-02-25 Thread Vishnu Thuletiya
In setting.py you can write LOGIN_REDIRECT_URL='your redirect path' On Tue, 25 Feb 2020, 11:57 pm Tosin Ayoola, wrote: > halo guy, i'm using allauth for my authentication, but i wan redirect the > signup user to a page where they get update their profile detail, how do i > override the default

Re: Django Session KeyError

2020-02-25 Thread Guy NANA
Hi! Yes, it is. INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'tsanalysisapp.apps.TsanalysisappConfig', # Django Rest Framework -

Re: Django Session KeyError

2020-02-25 Thread Juan Pablo Romero Bernal
Hi, In your Django application, session middleware is enabled ? [1] [1] https://docs.djangoproject.com/en/3.0/topics/http/sessions/ On Tue, Feb 25, 2020 at 8:16 AM Guy NANA wrote: > I don't understand the first part of your answer : *Make sure your >> line request.session['ts_dataset_copy'],

Re: From and Template in Django

2020-02-25 Thread Juan Pablo Romero Bernal
Hi, Yes, you can use an instance of Form in more than one template: See: https://docs.djangoproject.com/en/3.0/topics/forms/ for more details. On Tue, Feb 25, 2020 at 4:54 PM ben aziz zizah wrote: > Is that possible to use the same form in more than one template > > -- > You received this

Re: 'ssl_disabled' is an invalid keyword argument for connect()

2020-02-25 Thread Juan Pablo Romero Bernal
Hi Steve, The supported option is ssl, see: https://github.com/django/django/blob/stable/3.0.x/django/db/backends/mysql/client.py I hope this helps, On Tue, Feb 25, 2020 at 4:54 PM Stephen Loughin wrote: > The django doc > s

Re: Get last instance object per each month and sum per month in Django

2020-02-25 Thread Simon Charette
If you don't want to operate on Activity instances annotations you can use the following queryset Status.objects.annotate( status_month=TruncMonth('status_date'), ).order_by( 'activity', 'status_month', ).values_list( 'activity', 'status_month', ).annotate(

From and Template in Django

2020-02-25 Thread ben aziz zizah
Is that possible to use the same form in more than one template -- 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

Re: Get last instance object per each month and sum per month in Django

2020-02-25 Thread Agnese Camellini
You should search how to make a group by activity and a partition by month then take each partition and sum the record up, i don't know how to do it in Django orm but in sql is the most effective way to solve the issue and it's a lot let expensive than taking all the activities and then search in

'ssl_disabled' is an invalid keyword argument for connect()

2020-02-25 Thread Stephen Loughin
The django doc s say I can pass OPTIONS for the db connection here: DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'OPTIONS': { 'ssl_disabled': 'True', }, 'NAME':

Get last instance object per each month and sum per month in Django

2020-02-25 Thread Mario Bisiani
I tryed to search for answer but nothing yet can help me. I have one class model Activity and a class model Status : class Status(models.Model): activity = models.ForeignKey(Activity, on_delete=models.CASCADE, related_name="all_status") status_date = models.DateField()

Django rest api connect with android mobile app

2020-02-25 Thread Zain Mehar
please anyone tell me how i connect my Django rest API with my Andriod mobile application please anyone tells? -- 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

allauth- signup redirect

2020-02-25 Thread Tosin Ayoola
halo guy, i'm using allauth for my authentication, but i wan redirect the signup user to a page where they get update their profile detail, how do i override the default success_url after the user have successfully signup , -- You received this message because you are subscribed to the Google

Re: django context data into javascript

2020-02-25 Thread 'Artem Vasin' via Django users
.js files, even if linked in Django templates are not processed by template engine. To output value from context to file, this file should be an output from template engine. You have three ways to solve your problem: Make your myjs.js file generated by template processor. It’s most difficult

Re: django context data into javascript

2020-02-25 Thread Soumen Khatua
But I'm getting one error On Tue 25 Feb, 2020, 5:59 PM Naveen Arora, wrote: > Hi, this is simple just enclose {{name}} into " " as "{{name}}" for your > part. > > Thanks > > On Tuesday, 25 February 2020 15:56:05 UTC+5:30, Soumen Khatua wrote: >> >> Hi Folks, >> >> I'm sending some context data

Re: Django Session KeyError

2020-02-25 Thread Guy NANA
> > I don't understand the first part of your answer : *Make sure your > line request.session['ts_dataset_copy'], print anything above it.* For sending dataset file from angular app to django, I've used a post request. The matter is that when I send the second http crosss-origin from angular

Re: reg: Error:-django.db.utils.OperationalError: (1170, "BLOB/TEXT column 'Description' used in key specification without a key length")

2020-02-25 Thread Ganesh Babu
Hi Team, I am getting an issue that issue i.e., ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output. i am trying to install mysql using django template. please help me. On Mon, Feb 24, 2020 at 8:13 PM 'Amitesh Sahay' via Django

Re: reg: Error:-django.db.utils.OperationalError: (1170, "BLOB/TEXT column 'Description' used in key specification without a key length")

2020-02-25 Thread Naveen Arora
This can be resolved using max_length attribute. If it doesn't work try deleting the migration files and doing makemigrations and migrate again. On Monday, 24 February 2020 20:14:25 UTC+5:30, Amitesh Sahay wrote: > > Hi, > > I am creating a model, which is taking a description as text field.

Re: Django Session KeyError

2020-02-25 Thread Pankaj Sharma
Make sure your line request.session['ts_dataset_copy'], print anything above it, also make sure you are using POST method in forms (method = "post") On Tuesday, February 25, 2020 at 3:47:25 AM UTC+5:30, Guy NANA wrote: > > I have an angular frontend app which send file to django backend which

Re: django context data into javascript

2020-02-25 Thread Naveen Arora
Hi, this is simple just enclose {{name}} into " " as "{{name}}" for your part. Thanks On Tuesday, 25 February 2020 15:56:05 UTC+5:30, Soumen Khatua wrote: > > Hi Folks, > > I'm sending some context data into html like > name = 'soumen' > return render(request,'xyz.html', context =

Re: reg: Error:-django.db.utils.OperationalError: (1170, "BLOB/TEXT column 'Description' used in key specification without a key length")

2020-02-25 Thread Pankaj Sharma
You haven't set max_len of TextField, use this - do it like this -- Description = models.TextField(max_length=1000) On Monday, February 24, 2020 at 8:14:25 PM UTC+5:30, Amitesh Sahay wrote: > > Hi, > > I am creating a model, which is taking a description as text field. when I > migrate I see

Re: django context data into javascript

2020-02-25 Thread Gil Obradors
Hi! The context is a dictionary mapping template variable names to Python objects. from https://docs.djangoproject.com/en/3.0/intro/tutorial03/ May be you need to test with a dict nor string directly. I haven't test a direct variable. Try not using JS, first resolve dict context in html , then

django context data into javascript

2020-02-25 Thread Soumen Khatua
Hi Folks, I'm sending some context data into html like name = 'soumen' return render(request,'xyz.html', context = {'name':name}) inside myjs.js(js script has been integrated to html): --- var my_name = {{name}}; I'm getting an