Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Is it possible to reset a password without a token? django + react
Could I reset a password for a user without a token , which (ithink) would require sending a link via a email to a users email address (I'm not sure if django or react have that functionality) So could I rewrite their password data with a axios post request if I had most details of their account like username,email,user_id. -
error while trying to run Unittest with PostgreSQL db inside docker container
I have this Django app which runs inside Docker. I am trying to run some test on a script. I run this command below but receive the following error: any idea? iam new to docker and postgresql and django as well.. docker-compose run web sh -c "python manage.py test test test.unit.enrollments.test_views.MyAPIViewTestCase.test_id" =========================================================== ERROR: test.unit.transactions.test_views (unittest.loader._FailedTest) ---------------------------------------------------------------------- ImportError: Failed to import test module: test.unit.transactions.test_views Traceback (most recent call last): File "/usr/local/lib/python3.5/unittest/loader.py", line 428, in _find_test_path module = self._get_module_from_name(name) File "/usr/local/lib/python3.5/unittest/loader.py", line 369, in _get_module_from_name __import__(name) File "/opt/app/test/unit/transactions/test_views.py", line 15, in <module> from test.unit.transactions.view_testing_utils import ViewTestingUtils File "/opt/app/test/unit/transactions/view_testing_utils.py", line 9, in <module> from test.unit.groups.view_testing_utils import ViewTestingUtils as SharedViewTestingUtils File "/opt/app/test/unit/groups/view_testing_utils.py", line 27, in <module> class ViewTestingUtils: File "/opt/app/test/unit/groups/view_testing_utils.py", line 169, in ViewTestingUtils status=LargeGroupGroupStatus.IN_PROGRESS.value, File "/usr/local/lib/python3.5/enum.py", line 274, in __getattr__ raise AttributeError(name) from None AttributeError: IN_PROGRESS ---------------------------------------------------------------------- Ran 138 tests in -70489110.777s FAILED (errors=168, skipped=8) Destroying test database for alias 'celery'... ERROR: 1 -
AWS Elastic Beanstalk Deployment Error: 502 Bad Gateway - Django Application
I am having problems deploying my 1st python django app to AWS Elastic Beanstalk. The app appears to upload correctly but when I try to use it I get 502 Bad Gateway. The logs show the following: *2021/03/25 20:14:53 [error] 5144#0: 357 connect() failed (111: Connection refused) while connecting to upstream, client: 172.31.8.43, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8000/", host: "crap-env.eba-2nhwp4ty.us-west-2.elasticbeanstalk.com" Would appreciate any help. -
I don't understand how sorl-thumbnail uses db and also a cache
I'm trying to get my head around how sorl-thumbnail works but getting a bit confused. I know it get's a key depending on the image and its settings then saves/returns the value when it's needed. To me this seems like it would all be done with the cache. I just don't get why it's saving the key/value in a database too. Can you explain why you need a cache engine and also a database? It doesn't make sense to me why it would need to use both. -
How to render different templates per user status
I want to render a different template per user is_teacher status. here is my model.py class Profile(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE) is_teacher = models.BooleanField(default=False) here is my view.py def home(request): if User.profile.is_teacher==True: return render(request, 'home/home.html') else: return render(request, 'home/tutor_home.html') I am having issues with the second line, I want a situation where if is_teacher is true in user profile then it renders a template and if false it renders another template -
Any developers looking to join a Bio- Tech Start up on contractor rate?
I am looking for London based Back End & Front End Developers who are readily available and have previous experience working in a Start-Up environment is key. Key technologies Python, Django, Rest Framework, React, TypeScript, Ionic, Node.js, PostgreSQL, NoSQL, TDD, Gitflow, CI/CD, AWS If you are interested please do make contact with a copy of your updated CV. NO AGENCIES PLEASE. -
How to convert PIL image to InMemoryUploadedFile
How can i store PIL image into database,whenever try to convert PIL image into InMemoryUploadedFile that time we get an error like 'JpegImageFile' object has no attribute 'read'.Thank u //views.py file FIRST_NAME = request.POST["FIRST_NAME"] LAST_NAME = request.POST["LAST_NAME"] BLOOD = request.POST["BLOOD"] CONTACT = request.POST["CONTACT"] ADDRESS = request.POST["ADDRESS"] image = Image.new('RGB', (640, 480), (255, 255, 255)) # produces white color 255 255 255 image.save('temp.jpeg') image = Image.open('temp.jpeg') print(image.load()) pic_file = InMemoryUploadedFile(file=image, field_name=None, name=image.filename, content_type=image.format,size=image.size, charset=None) ins = person_data(FIRST_NAME=FIRST_NAME, LAST_NAME=LAST_NAME, BLOOD_CUST=BLOOD,CONTACT_CUST=CONTACT, ADDRESS_CUST=ADDRESS, IMAGE_CUST=file, ID_CUST=pic_file) ins.save() //model.py class person_data(models.Model): FIRST_NAME = models.CharField(max_length=50, default='') LAST_NAME = models.CharField(max_length=30, default='') BLOOD_CUST = models.CharField(max_length=30, default='') CONTACT_CUST = models.IntegerField(default=0) ADDRESS_CUST = models.CharField(max_length=30, default='') IMAGE_CUST = models.ImageField(upload_to='images/', default='',null=True, verbose_name="") //Console error 'JpegImageFile' object has no attribute 'read' Internal Server Error: / -
django-graphql-jwt with django-phone-field Object of type PhoneNumber is not JSON serializable
I'm currently using the django-phone-field library in a project where I use graphene-django as well. Here's my custom User model, where I'm using the PhoneField. class User(AbstractBaseUser, PermissionsMixin): """ Custom User model to add the required phone number """ first_name = models.CharField( max_length=100 ) last_name = models.CharField( max_length=100 ) email = models.EmailField( verbose_name='Email address', max_length=255, unique=True, # Because it's unique, blank is not an option because there could be 2 with the same value ('') blank=False, null=True ) phone = CustomPhoneField( # Please note this formatting only works for US phone numbers right now # https://github.com/VeryApt/django-phone-field#usage # If international numbers are needed at some point, take a look at: # https://github.com/stefanfoulis/django-phonenumber-field E164_only=True, unique=True ) is_active = models.BooleanField(default=True) is_admin = models.BooleanField(default=False) objects = UserManager() USERNAME_FIELD = 'phone' REQUIRED_FIELDS = ['first_name', 'last_name',] I'm using django-graphql-jwt to handle authentication. Here's my tokenAuth query: mutation TokenAuth ($phone: String!, $password: String!) { tokenAuth(phone: $phone, password: $password) { token payload refreshExpiresIn } } The server is retrieving me an error when trying to execute that query: { "errors": [ { "message": "Object of type PhoneNumber is not JSON serializable", "locations": [ { "line": 2, "column": 5 } ], "path": [ "tokenAuth" ] } ], "data": { … -
How can I make Django create migration files for tables that aren't Django managed?
Background I've got a Django app that I want to test. The Django app relies on database tables that were created by a different, non-Django app, but in the same database. Every time I try to run a test I get the following error: django.db.utils.ProgrammingError: relation "mytable" does not exist I'm thinking that this error is caused by the fact that the table was created manually and there are no migrations. Question Is there a way I can tell Django to build migration files based off of a database table that already exists? -
Can i create a web virtual laboratory with python?
i Just finished learning the basics of python and before going afar, i would like to know if it's possible with a module/framework( django, pygame ? ) to build a stimulated lab websites(with a virual microscope and virtual histological slides) -
Error while creating middleware in Django to authenticate a user from different microservice
Building Microservices With Django and pyJWT Let me explain this in summarised manor, maybe someone can help me out been at this for too long I have three microservices i.e. Authentication : Which creates the User and makes the token for a user using RS256 algorithm Student : which is basically a user type that needs to be verified using JWT Investor : which is also a user type that needs to be verified using JWT [I have tried to make a generic create token function in authentication service something like] data = {"id": user.uuid.hex, "type": user.user_type} encoded = jwt.encode(data, private_key, algorithm="RS256") return encoded It is generating a correct token i have verified using JWT.io In my student service i have created a middleware something like this class JWTAuthenticationMiddleware(object): #Simple JWT token based authentication. #Clients should authenticate by passing the token key in the "Authorization" #HTTP header, prepended with the string "Bearer ". For example: # Authorization: Bearer <UNIQUE_TOKEN> keyword = "Bearer" def __init__(self, get_response): self.get_response = get_response def __call__(self, request): auth = request.META.get("AUTHORIZATION", None) splitted = auth.split() if auth else [] if len(splitted) == 2 and splitted[0] == self.keyword: if not splitted or splitted[0].lower() != self.keyword.lower().encode(): return None if … -
return back data of related the foreign key before submitting the form django
im trying to return back some data based on selected item , i have an application which everyone can order mobile cases sometimes happen the user wants to order 4 mobile cases but in our storage only has 3 i have to do something before submitting the form it will display the quantities of the selected item ! if quantity in Item table = 3 but i have write 4 in the ItemsInvoice i want to show an alert if write more than 3 ? is it possible please ? class Item(models.Model): items = models.CharField(max_length=50) quantity = models.IntegerField() def __str__(self): return self.items class Invoice(models.Model): seller = models.ForeignKey(User,on_delete=models.CASCADE) customer = models.CharField(max_length=50) items = models.ManyToManyField(Item,through='ItemsInvoice') class ItemsInvoice(models.Model): invoice= models.ForeignKey(Invoice,on_delete=models.CASCADE) item = models.ForeignKey(Item,on_delete=models.CASCADE) quantity = models.IntegerField() price = models.IntegerField() i have prevent submitting the form if we dont have enough items , but i want to display it before trying to submit the form <form method="POST">{% csrf_token %} {{items.management_form}} <div class="p-1 pr-2 pb-1 text-xs border border-black rounded-lg flex flex-wrap" style="direction: rtl;"> <div class="flex w-8/12 lg:w-9/12"> <div class=""> customer name : </div> <div class="w-10/12 ml-8 border-b border-gray-600 border-dotted"> {{form.customer | add_class:'bg-transparent w-full text-center focus:outline-none customer' }} {% if form.customer.errors %} <div class="redCOLOR pb-1 my-0 … -
from imagekit.models import ImageSpecField ModuleNotFoundError: No module named 'imagekit'
I have ran into the above error even though i've ran pip install django-imagekit phoneshop/models.py: import uuid from django.db import models from django.urls import reverse from django.utils.text import slugify from imagekit.models import ImageSpecField from imagekit.processors import ResizeToFill class Category(models.Model): id = models.UUIDField( primary_key=True, default=uuid.uuid4, editable=False) name = models.CharField(max_length=250, unique=True) description = models.TextField(blank=True) image = models.ImageField(upload_to='category', blank=True) slug = models.SlugField(null=True, unique=True) class Meta: ordering = ('name',) verbose_name = 'category' verbose_name_plural = 'categories' def save(self, *args, **kwargs): self.slug = slugify(self.name) super(Category, self).save(*args, **kwargs) def get_absolute_url(self): return reverse('phoneshop:products_by_category', args=[self.slug]) def __str__(self): return self.name class Product(models.Model): id = models.UUIDField( primary_key=True, default=uuid.uuid4, editable=False) image_thumbnail = ImageSpecField(source='image', processors=[ResizeToFill(90, 90)], format='JPEG', options={'quality': 60}) name = models.CharField(max_length=250, unique=True) description = models.TextField(blank=True) category = models.ForeignKey(Category, on_delete=models.CASCADE) price = models.DecimalField(max_digits=10, decimal_places=2) image = models.ImageField(upload_to='product', blank=True) stock = models.IntegerField() available = models.BooleanField(default=True) created = models.DateTimeField(auto_now_add=True, blank=True, null=True) updated = models.DateTimeField(auto_now_add=True, blank=True, null=True) slug = models.SlugField(null=True, unique=True)# class Meta: ordering = ('name',) verbose_name = 'product' verbose_name_plural = 'products' def save(self, *args, **kwargs): self.slug = slugify(self.name) super(Product, self).save(*args, **kwargs) def get_absolute_url(self): return reverse('phoneshop:prod_detail', args=[str(self.category.slug), str(self.slug)]) def __str__(self): return self.name Both "from"'s in the imagekit imports are underlined saying no name in module ImageKit I've imported the correct imagekit and tried uninstalling as i … -
How can I mute or disable signals in PyTest during fixture creation?
In my Django project I create Profile of the User via the post_save signal: @receiver(post_save, sender=User) def post_save_user(sender, instance, *args, **kwwargs): Profile.objects.create_profile(instance) return None In Profile objects manager I iterate over permissions and assign them to Profile object: for perm in ASSIGNED_PERMISSIONS['profile']: assign_perm(perm[0], user, profile) When I try to create user fixture in PyTest: @pytest.fixture def user(db, django_user_model): return django_user_model.objects.create(username='user', password='password') I get error about missing Permissions in the DB. django.contrib.auth.models.Permission.DoesNotExist: Permission matching query does not exist As I understand PyTest tries to create user fixture. User model emits post_save signal which is handled in Profile. However, required permissions over which I iterate are not yet in the DB. One of the solutions could be to disable signals with autoused fixture which will be then applied to each test: @pytest.fixture(autouse=True) def mute_signals(request): restore = {} if not 'enable_signals' in request.keywords: signals = [ pre_save, post_save, pre_delete, post_delete, m2m_changed ] for signal in signals: restore[signal] = signal.receivers signal.receivers = [] yield for signal, receivers in restore.items(): signal.receivers = receivers However, then I need to define user and related objects (user_profile, user_profile_settings) in every test: @pytest.mark.django_db def test_check_follows(): user = User.objects.create(username='user', password='password') user1 = User.objects.create(username='user1', password='password1') profile = .. profile1 = ... … -
Why django not letting me to create foreign key (attribute error)?
from django.db import models class Category(models.Model): category_name = models.CharField(max_length=50) def __str__(self): return self.category_name class SubCategory(models.Model): subcategory_name = models.CharField(max_length=200) base_category = models.ForeginKey(Category, on_delete=models.PROTECT) def __str__(self): return self.subcategory_name class Products(models.Model): product_name = models.CharField(max_length=50) price = models.IntegerField() model = models.CharField(max_length=50) category = models.ForeignKey(Category, on_delete=models.PROTECT) description = models.TextField(max_length=400) image = models.ImageField(max_length=200) child_category = models.ForeignKey(SubCategory, on_delete=models.PROTECT) def __str__(self): return self.product_name module 'django.db.models' has no attribute 'ForeginKey' its shows me something like this line 13, in SubCategory base_category = models.ForeginKey(Category, on_delete=models.PROTECT) AttributeError: module 'django.db.models' has no attribute 'ForeginKey' I am new to django please help me and explain when i trying to create only one foreign key it's working fine but trying to make subcategory it's show me this -
Failed to exec Python script file '/home/dev/project/project/wsgi.py'.Exception occurred processing WSGI script '/home/dev/project/project/wsgi.py'
I am trying to host my django website on a VPS provided by Hostinger. The server is running on Ubuntu 20.04 64bit. I got the website to run without apache2 by running the command python manage.py runserver After I set up the apache2 server I am getting the 500 internal server error. I checked the error logs and it shows this [wsgi:error] [pid 22109:tid 140485106763520] [remote 49.206.15.222:58388] mod_wsgi (pid=22109): Failed to exec Python script file '/home/dev/medovation_inc/medovation_inc/wsgi.py'. [wsgi:error] [pid 22109:tid 140485106763520] [remote 49.206.15.222:58388] mod_wsgi (pid=22109): Exception occurred processing WSGI script '/home/dev/medovation_inc/medovation_inc/wsgi.py'. [wsgi:error] [pid 22109:tid 140485106763520] [remote 49.206.15.222:58388] Traceback (most recent call last): [wsgi:error] [pid 22109:tid 140485106763520] [remote 49.206.15.222:58388] File "/home/dev/medovation_inc/medovation_inc/wsgi.py", line 16, in <module> [wsgi:error] [pid 22109:tid 140485106763520] [remote 49.206.15.222:58388] application = get_wsgi_application() [wsgi:error] [pid 22109:tid 140485106763520] [remote 49.206.15.222:58388] File "/home/dev/medovation_inc/venv/lib/python3.8/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application [wsgi:error] [pid 22109:tid 140485106763520] [remote 49.206.15.222:58388] django.setup(set_prefix=False) [wsgi:error] [pid 22109:tid 140485106763520] [remote 49.206.15.222:58388] File "/home/dev/medovation_inc/venv/lib/python3.8/site-packages/django/__init__.py", line 19, in setup [wsgi:error] [pid 22109:tid 140485106763520] [remote 49.206.15.222:58388] configure_logging(settings.LOGGING_CONFIG, settings.LOGGING) [wsgi:error] [pid 22109:tid 140485106763520] [remote 49.206.15.222:58388] File "/home/dev/medovation_inc/venv/lib/python3.8/site-packages/django/conf/__init__.py", line 83, in __getattr__ [wsgi:error] [pid 22109:tid 140485106763520] [remote 49.206.15.222:58388] self._setup(name) [wsgi:error] [pid 22109:tid 140485106763520] [remote 49.206.15.222:58388] File "/home/dev/medovation_inc/venv/lib/python3.8/site-packages/django/conf/__init__.py", line 70, in _setup [wsgi:error] [pid 22109:tid 140485106763520] [remote 49.206.15.222:58388] self._wrapped = … -
make spaces between two Buttons in html (no css)
i made two buttons and margin them to the right to appear on the right side of the page, but the buttons is stick together with no space between them, and i tried to margin 30px e.g. but they both margin together <button type="button" class="btn btn-primary" style="float: right; margin-right: 30px;">Login</button> <button type="button" class="btn btn-secondary" style="float: right; margin-left: 30px;">Register</button> -
How to pass checkbox field to forms in django
I know it might be a duplicate and or such a simple thing to ask here. Please assist if you know how to and ask for more details to help me sort my problem. DISCLAIMER: I am a django beginner. I have a model which has a foreignkey field. I'd like to have the options passed into the foreignkey field display in checkboxes. I have not been able to get it work. These are what I have class Students(models.Model): name = models.CharField(max_length=200,unique=True,help_text="Student's name") form = models.ForeignKey(Form, on_delete=models.CASCADE) class Form(models.Model): form = models.CharField(max_length=20) All the options in form model are to be passed as check boxes in Students model My forms.py is shown below class StudentsForm(forms.ModelForm): def __init__(self, school, *args, **kwargs): super(StudentsForm, self).__init__(*args, **kwargs) self.fields['form'] = forms.ModelChoiceField( queryset=Form.objects.filter(school=school)) class Meta: model = Students fields = ("name",'form') My views.py class StudentView(LoginRequiredMixin,CreateView): model = Students form_class = StudentsForm template_name = 'add_student.html' success_url = reverse_lazy('students') def get_form_kwargs(self): kwargs = super(StudentView, self).get_form_kwargs() kwargs['school'] = self.request.user.school return kwargs Could I have the options as checkboxes, please??? -
TypeError: Field 'id' expected a number but got <channels.auth.UserLazyObject object at 0x7f3e01742e90>
I'm deploying a chat application built with django channels. It is working on my localhost but IN production, the sockets connects at first but as soon as i send a message the following error shows up: WebSocket is already in CLOSING or CLOSED state. What could go wrong? Thanks in advance My server logs are as follows: Error logs File "/home/ubuntu/django/virtualenv2/lib/python3.7/site-packages/django/db/models/fields/__init__.py", line 1774, in get_prep_value return int(value) TypeError: int() argument must be a string, a bytes-like object or a number, not 'UserLazyObject' File "/home/ubuntu/django/virtualenv2/lib/python3.7/site-packages/channels/generic/websocket.py", line 175, in websocket_connect await self.connect() File "./chat/consumers.py", line 179, in connect File "./chat/managers.py", line 24, in by_user threads = self.get_queryset().filter(thread_type="personal") My consumers.py file and managers.py file are as follows. Consumers.py file from django.utils import timezone import pytz, time, datetime import json from channels.layers import get_channel_layer from chat.models import Message, Thread, Notification from channels.consumer import SyncConsumer from asgiref.sync import async_to_sync from django.contrib.auth import get_user_model from datetime import datetime from django.dispatch import receiver from django.db.models import signals import asyncio from asgiref.sync import async_to_sync, sync_to_async from channels.db import database_sync_to_async from channels.generic.websocket import AsyncJsonWebsocketConsumer from django.utils import timezone User = get_user_model() # ================== Chat consumer starts ================== class ChatConsumer(SyncConsumer): def websocket_connect(self, event): my_slug = self.scope['path'][-8:] me = User.objects.get(slug=my_slug) other_user_slug … -
Can I get this result of PostgreSQL query using Django ORM?
I am having trouble with django ORM. I want to get the data which I can get using PostgreSQL and raw sql query in views. But is there any solution to achieve this using Django ORM. Here is my models class Invoice(models.Model): class PaymentMode(models.TextChoices): Cash = 0, _('CASH') Credit = 1, _('CREDIT') class PaymentStatus(models.TextChoices): Paid = 0, _('PAID') Pending = 1, _('PENDING') total_amount = models.IntegerField() payment_mode = models.CharField(choices=PaymentMode.choices, max_length=20, default=PaymentMode.Credit) payment_status = models.CharField(choices=PaymentStatus.choices, default=PaymentStatus.Pending, max_length=15) print_date = models.DateField(default=now) invoice_date = models.DateField(default=now) created_by = models.ForeignKey(User, on_delete=models.DO_NOTHING) customer = models.ForeignKey(Customer, on_delete=models.DO_NOTHING) class Payment(models.Model): class PaymentMethod(models.TextChoices): Cash = 0, _('CASH') Cheque = 1, _('CHEQUE') OnlineTransfer = 2, _('WEB_TRANSFER') Other = 3, _('OTHER') invoice = models.ForeignKey(Invoice, on_delete=models.DO_NOTHING, default=0) amount = models.IntegerField() date = models.DateField(default=now) recieved_by = models.CharField(max_length=150) payment_method = models.CharField(choices=PaymentMethod.choices, default=PaymentMethod.Cash, max_length=20) and here is my PostgreSQL query SELECT A.id , A.total_amount , A.payment_mode, A.payment_status, A.print_date, A.invoice_date, A.created_by_id, A.customer_id, coalesce(SUM(P.amount), 0) AS "paid", ABS(A.total_amount - coalesce(SUM(P.amount), 0)) As "remaining" FROM public."Invoicing_invoice" as A LEFT JOIN public."Invoicing_payment" as P ON P.invoice_id = A.id GROUP BY A.id -
Django admin create superuser
127.0.0.1:8000/admin seems to go straight to 127.0.0.1:8080 So I tried: $ python manage.py createsuperuser and got psycopg2.IntegrityError: null value in column "id" violates not-null constraint DETAIL: Failing row contains (null... What table is it talking about? How do I get around this? -
How to structure Django project with external python packages interacting with the same database
I am developing a Django Rest Api for which I am targeting below structure: django_project │-- django_project │--__init.py__ │-- asgi.py │-- setting.py │-- urls.py │-- wsgi.py │-- app │-- migrations │-- __init.py__ │-- admin.py │-- apps.py │-- models.py │-- tests.py │-- views.py │-- manage.py │-- media │-- static │-- templates The thing is that I would like to include an external python package that I have developed for the data processing. This package uses slqalchemy for the db mapping so I am not sure how (and where) to fit it inside my django project since there will be duplicate models definition (with sqlachemy and Djando ORM). Thanks for your help -
Confusion regarding slack modal behavior
I'm a bit confused regarding the behavior of the slack modal. Here's my use case: Upon successful modal submission, I have to perform some CRUD and send few acknowledgments to a bunch of people. I'm unable to perform this in a single call. pseudo will make more sense: Not working if data["type"] == "view_submission": # CRUD ops # acknowlegement-1 conn = http.client.HTTPSConnection("hooks.slack.com") # acknowlegement-2 # close the modal return HttpResponse(status=204) #can't close at this stage. always returns error(something went wrong) Working: if data["type"] == "view_submission": # CRUD ops # close the modal return HttpResponse(status=204) My simple question: how to perform these operations? I'm trying to do it in a single call after handling view_submission but I think the modal is expiring. If I close the modal, how can I send an acknowledgment back even if I know the incoming webhook? The function will return, right? Any help would be appreciated! -
How to authenticate custom user that doesn't extend AbstactUserModel with djangorestframework-jwt
I'm new to django rest framework and i have problem about jwt authentication .I create a manually token in signin view payload = jwt_payload_handler(serialized_data) token = jwt_encode_handler(payload) response['token'] = token but i don't know how to authenticate with that token because my Model doesn't extend AbstactUserModel. I just found how people use jwt authentication with custom users that extends AbtractUser class Shop(models.Model): uuid = models.UUIDField(default=uuid.uuid4) username = models.CharField(max_length=30) password = models.CharField(max_length=64) name = models.CharField(max_length=100, blank=True) Should i write custom Permission for this situation? Can anyone tell me what should i do? Thank you very much -
how to activate existing virtual enviroment (using pipenv)
I am working with a project in django where i am using virtual enviroment using pipenv shell (which created enviroment name (Django_and_Rest-YRrszWnq)) so in this enviroment I have installed many packages releated to this project Now I started new project and also i want to used above virtual enviroment How to activate this ((Django_and_Rest-YRrszWnq)) enviroment to new project using pipenv command ?