Re: Using JavaScript to enumerate a dataset returned to a page.

2023-06-20 Thread Prosper Lekia
You can write an Ajax request with Django, and work with the data with JavaScript in the frontend. On Mon, Jun 19, 2023, 15:30 Lee Stevens wrote: > Helo, > > I have a dataset returning to a page. I need JavaScript to be able to > process this. > > Instead of using: > {% for item in dataset %} >

Re: can someone help me why my static files is not being rendered?

2023-06-15 Thread Prosper Lekia
Where is the Python.png located? >From your code, it should be directly in your static folder not a subfolder. So verify your file structure first. If every is in order, confirm if whitenoise is installed, and been added to your MiddleWare. On Thu, Jun 15, 2023, 14:33 Aspersh Upadhyay < aspershup

Re: CSV file

2023-06-08 Thread Prosper Lekia
Ask this question on the Railway Discord community. The expert their will tell you if it's a Railway thing or not. But you should look more at your code, your settings.py. On Thu, Jun 8, 2023, 20:03 Percy Masekwameng wrote: > Hi > > I have web app survey that collect data and generate a CSV file

Re: Serving static files in production

2023-04-26 Thread Prosper Lekia
Is whitenoise installed and added to MiddleWare? On Thu, Apr 27, 2023, 00:37 David Nugent wrote: > Ensure that nginx is correctly configured, since from what you have > provided the django configuration looks correct (although I generally use > /static/ as STATIC_URL - with the leading / but sho

Re: Debug error when c

2023-04-01 Thread Prosper Lekia
Remove the second urlpattern, and add the debug_toolbar path to the first urlpattern. Try running makemigrations and migrate after installing the debug_toolbar. On Thursday, March 30, 2023 at 6:48:51 PM UTC+1 Ricky Abura wrote: > Hi, > I am learning django, in the process of developing youtube

Re: Django error while running

2023-03-21 Thread Prosper Lekia
If the clone project has a requirements.txt file, you can run pip install requirements.txt. Else, install Django rest_framework in your virtual environment. On Tue, Mar 21, 2023, 17:06 oba stephen wrote: > Can you share the content of your settings file? The installed apps in > particular... > >

Re: sub-list not showing

2023-03-16 Thread Prosper Lekia
The easiest way to do this is to have a query of all students that has that parent. Add Something like this to your parent detail views, students = Students.objects.filter(parent__id = pk) context["students"] = students Your Template should be {% for student in students %} {{student.std_matric

Re: Stuck with Django Tutorial Part 4

2023-03-14 Thread Prosper Lekia
(request, 'polls/detail.html', {'question':question}) > > > > def results(request, question_id): > question = get_object_or_404(Question, pk=question_id) > return render(request, 'polls/results.html', {'question': question}) > &g

Re: Stuck with Django Tutorial Part 4

2023-03-14 Thread Prosper Lekia
Let's see your views. On Tue, Mar 14, 2023, 14:32 Muhammad Juwaini Abdul Rahman wrote: > question_id=question.id > > On Tue, 14 Mar 2023 at 21:22, Nithin Kumar > wrote: > >> Hi, >> >> Stuck with this problem >> >> https://docs.djangoproject.com/en/4.1/intro/tutorial04/ >> >> NoReverseMatch at /

Re: Django Admin

2023-03-13 Thread Prosper Lekia
This is how I deal with all csrf related issues. Make sure csrf MiddleWare is in your MiddleWare list 'django.middleware.csrf.CsrfViewMiddleware' Add the settings below in your settings.py to prevent all csrf related issues CSRF_TRUSTED_ORIGINS = ['https://your site url',] SECURE_PROXY_SSL_HE

Re: Function-based Views vs Class-based Views

2023-03-06 Thread Prosper Lekia
Using classes is always a good way of promoting code usability, and inheritance. With class base views you don't need to reinvent the wheel. You can access other Django classes and methods and reduce code complexity. Although most codes are encapsulated, but you can always go back to the Djang

Re: "Django road map and resources"

2023-03-03 Thread Prosper Lekia
Hi Yaqiinso. Just start small. All you need is a good understanding of your project logic, and what you want to achieve. You can also try collaborating on a existing project. You can always reach out to me. I started Django with the docs, and by studying the code base of cloned projects. I have