Anonymous
international
I tried all possible solution
international
Anonymous
Anonymous
just use a FielField?
international
No reverse match
AV
So just use html and css
I don't understand how can i do it exactly. I implemented a html template and a style to it, but i'll get this template as plain text
Doragonsureiyā
hello!
Main.urls
path('stay', include('stay.urls')),
path('<slug:city_url>/', include('city.urls')),
stay.urls
path('/<str:category_url>/', views.StayList.as_view(), name='stay_list'),
city.urls
path('stay', include('stay.urls')),
Can you tell me properly way to output the url of stay_list in the template, depending on whether the city is selected or not? (/city_url/stay/category_url/ or /stay/category_url/)
Now I do it like this:
{% if cityurl %}
{% url 'stay_all_in_category' category_url=categ.url city_url=cityurl %}">
{% else %}
{% url 'stay_all_in_category' category_url=categ.url %}">
{% endif %}
Rule 5️⃣: To share code or error tracebacks, use an online pasting service like:
- https://del.dog
- https://dpaste.org
- https://linkode.org
- https://hastebin.com
- https://bin.kv2.dev
If you posted a wall of text, go back and delete it.
Anonymous
international
Can anybodody help me uploding file code
international
Sorting
manoj
Can any one pls tell me ,What are the tools we use in django
manoj
Are pycharm ,fabric ,ide are they called tools ,?
Anonymous
🙄 it depends on interviewer
Neeraj
Hi I am beginner creating multiple urls for my api I am using the following cmd in main urls.py
path("", include("library.urls"), name="library"),
path('admin/', admin.site.urls),
and I am having a library.urls.py and I have added two urls
urlpatterns = [
path("book", views.BookList.as_view()),
path("book/<int:pk>", views.BookDetail.as_view()),
path("enrollmentresponse", views.EnrollmentResponseList.as_view()),
path("enrollmentresponse/<int:id>", views.EnrollmentResponseDetail.as_view()),
]
I am able to access book url but not able to open my enrollmentresponse url "GET /enrollmentresponse/ HTTP/1.1" 404 179
any suggestions please
I think you add a url in main url.
ֆ33ʏ377
Hi I am beginner creating multiple urls for my api I am using the following cmd in main urls.py
path("", include("library.urls"), name="library"),
path('admin/', admin.site.urls),
and I am having a library.urls.py and I have added two urls
urlpatterns = [
path("book", views.BookList.as_view()),
path("book/<int:pk>", views.BookDetail.as_view()),
path("enrollmentresponse", views.EnrollmentResponseList.as_view()),
path("enrollmentresponse/<int:id>", views.EnrollmentResponseDetail.as_view()),
]
I am able to access book url but not able to open my enrollmentresponse url "GET /enrollmentresponse/ HTTP/1.1" 404 179
any suggestions please
make sure url spelling is correct in browser
Harsh
How can I control number of connections made to database in a Django rest Framework?
I'm using
dj_database_url...(conn=600)
And it exceeds my database host plans for maximum connections
Charles
How can I create a custom user with username name as the unique field?
William
Hi I am beginner creating multiple urls for my api I am using the following cmd in main urls.py
path("", include("library.urls"), name="library"),
path('admin/', admin.site.urls),
and I am having a library.urls.py and I have added two urls
urlpatterns = [
path("book", views.BookList.as_view()),
path("book/<int:pk>", views.BookDetail.as_view()),
path("enrollmentresponse", views.EnrollmentResponseList.as_view()),
path("enrollmentresponse/<int:id>", views.EnrollmentResponseDetail.as_view()),
]
I am able to access book url but not able to open my enrollmentresponse url "GET /enrollmentresponse/ HTTP/1.1" 404 179
any suggestions please
What is the URL you have entered in the browser?
Aneesh
I have passed a class as a argument.
Result = client.publish()
Client is the class and publish is a function inside the class.
I need to patch this publish function.how to do this in python unittest.any one know about this?
Sherlock
For projects Is using sqlite considered poor choice ? Some say it's not considered as a real database. If I use sqlite , will this downgrade my resume. 🙏
Anshu
Sherlock
Anshu
If u r planning on making the project live, definitely not
Anshu
However for testing u can use it
Sherlock
Sherlock
Anshu
Yea all the heavy lifting is already done by django-ORM. Just configure the server for postgres and u r good to go
U can find tutorial for configuration
Sherlock
Anonymous
Sqlite is light weight DB, problem with it is multiple query/connection will lock database that's it
Sherlock
John
rich text field are not added in django admin
Anonymous
If db get's locked then your data is done
Sergio
Hey people, Could anyone help with this error?
TemplateDoesNotExist
I just wanna prove the reset password endpoint from djoser
Sergio
Thanks in advance!
Benson
Hello guys. So im building a django bank project for fun, and it has 4 main apps
-Accounts app-
-Transactions app
-online banking app
-loan processing app
Now I appreciate the need for a well designed database and im trying to create models for all the involved entities.
i however wonder, is it possible to create a single unified database or model away from the apps then have the views in the individual apps connect to the db? or maybe, could we have a single app having the entire dayabase models then importing the app models to the other apps views?
im relatively new to django, and this is the first big project i have undertaken. any help would be appreciated. Thanks in advance!
Damilola
Sergio
Riswandi
not for me too
Anonymous
Any here who can help me
Anonymous
When ever I set up new app register showing error
TЯЕBŌГ
Hello good, first of all I apologize for my English, but I have a very important question:
If, for example, I have different types of content (movies, series, video games, etc ...)
And I want to make an abstract model because they will share fields such as title, image, description, etc ...
I would like to include a category field, but how do I prevent the content from getting mixed up? That is, if the category "action" exists for both movies, series and video games, how would I do so that when I want to get action movies, it does not return video games and series to me?
LEX
Bobosher
Hello good, first of all I apologize for my English, but I have a very important question:
If, for example, I have different types of content (movies, series, video games, etc ...)
And I want to make an abstract model because they will share fields such as title, image, description, etc ...
I would like to include a category field, but how do I prevent the content from getting mixed up? That is, if the category "action" exists for both movies, series and video games, how would I do so that when I want to get action movies, it does not return video games and series to me?
Hello.
If you're using the same model for different kinds of contents, then I would recommend to add another category-like field that indicates which type of content it is(movie, series, ...). Like:
categories = models.ManyToManyField(...)
type = models.ForeignKey(...)
Jerome
Could try a query with filter( ) and exclude ()
Anonymous
What kind of error
When I try to set up app then perform simple mvt on app that I make
Anonymous
Any here who can set up app
S
Hi!
I have list of dictionaries with structure like this:
[
{
"id": "http://127.0.0.1:8000/api/upload_file/4/",
"upload_name": "123",
"date_from": "2000-10-05",
"date_to": "2000-10-05",
"comment": "123",
"file": "http://127.0.0.1:8000/files/csv_files/csv_1.csv"
},
...
]
My task was to make a link to each copy of the dictionary, so I used HyperLinkedRelatedField for this, but how can I change url in the field "id" to integer value of id, which will be the link?
I created this link with the help of this serializer:
class UploadFileSerializer(serializers.ModelSerializer):
id = serializers.HyperlinkedRelatedField(many=False, read_only=True, view_name='api:customers', lookup_field='pk')
class Meta:
model = UploadFile
fields = 'all'
William
Hi!
I have list of dictionaries with structure like this:
[
{
"id": "http://127.0.0.1:8000/api/upload_file/4/",
"upload_name": "123",
"date_from": "2000-10-05",
"date_to": "2000-10-05",
"comment": "123",
"file": "http://127.0.0.1:8000/files/csv_files/csv_1.csv"
},
...
]
My task was to make a link to each copy of the dictionary, so I used HyperLinkedRelatedField for this, but how can I change url in the field "id" to integer value of id, which will be the link?
I created this link with the help of this serializer:
class UploadFileSerializer(serializers.ModelSerializer):
id = serializers.HyperlinkedRelatedField(many=False, read_only=True, view_name='api:customers', lookup_field='pk')
class Meta:
model = UploadFile
fields = 'all'
Use a separate URL for that.
All you have to do is passing the id in the URL and you will get the information about that content
Michael ✨
Has anyone integrated mercadopago? I have trouble understanding how to do it
Axror
Hi everyone. I have a #question. I used jquery with ajax in my project. And I run python manage.py runserver ajax working well. But in server ajax not working. pls advice me.
Harsh
How to implement API Key authentication in a Django REST Framework?
I want only super user to create an API Key.
Repo: https://github.com/YAIFoundation/yaif-url-shortener-api
PS: any other suggestions are welcome.
Anonymous
Anonymous
It must be localhost
Benson
William
Axror
I used jquery and ajax for filter. So, ajax works well in my localhost but it not working in server
William
Axror
yeap
Wanjohi
Anyone who's used django-admin-charts? I need some help with setting dashboard stats criteria
Axror
William
yeap
In which Heroku or other?
Axror
and I deployed site with nginx
William
Aditya
Has anyone used this operation
elasticsearch.helpers.bulk()
Axror
William
and I deployed site with nginx
https://stackoverflow.com/questions/2451739/django-serving-static-files-through-nginx
https://www.digitalocean.com/community/questions/nginx-not-serving-static-files-for-django-app-help
William
Axror
tushar
hlo
tushar
<a class="btn btn-primary" id="route" href="{% url 'homepage' %}?excel_data={{users}}">GetRoute</a> in users data in json