Jerome
i need clarification why in (example): path('<int:question_id>/', views.detail, name='detail'), exactly this order, why the first <int:question_id>/ second views.detail third name='detail, and not vice versa. only with other parts of the code and, in principle, an explanation of what is responsible for what
? That's how variables & arguments work Path is obviously the first data, here for a particular page (so called detailed), second is the view, a function. when you got the path you need to tell what will going on then, & third is the related name of the page (which is callable).
Chaitanya
Who can explain me, why django supported hosting is more expensive than php hosting?
Hi. It depends on architecture and how you want it to run. But you can still start it with $0.
Bobosher
Hello everyone. I am integrating my new project with existing database. After instpectdb command, models are re-generated in models.py file. When I run makemigrations command, django generates new migration file. Now, the problem is that this file includes migrations.CreateModel class that generates CREATE TABLE query when running migrate command, which causes ProgrammingError: relation already exists. Because, it is an initial migration file and cannot avoid CreateModel. Also, cannot run migrate command without makemigration. Any suggestions about syncronizing migration files and database schema?
Zhaks
Hi, everyone. How u doing? I'm new to Django, and I recently got my first job as a junior developer. Are there experienced developers here from whom I can ask incomprehensible moments in development?
Sparrow
Hi all, how can I use Postgresql on heroku and sqlite locally. I'm not sure if the addons on heroku works
Doragonsureiyā
Hi all, how can I use Postgresql on heroku and sqlite locally. I'm not sure if the addons on heroku works
Your question is not related to Django. If it's a Python related question go to @Python group, otherwise please move to @PythonOfftopic group and ask there.
Srinath
It will avoid the migration
vivek
Hello Every one
vivek
can please guide me
vivek
i am stuck in my project
vivek
in single view can we render two html template at one time
vivek
Please any have answer
vivek
reply me
mukul
But you can use condition
mukul
There
vivek
yes what condition
vivek
but my senior attach like url dictionary from
vivek
'dashboard/main_template.html', {"url_page": settings.BASE_URL+"/media/menu.html"},content_type="text/html; DEFAULT_CHARSET='latin-1") def menu(request):
vivek
please see it what she do
vivek
please reply otherwise i lost my job
mukul
In return
vivek
can you brief me
mukul
can you brief me
It's means you can use this value in your current template
mukul
You never worked with dictionary before
mukul
??
vivek
i worked
vivek
but i want how to do setting in urls
vivek
.py
vivek
after that setting render two html
Rushikesh
How to host django website in static ip
Maxim
How to host django website in static ip
you won't get an answer to a question until its meaning is clear
Sparrow
Your question is not related to Django. If it's a Python related question go to @Python group, otherwise please move to @PythonOfftopic group and ask there.
Its related to Django. Ok the full question is this: How can I use SQLite locally and Postgresql on production for Django. Using Heroku as a hosting platform
Anonymous
How to host django on windows server
F
Help. Instead of get CSS and image my page outputs { % load static % } in beginning
Aayush
Help. Instead of get CSS and image my page outputs { % load static % } in beginning
<img src = "/static/1.jpg"> It works..try
Aayush
<img src = "/static/1.jpg"> It works..try
Also check if u have given staticfiles_dirs in settings.py
F
Also check if u have given staticfiles_dirs in settings.py
Like this: STATIC_URL = '/static/' STATICFILES_DIRS = [ os.path.join(BASE_DIR, "static"), ] STATIC_ROOT = os.path.join(BASE_DIR, '/static')
F
Problem in processing, because { % load static % } should not be output
Aayush
Like this: STATIC_URL = '/static/' STATICFILES_DIRS = [ os.path.join(BASE_DIR, "static"), ] STATIC_ROOT = os.path.join(BASE_DIR, '/static')
Yes.. instead of os.path.join.. I have given STATICFILES_DIRS = [ BASE_DIR / "static", ] And I haven't used load static for images..
F
Yes.. instead of os.path.join.. I have given STATICFILES_DIRS = [ BASE_DIR / "static", ] And I haven't used load static for images..
Ok, i get 404, not 400. Now complain is "Refused to apply style from 'https://grizikf.ru/static/css/styles.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled."
Aayush
Image not work too
For me it's working...images are loading
MADY
How to host django site with my sql on Normal hosting like blue host
Poo
Hi developers
Poo
I am new django
Poo
I am facing this
Poo
Template does not exist
λ701
Template does not exist
That’s literally what it says. Create your template.
Poo
Image can't send
λ701
λ701
Use a pasting service to show your error.
Poo
Ok
Poo
This error
Chandu
The templates folder will be placed settings.py file. After runserver
λ701
Please read rule 5 https://t.me/pythonrules/45
Scary
hello , i am getting a migration issue can you help https://ibb.co/f9r20w8 this is the screen shoot of settings.py can you find the problem here?
Adiziel
In installed apps list, remove first element 'pollster.polls.apps.PollsConfig' and just add 'pollster'
Adiziel
No no just add polls
Adiziel
'polls'
cj
read this https://www.django-rest-framework.org/api-guide/relations/
Anonymous
What is the best way to build django and react project?
Nurhonov
Hello. Is using generic views good practice? Or should i make everything by myself?
Hvitserk
guys what sql your use for django mysql or postgresql?
Антон
guys what sql your use for django mysql or postgresql?
It depends. But basically doesn`t matter
LB (Ben)
Hello. Is using generic views good practice? Or should i make everything by myself?
Generic views are a great way to get started and help solve common problems plus also help you learn to think like Django thinks. But they won't suit every case.
Jerome
Its related to Django. Ok the full question is this: How can I use SQLite locally and Postgresql on production for Django. Using Heroku as a hosting platform
Pretty easy, you just have to dl django-heroku , package, installation & configuration are made for you, WSGI server, DB connection, & static files. You also keep sqlite for your local setup. ;)
Ali
Hello. Is using generic views good practice? Or should i make everything by myself?
Hi. Let me separate em' all to two topics. 1. CBVs 2. Functional Views Now, can I tell the truth?