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

extending abstract model in Django

I'm using Django 2.x and OAuth Toolkit. I'm writing an application where I need to add ForeignKey pointing to Application model of OAuth Toolkit plugin, which is defined Abstract. According to the documentation. I can extend the AbstractApplication…
Anuj TBE
  • 9,198
  • 27
  • 136
  • 285
0
votes
1 answer

Python Django 2 Email Verification on User SignUp

I'm working on a project using Python(3.6) and Django(2.0) in which I need to verify the user's email on registration. Here's what I have tried: App to users named as users forms.py class SignUpForm(UserCreationForm): first_name =…
Abdul Rehman
  • 5,326
  • 9
  • 77
  • 150
0
votes
1 answer

django parameter causing the wrong template and view to render

Overview / Problem: Hi! The wrong template and view are loading every time I click the check_tier_level link in my template. When that parameter is in, it loads the home view with "check_tier_level" as the special_message, even though my links go to…
0
votes
1 answer

How to forget session Django 2.1

In my project I need to force Django to forget session and create new one. Is there the way to do something like session.forget() in view file? Thanks in advance
0
votes
0 answers

Django post save signal calling two times with each request

I'm using Django 2.x I have a model TransactionLog which logs the amount given and updated. Each time amount is given, a new record is created in AmountGiven model and thus will create a log with action as given and if the earlier given amount is…
Anuj TBE
  • 9,198
  • 27
  • 136
  • 285
0
votes
0 answers

Django wsgi error after upgrade from 1.11 to 2.0 (load_middleware: argument to reversed() must be a sequence)

After upgrading from django 1.11 to 2.0 I got this error on my productive machine. mod_wsgi (pid=26504): Target WSGI script '/var/www/htdocs/myappdir/app_myapp.wsgi' cannot be loaded as Python module. mod_wsgi (pid=26504): Exception occurred…
Philipp S.
  • 827
  • 17
  • 41
0
votes
1 answer

How to redirect user and admin to a different template after login in Django 2

I'm new in Django 2. I try to develop a project where my requirement is from the same login page user and admin can log in but when user login he will view his own dashboard and admin will view his own different dashboard. My views.py code is def…
Antu
  • 2,197
  • 3
  • 25
  • 40
0
votes
0 answers

multiple items in wagtail carousel

I want to have 4 different items in a slider(Product Name section). And in the next slider, again 4 items. How to achieve this in wagtail? Below I have given screenshot how it should be. Screenshot: This one is in static, but I want it dynamic. For…
0
votes
1 answer

Django 2.1.1 Import Errors

i use vscode on windows10. I just created a Django project+app like this: In the vscode powershell terminal: python -m venv venv #createing a virtual environment called venv .\scripts\activate #activate the virtual environment pip install…
0
votes
1 answer

json.dump not converting python list to JS array

When I attempt to pass a python list through to JavaScript in the template it doesn't parse the list into an JS array as expected but instead returns this ["Groceries", "Clothing", "Takeaways", "Alcohol"]…
Todd Drinkwater
  • 379
  • 6
  • 17
0
votes
1 answer

How to access from the list template to the detail template in Django 2?

I'm trying to access from the list template, to detail template Exmaple: article: urls article_patterns = [ path('', HomePageView.as_view(), name='home') path('articles/', ArticleListView.as_view(), name="articles"), path('articles//',…
Alex
  • 615
  • 8
  • 26
0
votes
0 answers

django 2 re_path expression passing email verification token

I'm quite stuck with using regular expression in django 2 url. All seems to be correct, however i'm getting 404 error. Actual path: http://localhost:8000/user/activate/b'MjQ'/4zb-89a933fe70e0d12de725/ error: Using the URLconf defined in…
user1935987
  • 3,136
  • 9
  • 56
  • 108
0
votes
1 answer

latest Django is not supporting imports for models from other app. please give me solution for that

As i am importing models from other app by from projectname.app1.models import model1 it says for projectname.app1 ModuleNotFounderror https://i.stack.imgur.com/mYuIS.jpg
Gayatri
  • 1
  • 1
0
votes
1 answer

Django + Anymail + Mailgun - Email HTML renders without button and image

I am having an issue while trying to send an email containing html and an image, through mailgun, using the anymail library. This is my code: url_formulario = CLIENT_URL + str(token.key) email = EmailMultiAlternatives('Confirmación Vacante',…
Guido
  • 81
  • 2
  • 9
0
votes
1 answer

Django 2 email unsubscribe link

I want to add an unsubscribe link in emails being sent to the user. I am unsure on how to achieve it. I want the user to be able to unsubscribe without having to log in. Any suggestions on how to achieve this would be appreciated. Thanks
Syed Annas
  • 13
  • 2
  • 7