DB queries in django scripts

2019-04-09 Thread Web Architect
Hi, We have a Django 1.11 based ecommerce web site. We use django management scripts and django extension of runscript heavily for DB operations - running under cron. There's a tool - django-debugtoolbar to check the DB queries on the web. But is there a tool to monitor/check the DB queries

Set user permission via python

2019-04-09 Thread matt
Hi, I'm trying to set a permission for a user that I'm creating with a python script. I've tested and found that the codename for the permission is "display_data.settings" using the following: python manage.py shell from django.contrib.auth.models import User user_name =

Re: Django 2.2 and custom media in the admin

2019-04-09 Thread Simon Charette
Hello Thorsten, this is a change document in the 2.2 release notes[0]. There's even a resolution example for a django.jQuery dependency like you have > For example, widgets depending on django.jQuery must specify > js=['admin/js/jquery.init.js', ...] when declaring form media assets. [1]

Re: fesherstructural error

2019-04-09 Thread Julio Cojom
If you're using virtualenv, then u need to activate before running manage.py, to activate, use workon . Maybe you only installed Django in your virtualenv and not in your system. Regards! El mar., 9 abr. 2019 a las 13:20, sachin thakur (< sachin.thakur9...@gmail.com>) escribió: > Create your

Re: fesherstructural error

2019-04-09 Thread sachin thakur
Create your virtual machine in any or directory Then install the django in that virtual machine n create your project Regards Sachin Thakur On Wed 10 Apr, 2019, 12:47 AM Joseph Jones, wrote: > Hello fellow Django community members, > I seem to be having quite a bit of trouble fixing my

fesherstructural error

2019-04-09 Thread Joseph Jones
Hello fellow Django community members, I seem to be having quite a bit of trouble fixing my error in calling the manage.py directory in my project. I've received of a hint in that my code launcher indicates that "Django is not importable into this environment" so it would appear as well as the

Re: Generic display views / DetailView

2019-04-09 Thread Sithembewena L. Dube
The slug must be descriptive of the record. It is often derived from a value such as a blog title. A good slug is useful for SEO purposes as it can contain descriptive keywords. I just sent more reading on slugs from the official Django docs. Kind regards, Sithu *Sent with Shift

Re: Generic display views / DetailView

2019-04-09 Thread Sithembewena L. Dube
The slug would be the part of the url that points to a specific blog entry or article. https://docs.djangoproject.com/en/2.2/glossary/#term-slug https://docs.djangoproject.com/en/2.2/ref/models/fields/#django.db.models.SlugField Kind regards, Sithu *Sent with Shift

Generic display views / DetailView

2019-04-09 Thread John
Hello maybe someone could help me, Im working on an example similar to the DetailView for Generic Display Views https://docs.djangoproject.com/en/2.2/ref/class-based-views/generic-display/#detailview In

Re: I have created a Django App, How to create a Django App Launcher?

2019-04-09 Thread Test Bot
The issue here is you have a web app and you expect a desktop application. This should be asked on a GUI-Framework mailing list. You can call your APIs from that desktop app instead of writing the same code again(DRY). On Tue, Apr 9, 2019, 8:42 PM Julio Cojom wrote: > Django Is a web

Re: How to run ORM commands in Javascript DOM?

2019-04-09 Thread Ing.Daniel Bojorge
[image: image.png] https://debsconsultores.blogspot.com/2019/04/ventanas-modales-con-django-usando.html I hope be useful for you. In this tutorial (in spanish) I work with bootstrap modal window. May be give you ideas. Dios L@s Bendiga Saludos, [image: --] daniel.bojorge [image:

Re: Server Error (500)

2019-04-09 Thread Julio Cojom
If it's development servers or localhost , allow DEBUG=True, that will help you a lot every time that you found this issues. Assuming that you use git, if you use localhost before push your changes, then the shell where you run "manage.py runserver" will show you specific data about your problem.

Re: How to run ORM commands in Javascript DOM?

2019-04-09 Thread Shashank Singh
Get the data in the current screen before opening the popup or hit a ajax request to the server to get the said data. On Tue, 9 Apr, 2019, 8:32 PM sairanganadh Narayana, wrote: > I am trying to run model.objects.filter(id=2) through javascript and show > results in popup. I am unable to find

Re: I have created a Django App, How to create a Django App Launcher?

