Connecting gcp cloud SQL instance with django project

2020-05-25 Thread Anirudh choudhary
Hello I am trying to connect gcp SQL instance with my django project I am connecting it as DATABASES = { 'default':env.db() } I am following this guide https://codelabs.developers.google.com/codelabs/cloud-run-django/index.html?index=..%2F..index#0 It is showing me error that no

How to create a function like Count

2020-05-25 Thread Saurabh Adhikary
I want to create a custom function which will get modified into a sql querry and will work like Count ...i.e. for every row of the queryset -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails

Re: Can we use Database with Django without creating models

2020-05-25 Thread Dylan Reinhold
Inspectdb is the way to go. Nothing is stopping you from just running sql queries though your DB python package like mysql-connector. You will loose much of the extras django provides with using the django-orm like admin connections to your database. Maybe flask would suit your use case better? D

Re: Can we use Database with Django without creating models

2020-05-25 Thread _M_A_Y_A_N_K_
Adding more details... I did tried *inspectdb, *but having other different issues with this. Here i want to purely use the legacy / existing database. Thanks & Regards, - Mayank Tripathi Mo. +1 615 962 2128 "Do what you can, with what you have, where you are -by Theodore Roosev

Re: Regarding opening Google docs

2020-05-25 Thread VenkataSivaRamiReddy
Use iframe or object tag in template... On Tue, May 26, 2020, 07:58 akshay bardiya wrote: > I want to create a button on a webpage . After clicking on that button it > should redirect to open Google docs where we can create, update ,delete > document so how can I do this > > -- > You received th

Regarding opening Google docs

2020-05-25 Thread akshay bardiya
I want to create a button on a webpage . After clicking on that button it should redirect to open Google docs where we can create, update ,delete document so how can I do this -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe fro

regular expression in an url showing post details

