Re: API for writing a new database backend

2018-07-20 Thread Derek
> I'm starting to write a new database backend for a non-relational > database, but I can't find any API specification that I should follow. > Such API or any related documentation exists? > > Thank you, > Nuno > > -- You received this message because you are

[Channels] How to write tests with database access?

2018-07-19 Thread Neraste
Hello Django users, This sounds like a pretty newbish question, but I am struggling on how to write tests for Django-channels 2 websocket consumers that access the database. I am not familiar with pytest and asynchronous programming (the bread and butter of Channels testing), so while I

Re: API for writing a new database backend

2018-07-19 Thread C. Kirby
date, but should have most of the info you need) https://reinout.vanrees.org/weblog/2016/11/04/database-backends.html On Wednesday, July 18, 2018 at 5:32:09 PM UTC-4, Nuno wrote: > > Hi, > I'm starting to write a new database backend for a non-relational > database, but I can&#

API for writing a new database backend

2018-07-18 Thread Nuno
Hi, I'm starting to write a new database backend for a non-relational database, but I can't find any API specification that I should follow. Such API or any related documentation exists? Thank you, Nuno -- You received this message because you are subscribed to the Google Groups &qu

Re: Is it possible to create models inside a database model

2018-07-11 Thread mottaz hejaze
you cant make models inside models becouse you cant make tables inside tables ... a model is a database table aditya the easiest way is to redesign your model and make it of 15 fields ..each field will upload to a specific folder inside the media folder another way . is to make a one image

Re: Is it possible to create models inside a database model

2018-07-11 Thread mottaz hejaze
;> field in the template so it needs to be unique to the model field. When you >> use the ForeignKey field type it uses the primaryKey of the related >> database models automatically so you dont need to worry about actually >> telling it which field to use to relate to in a RD

Re: Is it possible to create models inside a database model

2018-07-10 Thread aditya gupta
to access the specific field > in the template so it needs to be unique to the model field. When you use > the ForeignKey field type it uses the primaryKey of the related database > models automatically so you dont need to worry about actually telling it > which field to use to relat

Re: Is it possible to create models inside a database model

2018-07-10 Thread Alexander Joseph
Oh ok I see. The related_name is what you use to access the specific field in the template so it needs to be unique to the model field. When you use the ForeignKey field type it uses the primaryKey of the related database models automatically so you dont need to worry about actually telling it

Re: Is it possible to create models inside a database model

2018-07-10 Thread Alexander Joseph
5 AM UTC-6, aditya wrote: >> >> I have created a model Named Gallery and set upload path to media folder >> and in that folder I have 15 more folders with different images. >> Now I want to access each folder and images present inside it using >> database. >&

Re: Is it possible to create models inside a database model

2018-07-10 Thread Alexander Joseph
at 9:26:55 AM UTC-6, aditya wrote: > > I have created a model Named Gallery and set upload path to media folder > and in that folder I have 15 more folders with different images. > Now I want to access each folder and images present inside it using > database. > My question is :

Is it possible to create models inside a database model

2018-07-10 Thread aditya
I have created a model Named Gallery and set upload path to media folder and in that folder I have 15 more folders with different images. Now I want to access each folder and images present inside it using database. My question is : Is it possible to create 15 model inside an model and if

Re: Database data caching in Django?...

2018-07-09 Thread Ravi Bhushan
rite-through > database cache in Django? > > I'd want memcached or something to cache all data read by the > Django ORM and use the cached copy on future reads, and of > course update the cache as well as the DB (a "write-through" > cache) when writing data. > &g

Modelformset_factory does not save to database

2018-07-05 Thread martinnnn2019
Hello, I am trying to scale multiple modelforms by using modelformset_factory and save them to database to their respective models. Even though code creates different forms for different models but it does not save them to database. The relevant code parts can be found here https

Re: Unable to Save form to mysql - How to save form field values to mysql database and get the value from database

2018-07-02 Thread Andréas Kühne
ing to using simple forms to > save into mysql database. also any samples pls send it to me, which will > help to understand the connectivity. > > *see my sample code:* > > > *views.py* > > from django.http import HttpResponseRedirect > from django.views import View >

