clouded
Try to understand what you do there.
Rawat_OG
I have one question that when I'm turning off debug in settings my images won't load anymore
Pablo
I have one question that when I'm turning off debug in settings my images won't load anymore
I assume you turned it off in production. Have you setup static files properly in your setting? If no, make use of whitenoise to serve your static files in production
Nana
Please is django a right choice to build a full flex school webapp with Lil social features?
Charly
Please is django a right choice to build a full flex school webapp with Lil social features?
I don't see why not, it is also possible to make it with any other library or frameworks it doesn't sound like something too specific
Johnnybrand
Please is django a right choice to build a full flex school webapp with Lil social features?
Yes because of "Scalability" and you don't much interactivity.. most students only visit their school websites to either check results or information.
Charly
There would be a lot of interactivity like live classes, chat forum, study groups etc
All of these doable with django (well with help of other technologies)
Nana
All of these doable with django (well with help of other technologies)
Okay so django can do it fine when combine with other libraries right?
Nana
As any other framework or library
I'm very grateful sir🙏
Vs
How to connect API (DRF)IN HTML CSS frontend
Mohit
Please is django a right choice to build a full flex school webapp with Lil social features?
I had built my product with school ERP+ LMS with lil social media feature on Django works well for more than a year now
Charly
How to connect API (DRF)IN HTML CSS frontend
You use JavaScript to call the API using fetch or ajax: https://www.freecodecamp.org/news/make-api-calls-in-javascript/
Parag
Access to fetch at 'http://localhost:5050/upload_post' from origin 'http://localhost:3000' has been blocked by CORS policy: Request header field authorization is not allowed by Access-Control-Allow-Headers in preflight response.Understand this error UploadPost.jsx:37 POST http://localhost:5050/upload_post net::ERR_FAILED
Parag
please help with this error
The Inspired
please help with this error
I mean, it says right there in the error: "blocked by CORS policy"
The Inspired
you have to install cors in django
The Inspired
https://www.geeksforgeeks.org/how-to-enable-cors-headers-in-your-django-project/
Parag
https://www.geeksforgeeks.org/how-to-enable-cors-headers-in-your-django-project/
UploadPost.jsx:37 POST http://localhost:5050/upload_post 401 (UNAUTHORIZED)
Parag
Failed to load resource: the server responded with a status of 409 (CONFLICT)
The Inspired
then it's a frontend error, I think
The Inspired
might need to see the code to say anything
Nana
hello, please can i used django as a backend for mobile app created with reactNative?
Nana
Yes
God bless you brother
S
Hello, anyone here can help me for our django activity? First time using django and I really dont know how i am 2nd yr IT student
Parag
Why u guys just liking the error ,I want solution 🙂🥲
Ahmad
Why u guys just liking the error ,I want solution 🙂🥲
you're not showing the code, shows the code
hamid
Hey guys I have a status field for a model for example I want if the status don't change from unpaid to paid after 5 min after creation of it the status change to failed how can I deploy this?
Dev
Hey guys I have a status field for a model for example I want if the status don't change from unpaid to paid after 5 min after creation of it the status change to failed how can I deploy this?
Run a celery beat task, set a field to note the time of record creation, let your task run lets say every minute and check if the model has expired or elapsed time, then change status
Eric
Run a celery beat task, set a field to note the time of record creation, let your task run lets say every minute and check if the model has expired or elapsed time, then change status
I wonder when this becomes a performance issue. like at what point is the database table gets so big that a query on that table every single minute will be seriously 🫰🏾
Dev
If you’re concerned about performance, get a dedicated table, clear the record after its served its purpose and update the main table
Capi
indexing should be enough.
Rohan
You run a cleanup job that removes the entries from table that are executed. Not to mention you do indexing on the table.
Rohan
Celery can be more of a bottleneck in a distributed system than this scheduler design.
It’s
i face a problem , can not show static file in deply product any one please help me.
It’s
STATIC_URL = 'static/' # Development mode e eta lagbe STATICFILES_DIRS = [BASE_DIR / "static"] # Production mode e: STATIC_ROOT = '/home/pkgitbdc/operations.pkgitbd.com/static' MEDIA_ROOT = '/home/pkgitbdc/operations.pkgitbd.com/media' MEDIA_URL = '/media/'
It’s
okey?
WenDao
There is only one fragment that cannot help solve the problem.
It’s
my local project work, static file no issue , but when i deply it in Cpanel. then my static file can not show
WenDao
check that is it deployed right
It’s
i host on subdomain
It’s
can i share link?
It’s
for just see
WenDao
my site is on subdomain too
It’s
https://diucpc.pkgitbd.com/accounts/login/?next=/
HAJI MASTAN
my local project work, static file no issue , but when i deply it in Cpanel. then my static file can not show
in cpanel goto terminal and then ur project and do python manage.py collectstatic
It’s
yes, already do this. but my.hta. ess file maybe create problem
It’s
in subdomain .htacess file maybe not create
Charly
in subdomain .htacess file maybe not create
So why don't you verify if the file exists?
~~~
Hi all I am having issue with cloudinary image uploading. I configured everything as per the documentation...but still image is saving into local folder. The api keys are working and the custom cloudinary field is also working.But with default Imagefield it is not working Does anyone know the issue?
pink
Default ImageField isn’t uploading to Cloudinary.
pink
Instead of Django’s default ImageField, you can use CloudinaryField from cloudinary model
pink
you must set DEFAULT_FILE_STORAGE = 'cloudinary_storage.storage.MediaCloudinaryStorage' in the settings.py
~~~
Default ImageField isn’t uploading to Cloudinary.
But their document says we can use django field and in one youtube tutorial also..it says same
pink
If you’re manually saving the file with something like image_file.save(path), that would bypass the configured storage
WenDao
just set DEFAULT_FILE_STORAGE = 'cloudinary_storage.storage.MediaCloudinaryStorage' first
~~~
Okay, let me check that..Thank you for the help👍
~~~
But still it is bypassing it
WenDao
INSTALLED_APPS = [ ... 'cloudinary_storage', # must before staticfiles 'django.contrib.staticfiles', 'cloudinary', ... ]
pink
If you load secrets from .env or environment variables, make sure they’re actually being read. Otherwise, Django may silently fall back to the default filesystem.
pink
can you print this : print(default_storage.__class__)
~~~
can you print this : print(default_storage.__class__)
It is printing default file storage system
pink
you have multiple settings file?
pink
setting.prod, local v v
pink
ensure your DEFAULT_FILE_STORAGE is set corectly