Re: self.foreign_related_fields[0] IndexError: tuple index out of range

2019-11-25 Thread Integr@te System
Hi man, Check 'class UserManager(): ..orgid = org_obj ' On Tue, Nov 26, 2019, 01:40 Ahmad Saki wrote: > My custom authentication model in django: > > from django.db import models > from django.contrib.auth.models import ( > AbstractBaseUser, BaseUserManager > ) > from

Re: Session backend for production

2019-11-25 Thread Parth Joshi
Cache implementation will be definitely use faster if you are using MVT. If using REST (DRF) then token Auth definitely helps. Regards, Parth Joshi > On 26-Nov-2019, at 2:41 AM, Lorenzo Peña wrote: > > Hello, fellow djangonauts! > > Is there any particular reason why should I pick

Re: Customer specific translations

2019-11-25 Thread Mike Dewhirst
On 25/11/2019 11:11 pm, Jani Tiainen wrote: I've use-case where my django app is delivered to multiple customers in multiple languages. Due the nature of application end users do use for certain terms their own wording, which differ significantly from others. For example: "Delivery route".

Re: Trying to update a record using UpdateView Error: Circuitinfotable matching query does not exist

2019-11-25 Thread Gil Obradors
Hi! Matching query doesn't exists says that this entry with this id not exists in db Are you sure that this object exists? STTK-100G-18040-01-WRBB Can you open a shell and: from xxx.models import Circuitinfotable obj = Circuitinfotable.objects.all() print(len(obj)) obj =

Re: Django on an existing PostgreSQL Database?

2019-11-25 Thread carlos
https://docs.djangoproject.com/en/2.2/howto/legacy-databases/ On Mon, Nov 25, 2019 at 3:03 PM Ulrich Goebel wrote: > Hi, > > I have an existing PostgreSQL Database with about 20 tables, using > collating sequences, foreign keys, triggers, and even additional indexes. > For that database I want

Re: How to migrate Django site from MySQL database to Postgres?

2019-11-25 Thread carlos
1. Install your application on the server first, if you have media files, then copy them from your localhost to the server 2. Do the dumpdata from your local in .json, then copy that json to your server 3. Once on the server just load that json with the loaddata command. On Mon, Nov 25, 2019 at

Re: Trying to update a record using UpdateView Error: Circuitinfotable matching query does not exist

