Charly
Or any other here: https://pypi.org/project/Django/#history
GreenHouse
5.0.4
pip install django==5.04 doesn't work
GreenHouse
now i use the latest version
cj
cj
cj
see?
cj
sorry that is typo
see? that was the problem why you got errors, you're writing version numbers wrong
cj
use the correct version numbers, and you'll be fine
GreenHouse
thank you @c0x6a
GreenHouse
pip install django~=5.0.4 here ~= means that require more than 5.04
Kamronbek
hi. how can I load FIREBASE_PRIVATE_KEY from .env properly using django-envrion? private_key = env.str("FIREBASE_PRIVATE_KEY", default="").replace("\\n", "\n") # single line FIREBASE_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\nMIIEvwIBADANBg...==\n-----END PRIVATE KEY-----\n"
Kamronbek
What do you get if you don' t make the .replace() part?
in any case I'm getting only this. In [15]: private_key Out[15]: '-----BEGIN PRIVATE KEY-----'
Kamronbek
https://johnnyreilly.com/multiline-strings-dot-env-files
I couldn't really figure out how this is happening, but it is kind of working. # .env just remove single and double quotes FIREBASE_PRIVATE_KEY=-----BEGIN PRIVATE KEY-----\nMII...3Q==\n-----END PRIVATE KEY-----\n # firbase_auth.py private_key_environ = env.str("FIREBASE_PRIVATE_KEY", default="", multiline=True) private_key_environ = env("FIREBASE_PRIVATE_KEY", default="") the results are the same!
𝚂 𝙷 𝙰 𝙼 𝙼 𝙰 𝚂
i am getting 404 error , i tried adding another path on urls.py, but still it shown the same error
Doragonsureiyā
i am getting 404 error , i tried adding another path on urls.py, but still it shown the same error
Impossible to help without details. Read this please: http://www.catb.org/~esr/faqs/smart-questions.html
FORTUNATE
I need a tutorial video or guide on how to build a subscription website.
FORTUNATE
Anyone wo can help ?
👑SKB👑
Hi guys, I have a react Django project I’m working on. Is it possible to access the Django admin panel by setting it as a route in the react frontend?
ﹺ ﹺ
When will Django orm be fully async ready? Can't wait.
Mirco
When will Django orm be fully async ready? Can't wait.
With Django 5 you can already start playing with it asynchronously
ﹺ ﹺ
With Django 5 you can already start playing with it asynchronously
Yes but not recommended in production, I think.
Mirco
Yes but not recommended in production, I think.
Who told you ? You can It's stable to be ran in production
ishaan
plz explain more
ﹺ ﹺ
Who told you ? You can It's stable to be ran in production
What's the async version of Model.objects.filter(id=my_id)?
Mirco
What's the async version of Model.objects.filter(id=my_id)?
https://docs.djangoproject.com/en/5.1/topics/async/#queries-the-orm You can find everything here
ﹺ ﹺ
https://docs.djangoproject.com/en/5.1/topics/async/#queries-the-orm You can find everything here
Thanks. From the docs, they say they're still working on the orm part. Meaning it's not yet ready.
Mirco
Thanks. From the docs, they say they're still working on the orm part. Meaning it's not yet ready.
It's not fully covered but you can already start using what's ready
mbk
Where do I can host my p Django project for free It is a base project and I want to host it on any server
Doragonsureiyā
Where do I can host my p Django project for free It is a base project and I want to host it on any server
Adding the word Django to your Off-Topic question doesn't magically turn it to a Django related question, so delete your question here and move to the @PythonOfftopic group and ask there.
Kuth
Where do I can host my p Django project for free It is a base project and I want to host it on any server
Django is dynamic process backend required more resources to run. May not for free hosting currently
Muhammadyusuf Engineer
Hi 👋 I Front-end dev, I dunno python nor django. But created django project using AI. then uploaded to pythonanythere, now I'm accessing API came from my project, but images are blocked, but whole API is working. ❗️ When set DEBUG=TRUE it shows images, when set DEBUG=False on production, it does not show images. 🤷‍♂️ So what should I consider changing before production things like CORS, cross-origin, and other things in setting.py 👉 here's some important info about my project: installed django djangorestframework django-cors-headers Pillow it's creates api of products and product categories ⚙️ settings.py: STATIC_URL = '/static/' STATICFILES_DIRS = [BASE_DIR / 'static'] STATIC_ROOT = BASE_DIR / 'staticfiles' # Media files (User-uploaded content) MEDIA_URL = '/media/' MEDIA_ROOT = BASE_DIR / 'media' BASE_DIR = Path(__file__).resolve().parent.parent load_dotenv(os.path.join(BASE_DIR, '.env')) SECRET_KEY = os.getenv('SECRET_KEY') ALLOWED_HOSTS = [ 'myusername.pythonanywhere.com', 'localhost', '127.0.0.1' ] DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' CORS_ALLOW_CREDENTIALS = True CORS_ALLOWED_ORIGINS = [ 'http://localhost:3000', 'http://127.0.0.1:8000', 'my-front-end-url' ] CORS_ALLOW_HEADERS = list(default_headers) + [ 'Access-Control-Allow-Origin', ]
Parag
How to start with django yt channels?
Doragonsureiyā
How to start with django yt channels?
Read the documentation of it!
Un Poco Loco
Read the documentation of it!
I agree nothing is better than the documentation 👏👏
Abdullo
can i deploy django project without cors-headers or whotenoise and what is difference between them?
Abdo
can i deploy django project without cors-headers or whotenoise and what is difference between them?
The only time you would need cors-headers is only if you're building an api with django-rest-framework and your User Interface using one of the front-end frameworks/libraries such as react, vue, angular. Why should you need corsheaders: To be able to have access to the resources on your api without being block cause you will be accessing them from another domain. Cross-Origin Resource Sharing: prevent making requests against a different domain than it's own. Whitenoise allows you to server your own staticfiles in production if you are not planning to use cloud storage for your staticfiles
𝚂 𝙷 𝙰 𝙼 𝙼 𝙰 𝚂
Page not found (404) Request Method: GET Request URL: http://127.0.0.1:8000/search?csrfmiddlewaretoken=(csrf_token)&q=v Raised by: shop.views.home No categ matches the given query
𝚂 𝙷 𝙰 𝙼 𝙼 𝙰 𝚂
solution plzz i get same error when i made search option, details ,....
Kuth
There are many factors of deployment like serve static files
𝚂 𝙷 𝙰 𝙼 𝙼 𝙰 𝚂
Show your urls and view
solved, forgot to put '/'
𝚂 𝙷 𝙰 𝙼 𝙼 𝙰 𝚂
in urls
Dipanshu
can someone explain what is a get serializer context method
Kuth
can someone explain what is a get serializer context method
https://www.django-rest-framework.org/tutorial/1-serialization/
Kuth
This document is very details and helpful
ﹺ ﹺ
Does anyone have experience with inertia Django? I tried using it, but the responses weren't coming nicely. Was getting html responses instead of json
It’s
how to build erp?? any resource or guildine??
Maxim
Does anyone have experience with inertia Django? I tried using it, but the responses weren't coming nicely. Was getting html responses instead of json
no surveys, no polls, no roll calls here just state you issue the more detailed, the more likely you are to get help
ﹺ ﹺ
Doragonsureiyā
I get json html responses instead of json. That's the issue I stated.
Read this please: http://www.catb.org/~esr/faqs/smart-questions.html
ﹺ ﹺ
reread the underlined text
Are you a bot or something?
Kuth
how to build erp?? any resource or guildine??
Brother ERP system is complicated not for Only a man. You need to consult with expert of each criteria like, accounting expert, marketing expert, logistic experts and more
Maxim
Are you a bot or something?
nope do you need help or something?
Brown
Are you a bot or something?
I thought @MaxZhurkin was a bot too. Honestly
Brown
Well, he’s doing a good job. 👍
Ram
Suggest some basic Django project's
Ram
And do share resources if possible
Doragonsureiyā
And do share resources if possible
Looking for Django tutorials? you can follow these three recommended ones: * Official documentation and tutorial * Tutorial from MDN * Tutorial from django-girls
Maxim
Suggest some basic Django project's
we do not provide neither projects, nor projects suggestions here
Mr
Hi, how do I encrypt a django app running as a desktop app so source code is not accessible
Mr
Django is not for desktop apps
It's a django web app running on an internal network that is accessible by other pcs, but don't want to submit the source code to client.
Mr
They cannot see the backend code if your codebase is not shared or public
I'm to set it up on their server, so they will have the source code, and that is what I want to avoid.. I have tried pyinstaller but got errors
Charly
I'm to set it up on their server, so they will have the source code, and that is what I want to avoid.. I have tried pyinstaller but got errors
You choose the wrong tool if you want to have the code hidden. Pyinstaller is the option you just need to solve the errors you get.
Mr
You choose the wrong tool if you want to have the code hidden. Pyinstaller is the option you just need to solve the errors you get.
I see, then I will break the functions into segments and convert them into little exe so py can call them to access the functions.. is that a reasonable fix
Charly
Why is that ?
Each executable will be big in size because it will have the full interpreter and libraries you are going to waste a lot of resources and will be slow as fuck