Doragonsureiyā
I will share
To share code or error tracebacks, use a pasting service, like: - https://dpaste.org - https://hastebin.com - https://nekobin.com - https://bin.kv2.dev
Maxim
:| why?
read the rules
Sea
I want to store urls of profile_images in db, but in frontend show the imagefield user can upload image file. => How to achieve this Anyone can help me?
Nida
redis.exceptions.ResponseError: CROSSSLOT Keys in request don't hash to the same slot
Nida
getting above error when i tries to serverless redis as message broker of celery....
experes
Hello friends I had a question regarding the fact that text editors like ckeditor do not look good for the user If we implement the article writing system on the user side with js, then what security problems might arise?
Doragonsureiyā
Hello friends I had a question regarding the fact that text editors like ckeditor do not look good for the user If we implement the article writing system on the user side with js, then what security problems might arise?
Your question is not related to Django. If it's a Python related question go to @Python group, otherwise please move to @PythonOfftopic group and ask there.
M o h m a d
read the rules
ok it's not allowed but why?
Maxim
ok it's not allowed but why?
because programmers deal with text
Anton
Manager isn't available; 'auth.User' has been swapped for 'Profile.User' class RegisterView(CreateView): form_class = UserCreationForm template_name = 'registration/register.html' success_url = reverse_lazy('login') def form_valid(self, form): response = super(RegisterView, self).form_valid() email = form.cleaned_data.get('email') password = form.cleaned_data.get('password1') user = authenticate(self.request, email=email, password=password) user.set_password(form) return response def form_invalid(self, form): response = super().form_invalid(form) return response models.py class User(AbstractUser): id = models.UUIDField(primary_key=True, default=uuid.uuid4) email = models.EmailField(_("email address"), unique=True) USERNAME_FIELD = 'email' REQUIRED_FIELDS = ['username'] settings.py AUTH_USER_MODEL = "Profile.User"
Bekzod
why i have that mistake
this error maybe come from form class, can you send form class too?
Bekzod
i dont use custom form class
can you try with custom form class UserCreationForm and in form, model = get_user_model() # this important, you need import from django, not your User class
Y
On my DJANGO project I create a simple navbar using only two file home and event First page was home page and also on home page the event button will show Whenever I click on event butto the page will open But issues was when I write on url /evnt also event page open how can I solve this error If user click button the page was open other wise not open so 404 error
Y
Nothing problem on url pattern Program run properly I just wan do if any user can try to open directly the page should be not open Like If I write on url ...8000/event Event page couldn't open User must should b clik on button then thy open
cj
Nothing problem on url pattern Program run properly I just wan do if any user can try to open directly the page should be not open Like If I write on url ...8000/event Event page couldn't open User must should b clik on button then thy open
what you can do, but it's a dirty and 💩 trick, but works, is that the button which will redirect the user to the desired URL will be a form button with a POST method and the action will be the URL you want to go to, and in your views you render the template on the post method, and in the get method you throw a 404 exception, so that way it will work as you want it to work, when going directly to the URL, as it's a get method, will be show a 404 error, but while going through clicking a form button that perform a POST method, the template will be rendered... totally dirty and 💩 way of doing things, but it will do what you want
king
i want to learn django
Believe
i want to learn django
So learn who is stopping you
Doragonsureiyā
i want to learn django
Looking for Django tutorials? you can follow these three recommended ones: * Official documentation and tutorial * Tutorial from MDN * Tutorial from django-girls
Усмонали
ModuleNotFoundError: No module named 'dj_database_url' How to solve this problem?
Усмонали
ModuleNotFoundError: No module named 'dj_database_url' How to solve this problem?
My requirements.exe: Django==4.2.7 dj-database-url==2.0.0 gunicorn==21.2.0 psycopg2-binary==2.9.6 wheel==0.38.1 whitenoise==6.5.0
Усмонали
Have you installed them?
Yes. Thank you all. Already solved
Nithin
What is the use of whitenoise
Alex
What is the use of whitenoise
To serve static files in production.
Rakshit
Can you short describe what is MIDDELVARE?
Mirco
Can you short describe what is MIDDELVARE?
Very short ? 😂 It's a set of hooks into Django's request / response pipeline
Rakshit
Ok thank yo
Mirco
Ok thank yo
For any other detail, https://docs.djangoproject.com/en/5.0/topics/http/middleware/
Rakshit
Can you suggest me which is best hosting in django project
Rakshit
Like versal netflite
Mirco
Can you suggest me which is best hosting in django project
It depends as usual For free ( limited ), I think fly.io nowadays otherwise appliku
Eclair
why after sending post request, all data is clear and all fields marked as "this field is required" in drf?
Dutchq
good evening guys please i need help am trying to creat credentials for superuser but i get this error what to do
Dutchq
https://dpaste.org/t9FpR
Артём
who may explain to me how to set ajax for multiple elements in django cart? do i need to use loop to access every form on a template?
Vishal
I have two excel sheet for customer_data and loan_data... I have successfully ingest all contents of customer_data in django database using django model and django_import_export library .. I wanna ingest the contents of loan_data in my project... The problem is in loan_data there is foreign-key relationship with customer.. How can i ingest... plz anyone help me?
Dinesh
https://dpaste.org/t9FpR
Make last_login in your User model null and blank equals True (null=True, blank=True) then migrate it. Because while creating account the field will be empty.
🎉🅹🅰️🅻🅾️🅻🅸🅳🅳🅸🅽🎉
What is Djangorest Framework
Doragonsureiyā
What is Djangorest Framework
These single steps will help you a lot: Step 1️⃣: Open a browser Step 2️⃣: Write down https://google.com or https://duck.com and press Enter Step 3️⃣: In the search box, write down the same words you asked here Step 4️⃣: Read the first results
🎉🅹🅰️🅻🅾️🅻🅸🅳🅳🅸🅽🎉
it didnt work
🎉🅹🅰️🅻🅾️🅻🅸🅳🅳🅸🅽🎉
i want real person to know
Youssef
How to test delete in DRF?
Charly
i want real person to know
A lot of people know but you need to be able to search these basic things and ask more specific things here
Charly
How to test delete in DRF?
As any other view, have you tried something?
Youssef
As any other view, have you tried something?
I tried to test on api view using APITestCase for deleting address but in want to know how
Charly
I tried to test on api view using APITestCase for deleting address but in want to know how
So you do the delete request in your test method and then query the model to verify the object was deleted, look at the basic example on documentation of APITestCase: https://www.django-rest-framework.org/api-guide/testing/#example
Arman
How to automate djangos primarily standard setup? I mean - install, startproject, startapp, in project.urls include app.urls, adjust settings.py(staticroot, mediaroot) and etc .
Jimmies San
https://github.com/cookiecutter/cookiecutter-django
Arman
Jimmies San
How is this useful ?
Did you read the repository readme?
Anurag K
How to do otp verification for user registration Please anybody help
Siddharth
Did you read the repository readme?
Yh according to that, it provides the boiler plate of the project
Sesibhushan Rao
How to do otp verification for user registration Please anybody help
The process includes following steps 1. Register for SMS Service from a provider or develop your own automatic sms service 2. Create a table for OTP with time stamp, mobile number, user ID 3. Create a random number of 7 to 8 digits 4. Send the OTP to the user given mobile number save the OTP, mobile number, user ID and timestamp 5. Check the OTP, mobile number and the entered time, this time must before expiration time.
Sesibhushan Rao
ERMIA
What is Djangorest Framework
Google.com/search?q=what+is+djangorestframework
Anonymous
Why isn't my max length not working with my charfield
Anonymous
I assigned a class and given a character field but the max length isn't working.
Anonymous
How?
What