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 
currently built a an ecommerce site, an online banking app, a delivery 
tracking app, and currently working on my startup, a social media site. 
With you knowledge you can build the project of your dreams.

On Wednesday, March 1, 2023 at 5:00:43 PM UTC+1 yaqiinso wrote:

> Hello dear django developers i was learning django since december i 
> understood all the basics like how create apps,models,views,url,some 
> authentication like adding user,login and logout but still i can not make 
> the projects of my dreams like building school management system software , 
> E_commerce web, and so ,  where to go can  any one please give road map 
> that takes me to my dream ..

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f982abf5-a498-426c-b1fb-46aed5701596n%40googlegroups.com.


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 Django source code for review.

On Monday, March 6, 2023 at 9:19:21 PM UTC+1 Michael Starr wrote:

> What are the pros and cons of either method of rendering HTTP request 
> responses?
>
>
> https://www.geeksforgeeks.org/class-based-vs-function-based-views-which-one-is-better-to-use-in-django/
>
> In the article above it states that CBVs are DRYer, but I don't understand 
> why. The article doesn't explain, it just states it.
>
> The rest of the article is pretty good but it's a pretty slim introduction.
>
> I thought many of you would like to chime in on this topic. Leave your 
> opinion below! What do you use?
>
> Mike
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d998e837-efcf-4f42-94cb-cc174135d35bn%40googlegroups.com.


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_HEADER = ('HTTP_X_FORWARDED_PROTO', 'http')
CSRF_USE_SESSIONS = False
CSRF_COOKIE_SECURE = True
SECURE_BROWSER_XSS_FILTER = True

CORS_ALLOW_CREDENTIALS = True
CORS_ORIGIN_ALLOW_ALL = True


SECURE_CONTENT_TYPE_NOSNIFF = True
SECURE_FRAME_DENY = True
SECURE_HSTS_SECONDS = 2592000
SECURE_HSTS_INCLUDE_SUBDOMAINS = True
SECURE_HSTS_PRELOAD = True
X_FRAME_OPTIONS = 'SAMEORIGIN'
SECURE_REFERRER_POLICY = 'same-origin

On Saturday, March 11, 2023 at 7:04:40 PM UTC+1 James Hunt wrote:

> Hi there. I am fairly new to Django but have had previous success with 
> creating an app and being able to access the Admin page.
> Recently, if I attempt to access the admin page of a new Django app it 
> throws the CSRF error upon trying to log in!!!
>
> I have attempted several ways to bypass this error including adding 
> allowed hosts but I cant seem to get past this issue.
>
> Can someone please provide me with the definitive way of stopping CSRF 
> error when simply trying to access the admin part of Django? I mean there 
> are no post functions that really apply to this feature so I cant 
> understand the CSRF token.
>
> I cant get past this issue which means I can never access the admin page!!
>
> Please help.
>
> Regards
>
> James
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3f7e8ff3-3619-4ddf-8517-0ee3a613ed20n%40googlegroups.com.


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 /polls/2/Reverse for 'vote' with arguments '(2,)' not
>> found. 1 pattern(s) tried: ['polls/>
>> My detail.html is like this and it is failing at Line 1.
>> I checked all solutions online but no luck.
>>
>> 
>> {% csrf_token %}
>> 
>> {{ question.question_text }}
>> {% if error_message %}{{ error_message }}{%
>> endif %}
>> {% for choice in question.choice_set.all %}
>> 
>> {{
>> choice.choice_text }}
>> {% endfor %}
>> 
>> 
>> 
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/d6c40407-64a0-4418-ba9a-39db89b1c1dcn%40googlegroups.com
>> 
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAFKhtoQ1tfqUempakxY7DHy26utEt3QN1iBbLBM78r5neYM3QQ%40mail.gmail.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CALGeGE3X4o_uE-302%2Bt36q%2B%3DVToch7qfYWDdxuY94bXsUk4FGg%40mail.gmail.com.


Re: Stuck with Django Tutorial Part 4

2023-03-14 Thread Prosper Lekia
This should be your views for vote.


from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import get_object_or_404, render
from django.urls import reverse

from .models import Choice, Question
# ...
def vote(request, question_id):
question = get_object_or_404(Question, pk=question_id)
try:
selected_choice = question.choice_set.get(pk=request.POST['choice'])
except (KeyError, Choice.DoesNotExist):
# Redisplay the question voting form.
return render(request, 'polls/detail.html', {
'question': question,
'error_message': "You didn't select a choice.",
})
else:
selected_choice.votes += 1
selected_choice.save()
# Always return an HttpResponseRedirect after successfully dealing
# with POST data. This prevents data from being posted twice if a
# user hits the Back button.
return HttpResponseRedirect(reverse('polls:results', args=(
question.id,)))

On Tue, Mar 14, 2023, 20:34 Nithin Kumar  wrote:

> question.id or question_id both gave the same result.
> These are the views.
>
> from django.shortcuts import get_object_or_404, render
> from django.http import HttpResponse, Http404, HttpResponseRedirect
> from django.template import loader
> from .models import Choice,Question
> from django.urls import reverse
>
> # Create your views here.
>
> def index(request):
> latest_question_list = Question.objects.order_by('-pub_date')[:5]
> template = loader.get_template('polls/index.html')
> context = {
> 'latest_question_list': latest_question_list,
> }
> return render(request, 'polls/index.html',context)
>
>
> def detail(request, question_id):
> try:
> question = Question.objects.get(pk=question_id)
> except Question.DoesNotExist:
> raise Http404("Question Does not exist")
> return render(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})
>
> def vote(request, question_id):
> return HttpResponse("You're voting on question %s." % question_id)
>
>
>
>
>
> On Tuesday, March 14, 2023 at 1:22:25 PM UTC-4 Prosper Lekia wrote:
>
>> Let's see your views.
>>
>> On Tue, Mar 14, 2023, 14:32 Muhammad Juwaini Abdul Rahman <
>> juw...@gmail.com> 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 /polls/2/Reverse for 'vote' with arguments '(2,)'
>>>> not found. 1 pattern(s) tried: ['polls/>>>
>>>> My detail.html is like this and it is failing at Line 1.
>>>> I checked all solutions online but no luck.
>>>>
>>>> 
>>>> {% csrf_token %}
>>>> 
>>>> {{ question.question_text }}
>>>> {% if error_message %}{{ error_message }}
>>>> {% endif %}
>>>> {% for choice in question.choice_set.all %}
>>>> 
>>>> {{
>>>> choice.choice_text }}
>>>> {% endfor %}
>>>> 
>>>> 
>>>> 
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Django users" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to django-users...@googlegroups.com.
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/django-users/d6c40407-64a0-4418-ba9a-39db89b1c1dcn%40googlegroups.com
>>>> <https://groups.google.com/d/msgid/django-users/d6c40407-64a0-4418-ba9a-39db89b1c1dcn%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users...@googlegroups.com.
>>>
>> To view this discussion on the web vi

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_matricule}}