Unable to Save form to mysql - How to save form field values to mysql database and get the value from database

2018-07-02 Thread Tamilvanan Anbalagan
Hi Team, I am very new to django framework, iI am trying to using simple forms to save into mysql database. also any samples pls send it to me, which will help to understand the connectivity. *see my sample code:* *views.py* from django.http import HttpResponseRedirect from django.views

How can I save uploaded image's url in a column of database?

2018-07-01 Thread prateek gupta
cessfully. But I want to save the same uploaded image's url to database also; inside 'image_url' column of Brand table. How can I do that? What change should I make here? -- You received this message because you are subscribed to the Google Groups "Django users" gr

Re: Database

2018-07-01 Thread Tomasz Knapik
Django has support for Postgres-only features - https://docs.djangoproject.com/en/2.0/ref/contrib/postgres/ - if you need any of them. Also full text search is much easier to implement with Postgres in Django - https://docs.djangoproject.com/en/2.0/ref/contrib/postgres/search/ Also I am not s

Re: Database

2018-06-30 Thread Mike Dewhirst
I've used both. If you have a choice use Postgres. Mike Connected by Motorola ABHISHEK PARMAR <150305105...@paruluniversity.ac.in> wrote: >Should i use postgres or mysql ? > >-- >You received this message because you are subscribed to the Google Groups >"Django users" group. >To unsubscribe

Re: Database

2018-06-30 Thread Mark Phillips
Use whichever one you are more familiar with, unless there is a technical reason for your specific project to pick one over the other. Familiarity is important if you are just learning django, as you don't need too many learning curves at the same time. Sometimes, it is helpful to look at the table

Re: Database

2018-06-30 Thread Joshua Kayode
Use postgresql, but you can find reasons not to!, the choice between MySQL and postgresql is more or less personal! Both have their strengths and weakness! On Jun 30, 2018 14:05, "ABHISHEK PARMAR" <150305105...@paruluniversity.ac.in> wrote: > Should i use postgres or mysql ? > > -- > You receiv

Database

2018-06-30 Thread ABHISHEK PARMAR
Should i use postgres or mysql ? -- 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 post to this group, send email to

Re: Why some Django fields are not saved in database?

2018-06-21 Thread prateek gupta
ributes and model fields. > > > > A model field is a special class attribute that Django stores in the > database. You have to declare them using one of the field types > <https://docs.djangoproject.com/en/2.0/ref/models/fields/> that Django > supports. > > Ever

Re: Why some Django fields are not saved in database?

2018-06-21 Thread Melvyn Sopacua
ng. The main issue you're facing is the difference between class attributes and model fields. A model field is a special class attribute that Django stores in the database. You have to declare them using one of the field types[1] that Django supports. Everything else is not saved in the da

Re: Why some Django fields are not saved in database?

2018-06-21 Thread prateek gupta
6 PM UTC+5:30, Melvyn Sopacua wrote: > > On donderdag 21 juni 2018 10:42:09 CEST prateek gupta wrote: > > > Issue is in database , latitude/longitude values are blank. > > > > What I am doing wrong here? > > Why do you not understand your own code? How did you g

Re: Why some Django fields are not saved in database?

2018-06-21 Thread Melvyn Sopacua
On donderdag 21 juni 2018 10:42:09 CEST prateek gupta wrote: > Issue is in database , latitude/longitude values are blank. > > What I am doing wrong here? Why do you not understand your own code? How did you get that code - you explicitly code it so that it they do NOT end up in the

Why some Django fields are not saved in database?

2018-06-21 Thread prateek gupta
the form submisson I am able to see both fields values- <https://lh3.googleusercontent.com/-Ei3fTveJ7oA/Wytkan_rUDI/MK8/1qyuFD_pqeUcP34P8Uvt3JJ5YoCLASOvACLcBGAs/s1600/django.JPG> Issue is in database , latitude/longitude values are blank. What I am doing wrong here? models.py-

Re: Performance comparison for several Database Types?