2019-04-09 Thread Julio Cojom
Django Is a web application, I guess if you create a shortcut of your browser with the URL of your app, that will be fine. Even you can change the icon to make a distinction between your app and the real browser. If you want to those scripts run every n hours or minutes to maintain your app feed

I have created a Django App, How to create a Django App Launcher?

2019-04-09 Thread jaidev joshi
Hello all, I have created a Django application, specifically, a dashboard application, python scripts that collect data from sensors running in the background will feed that data to Django app for live data plotting. I want to build this application in a more user-friendly way, and rather

How to run ORM commands in Javascript DOM?

2019-04-09 Thread sairanganadh Narayana
I am trying to run model.objects.filter(id=2) through javascript and show results in popup. I am unable to find the solution. Please guide me with solution or any alternative to get this. Thanks in advance. -- You received this message because you are subscribed to the Google Groups "Django

Django 2.2 and custom media in the admin

2019-04-09 Thread Thorsten Sanders
Hello, I insert a custom javascript inside the admin and do use the "django.jquery" this worked fine until updating to Django 2.2. With 2.2 the order in which the javascripts are loaded changed and the jquery.init.js is now loaded after my custom javascript, is that considered a bug or a

Re: Update many to many django

2019-04-09 Thread Luis Zárate
Vamos a ver si entiendo ya que sus modelos no describen una relacion many to many, voy a intentar decirlo con palabras y luego con código. Un articulo puede tener varios articulos consolidados y un articulo consolidado puede estar asociado a varios articulos. Si esto es así sus modelos no

Re: Django REST in Docker

2019-04-09 Thread PASCUAL Eric
It seems right. I suppose that requirements.txt contains the rest_framework package too. You can check the image content by executing the "pip freeze" command on it (docker run pip freeze). This will tell you of all the packages you nee are there. Eric From:

Re: Django REST in Docker

2019-04-09 Thread Alessandro Madruga Correia
You can use https://github.com/pydanny/cookiecutter-django as a start point. On Tue, Apr 9, 2019 at 5:54 AM Shubham Joshi wrote: > FROM python:3 > ENV PYTHONUNBUFFERED 1 > RUN mkdir /code > WORKDIR /code > COPY requirements.txt /code/ > RUN pip install -r requirements.txt > COPY . /code/ > > >

Re: UniqueConstraint raises uncaught IntegrityError in Admin

2019-04-09 Thread Simon Charette
No form validation is implemented for UniqueConstraint(condition) yet as that would require a non-trivial refactor of how it's performed. It was discussed during the feature development[0]. I'd suggest you override you form or your model's clean() method to perform the validation yourself

Re: How to run ORM commands from DOM Javascript?

2019-04-09 Thread Robin Riis
in models.py you can define a 'as_json' function def as_json(self): return dict( identification_number = self.id awesome_picture = self.picture ) in views.py: class My_View(View): def get(self, request): if request.is_ajax(): q =

Re: UniqueConstraint raises uncaught IntegrityError in Admin

2019-04-09 Thread Robin Riis
The Integrity error means that there is a row in the database with role = 1 So another row with role=1 would break the unique constraint and is not allowed. So either remove the unique constraint or make sure it will be unique. Den tis 9 apr. 2019 13:29Ryan Jarvis skrev: > Hey there, > > I'm

How to run ORM commands from DOM Javascript?

2019-04-09 Thread sairanganadh Narayana
I'm trying to get run model.objects.filter(id=2) from javascript and show on database. I am unable to get solution for this. Please guide me solution for this or alternative for this. -- You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: Custom multiuser login, registration in DRF

2019-04-09 Thread mazz ahmed
Hi, I am running celery using nohup in the background on the server but not able to run properly. Sometimes it start a task or sometimes it skip tasks in queue. Thanks On Tue, Apr 9, 2019 at 4:20 PM Shubham Joshi wrote: > I am developing a school website in DRF, in which admin, student

UniqueConstraint raises uncaught IntegrityError in Admin

2019-04-09 Thread Ryan Jarvis
Hey there, I'm trying out the new UniqueConstraint functionality in Django 2.2 and seem to be misunderstanding something. When adding a Constraint to the model I am getting an uncaught IntegrityError in the admin. I've got the following sample code: *models.py* class Seminar(models.Model):

Feedback regarding Django-Suit for Django Admin Panel Customization - Need to add New Menu for Report Generations

