Questions tagged [django-2.0]

Django 2.0 is a version of the Django framework, released December 2017. Please only use this tag if your question relates specifically to this version.

Django 2.0 requires Python 3.4, 3.5, or 3.6. It is the first version of Django to support only Python 3.

Here are some of the salient features of Django 2.0:

Django 2.0 was released in December 2017 and was supported until April 2019.

423 questions
2
votes
0 answers

Django - Variable deleting itself prior to Object Create?

Consider this snippet: if fire_prim is not None: print('Fire Primary is definitely not Null, here is proof: {}'.format(fire_prim)) fire_primary_obj = LifeSafety.objects.create( name='Fire Primary', store=store_obj, …
CodeSpent
  • 1,684
  • 4
  • 23
  • 46
2
votes
1 answer

Django queryset iterator() doesn't work as expected

I have tested queryset.iterator() based on Django document. Oracle and PostgreSQL use server-side cursors to stream results from the database without loading the entire result set into memory. With server-side cursors, the chunk_size parameter…
SangminKim
  • 8,358
  • 14
  • 69
  • 125
2
votes
2 answers

How to send event email request from gmail to outlook in Django 2

I was trying to create an appointment management system where user can send invitation meeting mail to admin. I can send single mail from user to admin but how could I send an event email from Gmail to outlook Here is my settings.py…
Antu
  • 2,197
  • 3
  • 25
  • 40
2
votes
1 answer

Access updated values in prefetched self recursion set

I have a model: class Vertex(models.Model): pmap = models.ForeignKey('PMap',on_delete=models.CASCADE) elevation =…
Snail
  • 467
  • 2
  • 7
  • 20
2
votes
0 answers

How to print a PDF file in django 2

I am new in Django I try to develop a POS system where a user clicks on a button and a PDF will print I can generate PDF but I cannot print that PDF Here is my code where I was trying to print the PDF file import os def printPDf(request, id): …
Antu
  • 2,197
  • 3
  • 25
  • 40
2
votes
1 answer

How to fix massive lag on django development server?

OVERVIEW: Hi, I have massive lag on my development server as long as I am offline. I'm using windows 10 pro. I have a website on my local environment at 127.0.0.1:8000/. I have a fairly high end laptop that can play high graphics games on it with no…
2
votes
1 answer

Is it possible to add 2nd slug to URL path in Django?

I'm using Django version 2.1. I want to create this type of URL Path in my Project: www.example.com/bachelor/germany/university-of-frankfurt/corporate-finance Is it possible to do it in Django?
Ulvi
  • 965
  • 12
  • 31
2
votes
1 answer

How to autofill variable with foreign key in django form?

In short: I want to autofill form's foreign variable: TL;DR Here is project link. I have a model: from django.db import models from django.urls import reverse # Create your models here. class School(models.Model): name =…
unnobtainium
  • 528
  • 1
  • 5
  • 15
2
votes
0 answers

django - nginx - "ERR: TOO MANY REDIRECTS"

I'm having an issue with my nginx configuration. I receive the error ERR: TOO MANY REDIRECTS If I change the var SECURE_SSL_REDIRECT = True to False the error goes away but I believe this is causing issue with my channels setup, my websockets are…
Mint
  • 1,013
  • 1
  • 12
  • 29
2
votes
1 answer

Django: Validator returns False but form.is_valid() == True

I've created a custom validator which checks, if the upper number in RangeField is lower than some number. The problem is that I can see in debug mode that the Validator.compare returns False but Django raises DataError Value "21474834555" is out…
Milano
  • 18,048
  • 37
  • 153
  • 353
2
votes
1 answer

Django static files - Changing URL

I'm a little confused with Django's static files. I understand they are not served in development however in my production environment I have tried everything to change the URL for the files which are being server. It just doesnt make any sence to…
Kyias
  • 166
  • 2
  • 11
2
votes
1 answer

Wrong encoding when retrieving get argument

I have a an url encoded with URL encoding, namely : /filebrowser/?cd=bank/fran%E7ais/essais The problem is that if I retrieve the argument through : path = request.GET.get('relative_h', None) I get : /filebrowser/?cd=bank/fran�ais/essais instead…
user5510840
2
votes
2 answers

Remove double quotes around string list

I have a list with dates in it. event_labels = [] for item in all_list: event_labels.append(str(item.event_created_at)) context['graph_data_labels'] = json.dumps(event_labels) "['2018-05-18', '2018-05-17', '2018-05-16', '2018-05-15',…
Sharpless512
  • 3,062
  • 5
  • 35
  • 60
2
votes
1 answer

Migrate users from database to another on Django

I already have an existing website running and want to transfer just the users (usernames, passwords and emails) to another database for a separate Django website as I am rebuilding it.
Kareem
  • 569
  • 2
  • 18
2
votes
1 answer

Django 2.0: NoReverseMatch at /url/ (/pledges/group/7/)

I just have upgraded from Django 1.11 to 2.0. These are the urls I have for one Django application: urlpatterns = [ url(r'^logout/$', views.logout, name='logout'), url(r'^$', views.home, name='home'), …
lmiguelvargasf
  • 63,191
  • 45
  • 217
  • 228