2019-11-25 Thread Patrick Carra
Sorry I forgot one! My models.py for this class is below: class Circuitinfotable(models.Model): id1 = models.IntegerField(blank=True, null=True) pid = models.CharField(max_length=255, blank=True, null=True) circuitid = models.CharField(primary_key=True, max_length=255, blank= False,

Trying to update a record using UpdateView Error: Circuitinfotable matching query does not exist

2019-11-25 Thread Patrick Carra
I have a built a database application that users can search and view records from. I am trying to incorporate an update feature to allow users to edit information the app is called editLit. When I try to pass a parameter into the editLit app via urls into views.py I get the following error:

Session backend for production

2019-11-25 Thread Lorenzo Peña
Hello, fellow djangonauts! Is there any particular reason why should I pick memcached backed sessions in production over db, or viceversa? Most documentation seems to slightly suggest that memcached should perform faster than database. Any other criteria I should be aware of? I am using single

Django on an existing PostgreSQL Database?

2019-11-25 Thread Ulrich Goebel
Hi, I have an existing PostgreSQL Database with about 20 tables, using collating sequences, foreign keys, triggers, and even additional indexes. For that database I want to write a WEB-frontend to insert, update and delete data in the database. I don't want to define the data model in python

Re: How to fix this - ERROR: Failed building wheel for mysqlclient

2019-11-25 Thread Ram
Hello Integr, I did not understand your suggestion? How do I clear cache in Python virtual environment? and what is other method you suggest based on the install error that I'm hitting. Best regards, ~Ram On Mon, Nov 25, 2019 at 10:16 AM Integr@te System wrote: > Hi man, > > Clear cache and

Re: How to migrate Django site from MySQL database to Postgres?

2019-11-25 Thread Ram
Hi Carlos, I see there is a typo in my previous steps which could have mislead you. Basically old and new sites are different databases. Old site is running remotely in local host on our Developer's machine with MySQL dB. Now I've setup new hosting server with Postgres database (empty site so

Re: How to migrate Django site from MySQL database to Postgres?

2019-11-25 Thread carlos
i thing is good your plan copy your files local to server then dumpdata in local database and copy to server and last you loaddata in your server cheers On Sat, Nov 23, 2019 at 10:13 PM Mohammad yunus wrote: > Is this "migration" command will work for all type of databases or just > only for

self.foreign_related_fields[0] IndexError: tuple index out of range

2019-11-25 Thread Ahmad Saki
My custom authentication model in django: from django.db import models from django.contrib.auth.models import ( AbstractBaseUser, BaseUserManager ) from organization.models import Organization class UserManager(BaseUserManager): # use_in_migrations = True # python manage.py createsuperuser def

Re: How to fix this - ERROR: Failed building wheel for mysqlclient

2019-11-25 Thread Integr@te System
Hi man, Clear cache and try other method to requisite install. On Sun, Nov 24, 2019, 06:28 Ram wrote: > Hello Kasper, > > I tried installing libssl1.1 globally and then tried mysqlclient install > in virtualenv, but the result is the same and mysqlclient is still failed > with same error. > >

Re: Django- Display PDf document in an Iframe or Pdf VIewer

2019-11-25 Thread Mark Phillips
Lucas, I have many documents that I have uploaded to my django app. The docs are stored in the file system, but the path is in my django model. The docs are either pdfs or png images. This is how I am displaying pdf images in my ModelAdmin change form: readonly_fields = ('get_image_3', )

When to use Admin model_delete/model_save and Model delete/save?

2019-11-25 Thread Mark Phillips
Just curious as to the best practices for using save/delete in Model versus delete_model/save_model in ModelAdmin. Is one preferred over the other? In my particular case, I have a Document model with a JSON field that holds a bunch of metadata (name:value pairs) for Documents (photos, pdfs, etc).

Django- Display PDf document in an Iframe or Pdf VIewer

2019-11-25 Thread 'Lucas Gärtner' via Django users
Hello everyone! I just signed up here, so maybe this thread is wrong in this group. The problem is as follows: I need to display a PDF document in a half of a web application. I tried it first with Iframe and now today with pdf.js. Nothing helped. Do you have any idea? It is only showing the

Re: Internal error 500

2019-11-25 Thread Integr@te System
Hi friend, Inspect backward to previous error how you customized and see change in log system of backend srv. U can attemp to run localhost first. On Mon, Nov 25, 2019, 20:29 Josiah Umezurike < pcintegral.pcintegr...@gmail.com> wrote: > I was able to fix those now I have this error. > > > On

Re: Internal error 500

2019-11-25 Thread Josiah Umezurike
I was able to fix those now I have this error. On Saturday, November 23, 2019 at 2:14:31 PM UTC-5, Josiah Umezurike wrote: > > I was configuring django few days ago it seems that all went well. Then I > started getting internal error 500. > > my domain is apilokdon.com or www.apilokdon.com > >

Customer specific translations

2019-11-25 Thread Jani Tiainen
I've use-case where my django app is delivered to multiple customers in multiple languages. Due the nature of application end users do use for certain terms their own wording, which differ significantly from others. For example: "Delivery route". Some may call it "driving route". Some "route"

Re: Generic view template seems to have empty input

2019-11-25 Thread 山村維宏
Maybe you should use ListView, not DetailView. 2019年11月25日(月) 19:44 Manos Zeakis : > Hi > > I have declared a model and the simple views I created are working. > > Now I am trying to move to generic views. > > So I added in urls.py > > path('book2//', views.DetailView.as_view(),

Re: Generic view template seems to have empty input

2019-11-25 Thread 山村維宏
Sorry, I mistaked. You can use Detail view. DetailView pass your model data, which named "book"(because model name is Book). Model doesn't list. 2019年11月25日(月) 19:44 Manos Zeakis : > Hi > > I have declared a model and the simple views I created are working. > > Now I am trying to move to

Generic view template seems to have empty input

2019-11-25 Thread Manos Zeakis
Hi I have declared a model and the simple views I created are working. Now I am trying to move to generic views. So I added in urls.py path('book2//', views.DetailView.as_view(), name='detail'), And in views.py class DetailView(generic.DetailView): model = Book And the template is

Re: Best way to organize custom admin views?

2019-11-25 Thread Wim Olivier
Hi, I'd recommend using seperate apps for custom admin areas (1 app for each), and implementing a middleware that allows access to the relevant admin based on roles/permissions, etc. It's simple, kept seperate from other code/apps nicely, and easy to limit access to different groups. blogapp/