2019-04-09 Thread Balaji Shetty
Dear Sir, I am developing one web based application Django. I could understand Simple Web application as well as entire Django Admin Panel working upto this time. My requirement is I want to add new menu in existing Admin Panel. I have been searching a lot from many days but could not get any

Re: Caltech Pedestrian Detection Annotations

2019-04-09 Thread Balaji Shetty
Please refer kaggle web site. It contains all data set with Classification algorithm and results also. You may get ideas. https://www.kaggle.com/c/state-farm-distracted-driver-detection/discussion/22018 Shetty Balaji On Mon, Apr 8, 2019 at 4:37 PM Aakash Baranwal wrote: > Hi Everybody, > >

Is there a way to extend Django Admin to normal user/staff? If so, how?

2019-04-09 Thread Chaitanya Vankadaru
I am looking to extend Django Admin to normal user/staff? If so, how? Please reply with your ideas/solutions. -- 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

Re: Update many to many django

2019-04-09 Thread Tatiana Mesa
Hola Luis, eres muy amable en responderme tan rápido, mi pregunta puntual es de que manera puedo hacer un update en una tabla de muchos a muchos. Estos son mis dos modelos class Articulo(models.Model): titulo = models.CharField(max_length=255, blank=True) texto = models.TextField()

Celery running in server by nohup Isuue

2019-04-09 Thread mazz ahmed
Hi, I am running celery using nohup in the background on the server but not able to run properly. Sometimes it start a task or sometimes it skip tasks in queue. Thanks -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this

Custom multiuser login, registration in DRF

2019-04-09 Thread Shubham Joshi
I am developing a school website in DRF, in which admin, student teacher, and student are 3 users. So for admin only username and password is Okay, but for student and teacher, when they visit the website, they have to fill up a form which will be having custom fields DOb, roll no etc of

Re: Server Error (500)

2019-04-09 Thread tribhuvan kishor
first of all, allow debugging that will help you to show server errors and their specific reasons. setting.py DEBUG=true then run make migration command python manage makemigrations then migrate the model by using python manage migrate then let us know if there is any error On Tue, Apr 9, 2019

Re: how do I create a slug in Django 2.2

2019-04-09 Thread Robin Riis
def save(self, *args, **kwargs): self.slug = slugify(self.title) super(name, self).save(*args, **kwargs) Den tis 9 apr. 2019 12:24AMI FIDELE skrev: > I have tried to create a slug watch here and please tell the problem > > this is model.py > > from django.db import models > > # this is

Re: Migration auth.0011_update_proxy_permissions from Django 2.2 fails to apply

2019-04-09 Thread Julien Enselme
@Arpit Singh: I am in a single database setup and we don't use database routers. As far as I know, the migration was never applied before. But from what I understand from you answer, I can --fake it and I should be fine. @אורי רודברג I tried to update directly from 2.0 to 2.2. Since we switched

how do I create a slug in Django 2.2

2019-04-09 Thread AMI FIDELE
I have tried to create a slug watch here and please tell the problem this is model.py from django.db import models # this is my models class Article(models.Model): title = models.CharField(max_length=100) slug = models.SlugField() body = models.TextField() date =

Re: Django REST in Docker

2019-04-09 Thread Shubham Joshi
FROM python:3 ENV PYTHONUNBUFFERED 1 RUN mkdir /code WORKDIR /code COPY requirements.txt /code/ RUN pip install -r requirements.txt COPY . /code/ On Tue, Apr 9, 2019 at 1:30 PM PASCUAL Eric wrote: > Hi, > > Working in contenerized context does not change anything from other modes. > > You just

Re: Django REST in Docker

2019-04-09 Thread PASCUAL Eric
Hi, Working in contenerized context does not change anything from other modes. You just need to include the appropriate pip install command in the Dockerfile, so that all the dependencies are installed in the image. They will then available to your app the same way they are on you dev machine.

Re: HTML form filled, proposes a download link for the data filled in a json file

2019-04-09 Thread Robin Riis
Hello! well in the form is there anything that will be saved in a database? if so you can start by looking at models.py in your application. if not you can jump directly to forms.py. an example of a model and form: *** in models.py from django.db import models class Company(models.Model):

[formset] ManyToMany

2019-04-09 Thread Robin Riis
if i have the following models: class Wiggs_Filter(models.Model): wiggs_nr = models.CharField(max_length=30, unique=True, blank=True, null=True) picture = models.ImageField(upload_to='filter/', default='filter/saknas.jpg') description = models.CharField(max_length=100, blank=True,