Anders (izzno / gooood) 🇳🇴
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)
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.
Mirco
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
?
inchidi
"""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."""
what do you mean by "not working"?
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"),
NR
cannot understand, i want both urls should work
NR
from same single view with two defs
Anders (izzno / gooood) 🇳🇴
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) 🇳🇴
...
inchidi
NR
https://pastebin.com/zx5V6Xyq
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.
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) 🇳🇴
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
George
inchidi
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
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