{% endfor %}


On Fri, Mar 17, 2023, 04:02 nef  wrote:

> Hi Daniel,
> Thanks for your feedback.
> Please, is there anyone  who can help me on how to do it?
> Thank you
>
> On Thursday, 16 March 2023 at 22:01:53 UTC+1 Namanya Daniel wrote:
>
>> You need to achieve related fields to achieve the most of this… thank you
>>
>> On Thu, 16 Mar 2023 at 23:59, Namanya Daniel 
>> wrote:
>>
>>> Hello… am using a phone to reply this but I would love to give a hint on
>>> something. When you have a child, it’s means there’s a parent foreign key
>>> in the child model. You can use grouper to group child model results so
>>> that every is grouped together under a particular parent field.
>>>
>>> On Thu, 16 Mar 2023 at 21:22, nef  wrote:
>>>
 Hi all,
 I am facing problem to display a sub-list.
 In my model, I ahave a Student and Parent models. A prent can have one
 or more students.
 I want to list all the student in the parent page, but it is not
 showing.
 Please see here my code.
 Models

 class Student(models.Model):
 #std_matricule = models.CharField(verbose_name='Student
 matricule', max_length=6, null=False, unique=True, primary_key=True)
 std_matricule = models.CharField(verbose_name='Matricule', unique=
 True, max_length=16, null=False, blank=False, help_text='Matricule of
 the student')
 std_parents = models.ForeignKey(Parents, on_delete=models.
 DO_NOTHING, related_name='Parents', unique=False, null=True, blank=True,
 verbose_name='Student parents')
 std_email = models.EmailField(verbose_name='Email', null=False,
 blank=True, help_text='Enter the email of the student or leave blank
 if not exist')
 std_password = models.CharField(verbose_name='Password', max_length
 =512, null=False, blank=True, help_text='Type the password with 6
 characters minimum')
 std_surname = models.CharField(verbose_name='Surname', null=False,
 blank=False, max_length=128, help_text='Type the Surname of the
 student as in the birth certificate')
 std_firstname = models.CharField(verbose_name='First name', null=
 False, blank=True, max_length=128, help_text='Type the student first
 name')
 std_midlename = models.CharField(verbose_name='Midle name', null=
 False, blank=True, max_length=128, help_text='Type the student first
 name')
 std_nickname = models.CharField(verbose_name='Student Nickname',
 max_length=64, null=False, blank=True, help_text='If exist, type
 student nickname here')

 lass Parents(models.Model):
 father_surname = models.CharField(verbose_name='Father surname',
 max_length=128, null=False, blank=True, help_text='Student Father
 surname as in the birth certificate')
 father_firstName = models.CharField(verbose_name='Father name',
 max_length=128, null=False, blank=True)
 father_phone = models.CharField(verbose_name='Father phone number',
 max_length=24, null=False, blank=True, help_text='Phone number of the
 Father')
 father_dateOfBirth = models.DateField(verbose_name='Father date of
 birth', null=True, blank=True)
 father_placeOfBirth = models.CharField(verbose_name='Father place
 of birth', max_length=512, null=True, blank=True)
 father_nationality = models.CharField('Father nationality',
 max_length=256, null=False, blank=True)
 father_adress = models.CharField(verbose_name='Father resident
 adress', max_length=512, null=False, blank=True)
 father_occupation = models.CharField(verbose_name='Father
 occupation', max_length=512, null=False, blank=True)
 mother_surname = models.CharField(verbose_name='Mother surname',
 null=False, max_length=128, help_text='Student Father name as in the
 birth certificate')
 mother_firstName = models.CharField(verbose_name='Mother name',
 max_length=128, null=False, blank=True)
 mother_phone = models.CharField(verbose_name='Mother phone number',
 max_length=64, null=False, blank=True, help_text='Phone number of the
 mother')
 mother_dateOfBirth = models.DateField(verbose_name='Mother date of
 birth', null=True, blank=True)
 mother_placeOfBirth = models.CharField(verbose_name='Mother place
 of birth', max_length=512, null=False, blank=True)
 mother_nationality = models.CharField('Mother nationality',
 max_length=512, null=False, blank=True)
 mother_adress = models.CharField(verbose_name='Mother resident
 adress', max_length=512, null=False, blank=True)
 mother_occupation = models.CharField(verbose_name

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...
>
> On Tue, 21 Mar 2023, 16:05 Chandresh . T, 
> wrote:
>
>> Recently I was running a git clone (
>> https://github.com/divanov11/StudyBud.git)
>>
>> after doing required steps like migrations, etc. I started to run it by
>> (python manage.py runserver) but I got this error.
>>
>> can anyone help me with this, please?
>>
>> Thanks in advance!
>>
>> PS C:\Users\chand\OneDrive\Desktop\StudyBud> python manage.py runserver
>> Watching for file changes with StatReloader
>> Exception in thread django-main-thread:
>> Traceback (most recent call last):
>>   File
>> "C:\Users\chand\AppData\Local\Programs\Python\Python310\lib\threading.py",
>> line 1016, in _bootstrap_inner
>> self.run()
>>   File
>> "C:\Users\chand\AppData\Local\Programs\Python\Python310\lib\threading.py",
>> line 953, in run
>> self._target(*self._args, **self._kwargs)
>>   File
>> "C:\Users\chand\AppData\Local\Programs\Python\Python310\lib\site-packages\django\utils\autoreload.py",
>> line 64, in wrapper
>> fn(*args, **kwargs)
>>   File
>> "C:\Users\chand\AppData\Local\Programs\Python\Python310\lib\site-packages\django\core\management\commands\runserver.py",
>> line 125, in inner_run
>> autoreload.raise_last_exception()
>>   File
>> "C:\Users\chand\AppData\Local\Programs\Python\Python310\lib\site-packages\django\utils\autoreload.py",
>> line 87, in raise_last_exception
>> raise _exception[1]
>>   File
>> "C:\Users\chand\AppData\Local\Programs\Python\Python310\lib\site-packages\django\core\management\__init__.py",
>> line 398, in execute
>> autoreload.check_errors(django.setup)()
>>   File
>> "C:\Users\chand\AppData\Local\Programs\Python\Python310\lib\site-packages\django\utils\autoreload.py",
>> line 64, in wrapper
>> fn(*args, **kwargs)
>>   File
>> "C:\Users\chand\AppData\Local\Programs\Python\Python310\lib\site-packages\django\__init__.py",
>> line 24, in setup
>> apps.populate(settings.INSTALLED_APPS)
>>   File
>> "C:\Users\chand\AppData\Local\Programs\Python\Python310\lib\site-packages\django\apps\registry.py",
>> line 91, in populate
>> app_config = AppConfig.create(entry)
>>   File
>> "C:\Users\chand\AppData\Local\Programs\Python\Python310\lib\site-packages\django\apps\config.py",
>> line 228, in create
>> import_module(entry)
>>   File
>> "C:\Users\chand\AppData\Local\Programs\Python\Python310\lib\importlib\__init__.py",
>> line 126, in import_module
>> return _bootstrap._gcd_import(name[level:], package, level)
>>   File "", line 1050, in _gcd_import
>>   File "", line 1027, in _find_and_load
>>   File "", line 992, in
>> _find_and_load_unlocked
>>   File "", line 241, in
>> _call_with_frames_removed
>>   File "", line 1050, in _gcd_import
>>   File "", line 1027, in _find_and_load
>>   File "", line 992, in
>> _find_and_load_unlocked
>>   File "", line 241, in
>> _call_with_frames_removed
>>   File "", line 1050, in _gcd_import
>>   File "", line 1027, in _find_and_load
>>   File "", line 1004, in
>> _find_and_load_unlocked
>> ModuleNotFoundError: No module named 'rest_frameworkdjango'
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CA%2BPOfqPK%3Ds66GNBJPF-pBLR3BvQiy1OnMjxNjQOmFo3OVu2%2B0w%40mail.gmail.com
>> 
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAAJsLnpgmDROwPudhGVdi1N_OsyKMSmHTvQWxb9LRoAsuZE5Yw%40mail.gmail.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CALGeGE0Bu2HPqdLbY66YwYmyOxcFEs9r6kpEw_UrWyUyLmOHRA%40mail.gmail.com.


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 clone, I meet 
> the attached error when installing django debug toolbar. I don't know where 
> I am not getting right but I strictly follow some tutorial. Any assistance 
> please?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/36cfe6fe-4186-4fa8-9c31-9e57a0428c03n%40googlegroups.com.


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 should work as you have
> it). Check the nginx error log to try to discover the cause of the 404s. I
> suspect that the location blocks are defined in the wrong order or the
> directory pointing to the incorrect location.
>
> In any case, whitenoise is not a bad solution tbh, and very flexible
> besides. I would solve the above - which should work - before investigating
> that further.
>
> Regards,
> David
>
> On Thu, Apr 27, 2023 at 1:01 AM Brian Odhiambo 
> wrote:
>
>> Hello everyone,
>> I am deploying a django project to a dedicated server.
>> I have set nginx to find static files in this file "staticfiles".
>>
>> This is the setting in settings.py file:
>>
>> STATIC_ROOT = BASE_DIR / 'staticfiles'
>> STATIC_URL = 'static/'
>>
>> After running collectstatic command, my project can't still load the
>> static files.
>> Could I get a general way of going about this, without having to rely on
>> a third party library like whitenoise?
>>
>> My appreciation in advance.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/eefed174-efad-4101-80c1-b0a589c64507n%40googlegroups.com
>> 
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAE5VhgWQ%3D589ZJwwycoO3g0%3DXh6x%2Bqjhu9---iUtV6nRQE4jhw%40mail.gmail.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CALGeGE1oLKr5e2hAz1WLV1k%3DO9JYpNss_1GX1CPRr_r4FuuvEg%40mail.gmail.com.


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,
> I'm using railway to deploy my web app, running on 8GB RAM and each time I
> generate a file, the server goes down and display "Application failed to
> respond" the database table has over 2k records
> Is there any way to improve the performance so that I can be able to
> download large dataset from the web app?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CANfc-pBoutR0kD%3DcqwRHGSQ8gac%2B_YLMyCQoFK--%3DD54TZpotA%40mail.gmail.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CALGeGE23%2BpbHmf-UC0M04cMnQr-Dg%3DMcoPsOZvDzBXPBOL-jFA%40mail.gmail.com.


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 <
aspershupadhyay.deityr...@gmail.com> wrote:

> my settings.py
>
> STATIC_URL = 'static/'
>
> STATICFILES_DIR = [
> BASE_DIR / "static"
> ]
>
> Template where I am trying to load static files
>
> {% extends 'base.html' %}
> {% load static %}
>
> {% block title %}
>   Issue With Django static files
> {%endblock title %}
> {% block body %}
> 
>   
>  src="{% static 'Python.png' %}">
>   
> 
>
> terminal throwing me 404 see this 👇👇
>
> "GET /static/Python.png HTTP/1.1" 404 1789
>
> I hope here I will get my solution for this.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/54b813cc-58f4-4cbe-80af-a427f063fbb2n%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CALGeGE2kXEJ77bEAQY-eQA588PAJsM2ssUicpJsDrxdz8V2g_A%40mail.gmail.com.


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 %}
> {{ item.field1 }}
> {{ item.field2 }}
> {% endfor %}
>
> Is there a *JavaScript* way to read this dataset/variable instead?
>
> Thanks.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/37febb44-36e2-47ca-9eff-7011c4e9b963n%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CALGeGE2HGSv6G5fZHHG1rNJ7T_YqyjO6V-134zL%2BeT%2BU1bbbrg%40mail.gmail.com.