Anshul
sure
Doragonsureiyā
you want my url code?
To share code or error tracebacks, use a pasting service, like: - https://linkode.org - https://dpaste.org
Anshul
from django.urls import path, include from tutorials import views urlpatterns = [ path(r'^api/tutorials$', views.tutorial_list), path(r'^api/tutorials/(?P<pk>[0-9]+)$', views.tutorial_detail), path(r'^api/tutorials/published$', views.tutorial_list_published), ]
Anshul
this is my app level file
Anshul
from django.urls import path, include from django.contrib import admin urlpatterns = [ path(r'^$', include('tutorials.urls')), path('admin/', admin.site.urls), ]
Anshul
this is my project level urls.py file
Charly
And what url are you accesing in your browser?
Anshul
http://localhost:7002/api/tutorial
Anshul
or http://localhost:7002
Charly
Anshul
Still Not working
Anshul
http://localhost:7002/api/tutorials ??
Anshul
I've used this
Anshul
just a sec
Anshul
from django.urls import path, include from tutorials import views urlpatterns = [ path(r'^api/tutorials$', views.tutorial_list), path(r'^api/tutorials/(?P<pk>[0-9]+)$', views.tutorial_detail), path(r'^api/tutorials/published$', views.tutorial_list_published), ]
Anshul
I'm sorry but this is not working
Charly
I'm sorry but this is not working
Show the change I propossed you
Anshul
yaa sure
Anshul
from django.urls import path, include from django.contrib import admin urlpatterns = [ path('', include('tutorials.urls')), path('admin/', admin.site.urls), ]
Anshul
FYI I'm learning with this tutorial
Anshul
I'm following this
Anshul
just a sec
Anshul
Yes but not working
Charly
Anshul
Yes
Charly
Yes
show the debug error please
Anshul
(vapi) antinolabs@192 DjangoRestApi % python manage.py runserver 7004 Watching for file changes with StatReloader Performing system checks... System check identified some issues: WARNINGS: ?: (2_0.W001) Your URL pattern '^api/tutorials$' has a route that contains '(?P<', begins with a '^', or ends with a '$'. This was likely an oversight when migrating to django.urls.path(). ?: (2_0.W001) Your URL pattern '^api/tutorials/(?P<pk>[0-9]+)$' has a route that contains '(?P<', begins with a '^', or ends with a '$'. This was likely an oversight when migrating to django.urls.path(). ?: (2_0.W001) Your URL pattern '^api/tutorials/published$' has a route that contains '(?P<', begins with a '^', or ends with a '$'. This was likely an oversight when migrating to django.urls.path(). System check identified 3 issues (0 silenced). May 31, 2022 - 19:45:39 Django version 4.0.4, using settings 'DjangoRestApi.settings' Starting development server at http://127.0.0.1:7004/ Quit the server with CONTROL-C. Not Found: /api/tutorials [31/May/2022 19:45:42] "GET /api/tutorials HTTP/1.1" 404 2640 Not Found: /favicon.ico
Anshul
Ummm.,...
Charly
you are folloing a tutorial for the old version of ddjango
Anshul
Ohhk
Anshul
trying this
Aleksej
Hello, How can one easily validate json web token on back end, its stored as cookie on react front end, do I pass it over axios everytime or I can get it from request object in some different way somehow?
Cheryl
Am new to django
Doragonsureiyā
Am new to django
Looking for Django tutorials? you can follow these three recommended ones: * Official documentation and tutorial * Tutorial from MDN * Tutorial from django-girls
hydrozzen
can only concatenate str (not "NoneType") to str This is coming when i made a django website,in a payment form
cj
can only concatenate str (not "NoneType") to str This is coming when i made a django website,in a payment form
validate and sanitize your data, the error message is self explained and totally clear
Neo
Ideally use a serializer to work with user input
hydrozzen
I know the eroor is clear,but I can't found that Let me say There are two pages contactus.html or payment.html Both have use of django,the contact us page works fine the info het rendered to my gmail account but payment.html throws this error,i almost copied the whole code,made changes in urls.py and views.py
Neo
You make it incredibly hard to help you. Share your code
Greg
hey guys, who knows, how to get information from a query request in django graphene. I need to do logging, in particular, I need to save which query with parameters request was sent
hydrozzen
You make it incredibly hard to help you. Share your code
That form worked,I put extra comas,and there was also an error in views.py, that somehow resolved! Now gonna deploy my site to heroku
RK
Plz some one help me how to deploy django project in AWS Server
RK
Plz provide atleast documentation
Neo
Plz provide atleast documentation
if you google you will find plenty
RK
But I'm fresher ..I'm unable to understand
Django
But I'm fresher ..I'm unable to understand
Do one thing, first learn how to use nginx with gunicorn
star
How to do add to cart in django
umarxon
djangonauts I have question for you: I have a "Book" model and it has several fields including integerfield "amount", boolean field called "available". I want to make it true when its "amount" equals 0. any ideas?
Alex
it was method name
umarxon
use method in the model class.
yeah but which method
umarxon
create or save?
umarxon
create or save?
or should I implement signals?
Alex
create or save?
own custom method, thus boolean field will be not required.
Alex
:Property method
Anonymous
Hello. If i create an app, lets say "foo", with manage.py startapp foo - shall i create git branch "foo" for it? So there will be master branch, dev one, and in dev all apps(branch per app). Plz advice.
Anonymous
all in one
So all in "dev", and put it into "master"(or lets say "release") if all implemented?
Neo
branching strategies are not python django specific, please move to @pythonofftopic
Anonymous
yes
thanks
Raj
Can some provide good resources to learn postgresql
Kevin
Hi! I'm doing a django app, and I'm not sure where I should be placing my model methods, and when I should be using serializers and when not to do it
Sergey
Hi I have problem with debugging on Mac, I have error for encoding or something like that. Anyone can help?