2020-05-25 Thread Tiempo
Hi, my name is Tiempo and I'm new with Django. currently, I'm using django 3.0 and i want to display each article of a blog app ( like when I click on article 1, it should display it full details on page show with the following link http://127.0.0.1:8000/blog/posts/1/) containing a parameter n

Can we use Database with Django without creating models

2020-05-25 Thread Mayank Tripathi
Hi Team, I am trying to get options to connect to Database from Python-Django App. But here the requirement is I already have a Database setup (MySQL) with all required tables and fields. So am not willing to use models.py and create tables. Is there a way still i can use the tables... and still

Re: convert Date to milliseconds

2020-05-25 Thread HJ
thank you so much for your ideas , I am gonna fix this ^^ Le mardi 26 mai 2020 01:01:17 UTC+1, Samuel Nogueira a écrit : > > Hi! before answer you question I would recomend you to give a little fix > in your model and your function names. Try to follow the PEP8 style guide > for Python, in the g

Re: EmptyDataError at /upload_reading while reading csv file using pandas

2020-05-25 Thread Jason Turner
Are you sure the file is coma delimited? This error is usually because the file is not coma separated. On Mon, May 25, 2020, 5:04 PM jakote lejaha wrote: > Ideally I would have wanted to use the "csv.reader" function, but in this > case it becomes complicated as I would like to load the cvs file

Re: Regarding rendering templates query

2020-05-25 Thread Karthiki Chowdary
Okay I will try thankyou On Mon, 25 May, 2020, 10:51 pm Joe Leger, wrote: > Where you are rendering a single image, instead use a for loop to render > all of your images like so: > {% for image in images %} > > {% endfor %} > > > On Monday, May 25, 2020 at 11:10:47 AM UTC-4, Karthiki Chowda

RES: convert Date to milliseconds

2020-05-25 Thread Samuel Nogueira
Hi! before answer you question I would recomend you to give a little fix in your model and your function names. Try to follow the PEP8 style guide for Python, in the guide is recommended using only capitalized words for naming classes with composite names, and function names should be lowercase wit

convert Date to milliseconds

2020-05-25 Thread HJ
Hello everyone I want to convert my Date from string to *milliseconds* this is my *models.py class * *class mail_item_count_deliveries_perDate(models.Model):countDeliveries = models.IntegerField(default=0)Date = models.DateTimeField()* this is my *views.py * def jsonDeliv(request):

EmptyDataError at /upload_reading while reading csv file using pandas

2020-05-25 Thread jakote lejaha
Ideally I would have wanted to use the "csv.reader" function, but in this case it becomes complicated as I would like to load the cvs file to my web template before I decide if I want to save it to the database or not. So I opt for reading the file using pandas as it's easy to display the record

Re: GeoDjango with MySQL8

2020-05-25 Thread Tim Graham
Hi, you might have better luck getting an answer on the GeoDjango mailing list: https://groups.google.com/forum/#!forum/geodjango On Monday, May 25, 2020 at 11:06:26 AM UTC-4, Utkarsh Bansal wrote: > > I am facing problems while trying to use GeoDjango (v2.2) with MySQL 8.0.19 > > I created a new

Re: function model which generate a code for model field

2020-05-25 Thread Anselme SERI
hello, I am trying to create a function which will recover the last id of my model which I will increment and add to a character string, and I would like to add this new value (x = last id incremented + string) be added to the "code" field "of my model when I make a new recording. How else could we

Re: Django select list

2020-05-25 Thread Luqman Shofuleji
Little adjustment, $.ajax({ url: '{% url "" %}', data: { 'x': , }, dataType: 'json', success: function (data) { if (data.added_item) {

Re: Django select list

2020-05-25 Thread Luqman Shofuleji
Yes that's possible since you are using Ajax. It should be something like this: $.ajax({ url: '{% url "" %}', data: { 'x': , }, dataType: 'json', success: function (data) {

Re: Regarding rendering templates query

2020-05-25 Thread Joe Leger
Where you are rendering a single image, instead use a for loop to render all of your images like so: {% for image in images %} {% endfor %} On Monday, May 25, 2020 at 11:10:47 AM UTC-4, Karthiki Chowdary wrote: > > Hi, > > I have a query in in templates i was a beginner in django and pyt

Regarding rendering templates query

2020-05-25 Thread Karthiki Chowdary
Hi, I have a query in in templates i was a beginner in django and python. Please help me out in this query . For suppose i have a buttons on client browser like SKINCARE or HAIR CARE products if i click on that buttons it should display the logos of skin care products or hair care products.

Django select list

2020-05-25 Thread Sherif Adigun
I have a form which has a select field (your color). In front of the select field, I have a button that produces a popup which allows users to create new color before they submit. I am submitting that color form via Ajax. After adding a new color to the database, the popup closes. I want the new

GeoDjango with MySQL8

2020-05-25 Thread Utkarsh Bansal
I am facing problems while trying to use GeoDjango (v2.2) with MySQL 8.0.19 I created a new PointField and ran makemigrations geo_code = PointField(srid=4326) On running sqlmigrate on the generated migration - I notice that the column does not have a SRID constrain BEGIN; -- -- Create model Loca

Regarding redering data in html templates

2020-05-25 Thread Karthiki Chowdary
Hi i was beginner in django and i have a small query in templates. For suppose in the home page of any client browser if we have a button like SKINCARE or HEALTH CARE and if we click on that buttons we need to get the data of all skin care products companies logos/ health care companies logos.

SRID issues with GeoDjango on MySQL 8

2020-05-25 Thread Utkarsh Bansal
GeoDjango is not respecting SRIDs with MySQL 8. I created a new column geo_code = PointField(srid=4326) and ran makemigrations. Running sqlmigrate on the generated migration gives BEGIN; -- -- Create model Location -- CREATE TABLE `locations_location` (`id` integer AUTO_INCREMENT NOT NULL PR

Re: What is considered copyright when it comes to building a website?

2020-05-25 Thread David Swarbrick
Copyright varies a little from jurisdition to jurisdiction. The essence of it is that copyright arises automatically when a person records a creative element. Nothing more is required. Copyright opeates then to give to the creator the right to control the making of copies of that creation. Necessa