Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
What does the inflating step do during django deployment on elastic beanstalk and where are the files coming from?
I am currently debugging a deployment of a Django 1.11 application to AWS elastic beanstalk. The eb-activity.log specifies the following: gc3df-181026_105229@80/AppDeployStage0/AppDeployPreHook/02unzip.py] : Completed activity. Result: Archive: /opt/elasticbeanstalk/deploy/appsource/source_bundle c3df867f3af443a2c832b8a9071c9867b199f522 It then creates and inflates a bunch of files, excerpt: creating: /opt/python/ondeck/app/grams/migrations/ inflating: /opt/python/ondeck/app/grams/migrations/0001_initial.py inflating: /opt/python/ondeck/app/grams/migrations/0002_auto_20180729_1449.py inflating: /opt/python/ondeck/app/grams/migrations/0003_auto_20180729_1651.py inflating: /opt/python/ondeck/app/grams/migrations/0004_auto_20180805_1744.py inflating: /opt/python/ondeck/app/grams/migrations/0005_auto_20180805_2051.py inflating: /opt/python/ondeck/app/grams/migrations/0006_auto_20180806_2028.py inflating: /opt/python/ondeck/app/grams/migrations/0007_profile_interactive_gram.py inflating: /opt/python/ondeck/app/grams/migrations/0008_auto_20180911_0925.py inflating: /opt/python/ondeck/app/grams/migrations/0009_auto_20180917_1753.py inflating: /opt/python/ondeck/app/grams/migrations/0010_auto_20180918_2247.py inflating: /opt/python/ondeck/app/grams/migrations/0011_profile_email_verified.py inflating: /opt/python/ondeck/app/grams/migrations/0012_auto_20181025_1155.py inflating: /opt/python/ondeck/app/grams/migrations/0013_auto_20181025_2242.py extracting: /opt/python/ondeck/app/grams/migrations/__init__.py My questions are: Where is the ondeck folder? Is it temporary? I do not see it when poking around the server via ssh What is inflating? Where are these migration files coming from? I have specifically deleted migration files from my project and the server, save a single migration file in the code base that I am deploying. This is an old set of migration files listed? -
I can not run server Django 2.0
Hello I'm having a problem when trying to run server from an Django 2.0 old project. this is the error: File "/usr/lib/python3.7/site-packages/django/urls/conf.py", line 39, in include 'Specifying a namespace in include() without providing an app_name django.core.exceptions.ImproperlyConfigured: Specifying a namespace in include() without providing an app_name is not supported. Set the app_name attribute in the included module, or pass a 2-tuple containing the list of patterns and app_name instead.' this is my urls.py from django.conf.urls import url, include from django.contrib import admin from apps.sysgrub.views import LoginUser, LogoutUser app_name = 'apps' urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^alumno/', include ('apps.alumno.urls', namespace="alumno")), url(r'^grupo/', include ('apps.grupo.urls', namespace="grupo")), url(r'^maestro/', include ('apps.maestro.urls', namespace="maestro")), url(r'^rol/', include ('apps.rol.urls', namespace="rol")), url(r'^sysgrub/', include ('apps.sysgrub.urls', namespace="sysgrub")), url(r'^$', LoginUser), url(r'^logout/$', LogoutUser), ] and my urls by app urlpatterns = [ url(r'^index$', index), url(r'^horarios$', horarios), url(r'^listar$', Alumno_grupoList.as_view(), name='alumno_listar'), url(r'^agregar$', AlumnoCreate.as_view(), name='add_student'), ] thank you so much for your help greetings. -
How to create an unsubscribe feature in Django?
I am working on a django project, and I'm needing to add an unsubscribe feature to my emails that the server will be sending out. The way that I am managing the mailing list is through a .csv file, which when someone signs up for a service of our's, they get added to the mailing list. In the emails, I want to add an easy unsubscribe feature which would only require the user to click the link in the email, which would lead them to a page that will have a button for the user to unsubscribe from the service, which would be accomplished by removing their name from the mailing list .csv file. My question is, how do I set it up where, when the link is clicked in the email, the website will already know which user is attempting to unsubscribe? I was attempting to follow a tutorial here Tutorial but I do not have a "user profiles" set up, as it mentions. What other ways might this be accomplished? Is there a way to send the email's username to the website when the page is visited in order for me to make the unsubscription process easier? Thank β¦ -
how to display image from static django folder in vue using v-html
I have a png image in static folder of my Django app which works fine when called from html file as below: <img src="{% static 'app1/emojis/celebration.png' %}"> But when i have img_name:"<img src=\"{% static \'patient/emojis/celebration.png\' %}\" alt=\"img_error\" >" in javascript file and I render it in html as <span v-html="img_name"> </span> the image is not shown. instead the alternate text "img_error" is shown. A normal html tag without any static file is rendered correctly: in Javascript: h_tag:"<h1> hello </h1>" in Html: <span v-html="h_tag"> </span> So how can i make Vue understand the folder path to static files in Django. -
update ields of model that has a ForeignKey profile field
I have 3 Types of User Admin,Distributor,customer when I update the information of user created_by the admin that work but when I login in from another User And created user that created_by th log in user I get Errot Tell Me That has no Profile . Please Help me enter image description here **views.py ** @login_required(login_url="/account/login/") def edit_distributor(request,id=None): instance = get_object_or_404(Distributor, id=id) distributor_form = Distributorform(data=request.POST, instance=instance) if request.method == "POST": if distributor_form.is_valid(): # add_balance = distributor_form.cleaned_data.get('add_solde'): distributor = distributor_form.save(commit=False) distributor.created_by = request.user distributor.balance = distributor.balance + 10 profile_form = ProfileForm(instance=instance.profile,data=request.POST) distributor.profile = instance.profile profile_form.save() distributor_form.save() return redirect('all_distriubtor') else: messages.error(request, "Error", extra_tags='alert') return redirect('edit_distriubtor', id) else: distributor_form = Distributorform(instance=instance) return render(request,"UsersManager/edit_distributor.html",{ "instance":instance, "distributor_form":distributor_form, }) **models.py** class Profile(models.Model): user = models.OneToOneField(User,on_delete=models.CASCADE) phone = models.CharField(max_length=100) newpassword = models.CharField(blank=True,max_length=100) codePin = models.CharField(blank=True,max_length=150,unique=False,default="") is_customer = models.BooleanField(default=False) is_Distributor = models.BooleanField(default=False) def __str__(self): return self.user.first_name @receiver(post_save, sender=User) def user_is_created(sender,instance,created,**kwargs): if created: Profile.objects.create(user=instance) else: instance.profile.save() class Customer(models.Model): balance = models.DecimalField(max_digits=12,decimal_places=2) created_by = models.ForeignKey(User,on_delete=models.CASCADE,blank=True) profile = models.ForeignKey(Profile,on_delete=models.CASCADE,blank=True) created = models.DateField(null=True,blank=True) updated = models.DateTimeField(null=True, blank=True) def save(self): if not self.id: self.created = datetime.date.today() self.updated = datetime.datetime.today() super(Customer,self).save() modles.py class Distributor(models.Model): balance = models.DecimalField(max_digits=12,decimal_places=2) created_by = models.ForeignKey(User,on_delete=models.CASCADE,blank=True) profile = models.ForeignKey(Profile,on_delete=models.CASCADE,blank=True) created = models.DateField(null=True, blank=True) updated = models.DateTimeField(null=True, blank=True) def save(self): if β¦ -
Django Rest Framework- retrieving a related field on reverse foreign key efficiently
I have the following models that represent a working group of users. Each working group has a leader and members: class WorkingGroup(models.Model): group_name = models.CharField(max_length=255) leader = models.ForeignKey(User, null=True, on_delete=models.SET_NULL) class WorkingGroupMember(models.Model): group = models.ForeignKey(WorkingGroup, on_delete=models.CASCADE) user = models.ForeignKey(User, on_delete=models.CASCADE) In DRF, I want to efficiently retrieve all groups (there are several hundred) as an array of the following json objects: { 'id': <the_group_id> 'group_name': <the_group_name> 'leader': <id_of_leader> 'members': [<id_of_member_1>, <id_of_member_2>, ...] } To do so, I have set up the following serializer: class WorkingGroupSerializer(serializers.ModelSerializer): members = serializers.SerializerMethodField() class Meta: model = WorkingGroup fields = ('id', 'group_name', 'leader', 'members',) def get_members(self, obj): return obj.workinggroupmember_set.all().values_list('user_id', flat=True) So that in my view, I can do something like: groups = WorkingGroup.objects.all().prefetch_related('workinggroupmember_set') group_serializer = WorkingGroupSerializer(groups, many=True) This works, and gives the desired result, however I am finding it does not scale well at all, as the prefetching workinggroupmember_set does not seem to be used inside of the get_members method (Silky is showing a single query to grab all WorkingGroup objects, and then a query for each workinggroupmember_set call in the get_members method). Is there a way to set up the members field in the serializer to grab a flattened/single field version of workinggroupmember_set without β¦ -
"Authentication credentials were not provided" angular and django
I'm trying to get a registration form to work, using Django and Angular. Here are screenshots of my code: userView userService_Angular userSerializer settings here are screenshots of my console: console enter image description here -
Saving and calculating related (TabularInline) entries in detailed view in Django Admin
So, I have literally scoured the internet and SO for an answer to my issue and have tried everything I could find, so before you dismiss this as a duplicate, please read and don't just link me to a page I've already seen a million times. Thanks in advance for your patience and help! :D My issues are centered around these 2 models: models.py class Order(models.Model): user = models.OneToOneField(User) total_price = models.DecimalField() class OrderEntry(models.Model): order = models.ForeignKey(Order, related_name="order_entries") inventory = models.ForeignKey(Inventory, related_name="order_entries") quantity = models.PositiveSmallIntegerField(default=1) price = models.DecimalField(max_digits=4, decimal_places=2, blank=True, null=True) subtotal = models.DecimalField(max_digits=10, decimal_places=2, blank=True, null=True) As you can see, each OrderEntry instance has a foreign key connecting it to either inventory or an order. My main goal is to, in the detailed view (change_form.html) for an order, total up all the subtotals of each related order entry every time a new order entry is added and either saved with "save and view" or "save" in the order's total_price field. The problem occurs when I add the order entry and click on either of the above save buttons, the total is not reflected even though I wrote a function in my admin.py to get the total: admin.py total_price = β¦ -
display each day's date python from today
I was able to display the week that starts every Saturday by: today = now().date() sat_offset = (today.weekday() - 5) % 7 week_start = today - datetime.timedelta(days=sat_offset) This will display the week from last Saturday but how would I show the dates of each day forward as well? So if the week: Oct. 27, 2018 is display it should say: Saturday : Oct. 27, 2018 Sunday: Oct. 28, 2018 Monday: Oct. 29, 2018 Tuesday: Oct. 30, 2018 Wednesday: Oct. 31, 2018 Thursday: Nov. 01, 2018 Friday: Nov. 02, 2018 Thank you for your help. -
Django model: modify `objects` to *always* return a subset of objects?
I have an Events table which contains various types of events. I care only about one of those types. As a result, every query I write begins with Events.objects.filter(event_type="the_type").\ etc(...).etc(...)`. Obviously this is repetitive and easy to forget. Is there a way to use a custom Manager so that the objects attribute always returns a specific subset of the rows, without explicitly asking for it? Or any other way to restrict the model to specific subset of the rows?? -
NoReverseMatch after include Favorite button
first of all thanks for attention. i'm pretty new at django framework, and following a tutorial. although i when i tried to include a input button for favorites on my detail.html i got this error: Error during template rendering In template C:\Users\leo8\Desktop\Lucas\c2view03\webdeve\templates\detail.html, error at line 8 Reverse for 'favorites' with arguments '('',)' not found. 1 pattern(s) tried: ['webdeve/(?P[0-9]+)/favorites/$'] 1 <img src="{{ dream.imagem }}"> 2 <h2>{{ dream.titulo }} {{ dream.objetivo }}</h2> 3 4 {% if error_message %} 5 <p><strong>{{ error_message }}</strong></p> 6 {% endif %} 7 8 <form action="{% url 'webdeve:favorites' Dreams.id %}" method="post"> 9 {% csrf_token %} 10 {% for wich in dream.wich_set.all %} 11 <input type="radio" id="wich{{ forloop.counter }}" name="wich" value="{{ titulo.id }}"/> 12 <label for="wich{{ forloop.counter }}"> 13 {{ wich.make }} 14 {% if wich.favorites %} 15 <img src="https://cdn2.iconfinder.com/data/icons/aspneticons_v1.0_Nov2006/add_16x16.gif" /> 16 {% endif %} 17 </label><br> 18 {% endfor %} Those are my views: from .models import Dreams, Wich from django.shortcuts import render, get_object_or_404 app_name = 'webdeve' def index(request): all_dreams = Dreams.objects.all() contexto = {'all_dreams': all_dreams} return render(request, 'index.html', contexto) def detail(request, Dreams_id): #dream = Dreams.objects.get(pk=Dreams_id) dream = get_object_or_404(Dreams, pk=Dreams_id) return render(request, 'detail.html', {'dream': dream}) def favorites(request, Dreams_id): dream = get_object_or_404(Dreams, pk=Dreams_id) try: selected_wich = dream.wich_set.get(pk=request.POST['make']) except (KeyError, β¦ -
Automatic User Profile Create with Signup Using Django Allauth
models.py from django.db import models from django.contrib.auth.models import User from django.urls import reverse import time import os from django.utils import timezone class UserProfile(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE, unique=True, related_name='user') slug = models.SlugField(blank=True, unique=True, null=True) email_verified = models.BooleanField(default=False, null=True) contact = models.CharField(max_length=14, blank=True, null=True) gender = models.CharField(choices=GENDER_CHOICES, default='SELECT', max_length=15, null=True) image = models.ImageField(upload_to=upload_image_path, null=True, blank=True) about = models.TextField(null=True, blank=True, max_length=150) updated_at = models.DateTimeField(auto_now=True, null=True) def user_profile_pre_save_receiver(sender, instance, *args, **kwargs): UserProfile.objects.get_or_create(user=instance) pre_save.connect(user_profile_pre_save_receiver, sender=User) forms.py from allauth.account.forms import SignupForm from django import forms from django.contrib.auth.models import User from . import models class CustomSignupForm(SignupForm): first_name = forms.CharField(max_length=40, label="First Name:", required=False, widget=forms.TextInput( attrs={'placeholder': ('First Name'), 'autofocus': 'autofocus'})) last_name = forms.CharField(max_length=40, label="Last Name:", required=False, widget=forms.TextInput( attrs={'placeholder': ('Last Name'), 'autofocus': 'autofocus'})) def signup(self, request, user): user.first_name = self.cleaned_data['first_name'] user.last_name = self.cleaned_data['last_name'] user.save() user.profile.save() In my Settings.py ACCOUNT_FORMS = { 'signup': 'accounts.forms.CustomSignupForm' } I want to my user to be automatically create a user profile when a user sign up. Please Some one help. I am New to Django. Thanks in advance. -
Modeling product orders in Django
I have an order of a certain list of products, and I need to model this in Django. Each order has properties: id email total_price line_items line_items is a dictionary of products and the number of instances of that product required. Product is a separate model describing a class of products. I think I need a one-to-many relationship between Product and Order because each product could be part of many orders, but how does this look in my fields? -
pjax, eldarion-ajax and regular requests together in one website - is it normal?
I need your suggestion for best practices. I use in one website based on django the follow type of requests: 1. pjax (pushState + ajax) - for site navigation with changing url and working browser buttons 2. eldarion-ajax - for forms POST, table pagination, sorting and other GET requests with parameters 3. regular request - if users wants a direct access to url instead menu navigation based on pjax Is it normal to use all together in one website? Maybe some technologies not recommended to use or it should be combined? Many thanks in advance. -
Django CMS: get the parent model of a placeholder
I have a model called Article who has a placeholder field: class Article(BaseModel): content = PlaceholderField( 'article_content', on_delete=models.SET_NULL, related_name='articles', ) I can't find the way of getting the parent object model from the placeholder. I found the placeholder in this way: placeholder = Placeholder.objects.get(id = self.placeholder_id) and I want to find the instance of the Article object who owns the placeholder, something like: article = placeholder.parent_instance() I want to do in order to do some modifications in the article instance after a plugin in the placeholder has changed. Thanks, i'm new to Django CMS and i can't find the way to do that. -
Django ORM: filter related objects?
Assuming I have a many-to-one relationship class Author(model): name = TextField() class Book(model): year = IntegerField() author = ForeignKey(Author) you can easily filter from the "many" side. Eg, keep only the books whose author satisfies some condition books.objects.filter(author__name__like='...') How can I, from the Author side, keep (for each author) only the books that satisfy a condition? Eg. is there something like Author.related_filter(book__year__gt>1800) that would produce something like select * from author join book on ... where book.year > 1800 ?? -
AllowAny permissions required for DELETE requests in DRF?
I'm looking for some clarification here. I have build a react app that connects to a Django Rest Framework (DRF). The app is completely private, meaning that no-one who is not authenticated can do anything. For this I have used TokenAuthentication (for now, because I think that SessionAuthentication would be more secure). I'm struggling to understand this: I can authenticate and set the appropriate header (Authorization) with my token. I can perform GET/POST/PATCH requests with no issues however: DELETE requests don't work: I get a 401 - Unauthorized error. But my header with my token is there just fine. I'm using DELETE requests to remove objects from my database. I have found a way to get it working: by decoration my view class with @permission_classes((AllowAny, )) it just works fine. But I'm not happy with this. So, why is this? In my settings file I have: REST_FRAMEWORK = { 'DEFAULT_AUTHENTICATION_CLASSES': ( 'rest_framework.authentication.TokenAuthentication', ), 'DEFAULT_PERMISSION_CLASSES': ( 'rest_framework.permissions.IsAuthenticated', ) } In the DRF documentation (link) it says: DELETE requests require the user to have the delete permission on the model. But, my user is an admin, so why do I need to explicitly add this decorator? What am I doing wrong? This β¦ -
Django with ngrok on Shopify
I'm trying to get json data about orders from Shopify. The 'manage private apps' options seem to have changed in the last year or so and the last tut I can find for integrating with django seems out of date. The Shopify private app tut for Ruby uses ngrok to establish a tunneling protocol and connect the local environment with the webhook, but I'm not sure how to use the ngrok proxy url in Django? ngrok is running fine and I have the .ngrok.io url pointed at port 8000 I need to somehow pass a url in the format https://apikey:password@hostname/admin/resource.json to the ngrok proxy. How would I do that with Django? -
Django: use dictionary to construct method parameters
I want to call the MODEL.objects.get_or_create() method in Django using a dynamic way of inserting the lookup fields as parameters. Two examples: Address.objects.get_or_create( street=street_name, city=city_name ) Elsewhere, I call: Customer.objects.get_or_create( name=name ) However, I want to make a static method "obj_get_or_create" that dynamically receives the class names and parameters, like such: # dictionary with information address_obj = {'street': 'some street name', 'city': 'some_city'} # dynamic method call obj_get_or_create('Address', address_obj) # dictionary with information person_obj = {'name': 'some name',} # dynamic method call obj_get_or_create('Person', person_obj) Note that here the parameters are constructed from the dictionary! Therefore, the obj_get_or_create method calls: klass.objects.get_or_create( each_key=each_value ) Then I can call the obj_get_or_create method as a general get_or_create method. Is this possible in Python? -
django 404 error when running a server on window 10 with python 3
he guys i am getting an error in my django project please take a look what i am lacking The /api and /admin are working fine its only the main page Using the URLconf defined in backend.urls, Django tried these URL patterns, in this order: api-auth/ admin/ api/ The empty path didn't match any of these. You're seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard 404 page. My urls.py file is as follow from django.contrib import admin from django.urls import path, include urlpatterns = [ path('api-auth/', include('rest_framework.urls')), path('admin/', admin.site.urls), path('api/',include('movies.api.urls')) ] -
Celery Cannot find a module in my Django project
I have a Django 2.0 project using celery 4.2.1 and redis 2.10.6. The django project has two apps, memorabilia and face_recognition. I have it all successfully running tasks with django running on my development machine. I uploaded everything to my git server, then installed the apps on my laptop from git, updated all requirements, etc. Both are Ubuntu machines. I am not using django-celery. When I try to run celery -A MemorabiliaJSON worker -l debug, I get an exception saying ModuleNotFoundError: No module named 'face_recognition.tasks' I am not sure how to fix this, as the same code base is running on my development machine. My file structure is: βββ celery.sh βββ face_recognition β βββ admin.py β βββ apps.py β βββ __init__.py β βββ migrations β βββ models.py β βββ __pycache__ β βββ tasks.py β βββ tests.py β βββ views.py βββ __init__.py βββ manage.py βββ memorabilia β βββ admin.py β βββ apps.py β βββ fields.py β βββ fixtures β βββ __init__.py β βββ logs β βββ migrations β βββ models.py β βββ __pycache__ β βββ storage.py β βββ tasks.py β βββ templates β βββ tests β βββ urls.py β βββ validators.py β βββ views.py β βββ widgets.py βββ MemorabiliaJSON β βββ β¦ -
Custom output format serializer
I am using Django Rest Framework, and I have this serializer. class UserSerializer(serializers.Serializer): name = serializers.CharField() email = serializers.CharField() phone = serializers.CharField() That produces something like this: [ {"name": "NAME", "email": "EMAIL", "phone": "PHONE"}, {"name": "NAME", "email": "EMAIL", "phone": "PHONE"}, {"name": "NAME", "email": "EMAIL", "phone": "PHONE"}, ] But I want the response to look this way: { "new_user": ID_NEW_USER, "data": [ {"name": "NAME", "email": "EMAIL", "phone": "PHONE"}, {"name": "NAME", "email": "EMAIL", "phone": "PHONE"}, {"name": "NAME", "email": "EMAIL", "phone": "PHONE"}, ] } So I'm doing this. But it looks like I should be using another serializer. class UserListView(WorkspacePermissionMixin): def get(self, request): users = Users.objects.all() new_user = QUERY_TO_GET_NEW_USER serializer = UserSerializer(users, many=True) return Response({"new_user": new_user, "data": serializer.data}) I have tried using the method to_representation but seems that it might be an easier way. Anyone knows the best way to do this? -
How to reordenate elements in a django application
How Can I reordenate elements when an user click on the popularity, data or newest filter? I dont want to submit a form and do a new query for each user click. I think that the best way to do that is using jquery, json... I google it, but I didnt' find something that could help me. How can I implement it? Any suggestion or website recommendation? -
Django + Testypie Issue: AppRegistryNotReadyException
I'd been trying Testipie with Django and got an AppRegistryNotReady Exception. I'd found a few ways how to fix that but anything didn't help. Python: 3.6 Django: 2.1.2 django-tastypie: 0.14.2 Installed APPS INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'services', 'tastypie' ] services/__init__.py `default_app_config = 'services.apps.ServicesConfig'` services/apps.py from django.apps import AppConfig from django.contrib.auth import get_user_model from django.db.models import signals from tastypie.models import create_api_key User = get_user_model() class ServicesConfig(AppConfig): name = 'services' def ready(self): signals.post_save.connect(create_api_key, sender=User) And I got a Traceback: Traceback (most recent call last): File "/home/chumachenko/.local/share/virtualenvs/tastypie_tutorial-aq48eQFJ/lib/python3.6/site-packages/django/utils/autoreload.py", line 225, in wrapper fn(*args, **kwargs) File "/home/chumachenko/.local/share/virtualenvs/tastypie_tutorial-aq48eQFJ/lib/python3.6/site-packages/django/core/management/commands/runserver.py", line 109, in inner_run autoreload.raise_last_exception() File "/home/chumachenko/.local/share/virtualenvs/tastypie_tutorial-aq48eQFJ/lib/python3.6/site-packages/django/utils/autoreload.py", line 248, in raise_last_exception raise _exception[1] File "/home/chumachenko/.local/share/virtualenvs/tastypie_tutorial-aq48eQFJ/lib/python3.6/site-packages/django/core/management/__init__.py", line 337, in execute autoreload.check_errors(django.setup)() File "/home/chumachenko/.local/share/virtualenvs/tastypie_tutorial-aq48eQFJ/lib/python3.6/site-packages/django/utils/autoreload.py", line 225, in wrapper fn(*args, **kwargs) File "/home/chumachenko/.local/share/virtualenvs/tastypie_tutorial-aq48eQFJ/lib/python3.6/site-packages/django/__init__.py", line 24, in setup apps.populate(settings.INSTALLED_APPS) File "/home/chumachenko/.local/share/virtualenvs/tastypie_tutorial-aq48eQFJ/lib/python3.6/site-packages/django/apps/registry.py", line 89, in populate app_config = AppConfig.create(entry) File "/home/chumachenko/.local/share/virtualenvs/tastypie_tutorial-aq48eQFJ/lib/python3.6/site-packages/django/apps/config.py", line 116, in create mod = import_module(mod_path) File "/home/chumachenko/.local/share/virtualenvs/tastypie_tutorial-aq48eQFJ/lib/python3.6/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 994, in _gcd_import File "", line 971, in _find_and_load File "", line 955, in _find_and_load_unlocked File "", line 665, in _load_unlocked File "", line 678, in exec_module File "", line 219, in _call_with_frames_removed File "/home/chumachenko/Documents/Projects/tastypie_tutorial/services/apps.py", line 4, β¦ -
Django-rest-auth: Reverse for 'password_reset_confirm' not found. 'password_reset_confirm' is not a valid view function or pattern name
I'm trying to use django-rest-auth password reset feature but after a post request at /rest-auth/password/reset/ i get the error stated in the title (Traceback) and i don't understand why. I followed the installation procedure from the documentation page. My urls.py is: from django.urls import include, path urlpatterns = [ path('users/', include('users.urls')), path('rest-auth/', include('rest_auth.urls')), path('rest-auth/registration/', include('rest_auth.registration.urls')), I also added the required apps in settings.py