Questions tagged [django-1.10]

Django 1.10 is a version of the Django framework, released August 2016. Please only use this tag if your question relates specifically to this version.

Django 1.10 requires Python 2.7, 3.4, or 3.5.

Here are a list of changes:

Django 1.10 was released in August 2016 and was supported until December 2017.

191 questions
0
votes
1 answer

Returning username in django 1.10 drf jwt response

I've been fiddling around with JWT_PAYLOAD_HANDLER trying to get a username returned in the output So I tried this in my myApp/views.py: def jwt_response_payload_handler(token, user=None, request=None): if user and request: return…
Simply Seth
  • 3,246
  • 17
  • 51
  • 77
0
votes
2 answers

data is not inserting in database when I click submit button

I have created my first app in Django (1.10.5) / Python 3.4. I have a login page and a register page. Which is working fine. I can create new user and login with that id. Now after the login I want user to fill a form with some information and click…
Mohammad Shahbaz
  • 403
  • 8
  • 28
0
votes
1 answer

How do I connect to MongoDB v2.6.12 from Django 1.10 (python3.4) and pymongo v3.4?

I am new to Django, and I set up a mysites app using the tutorial given here I followed this guide to setup mongodb with Django using mongoengine However, I keep getting the following error everytime I try running the server: (myVirtEnv_1)…
sidx64
  • 426
  • 4
  • 10
0
votes
1 answer

Django Reverse relationship with Recursive M2M Relationship

Trying to expand from the documentation in here : https://docs.djangoproject.com/en/1.10/topics/db/models/#extra-fields-on-many-to-many-relationships The context makes it easier to understand, Person object, M2M relationship with itself that defines…
Mojimi
  • 2,561
  • 9
  • 52
  • 116
0
votes
1 answer

Unable to display ImageField within Django template

I hope you can help me withmy Django project. I am able to upload an images under a media_cdn folder, inside a folder based on the name of the slug. The problem occurs when I try to display the image inside my post list and post. Can you please have…
IoanCosmin
  • 25
  • 11
0
votes
1 answer

Display auth.User fields in related model

I have created this Django model: class Teacher(models.Model): user = models.OneToOneField('auth.User', on_delete=models.CASCADE, default=1) surname = models.CharField(max_length=15, null=True) creation_date =…
juankysmith
  • 11,839
  • 5
  • 37
  • 62
0
votes
1 answer

Changing Database in run time and making the changes reflect in Django in run time

I am developing a Cloud based data analysis tool, and I am using Django(1.10) for that. I have to add columns to the existing tables, create new tables, change data-type of columns(part of data-cleaning activity) at the run time and can't figure out…
VMohta
  • 1
  • 1
0
votes
2 answers

How get individual fields from django model?

In my django models.py : class Agent1(models.Model): show_name = models.CharField(db_column='Show_Name', max_length=100,null=True) exhibiting_company_name = models.CharField(db_column='Exhibiting_Company_Name', max_length=100,null=True) #…
0
votes
1 answer

Django-tables2 renders same first and last row

I have a weird problem with Django-tables2. I've created a simple table with two columns - timestamp and description. The problem is that the first object from QuerySet is not being rendered in the table. Instead of first object, there is last…
Milano
  • 18,048
  • 37
  • 153
  • 353
0
votes
2 answers

django 1.10 url dispatcher not working

I'm trying to simply give an app url an option of /headless/ to make it show a different template. My project/urls.py has: urlpatterns = [ url(r'^datastore/', include('datastore.urls')), ] My app/urls.py has: app_name = 'datastore' urlpatterns…
Simply Seth
  • 3,246
  • 17
  • 51
  • 77
0
votes
1 answer

How do I run SQL queries after a DB connection is established?

I want to run a command for the duration of the lifetime of the website. I don't want to run it more than once. Let's say I want to run the query: set names utf8mb4; Then I would just run something like: SomeRandomObject.objects.raw('set names…
User
  • 23,729
  • 38
  • 124
  • 207
0
votes
1 answer

How to create label_command ind django1.10

I am moving to Django1.10 from django 1.6.11 (I know this is very old. But finally moving to latest version) My management commands are breaking. class Command(LabelCommand): label = 'filename' def add_arguments(self, parser): …
Akamad007
  • 1,551
  • 3
  • 22
  • 38
0
votes
1 answer

Quick database update based on previous value in Django

I have a QuerySet which contains Page objects, which have page_number attribute. The QuerySet is sorted by page_number, so running [i.page_number for i in pages_query_set] would return something like, for example, [1,2,3,5,6,10,11,13,16,19,21]. My…
Highstaker
  • 1,015
  • 2
  • 12
  • 28
0
votes
1 answer

Retrieve property of an object through multiple foreignkeys

I'm learning Django and I have chained different classes Archipel -> Island -> Community in order to localize items to be published in a website (Communities belong to only one Island which belongs ton only one Archpelago). Maybe I did wrong but…
Letouane
  • 63
  • 1
  • 12
0
votes
1 answer

Django 1.10 Templating/staticfiles not showing any images

I am trying to enable Django templating in 1.10 and it is not behaving correctly. Anything I have referenced to be called from the static files (./manage.py collectstatic) is not showing where referenced in the html. I have it imported in my views:…