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

How to save uploaded files to models and serve them in templates?

I've been following the django 2 official tutorial but I'm a bit confused as how to work with images and uploaded files. I have a project with a few apps. Let's call the project myProj and the app myApp. There is a model in myApp called myModel…
ladybug
  • 323
  • 1
  • 4
  • 9
0
votes
2 answers

What is incorrect with my urls.py file? Chapter 18 of Python Crash Course

Why does the python code below crash my website? But the code at the very bottom does not crash the website Here is the code that crashes the website: from django.urls import path, include from django.contrib import admin urlpatterns = [ …
orbit6781
  • 1
  • 2
0
votes
1 answer

django2.0 international not work in my server environment

I trapped in a problem for a while. I do as the documentation and i get the result as i want in the local environment. Not only using python3 manage runserver but also uwsgi --http :8000 xxx.uwsgi. But after i upload my files into my server, i can…
jhd
  • 1,243
  • 9
  • 21
0
votes
0 answers

Iam executing the code from building django2 web applications. After changing sqlite db to postgresql iam getting this error.How to get rid of this?

Traceback (most recent call last): File "manage.py", line 15, in execute_from_command_line(sys.argv) File "C:\Users\HP\AppData\Local\Programs\Python\Python36\lib\site-packages\django\core\management\__init__.py", line 371, in…
Lohith
  • 51
  • 2
  • 5
0
votes
1 answer

Django: Unable To Replace The Default User Model With Custom User Model

I am unable to replace default django user model with my own custom user model. yes, i have AUTH_USER_MODEL = 'appName.modelName' set in settings.py here's my code settings.py INSTALLED_APPS =…
0
votes
2 answers

Sorting of Users Dropdown list (ForeignKey) in Django Admin

I'm using the django admin and want to sort (by last_name) the dropdown list of users in a related field (ForeignKey). I'm am using the standard User model in django. I tried the following in the model.py which is not working: ... from…
Laxas
  • 51
  • 6
0
votes
1 answer

Get array of related objects django

I have this models: class Project(models.Model): And class Group(models.Model): project = models.ForeignKey(Project, on_delete=models.CASCADE, related_name = "projects") I want to be able to retrieve projects groups. I tried something…
user2950593
  • 9,233
  • 15
  • 67
  • 131
0
votes
1 answer

django 2.0: Does not use the correct view

I'm following a django book project based on django 1.8. It's a little outdated, but I tried and somewhat successful in translating some parts into django 2.0. The project as of now has 2 apps, shop, then cart. shop app went out fine; when I…
JeffP
  • 539
  • 1
  • 5
  • 19
0
votes
1 answer

Django Twilio Texting - django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet

I’m new to Python and Django, but have decided to make my own wedding website based on https://www.placecard.me/blog/django-wedding-website/. The only major difference I want to make is to change the the email communication to SMS. I came across…
Gary
  • 5
  • 3
0
votes
1 answer

verify mobile number with twilio lookup

I making django webapp. on that webapp user can register with there email or phone number sometime user enter mobile number with country code and sometime user not enter country code that time i need get user ip address and find the country code and…
0
votes
1 answer

in inlineformset_factory, can't change widget of primary model(django 2.0)

I have 2 models class WorkOrder(models.Model): work_order_id = models.AutoField(db_column='Work_order_id', primary_key=True) work_order_number = models.CharField(db_column='Work_order_number', max_length=50, blank=True,…
0
votes
0 answers

Django always returning invalid form during signup

I am trying to implement email authentication during sign up. But always the compiler returning the invalid form. Can anyone suggest what may be the reason behind this? I am using SALEOR package for this project. Below I have posted model, forms and…
user7104029
0
votes
2 answers

Django:Html templates

I written a base html for another html base.html {% for foo in subjectType %} {%…
0
votes
1 answer

models not being saved with obj.save() in django

I have this model as an extension of the built in User model: class userprofile(models.Model): phone = models.CharField(max_length=20) address = models.CharField(max_length=500) user = models.OneToOneField(User,…
user9229406
0
votes
0 answers

Delete element from a database in Django

I am trying to develop a Django app able to CRUD files. At the moment I have developed the Upload-Download functionalities but things get pretty hard for me when I want to delete items. * Views.py * def list(request): # Handle file upload if…
Across
  • 63
  • 5