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
0
votes
1 answer

django-import-export adding widgets to the model resource

class AccountResource(resources.ModelResource): class Meta: model = Account skip_unchanged = True report_skipped = False import_id_fields = ('ID',) fields = ('ID', 'Rank_Test', 'UName', 'DecimalTest') Hello folks the above code…
CodeHard
  • 125
  • 14
0
votes
0 answers

Django ManyToManyField as separate checkboxes in form with individual error messages

For each possible many to many relation I want a form to have separate checkboxes. I know this is possible using the CheckboxSelectMultiple, but it seems I can't have individual error messages per checkbox. # models.py class OptIn(models.Model): …
ikkuh
  • 4,473
  • 3
  • 24
  • 39
0
votes
1 answer

Django tutorial NoReverseMatch error

I was following the tutorial for Django, however, I encounter an error when I reach part 5. NoReverseMatch at /polls/ Reverse for 'detail' with arguments '('',)' not found. 1 pattern(s) tried: ['polls\\/(?P[0-9]+)\\/$'] Request Method: GET…
shawnngtq
  • 687
  • 1
  • 7
  • 24
0
votes
0 answers

PythonAnywhere 'function' object has no attribute 'get_extra_actions' Django Rest

I've made a basic application with the Django framework and PythonAnywhere is not liking my code for some reason. When I ran the autoconfiguration for manual setup, I got an error that Django rest framework was required and the setup exited…
0
votes
1 answer

Store images URL

I have a "Article" model, where I'm going to store links to a different number of images. class Article(models.Model): name = models.CharField(max_length=200, null=False) created = models.DateTimeField() modified =…
shmnff
  • 647
  • 2
  • 15
  • 31
0
votes
1 answer

Django 2: Can't import models and save it

I somehow can not import my models from another app. I already looked it up and tried but does not work. events/models.py class Registration(models.Model): category = models.ForeignKey(Category, on_delete=models.CASCADE) user =…
Franz
  • 35
  • 9
0
votes
2 answers

When calling delete(), I get 'models aren't loaded yet' error in Django 2.0.3

I have two models defined in an app called coins. models.py from django.db import models class Coin(models.Model): model defintions class CoinData(models.Model): model defintions I have a function which can write data to my Coin model…
phil0s0pher
  • 231
  • 1
  • 4
  • 16
0
votes
1 answer

Heroku can't find my 'settings.py' file

After deploying my django project on heroku get this in logs: File "/app/django_structure/src/django_structure/wsgi.py", line 16, in 2018-03-23T12:09:10.575053+00:00 app[web.1]: application =…
0
votes
1 answer

Django formset fails date validation with valid date

I'm running into a date validation error with use of a django formset. I do not get the same validation error when I formset.is_valid(). The problem I'm experiencing is that the form is_valid check fails, only with the view and template use (not…
yekta
  • 3,363
  • 3
  • 35
  • 50
0
votes
1 answer

Why is 'DIRS': ['templates'] also works?

To be able to find the template file in django, everybody said you should amend the settings.py like this: TEMPLATES = [{ 'DIRS': [os.path.join(BASE_DIR, 'templates')] }] but I found that this also works: TEMPLATES = [{ 'DIRS':…
0
votes
2 answers

can't get image to load

I probably did something stupid but when i upload a image with /admin I can't get it to load. I made a for loop to get all post's and everything shows except for the image model: `class Post(models.Model): title = …
0
votes
0 answers

Centralized Authentication in Django 2.0

I need some help with building something (That I call) Centralized Authentication Server in Django 2.0, which will support the following: Say There are 2 services: Service A - which is the frontend application. It's a simple Django project the has…
0
votes
1 answer

How to access underscore starting attributes in templates OR Error Variables and attributes may not begin with underscores in Django 2.0?

I have ElasticSearch iterated data like this: (Pdb) data[0] {'_index': 'publishserdata-index', '_type': 'publishser_data_index', '_id': '35', '_score': 1.0, '_source': {'publisher': 'Admin', 'department':…
Mr Singh
  • 3,936
  • 5
  • 41
  • 60
0
votes
2 answers

clean django install, runserver, traceback

Been following a Python specialization on Coarsera and figured I'd try something out on my own! First thing I run into before I even began was this: C:\Users\kurts\Python>django-admin startproject Kurtain C:\Users\kurts\Python>cd…
0
votes
1 answer

How to Upgrade Pinax for Django 2.0

I am trying to upgrade my django project to Django 2.0, and I have read the release notes and read several blog posts about what to change, but nothing addresses my problem so far, which relates to the package pinax: File…
Marlo
  • 490
  • 3
  • 7
  • 21