Skip to content

Fix: Backend local setup#127

Open
Abhishek2634 wants to merge 2 commits intom2b3:testfrom
Abhishek2634:test
Open

Fix: Backend local setup#127
Abhishek2634 wants to merge 2 commits intom2b3:testfrom
Abhishek2634:test

Conversation

@Abhishek2634
Copy link

Fix Backend setup issues that contributors are facing. now its running correcly on any device.

What i fix :
The backend was hardcoded to create a log directory at the system root (/logs), which triggers a "Read-only file system" error on macOS and modern Linux distributions.
Fix : Update LOG_DIR in settings.py file to use a relative path (BASE_DIR / 'logs'), which ensure the application has the necessary write permissions within the project folder.

The current schemas in the articles, communities, and users modules use outdated Django-Ninja syntax that is incompatible with the latest library versions.
Fix: I refactored the ModelSchema classes across the project:
Renamed class Config to class Meta.
Replaced the unsupported model_fields property with the modern fields property.
Ensured all schemas explicitly define fields = "all" (or specific field lists) to comply with new security standards.

For reference check these ss :
https://loyal-lavender-rygj2i46qo.edgeone.app/60d98ee2904afeeef87dd9d7ba8393e179ee074b_2_1380x832.png

https://available-chocolate-tqfeq4dlnd.edgeone.app/a78f791ce23784a2458e4d11bdac1d94c0b14bcd_2_1380x828.jpeg

@Abhishek2634
Copy link
Author

Abhishek2634 commented Feb 13, 2026

@armanalam03 @bsureshkrishna

Can you check this PR please its working fine in mac and windows.
Also i have not compromise with Django-ninja to downgrade its version. Application is still using latest version.

@bsureshkrishna
Copy link

@Abhishek2634 - how does this relate to the fix in 126 ?

@Abhishek2634
Copy link
Author

@bsureshkrishna - Sir, In 126, the version of django-ninja is downgraded to 0.22.x in pyproject.toml file. Here i am not downgrade it. Version remain same as it was before ie : 1.4.1
With this version there were some code syntax which was not supported, that's what i fixed in this PR.
Feel free to comment what you want. I will fix necessary changes.

Thanks.

@ayu-yishu13
Copy link

For you information , I will tell you I already talked with @airfusion64 regarding version issue and Model config issue and according to sir he told don't change code and bring down the version to match current code.
Pls check pr regarding this.
@bsureshkrishna @armanalam03

@bsureshkrishna
Copy link

Thank you, that is clear now, we will look into it when we get a chance after some high priority things are completed. As discussed, it is great that you have both resolved it in different ways and are able to work with the backend, but we will likely change the instructions to point to the test backend, except for those committed few who are actually going to work on the backend itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants