Anders (izzno / gooood) 🇳🇴
Django uses python logging module , so you can follow its documentation for better fitting your Django logging configurations
Yepp, i got that from the documentation. I was hoping for a faster implementasion than learning about the python logging module... The documentation is as it often is with python (personal opinion) gard to grasp at overview.
Mirco
Yepp, i got that from the documentation. I was hoping for a faster implementasion than learning about the python logging module... The documentation is as it often is with python (personal opinion) gard to grasp at overview.
I think it's just because they suppose you already have a good python basics and if u need to know more about something related to py , you will go to py docs and get more info to use that better into the Django project But it's just my pov
Anders (izzno / gooood) 🇳🇴
Thats kind of my point, a lot of python documentation assumes youre a python dev and not a "any stack" dev ;)
Anders (izzno / gooood) 🇳🇴
I stay away from using "full stack" (as a reference) untill I have a Master in all languages ;) (so never going to happen)
Mirco
Thats kind of my point, a lot of python documentation assumes youre a python dev and not a "any stack" dev ;)
Exactly, that's why lots of people that try to use Django without knowing py have lots of troubles when coding a new project
Anders (izzno / gooood) 🇳🇴
But I am still amazed by the amount of JS devs who has no knowledge of Django and the extraction it brings to the table... It's simply unique and does not get the credit it deserves...
Anders (izzno / gooood) 🇳🇴
Anders (izzno / gooood) 🇳🇴
But anyway, I guess learning JS / Python in depth only secures our feature... So I wont complain.
NR
hi guys a small help is required
NR
https://pastebin.com/zx5V6Xyq
NR
"""urls.py/core urlpatterns = [ path('admin/', admin.site.urls), path('news/', include('news.urls')), path('coininfo/', include('coin_info.urls')), path('price/', include('coin_info.urls')), urls.py/app urlpatterns = [ path('price/', views.ci_price, name="ci_price"), path('', views.ci_top, name="ci_top_home"), ] i cam able to see www.example.com/price/price/ but www.example.com/price/ is not working."""
Muflone
Maybe '/' in place of '' ?
NR
it did not worked
NR
(urls.W002) Your URL pattern '/' [name='ci_price'] has a route beginning with a '/'. Remove this slash as it is unnecessary. If this pattern is targeted in an include(), ensure the include() pattern has a trailing '/'.
NR
?
NR
when i go to www.example.com/price/
NR
its loading index page not price page
NR
when i go for /price/price/ it will load correct page
NR
index page means path('', views.ci_top, name="ci_top_home"),
inchidi
index page means path('', views.ci_top, name="ci_top_home"),
then its not "its not working" tho. if you want http://www.example.com/price/ render views.ci_price then put it as your ci_top_home view
NR
cannot understand, i want both urls should work
NR
from same single view with two defs
Anders (izzno / gooood) 🇳🇴
cannot understand, i want both urls should work
Its hard to understand what you mean.
inchidi
cannot understand, i want both urls should work
so, let me ask you a question. if you want http://www.example.com/price/ render ci_price then what http://www.example.com/price/price/ should render?
NR
in app veiws i am using to def
NR
one for root path ''''
NR
and one for /price/
Anders (izzno / gooood) 🇳🇴
Paste your real urls.py (all of them)
Anders (izzno / gooood) 🇳🇴
You are very patient @Inchidi
Anders (izzno / gooood) 🇳🇴
...
NR
https://pastebin.com/zx5V6Xyq
Anders (izzno / gooood) 🇳🇴
https://pastebin.com/zx5V6Xyq
This does not make sense... You are defining the same list twice.
Anders (izzno / gooood) 🇳🇴
And there's writing in the bottom....
NR
thats not part of code
NR
please can you wirte correct one ?
NR
write
Anders (izzno / gooood) 🇳🇴
I understand that you are trying to include them i a paste but to better explain to you why this happens please paste the full content of your urls.py
Anders (izzno / gooood) 🇳🇴
No.
Anders (izzno / gooood) 🇳🇴
You need to understand it.
inchidi
https://pastebin.com/zx5V6Xyq
just by reading this we dont even know the relationship between your core/urls.py with app/urls.py
NR
this is core / main URL
NR
from django.contrib import admin from django.urls import path, include urlpatterns = [ path('admin/', admin.site.urls), path('news/', include('news.urls')), path('coininfo/', include('coin_info.urls')), path('price/', include('coin_info.urls')), ]
NR
this is app url
NR
from django.urls import path from . import views urlpatterns = [ path('price/', views.ci_price, name="ci_price"), path('', views.ci_top, name="ci_top_home"), ]
Anders (izzno / gooood) 🇳🇴
ok, so what do you want?
Anders (izzno / gooood) 🇳🇴
(to happen)
NR
when www.example.com/coininfo/ it goes to ''', working as expected
NR
when www.example.com/price/ it should go to ci_price
Anders (izzno / gooood) 🇳🇴
no
NR
its not going instead loading /coininfo page
NR
but with www.example.com/price/price it is loading ci_price
Anders (izzno / gooood) 🇳🇴
exactly...
Anders (izzno / gooood) 🇳🇴
You need to grasp the basics of routing.
Anders (izzno / gooood) 🇳🇴
(django routing)
Anders (izzno / gooood) 🇳🇴
do you want /price to route to the price view in your coininfo app ?
NR
yes please
Anders (izzno / gooood) 🇳🇴
move path('price/', views.ci_price, name="ci_price") to your main urls.py
NR
let me try
Anders (izzno / gooood) 🇳🇴
you need to import views.ci_price in that file... And thus you need to understand basic python ...
Anders (izzno / gooood) 🇳🇴
free tip: When just starting out, dont go making a bunch of apps for each "function" of your site. If you get to the point where that matters and you have scaling difficulties... Your app is worth rerwriting anyway...
NR
hmm thanks
NR
i appreciate
NR
@izznogooood I appreciate your help. It worked.
NR
thanks for @izznogooood and @Inchidi
NR
being so patient and helpful.
Anders (izzno / gooood) 🇳🇴
@MTRIX0
Your welcome.
Ur awesome man 😊😊
Anders (izzno / gooood) 🇳🇴
? what just happened ?
Illia
Hello to all There is a problem There are files that have a date of deletion. I should check this date every minute with the current time and as soon as this time comes, then when I try to download, I get an error 404 how to do it it would be great if someone took 10 minutes and looked at git but also good advice will be glad
inchidi
Hello to all There is a problem There are files that have a date of deletion. I should check this date every minute with the current time and as soon as this time comes, then when I try to download, I get an error 404 how to do it it would be great if someone took 10 minutes and looked at git but also good advice will be glad
you can use django celery beat to create task schedule to auto delete those pictures. store that picture data on model, like ImageField so you can handle whether that picture exists or not from that model object. if the model object deleted, then the picture deleted also.
Tom
Hi guys I have a therical question about the Django template language. I tried vainly to find an answer by myself so I am here. Okay, I'm a beginner in web development. I know what's backend and fronend. However I don't understand what's the template Language? Is that frontend or backend? Why does it exist while there is JavaScript? Who does usually work with that part of a project, backend or frontend developers? Thank you in advance!
José
hello, can you validate a form more than once, but in different functions?
Mirco
Hi guys I have a therical question about the Django template language. I tried vainly to find an answer by myself so I am here. Okay, I'm a beginner in web development. I know what's backend and fronend. However I don't understand what's the template Language? Is that frontend or backend? Why does it exist while there is JavaScript? Who does usually work with that part of a project, backend or frontend developers? Thank you in advance!
templates are your representation layer so frontend part the template language is useful because you can use inheritance for example, so you don't write the same code so many times then they are so powerful because you can use py code inside them so you can use forloop, if etc. or you can use builtins' template filters to achieve lots of common features they aren't there to stop you use js , you still need it to add more interactions with the DOM
José
what d'ya mean with more than once ?
i have 2 functions, which use form data... i have managed to validate the form in the first function, but the form does not validate in the second function