2018-06-09 Thread Jason
the answer is always, "it depends" https://www.digitalocean.com/community/tutorials/sqlite-vs-mysql-vs-postgresql-a-comparison-of-relational-database-management-systems the general feeling is unless theres something you absolutely need that it doesn't have, postgres really

Re: Performance comparison for several Database Types?

2018-06-09 Thread dononyx
On Saturday, June 9, 2018 at 1:52:49 AM UTC-7, Erik Rull wrote: > > Hi all, > > I'm currently using for a more or less "small" project Django with an > SQLite Database (was the easiest starting point for me). > If I would switch to another database, how woul

Performance comparison for several Database Types?

2018-06-09 Thread Erik Rull
Hi all, I'm currently using for a more or less "small" project Django with an SQLite Database (was the easiest starting point for me). If I would switch to another database, how would the performance behave? Will it be faster or slower and how much? Is there a comparison chart e

How to work with established postgresql database with multiple schemas in Django?

2018-06-05 Thread G.R. Nobles
I'm trying to develop a django interface for an existing postgresql db, the db makes use of various schemas, looking at the literature the following example should work, but it only returns the schema defined in the default database when I run python manage.py inspectdb. Also when this

Re: Updating django database

2018-06-03 Thread liujiawei . jevade
o guys, > Sorry about the above no subject mail > I am getting a json string(json_string) from frontend. How can we update > the django database in views.py. Below is my models.py. > > models.py > > class Patient(models.Model): > patient_id = models.CharField(pr

Re: Updating django database

2018-06-02 Thread 'Anthony Flury' via Django users
subject mail I am getting a json string(json_string) from frontend. How can we update the django database in views.py. Below is my models.py. models.py class Patient(models.Model):     patient_id = models.CharField(primary_key=True, max_length=200)     patient_age = models.CharField(max_length=

Re: Updating django database

2018-06-02 Thread Albin Antony
Can the first be done if there is a relation between the models? On Sat, Jun 2, 2018 at 7:49 PM, Melvyn Sopacua wrote: > On zaterdag 2 juni 2018 15:12:08 CEST Albin Antony wrote: > > For updating multiple models at the same time, Should we create multiple > > instances? > > Multiple models (Pat

Re: Updating django database

2018-06-02 Thread Melvyn Sopacua
On zaterdag 2 juni 2018 15:12:08 CEST Albin Antony wrote: > For updating multiple models at the same time, Should we create multiple > instances? Multiple models (Patient and Medication) or multiple instances of the same model (more than one Patient)? The later can be done with a single manager

Re: Updating django database

2018-06-02 Thread Albin Antony
> > > > On 29/05/18 12:37, Albin Antony wrote: > >> Hello guys, >> Sorry about the above no subject mail >> I am getting a json string(json_string) from frontend. How can we update >> the django database in views.py. Below is my models.py. >> models.py >&g

Re: Updating django database

2018-06-02 Thread 'Anthony Flury' via Django users
, Albin Antony wrote: Hello guys, Sorry about the above no subject mail I am getting a json string(json_string) from frontend. How can we update the django database in views.py. Below is my models.py. models.py class Patient(models.Model):     patient_id = models.CharField(primary_k

Updating django database

2018-05-29 Thread Albin Antony
Hello guys, Sorry about the above no subject mail I am getting a json string(json_string) from frontend. How can we update the django database in views.py. Below is my models.py. models.py class Patient(models.Model): patient_id = models.CharField(primary_key=True, max_length=200

Re: Public Django administrative database

2018-05-24 Thread Daniel Chimeno
Thanks all for your answer, the OS-Open seems to work well. -- 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 post to

Re: Open Sqlite database file directly in django

2018-05-24 Thread Sourabh Jaiswal
:30, Sourabh Jaiswal wrote: > > Hi, > > Is there any way to open sqlite db directly in django. > > I am working on an application for which a back end script creates a > database for every execution. > The database consists of multiple tables and I have to show those tables

Re: Open Sqlite database file directly in django

2018-05-24 Thread Sourabh Jaiswal
:30, Sourabh Jaiswal wrote: > > Hi, > > Is there any way to open sqlite db directly in django. > > I am working on an application for which a back end script creates a > database for every execution. > The database consists of multiple tables and I have to show those tables

Re: Open Sqlite database file directly in django

2018-05-24 Thread Vinicius Assef
t in my case data can be huge... Is that a good way to do it? > > Regards, > Sourabh Jaiswal. > > On Tuesday, May 22, 2018 at 5:55:32 PM UTC+5:30, Sourabh Jaiswal wrote: >> >> Hi, >> >> Is there any way to open sqlite db directly in django. >> >> I am

Re: Open Sqlite database file directly in django

2018-05-24 Thread PASCUAL Eric
Hi, The content of the context dict can be anything, including of course values read from the database thanks to the sqlite3 lib. What Django generic views working with templates do is transfering for you the object field values to context entries and also automating the creation of form

Re: Open Sqlite database file directly in django

2018-05-23 Thread Sourabh Jaiswal
PM UTC+5:30, Sourabh Jaiswal wrote: > > Hi, > > Is there any way to open sqlite db directly in django. > > I am working on an application for which a back end script creates a > database for every execution. > The database consists of multiple tables and I have to show th

Re: Open Sqlite database file directly in django

2018-05-22 Thread PASCUAL Eric
Thanks for the tip, I didn't notice this management command before. Eric From: django-users@googlegroups.com on behalf of Vinicius Assef Sent: Tuesday, May 22, 2018 6:56:20 PM To: django-users@googlegroups.com Subject: Re: Open Sqlite database file dir

Re: Open Sqlite database file directly in django

2018-05-22 Thread Jimmy Cowden
On Tue, May 22, 2018, 8:25 AM Sourabh Jaiswal wrote: > Hi, > > Is there any way to open sqlite db directly in django. > > I am working on an application for which a back end script creates a > database for every execution. > The database consists of multiple tables and

Re: Open Sqlite database file directly in django

2018-05-22 Thread Vinicius Assef
Re, > > > But you'll not be able to access the sqlite DB through Django models, since > it will not have the proper schema. > > > Eric > > From: PASCUAL Eric > Sent: Tuesday, May 22, 2018 3:59:35 PM > To: Django users > Subject: Re:

Re: Open Sqlite database file directly in django

2018-05-22 Thread PASCUAL Eric
Re, But you'll not be able to access the sqlite DB through Django models, since it will not have the proper schema. Eric From: PASCUAL Eric Sent: Tuesday, May 22, 2018 3:59:35 PM To: Django users Subject: Re: Open Sqlite database file directly in django

Re: Open Sqlite database file directly in django

2018-05-22 Thread PASCUAL Eric
Hi Jaiswal, You can use the Python sqlite3 standard lib for opening this database and manipulate it, and then display data using views written with Django. Eric From: django-users@googlegroups.com on behalf of Sourabh Jaiswal Sent: Tuesday, May 22, 2018 8

Open Sqlite database file directly in django

2018-05-22 Thread Sourabh Jaiswal
Hi, Is there any way to open sqlite db directly in django. I am working on an application for which a back end script creates a database for every execution. The database consists of multiple tables and I have to show those tables on the web site made in django. Is there any other way around

Re: Public Django administrative database

2018-05-19 Thread Melvyn Sopacua
r countries. > At first, I look > into https://github.com/django/django-localflavor/tree/master/localflavor/gb > but there aren't so many entities there. > > Then, searched in Google for some hours and couldn't find any reliable > database or csv. This really wasn&

Re: Public Django administrative database

2018-05-18 Thread Christian Ledermann
>>> At first, I look into https://github.com/django >>> /django-localflavor/tree/master/localflavor/gb >>> but there aren't so many entities there. >>> >>> Then, searched in Google for some hours and couldn't find any reliable >>> database

Re: Public Django administrative database

2018-05-18 Thread Christian Ledermann
r >> countries. >> At first, I look into https://github.com/django/django-localflavor/tree/ >> master/localflavor/gb >> but there aren't so many entities there. >> >> Then, searched in Google for some hours and couldn't find any reliable >> data

Re: Public Django administrative database

2018-05-18 Thread Christian Ledermann
h at the moment is only for UK, could be expanded to other > countries. > At first, I look into https://github.com/django/django-localflavor/ > tree/master/localflavor/gb > but there aren't so many entities there. > > Then, searched in Google for some hours and couldn'

Public Django administrative database

2018-05-18 Thread Daniel Chimeno
aster/localflavor/gb but there aren't so many entities there. Then, searched in Google for some hours and couldn't find any reliable database or csv. How you folks get this kind of information? Any resource? If it's Django related would be awesome, if not, I could process it. Thank

Re: How to retrieve existing data of mongodb database in Django

2018-05-17 Thread Ryan Nowakowski
It looks like you're reusing the variable connone. Could that be the issue? On May 15, 2018 10:38:06 AM CDT, gomahe...@gmail.com wrote: >I am new to Django started developing the application but got a >problem in >retrieving the data from already existing data which looks like this >below. >

How to retrieve existing data of mongodb database in Django

2018-05-15 Thread gomahesh5
I am new to Django started developing the application but got a problem in retrieving the data from already existing data which looks like this below. {"_id":"5ad72e80bdd7ad184031ab2d","name":"john","country":"usa","place":"xyz"} {"_id":"5ad72ec6bdd7ad184031ab2e","name":"ron","co

Re: unexpected JSONField behavior clarification - key value pairs initially loaded integers, then saved down as strings into the database

2018-05-07 Thread Oliver Zhou
ote: > > Using Django 1.11, Python 2.7, PostGres, and JSONField I'm getting > behavior I don't expect. > > It seems when JSONField values are initially saved/accessed in memory, > they're python "integers", but when saved to the database and then > re

Re: unexpected JSONField behavior clarification - key value pairs initially loaded integers, then saved down as strings into the database

2018-05-06 Thread Peter of the Norse
;t expect. > > It seems when JSONField values are initially saved/accessed in memory, > they're python "integers", but when saved to the database and then > re-accessed, the values are now in string format. > > What about how Django handles JSONField string vs inte

Re: database update after paypal payment

2018-04-25 Thread mab . mobile . 01
Hello Michael, I am having the same problem. I have no problems submitting the data from my website to paypal. I am using Django 2.0.x and just need the django IPN-listener code in an easy to understand way. I want to receive data back from paypal IPN and be able to store it in my database ie

unexpected JSONField behavior clarification - key value pairs initially loaded integers, then saved down as strings into the database

2018-04-24 Thread Oliver Zhou
Using Django 1.11, Python 2.7, PostGres, and JSONField I'm getting behavior I don't expect. It seems when JSONField values are initially saved/accessed in memory, they're python "integers", but when saved to the database and then re-accessed, the values are now in st

Re: Decoupling Postgres database credentials in django for deployment.

2018-04-22 Thread Vinnicyus Gracindo
Github: python-decouple Em dom, 22 de abr de 2018 14:05, Bill Torcaso escreveu: > > I waited a while to answer this, and my answer comes in three distinct > parts. > > #- > > Question: what is the danger is using environment variables to hold > secret info? > > Answer: The

Re: Decoupling Postgres database credentials in django for deployment.

2018-04-22 Thread Bill Torcaso
I waited a while to answer this, and my answer comes in three distinct parts. #- Question: what is the danger is using environment variables to hold secret info? Answer: The Django runtime will dump secret info from environment variables into an HTTP response, in some c

Re: Storing lists from api into database

2018-04-06 Thread James Farris
I would use the Requests module. It's much nicer and comes loaded with stuff. It's a module used to connect to API's. Here's the docs: http://docs.python-requests.org/en/master/ As far as using what you have, to save it to the database is just another few lines of code

Re: Storing lists from api into database

2018-04-06 Thread James Farris
I would use the Requests module. It's much nicer and comes loaded with stuff. It's a module used to connect to API's. Here's the docs: http://docs.python-requests.org/en/master/ As far as using what you have, to save it to the database is just another few lines of code

Re: Storing lists from api into database

2018-04-06 Thread Mateusz Kurowski
x27;]) > for i in range(0,10): > print(ldate[i]+" : ",end="") > print(lurl[i]) > > Now I have to store all such values in my database and call it in views > page. > > class tesla(models.Model): > id1=models.CharFie

Storing lists from api into database

2018-04-06 Thread Mukesh Jha
']['results'][i]['webUrl']) ldate.append(data['response']['results'][i]['webPublicationDate']) for i in range(0,10): print(ldate[i]+" : ",end="") print(lurl[i]) Now I have to store all such values in my databas

Re: Decoupling Postgres database credentials in django for deployment.

2018-04-02 Thread Mike Dewhirst
ls for any purpose but especially for keeping database credentials out of the repository. It means I have to store the credentials files (separate file for each eg database, email etc) in a place accessible to the web server but out of the doc root. The settings file only contains calls to t

Re: Decoupling Postgres database credentials in django for deployment.

2018-04-02 Thread Mike Dewhirst
On 2/04/2018 7:59 PM, Cictani wrote: Hi, You could rename your dev settings file to for example 'settings_dev.py' and only commit this file (add settings.py to .gitignore). I wrote a tiny utility to read a file and retrieve credentials for any purpose but especially for keepin

Re: Decoupling Postgres database credentials in django for deployment.

2018-04-02 Thread Cictani
Hi, You could rename your dev settings file to for example 'settings_dev.py' and only commit this file (add settings.py to .gitignore). On your Linux Server you could create a new directory in /etc like: /etc/django /etc/django/app1 /etc/django/app2 ... There you store your production 'setti

Re: Decoupling Postgres database credentials in django for deployment.

2018-04-01 Thread PASCUAL Eric
et. Eric From: django-users@googlegroups.com on behalf of Derek Sent: Saturday, March 31, 2018 3:46:53 PM To: Django users Subject: Re: Decoupling Postgres database credentials in django for deployment. How is github "security" going to help you keep you

Re: Decoupling Postgres database credentials in django for deployment.

2018-03-31 Thread Derek
ens when I run on a Vagrant VM, and I > think it would be the same in a Docker-like container. > > > > > On Thursday, March 29, 2018 at 4:24:40 PM UTC-4, prince gosavi wrote: >> >> Hi, >> I have made a django project and want to deploy it on cloud. >> B

Re: Decoupling Postgres database credentials in django for deployment.

2018-03-31 Thread Andréas Kühne
> Eric >> >> -- >> *From:* django-users@googlegroups.com on >> behalf of Bill Torcaso >> *Sent:* Friday, March 30, 2018 4:50:02 PM >> *To:* Django users >> *Subject:* Re: Decoupling Postgres database credentials in django fo

Re: Decoupling Postgres database credentials in django for deployment.

2018-03-30 Thread Phang Mulianto
ost name or some other properties of the target systems. > > > Best > > > Eric > > -- > *From:* django-users@googlegroups.com on > behalf of Bill Torcaso > *Sent:* Friday, March 30, 2018 4:50:02 PM > *To:* Django users > *Su

Re: Decoupling Postgres database credentials in django for deployment.

2018-03-30 Thread PASCUAL Eric
based on the host name or some other properties of the target systems. Best Eric From: django-users@googlegroups.com on behalf of Bill Torcaso Sent: Friday, March 30, 2018 4:50:02 PM To: Django users Subject: Re: Decoupling Postgres database creden

Re: Decoupling Postgres database credentials in django for deployment.

2018-03-30 Thread Bill Torcaso
to decouple the database info too, like the username password etc. > Any help is appreciated. > -- 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

Re: Decoupling Postgres database credentials in django for deployment.

2018-03-30 Thread PASCUAL Eric
_ From: django-users@googlegroups.com on behalf of Antonis Christofides Sent: Friday, March 30, 2018 2:11:02 PM To: django-users@googlegroups.com Subject: Re: Decoupling Postgres database credentials in django for deployment. Environment variables are the best option for not embedding

Re: Decoupling Postgres database credentials in django for deployment.

2018-03-30 Thread Antonis Christofides
replicas and services which need them. > > > Best regards > > > Eric > > > *From:* django-users@googlegroups.com on > behalf of Andréas Kühne > *Sent:* Friday, March 30, 2018 11:08:52 AM > *To:* django-users@googlegr

Re: Decoupling Postgres database credentials in django for deployment.

2018-03-30 Thread PASCUAL Eric
rds Eric From: django-users@googlegroups.com on behalf of Andréas Kühne Sent: Friday, March 30, 2018 11:08:52 AM To: django-users@googlegroups.com Subject: Re: Decoupling Postgres database credentials in django for deployment. Hi, I am sorry, but this doesn't really make sen

Re: Decoupling Postgres database credentials in django for deployment.

2018-03-30 Thread Andréas Kühne
Hi, I am sorry, but this doesn't really make sense. What do you mean by decoupling the data? Deploying to the cloud, will mean that you will need to setup a new database for your project - there you will get a completly new database, that won't be connected to your development data

Decoupling Postgres database credentials in django for deployment.

2018-03-29 Thread prince gosavi
Hi, I have made a django project and want to deploy it on cloud. Before that i want to decouple all the private information. I want to decouple the database info too, like the username password etc. Any help is appreciated. -- You received this message because you are subscribed to the Google

Re: How to upload and save excel data in database django

2018-03-29 Thread Jani Tiainen
Hi, there are few ways to do that, both represented in previous posts. Simpler one is to export data as CSV since it's simpler to read in Python (Python has built-in CSV reader/writer) Complex one is to use some library to read Excel files directly. See https://www.datacamp.com/community/tutorial

Re: How to upload and save excel data in database django

2018-03-29 Thread arvind yadav
how to use in django please explain On Thursday, March 29, 2018 at 5:51:17 PM UTC+5:30, Lei Zhao wrote: > > I think you use the library xlrd to extract data from the Excel file. > The documentation for the library can be found here at > http://xlrd.readthedocs.io/en/latest/ . > > > On Thursday, M

Re: How to upload and save excel data in database django

2018-03-29 Thread Lei Zhao
I think you use the library xlrd to extract data from the Excel file. The documentation for the library can be found here at http://xlrd.readthedocs.io/en/latest/ . On Thursday, March 29, 2018 at 6:03:03 PM UTC+8, arvind yadav wrote: > > this is may data format > > >

Re: How to upload and save excel data in database django

2018-03-29 Thread Julio Biason
Hi, I'd export the data to CSV (which is easier to parse), create a Django Command ( https://docs.djangoproject.com/en/2.0/howto/custom-management-commands/#module-django.core.management) that will open the CSV and then add the records. On Thu, Mar 29, 2018 at 7:03 AM, arvind yadav < developer.ar

How to upload and save excel data in database django

2018-03-29 Thread arvind yadav
this is may data format from django.db import models class RegisterMember(models.Model): GENDER_CHOICES = ( ('M', 'Male'), ('F', 'Female'), )

Re: A problem about database structure and displacement on django admin

2018-03-27 Thread Mike Dewhirst
isplay those fields with values and hide the fields without values? Or is there is any other way to modify the database structure or class structure to display the metabolites and stoichiometry only this reaction involves? Thank you -- You received this message because you are subscribed t

A problem about database structure and displacement on django admin

2018-03-27 Thread shawnmhy
t; In that case, how can only display those fields with values and hide the fields without values? Or is there is any other way to modify the database structure or class structure to display the metabolites and stoichiometry only this reaction involves? Thank you -- You received thi

Re: Get data from an external api into my database.

2018-03-20 Thread 'Tom Evans' via Django users
On Tue, Mar 20, 2018 at 10:23 AM, Mukesh Jha wrote: > I want to access a api from http://open-platform.theguardian.com/ or > https://newsapi.org/ and load it into my sqlite database. The data in these > site is in json format and I want them to get converted into my database > mode

Re: Get data from an external api into my database.

2018-03-20 Thread Jani Tiainen
Hi. Requests library will be your friend. ti 20. maaliskuuta 2018 klo 14.05 Mukesh Jha kirjoitti: > I want to access a api from http://open-platform.theguardian.com/ or > https://newsapi.org/ and load it into my sqlite database. The data in > these site is in json format and I want th

Get data from an external api into my database.

2018-03-20 Thread Mukesh Jha
I want to access a api from http://open-platform.theguardian.com/ or https://newsapi.org/ and load it into my sqlite database. The data in these site is in json format and I want them to get converted into my database model format and store in it and later on use them as when queried. I am

Re: Use SQLite file database for tests (and not in-memory)

2018-03-10 Thread Daniel Gilge
Ok, I found it. You just have to define a name for your test database in your settings: DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': 'mydatabase', 'TEST': { 'NAM

Use SQLite file database for tests (and not in-memory)

2018-03-10 Thread Daniel Gilge
Hi, *Introduction:* Django uses an in-memory database for testing <https://docs.djangoproject.com/en/2.0/topics/testing/overview/#the-test-database> when it finds a SQLite database in the settings. However, the ChannelsLiveServerTestcase (of Channels 2.0) cannot be used with an in-

StaticLiveServerTestCase: database emptied after first test after upgrading to Django 1.11

2018-02-23 Thread Simon McConnell
Nothing to do with this? https://docs.djangoproject.com/en/2.0/releases/1.11.2/ -- 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...@googleg

StaticLiveServerTestCase: database emptied after first test after upgrading to Django 1.11

2018-02-23 Thread 'Tom Evans' via Django users
Hi all We have a bunch of functional tests derived from StaticLiveServerTestCase using selenium that have started failing after upgrading from Django 1.8 to Django 1.11. The database is initially populated via data migrations, but after running one test it all the data loaded via migrations has

Re: Testing Channels database data missing in Consumer

2018-02-07 Thread Andrew Godwin
Interesting. I did note that you called ORM methods in an async context, which is not how you are supposed to do it, but I also believe that should work. Maybe try splitting the ORM methods into a separate function and awaiting it using SyncToAsync? As for the staticfiles in live test case problem

Re: Testing Channels database data missing in Consumer

2018-02-07 Thread Daniel Gilge
Hi Andrew, thanks for your reply. This test is passing (using the same packages): def test_fixture(db_with_segment, admin_client): assert models.MyModel.objects.count() == 1 response = admin_client.get('/api/my_model/list/') assert len(response.json()['results']) == 1 I tried to wri

Re: Testing Channels database data missing in Consumer

2018-02-06 Thread Andrew Godwin
I'm not quite sure either. Does the test setup work if you are not in async mode? Andrew On Tue, Feb 6, 2018 at 9:45 AM, Daniel Gilge wrote: > Hi, > > this question is related to Channels 2.0, Django 2.0, pytest 3.4, > pytest-django 3.1 and pytest-asyncio 0.8. > > I created a pytest: > > @pytes

Testing Channels database data missing in Consumer

2018-02-06 Thread Daniel Gilge
Hi, this question is related to Channels 2.0, Django 2.0, pytest 3.4, pytest-django 3.1 and pytest-asyncio 0.8. I created a pytest: @pytest.fixture def db_with_obj(db): factories.MyModelFactory() @pytest.mark.asyncio async def test_something(db_with_obj): print(models.MyModelFactory.ob

Re: need to find out if someone is an orphan when I have mother_alive and father_alive fields in the database

2018-01-29 Thread Jani Tiainen
ith Q queries you don't use and-operator. See details at https://docs.djangoproject.com/en/2.0/topics/db/queries/#complex-lookups-with-q-objects 29.1.2018 22.04 kirjoitti: Hi, I need to find out if someone is an orphan when I have mother_alive and father_alive fields in the database. Stepfa

Re: need to find out if someone is an orphan when I have mother_alive and father_alive fields in the database

2018-01-29 Thread Etienne Robillard
orphan when I have mother_alive and father_alive fields in the database. Stepfathers, and stepmothers etc aren't counted when determining if someone is an orphan, only their birth mother, and birth father. I tried   if form['orphaned'].data == True:              q = context['c

<    4   5   6   7   8   9   10   11   12   13   >