Amir
Check the code
Michael the wolf 🐺
Check the code
use hastebin or something
Doragonsureiyā
Check the code
Rule 5️⃣: Never post walls of text or screen photos. Use paste bins like https://dpaste.org, https://hastebin.com, https://bin.kv2.dev or your favorite one!
Amir
Can you please give me a sample code, I am new to Hangu
Hercules
are there css files in static folder?
Hercules
if there are, you should set path in setting.py of django
Hercules
# settings.py import os # Base directory of the project BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(file))) # Static files (CSS, JavaScript, Images) STATIC_URL = '/static/' # The directory where Django will look for static files for your apps STATICFILES_DIRS = [ os.path.join(BASE_DIR, 'myapp/static'), # Replace 'myapp' with your app name ] # The directory where collected static files will be stored (used in production) STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
Hercules
Now, you need to link the CSS file in your HTML templates. To do this, you should use Django's {% static %} template tag.
Hercules
{% load static %} <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>My Django App</title> <link rel="stylesheet" href="{% static 'css/styles.css' %}"> </head> <body> <!-- Your content here --> </body> </html>
Amir
Taks alot of
Hercules
Taks alot of
what mean?
Amir
I made all these settings, engineer, but I have a problem
Hercules
are you in production?
Hercules
In production, Django doesn't serve static files itself.
Hercules
You need to configure your web server (e.g., Nginx, Apache) to serve the files from the STATIC_ROOT directory.
Hercules
cofiguration for Nginx
Hercules
server { listen 80; server_name yourdomain.com; location /static/ { alias /path/to/your/project/staticfiles/; } location / { proxy_pass http://127.0.0.1:8000; # Other proxy settings } }
Ram
Guys share the best source to learn Django
Doragonsureiyā
Guys share the best source 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
Mael
I want kurz For Backend Django
Bekzhan
what is kurz?
he needs a course on Django.
Sing
Can some one please help is there any way to implement push notifications other than pyfcm way
Sing
For push notifications in django
Sing
When i tried with pyfcm locally its working fine after deploying code to heroku server getting double free 503 error
Hart
Hello friends, please can any one suggest a good hosting platform for django
Hart
Thank you
GreenHouse
welcome
Tukwasi
Good pm all
Tukwasi
Please I need your help
Yahya
Is there any problem with python anywhere
Tukwasi
I don't really know
Doragonsureiyā
Please I need your help
No one can help you until you explain your difficulties.
Tukwasi
Please I want develop Instagram bot using Django, how can I do that
Charly
Is there any problem with python anywhere
What exactly are you asking? For exercises or what?
Tukwasi
So what tool
Charly
So what tool
I'd use something like requests
Charly
But that's Offtopic, we only discuss Django here
Yahya
What exactly are you asking? For exercises or what?
Python anywhere hosting service by anaconda have any issue like server down ?? I can't host there
Tukwasi
I'd use something like requests
Thanks sir, I have developed some part of it
Tukwasi
Do I need to define the model or should live it
Charly
Do I need to define the model or should live it
I don't know, I don't have any context to know what exactly are you doing
Tukwasi
To send bulk messages to user, comment on post
Charly
mbk
How can we implement channels in django? And for what use they are being used I have never used channels till now
Amir
Hello, I hope you are well I had a question, in which folder of the Python virtual machine are the installed modules placed
Doragonsureiyā
Hello, I hope you are well I had a question, in which folder of the Python virtual machine are the installed modules placed
This is not a Django specific question, please delete your offtopic message. If it's a Python related question go to @Python group, otherwise please move to @PythonOfftopic group and ask there.
Shoaib
I started learning python basic and was willing to learn Django and fast api or should i change my decision if framework
Doragonsureiyā
I started learning python basic and was willing to learn Django and fast api or should i change my decision if framework
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.
Amir
how can i fix ModuleNotFoundError: No module named 'apps.main'
Mirjalolbek
Find module file
Mirjalolbek
Is it pip or local module
Sing
In my django project using pyfcm i implemented push notification locally they are executing fine. After deploying code to heroku sserver apis are crashing server with 503 error Can someone help a way to fix or any other approach for push notifocations
Yahya
i want to create a python django project to showcase in my cv
Yahya
which is best can anyone recommend
Yahya
which is best django project for showcase in cv
Doragonsureiyā
which is best django project for showcase in cv
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.
ishaan
in my django Admin, I have created 20 users. they will upload product content. Now I want that user should only see product added by him/her. Has anyone worked on something like this
GreenHouse
to install django module in venv, I use the commnad "pip install django~=5.04" but it does not work, while "pip install django" works
Doragonsureiyā
to install django module in venv, I use the commnad "pip install django~=5.04" but it does not work, while "pip install django" works
If you need help, don't just say "not working", explain in detail what's not working the way you expect it to.
ishaan
only pip install django==5.0.4
ishaan
or whatever the version is
cj
ERROR: No matching distribution found for django~=5.04
that's because 5.04 doesn't exist... do you mean 5.0.4 ?
GreenHouse
that's because 5.04 doesn't exist... do you mean 5.0.4 ?
I used 5.04, 5.07 and also the other versions. but the in only 5.0 and 5.1.1 works. "pip install django==5.00, 5.1.1" runs
GreenHouse
Charly
it also same error.
You sure is not 5.04?
GreenHouse
without virtual environment, I use 5.04, but for the venv there is error
Charly
without virtual environment, I use 5.04, but for the venv there is error
You can't use that because it doesn't exists
GreenHouse
which version can i use