Haleem
I have a small general question. When you makemigations at the local machine after changes to model. Are you uplaoding the migation files to the server (Cpanel Hosting) ?? or only the model.py ?? i never uplaod the migrations files. I always upload the model.py and running migations at the terminal in cpanel. Is it the correct way ?? Even if you upload the migation files, you have to run the migartion in the termial at the server. Just I am confused if i am doing it correctly ??? i am not a team or a company. I always code alone from starts so i have no interations with the other persons.
Haleem
Please let me know ONLY the best practice. I will to comply with it.
Aghyad
Hello everyone I have a question I want to build an app with backend for flutter app So I have a problem with build security for app I want to build Login/register for Two User managers/employee's With multiple options for login like By google... Apple account.. Facebook.. + Reset password with email And verification email sia code By using Django restful framework api
Aghyad
Anyone have a steps or course to help me do that
Данил
Hello guys, I have problem with sessionid. When I run my project on local everything works ok but on VPS I see that all time my sessionid from cookie is None. Why that's happening?
Georg
hi guys. I've got a problem with celery. When I run redis (6.x.x) from a distro - all tasks work fine. But if I install docker redis (6-alpine) (with or without config, anyway) one of my task holds in a get (async result) method. This one starts a several groups of others. In traceback I see it holds in waiting a message from redis: File "/usr/local/lib/python3.11/site-packages/celery/backends/redis.py", line 161, in drain_events message = self._pubsub.get_message(timeout=timeout) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/redis/client.py", line 1015, in get_message if self.subscribed_event.wait(timeout) is True: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/threading.py", line 629, in wait signaled = self._cond.wait(timeout) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/threading.py", line 331, in wait gotit = waiter.acquire(True, timeout) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Georg
is there actual redis config to solve this?
Mirco
it seems more networking issue with your dockerized redis
Progressive
who can help with multifile upload on django admin
Progressive
pliz share
Abdulaziz
who can help with multifile upload on django admin
https://docs.djangoproject.com/en/5.0/ref/contrib/admin/#django.contrib.admin.TabularInline
KAKASHI
Frame work problem. How do you define your html templates for tailwind in Django project
Dharani
I'm looking to implement HTML validation within a Django serializer and am struggling to find resources or examples online. Has anyone tackled this before? Any pointers or examples would be greatly appreciated!
cj
one thing you can do is to implement an API endpoint to validate data with a serializer, and use AJAX to interact with your HTML page... ¯\_(ツ)_/¯
Dharani
i am storing html data as text, so before saving i want to validate
cj
i am storing html data as text, so before saving i want to validate
ah, that's another different thing have you tried this: https://stackoverflow.com/questions/56887086/validating-if-a-string-is-a-valid-html-in-python
Dharani
Beautiful Soup library is not verified and i am working for a company and i think i should not use such library in my work
cj
Beautiful Soup library is not verified and i am working for a company and i think i should not use such library in my work
what do you mean by that? I worked for many companies and when we needed to use it, we used it
Maxim
no, there is a loopback connection
did you setup and start broker?
SALAMANDRA
I received such error when i try make controller /home/salyh/course/store-server/venv/bin/python /home/salyh/course/store-server/store/store/urls.py Traceback (most recent call last): File "/home/salyh/course/store-server/store/store/urls.py", line 22, in <module> path('admin/', admin.site.urls), File "/home/salyh/course/store-server/venv/lib/python3.10/site-packages/django/utils/functional.py", line 251, in inner self._setup() File "/home/salyh/course/store-server/venv/lib/python3.10/site-packages/django/contrib/admin/sites.py", line 601, in _setup AdminSiteClass = import_string(apps.get_app_config("admin").default_site) File "/home/salyh/course/store-server/venv/lib/python3.10/site-packages/django/apps/registry.py", line 156, in get_app_config self.check_apps_ready() File "/home/salyh/course/store-server/venv/lib/python3.10/site-packages/django/apps/registry.py", line 137, in check_apps_ready settings.INSTALLED_APPS File "/home/salyh/course/store-server/venv/lib/python3.10/site-packages/django/conf/init.py", line 89, in getattr self._setup(name) File "/home/salyh/course/store-server/venv/lib/python3.10/site-packages/django/conf/init.py", line 69, in _setup raise ImproperlyConfigured( django.core.exceptions.ImproperlyConfigured: Requested setting INSTALLED_APPS, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings. Process finished with exit code 1
Maxim
I received such error when i try make controller /home/salyh/course/store-server/venv/bin/python /home/salyh/course/store-server/store/store/urls.py Traceback (most recent call last): File "/home/salyh/course/store-server/store/store/urls.py", line 22, in <module> path('admin/', admin.site.urls), File "/home/salyh/course/store-server/venv/lib/python3.10/site-packages/django/utils/functional.py", line 251, in inner self._setup() File "/home/salyh/course/store-server/venv/lib/python3.10/site-packages/django/contrib/admin/sites.py", line 601, in _setup AdminSiteClass = import_string(apps.get_app_config("admin").default_site) File "/home/salyh/course/store-server/venv/lib/python3.10/site-packages/django/apps/registry.py", line 156, in get_app_config self.check_apps_ready() File "/home/salyh/course/store-server/venv/lib/python3.10/site-packages/django/apps/registry.py", line 137, in check_apps_ready settings.INSTALLED_APPS File "/home/salyh/course/store-server/venv/lib/python3.10/site-packages/django/conf/init.py", line 89, in getattr self._setup(name) File "/home/salyh/course/store-server/venv/lib/python3.10/site-packages/django/conf/init.py", line 69, in _setup raise ImproperlyConfigured( django.core.exceptions.ImproperlyConfigured: Requested setting INSTALLED_APPS, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings. Process finished with exit code 1
just read it and do it
Charly
I received such error when i try make controller /home/salyh/course/store-server/venv/bin/python /home/salyh/course/store-server/store/store/urls.py Traceback (most recent call last): File "/home/salyh/course/store-server/store/store/urls.py", line 22, in <module> path('admin/', admin.site.urls), File "/home/salyh/course/store-server/venv/lib/python3.10/site-packages/django/utils/functional.py", line 251, in inner self._setup() File "/home/salyh/course/store-server/venv/lib/python3.10/site-packages/django/contrib/admin/sites.py", line 601, in _setup AdminSiteClass = import_string(apps.get_app_config("admin").default_site) File "/home/salyh/course/store-server/venv/lib/python3.10/site-packages/django/apps/registry.py", line 156, in get_app_config self.check_apps_ready() File "/home/salyh/course/store-server/venv/lib/python3.10/site-packages/django/apps/registry.py", line 137, in check_apps_ready settings.INSTALLED_APPS File "/home/salyh/course/store-server/venv/lib/python3.10/site-packages/django/conf/init.py", line 89, in getattr self._setup(name) File "/home/salyh/course/store-server/venv/lib/python3.10/site-packages/django/conf/init.py", line 69, in _setup raise ImproperlyConfigured( django.core.exceptions.ImproperlyConfigured: Requested setting INSTALLED_APPS, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings. Process finished with exit code 1
You need to read a django tutorial. You ar enot supposed to run the urls file directly.
SALAMANDRA
Thanks, just I'm beginner
Ibnu
guys even though i use python class CreateViews (CreateView): model = Blog form_class = BlogForm template_name = 'blog/create.html' context_object_name = 'create_form' when i use {{ create_form}} it didnt work, but works for {{ form }} but why?
KAKASHI
Tailwindcss problem I've done all of the requestment to download or setup the tailwind The tailwind successfully installed and when run the server the default classes are enabled but I can't use the classes of the tailwind I installed it via Django-tailwind
Ibnu
The documentation ony shows context_object_name for dispay views not for creating views
So, what if I want to change like errors.. I think there is a way right ? Because now, form.lable is not working
Ibnu
What I mean is, if I want to change error text and so on, I should use {{form.lable}}... But, now when I use form.lable, it doesn't show the table
Charly
I mean, changing the name of the form doesn't change the way of using it so it would be the same
Ibnu
Show exactly what you have done
I am on data currently, Ok, when I use {{ form }} it shows me all the fields. What if I want the label to be below the description box and so on..
Ibnu
If you didn't understand, I will send what I mean with codes 👍🏼
Khaled
I am on data currently, Ok, when I use {{ form }} it shows me all the fields. What if I want the label to be below the description box and so on..
you need to do something like this: <label for="{{ form.employee.id_for_label }}">Employee:</label> {{ form.employee }}
Sree
Hi all, i have a scenario where i want to send realtime information to client side app when a live class started to a specific batch. Iam currently using django channels for this. But it seems pretty slow sometimes and increse load in my server. Can i use webhook instead of channels here? Is that a good idea?
Khaled
then you can display your form in any style you want
Divyyanshu
anyone now the intermediate level courses for django back-end
Happy
Hi, everyone. Who can help me with error (CORS error) for django backend?
Satya
Happy
' from origin 'http://localhost:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
Mirco
Happy
Instal django-cors-headers and allow localhost in origins Or if you have settings just for local env, allow all origins Don't do it when you deploy live
I added the below code in setting.py, but CORS error still exist ... 'corsheaders.middleware.CorsMiddleware', ... CORS_ORIGIN_ALLOW_ALL = True CORS_ORIGIN_WHITELIST = [ 'http://localhost:3000', 'http://localhost:3001', 'http://127.0.0.1:3000', 'http://127.0.0.1:3001', ]
Molham Jumaa
Hello Can anyone give me a link of video that help me to make authentication with jwt in django and flutter with project
$root:~/coder
Hellow guyz i deploy my django project in heroku but it delete every thing created i used sqlite
$root:~/coder
What can i use apart from sqlite
Leomar
Hi! What would be recommended way to build Django App around already existing postgresql schema ? I basicly want to be able to use Django Admin on some models and preserve relations, functions, constraings, etc. of the already working schema. I also want that schema gets applied the time the Django Aapp is installed.
Charly
cj
PostgreSQL or MySQL
still Heroku will delete the data AFAIK if OP is not paying for persistence
Charly
Not to run db in the same worker
cj
The idea of using these is to be external
good point, still an extra service to pay for ¯\_(ツ)_/¯
David
Hello guys I'm working in a chat project and video call with webRTC using channels and websokects, the project was working well until my computer restart the project stop working i tough maybe is a issue with Daphne or redis but I continue to find the problem any suggestions?
Kiran
Hellow guyz i deploy my django project in heroku but it delete every thing created i used sqlite
If you use sqlite in deployment, then the stored data only shown that dB, and whenever you add any entry in ur dB then it will be stored for some time but when the dyno is restart the data will be gone, that's why don't use sqlite in production use theirs dB servers on live for store dB
$root:~/coder
Юрий
Hey everybody. I have studied aiogram before, now I’m planning to study django. How long does it take on average to learn?
Subavani
I got cors error while using in react , but in postman it doesn't show anything like that how can I rectify this erroe
Subavani
Error
Rajesh
I got cors error while using in react , but in postman it doesn't show anything like that how can I rectify this erroe
Yes postman will not get corserror only when we browse it will getting the cors update your settings to support it
Subavani
How can I rectify this
𝙰𝚜𝚑𝚠𝚒𝚗
How can I rectify this
update ur backend and add CORS middleware
Progressive
i want to upload multiple images i have form.py like this from multiupload.fields import MultiFileField  # Örneğin MultiFileField kullanın class AttachmentForm(forms.ModelForm):     attachments = MultiFileField(min_num=1, max_num=3, max_file_size=1024*1024*5)     class Meta:         model = Attachment         fields = ['attachments'] class AttachmentAdmin(admin.ModelAdmin):     form = AttachmentForm admin.site.register(Attachment, AttachmentAdmin) and models.py like this class Attachment(models.Model):     file = models.FileField(upload_to='attachments') but it does not save photos
D🌷
Hi! ImportError: cannot import name 'CommentPage' from 'blog.models' (C:\Users\Fenix_Systems®\Desktop\MyBlogSite\blog\models.py) PS C:\Users\Fenix_Systems®\Desktop\MyBlogSite>
D🌷
I don't understand
D🌷
hm
Charly
hm
So, you wanna share the code?
D🌷
yeah
D🌷
from django import forms from .models import MessagePage, Comments class MessagePageForm(forms.ModelForm): class Meta: model = MessagePage fields = ['name', 'email', 'subject', 'message'] class CommentsForm(forms.ModelForm): class Meta: model = Comments fields = ['photo', 'name', 'email', 'comment']
D🌷
yeah