Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
how to put default user who is creating a session
I want to add user as a default user who is creating the session, class User(models.Model): user_name=models.CharField(max_length=30) def __str__(self): return self.user_name class Session(models.Model): session=models.CharField(max_length=20) user=models.ForeignKey(User,on_delete=models.CASCADE) player_participitating=models.ForeignKey(User,on_delete=models.CASCADE) def __str__(self): return self.session -
is there any way to fetch all the records of the project model and render all the project model records inside the latex template
I am pretty new with python and django, struck at rendering the whole table from database to a latex template -
Fail to runserver when adding django-import-export package into Django project
I am currently working with a project that requires import an excel file into Django database. I googled it and found out that django-import-export package is exactly what I want. However, when I import "import_export" into my "settings.py" or "from import_export.admin import ImportExportModelAdmin" into my "admin.py", the error appears although I have successfully installed this package. I have also followed the tutorial here, but the result is still the same. Is there any way to solve this problem or any suggestions? Could you please help me? Thanks in advance! Here is the code from a tutorial on youtube that I used for testing: /*admin.py*/ from django.contrib import admin # Register your models here. from .models import * from import_export.admin import ImportExportModelAdmin @admin.register(Laptop, Desktop, Mobile) class ViewAdmin(ImportExportMixin): pass /*settings.py*/ INSTALLED_APPS = [ ... 'import_export', ] /*After running python manage.py runserver */ Watching for file changes with StatReloader Exception in thread django-main-thread: Traceback (most recent call last): File "C:\FWTools\WinPython-201702\python-3.6.2\lib\threading.py", line 916, in _bootstrap_inner self.run() File "C:\FWTools\WinPython-201702\python-3.6.2\lib\threading.py", line 864, in run self._target(*self._args, **self._kwargs) File "C:\FWTools\WinPython-201702\python-3.6.2\lib\site-packages\django\utils\autoreload.py", line 53, in wrapper fn(*args, **kwargs) File "C:\FWTools\WinPython-201702\python-3.6.2\lib\site-packages\django\core\management\commands\runserver.py", line 109, in inner_run autoreload.raise_last_exception() File "C:\FWTools\WinPython-201702\python-3.6.2\lib\site-packages\django\utils\autoreload.py", line 76, in raise_last_exception raise _exception[1] File "C:\FWTools\WinPython-201702\python-3.6.2\lib\site-packages\django\core\management\__init__.py", line 357, in execute autoreload.check_errors(django.setup)() … -
Finding the current name of the model being used in a class based view, then using it as one of two filter parameters
My problem is that I am trying to find the name of the model currently being used in the Class based Detail View, then using that name as one of two search parameters (The Model used in the class based view is a foreign key of another model I'm trying to filter) I can't figure out how to find out how to filter by the current model being used. Here is my models.py class MyProjects(models.Model): title = models.CharField(max_length=30) description = models.CharField(max_length=140) class Post(models.Model): title = models.CharField(max_length=50) content = models.TextField() project = models.ForeignKey(MyProjects, on_delete=models.CASCADE, null=True, default=None) And here is my views.py class ProjectView(DetailView): model = MyProjects def get_context_data(self, **kwargs): CurrentProject = get_object_or_404(MyProjects, title=self.kwargs['MyProjects']) completed = Post.objects.filter(status='Completed', project= CurrentProject) inProgress = Post.objects.filter(status='InProgress', project= CurrentProject) posts = Post.objects.filter(project= CurrentProject) Features = Post.objects.filter(ticket_type='Features', project= CurrentProject) context = super().get_context_data(**kwargs) context['posts '] = posts context['Features '] = Features context['completed '] = completed context['inProgress '] = inProgress context['projects'] = projects return context Thanks -
How post data between the backends of 2 different project
Im familiar with using Axios to post data from the frontend to the backend , howevever im having troubles finding materials on posting data from the backend to the backend of another project. What im trying to achieve here is that whenever a user fills in a form in project A , i wish to post the data over to an API endpoint i have created in project B to create an object into project B's database. Is there an easy way to do this? -
JSON Decoder Callback?
I am having trouble with an error for a program I am trying to use. I believe the error is within my machine, rather than the program, but I cannot find a fix for it. Here is the error message: Traceback (most recent call last): File "/usr/local/bin/instabot-py", line 8, in <module> sys.exit(main()) File "/usr/local/lib/python3.7/site-packages/instabot_py/__main__.py", line 357, in main bot = InstaBot(config=config) File "/usr/local/lib/python3.7/site-packages/instabot_py/instabot.py", line 219, in __init__ self.login() File "/usr/local/lib/python3.7/site-packages/instabot_py/instabot.py", line 316, in login login_response = login.json() File "/usr/local/lib/python3.7/site-packages/requests/models.py", line 897, in json return complexjson.loads(self.text, **kwargs) File "/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/__init__.py", line 348, in loads return _default_decoder.decode(s) File "/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) Does anyone have an idea where the source of this issue might be? I am not familiar with json. -
How to fix Reverse for 'control_newletter' not found. 'control_newletter' is not a valid view function or pattern name
I have created a new control_newsletter_list function in the views.py, after creating the template and adding the related URL i keep getting Reverse for 'control_newletter' not found. 'control_newletter' is not a valid view function or pattern name. for some unknown reason with highlight on return render(request, template, context) Here is the views.py def control_newsletter_list(request): newsletter = Newsletter.objects.all() paginator = Paginator(newsletter, 10) page = request.GET.get('page') try: items = paginator.page(page) except PageNotAnInteger: items = paginator.page(1) except EmptyPage: items = paginator.page(paginator.num_pages) index = items.number - 1 max_index = len(paginator.page_range) start_index = index - 5 if index >= 5 else 0 end_index = index + 5 if index <= max_index - 5 else max_index page_range = paginator.page_range[start_index:end_index] context = { "items": items, "page_range": page_range } template = "control_newsletter_list.html" return render(request, template, context) <------------------error indicated here here is the urls.py from newsletters.views import control_newsletter, control_newsletter_list app_name = 'newsletters' urlpatterns = [ path('newsletter/', control_newsletter, name="control_newsletter"), path('newsletter-list/', control_newsletter_list, name="control_newsletter_list"), -
How to redirect to page multiple times and update information on page with django
I am working on a web app. The webapp has a view in which a for loop runs and updates three lists with every iteration. The lengths of the lists are stored in a dictionary. I want to display the length of the lists on a template after every iteration. How do I do this? Here is my code so far views.py def update_lst(request): if request.method == 'POST': lst1, lst2, lst3 = [], [], [] for i in range(10): lst1.append(i+1) lst2.append(i+2) lst3.append(i+3) context = {'length1':len(lst1), 'length2':len(lst2), 'length3':len(lst3)} render(request, 'details.html', context) return redirect('index.html') return render(request, 'index.html') details.html <h1>Extracting details</h1> <p>{{length1}}: length of list1</p> <p>{{length2}}: length of list1</p> <p>{{length3}}: length of list1</p> Right now the render function inside the for loop does not execute. What am I doing wrong? -
Django Attribute Error Str Object Homepage
When I go to http://127.0.0.1:8000/, at the very top of the page, it says AttributeError at / 'str' object has no attribute '_default_manager' When I look at the command line, it's pointing to one of the files downloaded when I installed Django, ...\site-packages\django\views\generic\list.py. Has anyone seen this before? Any suggestions? -
AWS Elastic Beanstalk Container Commands Failing
I've been having a hard time trying to get a successful deployment of my Django Web App to AWS' Elastic Beanstalk. I am able to deploy my app from the EB CLI on my local machine with no problem at all until I add a list of container_commands config file inside a .ebextensions folder. Here are the contents of my config file: container_commands: 01_makeAppMigrations: command: "django-admin.py makemigrations" leader_only: true 02_migrateApps: command: "django-admin.py migrate" leader_only: true 03_create_superuser_for_django_admin: command: "django-admin.py createfirstsuperuser" leader_only: true 04_collectstatic: command: "django-admin.py collectstatic --noinput" I've dug deep into the logs and found these messages in the cfn-init-cmd.log to be the most helpful: 2020-06-18 04:01:49,965 P18083 [INFO] Config postbuild_0_DjangoApp_smt_prod 2020-06-18 04:01:49,991 P18083 [INFO] ============================================================ 2020-06-18 04:01:49,991 P18083 [INFO] Test for Command 01_makeAppMigrations 2020-06-18 04:01:49,995 P18083 [INFO] Completed successfully. 2020-06-18 04:01:49,995 P18083 [INFO] ============================================================ 2020-06-18 04:01:49,995 P18083 [INFO] Command 01_makeAppMigrations 2020-06-18 04:01:49,998 P18083 [INFO] -----------------------Command Output----------------------- 2020-06-18 04:01:49,998 P18083 [INFO] /bin/sh: django-admin.py: command not found 2020-06-18 04:01:49,998 P18083 [INFO] ------------------------------------------------------------ 2020-06-18 04:01:49,998 P18083 [ERROR] Exited with error code 127 I'm not sure why it can't find that command in this latest environment. I've deployed this same app with this same config file to a prior beanstalk environment with no issues … -
virtualenv django project unknown files
I am trying to set up a virtual environment for my django project but when I do it adds a series of files that never added before to the scripts folder: this is what is included in the folder. Is this normal? Usually it just adds pip files and a couple of others, am I wrong? Can someone help please I don't have any experience with virtualenv.Thanks. -
Cannot import a Module from Models into admin.py which are in the same folder
I am following a tutorial exactly step-by-step, and it is not working for me. In a Django application, I am trying to import a Post class from the Models.py file, into the admin.py file. Here is admin.py: from django.contrib import admin from .models import Post # Register your models here. admin.site.register (Post) My directory structure is as follows: my-project manage.py blog __init__.py admin.py models.py I have tried to cd my Python terminal into various directories and nothing works. I also tried different syntaxes. I really don't know what is going one. I am running Windows. I keep getting each time: ImportError: attempted relative import with no known parent package -
How to use a specific room and queue of Redis with Django and Celery?
How do I set up a specific room of my Redis server with Django and Celery? I have set it up via the documentation present here: https://docs.celeryproject.org/en/stable/django/first-steps-with-django.html The issue is I want to run replicas of the Django or to be more specific I want to run a staging server in the same Redis container. Here is my docker-compose.yml file version: "3.7" services: api: container_name: api ports: - "5000:5000" image: test/api:v0.19 environment: - PYTHONUNBUFFERED=1 - PROD_MODE=False - CELERY_BROKER_URL=redis://redis restart: always volumes: - ./secret:/secret depends_on: - redis - worker entrypoint: "gunicorn -c gunicorn_config.py app.wsgi --bind 0.0.0.0:5000" worker: container_name: worker image: test/api:v0.19 restart: always environment: - PYTHONUNBUFFERED=1 - PROD_MODE=False - CELERY_BROKER_URL=redis://redis volumes: - ./secret:/secret depends_on: - redis entrypoint: "celery -A app worker -l info" api-dev: container_name: api-dev ports: - "8888:5000" image: test/api:v0.19 environment: - PYTHONUNBUFFERED=1 - PROD_MODE=False - CELERY_BROKER_URL=redis://redis restart: always volumes: - ./secret:/secret depends_on: - redis-dev - worker-dev entrypoint: "gunicorn -c gunicorn_config.py app.wsgi --bind 0.0.0.0:5000" worker-dev: container_name: worker-dev image: test/api:v0.19 restart: always environment: - PYTHONUNBUFFERED=1 - PROD_MODE=False - CELERY_BROKER_URL=redis://redis volumes: - ./secret:/secret depends_on: - redis-dev entrypoint: "celery -A app worker -l info" redis: container_name: redis hostname: redis image: redis:6.0.3 ports: - "6379:6379" restart: always command: ["redis-server", "--bind", "redis", "--port", "6379"] volumes: … -
Date filed Initial Value
models.py class Order(models.Model): date = models.ForeignKey('date', null=True, on_delete=models.CASCADE) user = models.ForeignKey(User, null=True, on_delete=models.CASCADE) quote_choices = ( ('Movie', 'Movie'), ('Inspiration', 'Inspiration'), ('Language', 'Language'), ) quote = models.CharField(max_length =100, choices = quote_choices) box_choices = (('Colors', 'Colors'), ('Crossover', 'Crossover'), ) box = models.CharField(max_length = 100, choices = box_choices) pill_choice = models.CharField(max_length=30) shipping_tracking = models.CharField(max_length=30) memo = models.CharField(max_length=100) status_choices = (('Received', 'Received'), ('Scheduled', 'Scheduled'), ('Processing/Manufacturing', 'Processing/Manufacturing'), ('In Progress','In Progress'), ) status = models.CharField(max_length = 100, choices = status_choices, default="In Progress") def __str__(self): return f"{self.user_id}-{self.pk}" class Date(models.Model): date_added = models.DateField(max_length=100, default="In Progress") scheduled_date = models.DateField(max_length=100, default="In Progress") service_period = models.DateField(max_length=100, default="In Progress") modified_date = models.DateField(max_length=100, default="In Progress") finish_date = models.DateField(max_length=100, default="In Progress") {% extends 'base.html' %} {% load crispy_forms_tags %} {% block content %} <!DOCTYPE html> <html> <head> <title> </title> </head> <body> <table class="table"> <thead class="bg-primary"> <tr> <th scope="col">Date added</th> <th scope="col">Scheduled date</th> <th scope="col">Service period</th> <th scope="col">Modified date</th> <th scope="col">Finish date</th> </tr> </thead> {% for Order in order %} <tbody> <tr> <th>{{Order.date.date_added}}</th> <th>{{Order.date.scheduled_date}}</th> <th>{{Order.date.service_period}}</th> <th>{{Order.date.modified_date}}</th> <th>{{Order.date.finish_date}}</th> </tr> </tbody> {% endfor %} </table> </body> </html> {% endblock %} views.py def dateDetailView(request, pk): initial_date = { 'status':"In Progress" } order = Order.objects.filter(pk=pk) context = { 'order': order } return render(request, "date_list.html", context) @login_required(login_url='/') def create_order(request): initial_date … -
Align text with image CSS
What would be the best way add extra spacing below the pictures so all the "Book Title:" are aligned? As you can, certain picture are longer than others and that causes "Book Title:" to be misaligned. Screenshot of the webpage -
How to serve Tornado with Django on waitress?
I have this tornado application wrapped with django function as WSGI app from django.core.wsgi import get_wsgi_application from django.conf import settings from waitress import serve settings.configure() wsgi_app = tornado.wsgi.WSGIContainer(django.core.wsgi.WSGIHandler()) def tornado_app(): url = [(r"/models//predict", PHandler), (r"/models//explain", EHandler), ('.*', tornado.web.FallbackHandler, dict(fallback=wsgi_app))] return Application(url, db=ELASTIC_URL, debug=options.debug, autoreload=options.debug) if __name__ == "__main__": application = tornado_app() http_server = HTTPServer(application) http_server.listen(LISTEN_PORT) IOLoop.current().start() To serve using waitress I tried http_server = serve(application), server is starting, now sure is it correct, getting error when hitting the endpoint -
How can I show count of objects?
I am trying to show the total count of Contact from this model.py import arrow from django.db import models from autoslug import AutoSlugField from model_utils.models import TimeStampedModel from django_countries.fields import CountryField from phonenumber_field.modelfields import PhoneNumberField from django.urls import reverse from django.conf import settings class Contact(TimeStampedModel): name = models.CharField("Name of Contact", max_length=255) first_name = models.CharField("First name", max_length=255, null=True) last_name = models.CharField("Last name", max_length=255, null=True) email = models.EmailField(unique=True, null=True) phone = PhoneNumberField(null=True, unique=True) slug = AutoSlugField("Contact Address", unique=True, always_update=False, populate_from="name") description = models.TextField("Description", blank=True) class Firmness(models.TextChoices): UNSPECIFIED = "unspecified", "Unspecified" SOFT = "soft", "Soft" SEMI_SOFT = "semi-soft", "Semi-Soft" SEMI_HARD = "semi-hard", "Semi-Hard" HARD = "hard", "Hard" # Other Fields Here... firmness = models.CharField("Firmness", max_length=20, choices=Firmness.choices, default=Firmness.UNSPECIFIED) country_of_origin = CountryField("Country of Origin", blank=True) creator = models.ForeignKey(settings.AUTH_USER_MODEL, null=True, on_delete=models.SET_NULL) created_on = models.DateTimeField("Created on", auto_now_add=True, null=True) is_active = models.BooleanField(default=False) def __str__(self): return self.name def get_absolute_url(self): """"Return absolute URL to the Contact Detail page.""" return reverse('contacts:detail', kwargs={"slug": self.slug}) @property def created_on_arrow(self): return arrow.get(self.created_on).humanize() class Meta: ordering = ["-created_on"] And I have this views.py from django.shortcuts import render from .models import Contact from django.contrib.auth.mixins import LoginRequiredMixin from django.views.generic import ( ListView, DetailView, CreateView, UpdateView ) class ContactListView(ListView): model = Contact class ContactDetailView(DetailView): model = Contact def total(request): … -
React Native to Django Using Axios [Error: Request failed with status code 400]
I have tried almost all options but not getting through. My Django server is working fine with Postman but when I try it from my React Native app, it gives an error [Error: Request failed with status code 400] My code is: submitData = () => { console.log("submitQuestionDataToServer"); let form_data = new FormData(); form_data.append('qOne_img', Platform.OS === 'android' ? photoUri : photoUri.replace('file://', '')); form_data.append('qOne_img', Platform.OS === 'android' ? secondPhotoUri : secondPhotoUri.replace('file://', '')); form_data.append('question_title', qTitle); form_data.append('asked_by', "http://127.0.0.1:8000/auth/users/2/"); let url = 'http://127.0.0.1:8000/api/questions/'; axios.post(url, form_data, { headers: { "Content-Type": "multipart/form-data", "Authorization": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1Nk", } }) .then(res => { console.log("res *******") console.log(res.data); }) .catch(err => console.log(err)) } Thanks in advance. -
How to Resolve this error " 'password_reset' is not a registered namespace in rest api django"
hi i am implementing password-reset feature on rest_API using `django_rest_passwordreset` library.but while testing end points its giving the following error: NoReverseMatch at /api/accounts/password_reset/reset-password 'password_reset' is not a registered namespace please check the code below: from django.urls import path,include from account.api.views import SignupApiView from account.api.views import UserCreationView from account.api.views import ProfileView,EnableDisableUserView from rest_framework.authtoken.views import obtain_auth_token app_name = 'account' urlpatterns = [ path("signup",SignupApiView.as_view(),name="signup"), path("create_user",UserCreationView().as_view(),name="create_user"), path("profile/<int:pk>",ProfileView.as_view(),name="profile"), path("disable_users/<slug:slug>",EnableDisableUserView.as_view()), path("disable_users/<int:pk>",EnableDisableUserView.as_view(),name="disable"), path("login",obtain_auth_token,name="login"), path('password_reset/', include('django_rest_passwordreset.urls', namespace='password_reset')),#this is where i am getting the error ] -
Django-heroku install failure
I am operating a django site from a mac catalina. It is working perfectly, except for the fact that I can't use python manage.py runserver. Pretty big problems, right? I have learned that you have to install django-heroku. I have tried that, but it doesn't work with this computer. To get around this, I installed something called heroku-toolkit. It works for pushing code to Heroku, but I can't runserver or collecstatic! Here is the error I get when I run pip3 install django-heroku: Collecting django-heroku Using cached https://files.pythonhosted.org/packages/59/af/5475a876c5addd5a3494db47d9f7be93cc14d3a7603542b194572791b6c6/django_heroku-0.3.1-py2.py3-none-any.whl Requirement already satisfied: django in /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages (from django-heroku) (3.0.7) Requirement already satisfied: whitenoise in /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages (from django-heroku) (5.1.0) Requirement already satisfied: dj-database-url>=0.5.0 in /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages (from django-heroku) (0.5.0) Collecting psycopg2 (from django-heroku) Using cached https://files.pythonhosted.org/packages/a8/8f/1c5690eebf148d1d1554fc00ccf9101e134636553dbb75bdfef4f85d7647/psycopg2-2.8.5.tar.gz Requirement already satisfied: asgiref~=3.2 in /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages (from django->django-heroku) (3.2.8) Requirement already satisfied: sqlparse>=0.2.2 in /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages (from django->django-heroku) (0.3.1) Requirement already satisfied: pytz in /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages (from django->django-heroku) (2020.1) Installing collected packages: psycopg2, django-heroku Running setup.py install for psycopg2 ... error ERROR: Command errored out with exit status 1: command: /Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/k8/4qqdxbkn1l31ctsjbgpngr_00000gn/T/pip-install-u8ftbfmm/psycopg2/setup.py'"'"'; __file__='"'"'/private/var/folders/k8/4qqdxbkn1l31ctsjbgpngr_00000gn/T/pip-install-u8ftbfmm/psycopg2/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/k8/4qqdxbkn1l31ctsjbgpngr_00000gn/T/pip-record-_tusvgi7/install-record.txt --single-version-externally-managed --compile cwd: /private/var/folders/k8/4qqdxbkn1l31ctsjbgpngr_00000gn/T/pip-install-u8ftbfmm/psycopg2/ Complete output (151 lines): running install running … -
Add user to group after post_save signal
I want to add a user to a group after the user object is saved. Each user has a permission level corresponding to the group the user belongs to. For example, if the permission level is 3, then the user belongs to Group_3, and so on. This is my code: models.py class User(AbstractUser): ... ID = models.IntegerField(default=random_integer, unique=True) permissions = models.IntegerField(default=0) ... def __str__(self): return self.first_name def add_2_group(sender, instance, **kwargs): if kwargs['created']: if instance.permissions == 3: group = Group.objects.get(name='Group_3') group.user_set.add(instance) post_save.connect(add_2_group, sender=User) As you can see, I am using a post_save signal to add the user to the group after saving the user instance. However, this is not working. Apparently, nothing happens after saving the user. How do I solve this? -
How to get foreignkey values instead of id in queryset to serialize (Django)?
I have a queryset with some foreignkeys in it. It is selected like this: servicePaymentHistory = service_payments.objects.filter(quotation_id=qid) json_resp = serializers.serialize("json", servicePaymentHistory) data = {"json_resp": json_resp} return JsonResponse(data) The problem is that the data (json_resp) contains id of foreignkeys while I want the value instead of id. What can I do to get a queryset with values of foreignkeys not their id so that I can serialize them with it? -
How to handle page after page flow in Django
I am learning Django and I am looking to setup a flow. It would be something similar to this.. myflow/start.html-> myflow/page1.html-> myflow/page2.html-> myflow/page3.html-> ..... myflow/page40.html-> myflow/end.html So from what I am guessing is the url would just show those in it. Is there a better way to do this? Can I still render those pages but not put those html pages in the url? So as the user navigates through the flow they only see something like: mysite.com/myflow/ And each time they click the "Continue" button it still displays that in the url? Or is there a better way? Or is this the right/correct way? -
Django Rest Framework router - exclude URL for prefix
I am using DRF router with a prefix + include like this: router = BulkRouter() router.register(r"myfeature", MyfeatureViewSet, base_name="myfeature") urlpatterns = [ url(r"^api/1/", include(router.urls)),] This allows me to hit the both api/1 and api/1/myfeature URLS. How can I prevent the first URL from returning 200's? The response of that endpoint is a list of everything registered under the router which I don't want to make easily obtainable. -
How do I create user registration for a AbstractUser?
Since Django recommends having a custom user model for a new project, I've extended the AbstractUser model without adding any additional fields, but how do I create a signup page for new users with my new user model? My model: from django.contrib.auth.models import AbstractUser class User(AbstractUser): pass