Re: Is it a good practice to store all static data dynamically in database rather?

2019-08-31 Thread Aldian Fazrihady
There are already servers that are very good at handling static files, such
as nginx, apache, or amazon S3.
Django will never be better at handling static files compared to those
servers, as on production, Django will always be put behind those web
servers.

Putting static files on database, means Django will be needed to handle
them, which is not efficient.


On Sat, Aug 31, 2019 at 3:35 AM Sapna Tomar  wrote:

> Hey! I'm making a static website (showcasing a hobby club of my college)
> using Django. I have used database for storing most of the content like
> photos, or events since they have multiple instances. Will it also be okay
> to save all the rest of the content which does not necessarily have more
> than one instance, like 'contact info' at the end of the page, or an
> 'About' of the page?
>
> --
> 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/1b86e8d4-6d37-4c85-b3d4-fb7283565fed%40googlegroups.com
> 
> .
>


-- 
Regards,

Aldian Fazrihady
http://aldianfazrihady.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/CAN7EoAa4TUKTbVuXFRLOZet3z-8rjkjw4_QB6W9_jP6utVc7DA%40mail.gmail.com.


Re: Reverse for 'modification' with no arguments not found issue

2019-08-31 Thread James Schneider
>
> The line with a problem is that one
>
> return render(request, 'insertion/modification.html', locals())
>
>
>
> And I really can't figure it out why, according the fact that "locals()"
> contains my variable and even if I send directly my variable instead, I get
> the same !
>

There's probably a URL tag in that template that is missing a variable or
has a typo in the variable reference. The error is complaining about a
reverse call, not a render call. It might be in a different part of the
traceback or error page. You need to look closer at the original error
page, it probably cites something in the modification.html template, and
you didn't post that one.

-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/CA%2Be%2BciXbr%3DtVaF5HredGqGK0LQ_9SiHuNKcv1%2Be0HFn1cX-zEQ%40mail.gmail.com.


Post request in foreign key details by providing id

2019-08-31 Thread Soumen Khatua
Hi Folks,
At the time of post request I want to provide only ID and then I want to
fetch the details related to that ID  from another model and then I want to
commit all the deatils inside my ForeignKey table,Please guys tell me How
can I do that bu using django rest framewoek?


*models.py*











*class DoctorProfile(models.Model):# doctor_id =
models.IntegerField(primary_key=True)user = models.OneToOneField(User,
on_delete = models.CASCADE,related_name = 'user_profile')specialities =
models.CharField(max_length=100)start_time = models.TimeField(null =
True)end_time = models.TimeField(null = True)cost =
models.DecimalField(max_digits=6, decimal_places=2)craeted_at =
models.DateTimeField(auto_now_add = True)updated_at =
models.DateTimeField(auto_now = True)def __str__(self):return
self.user.username*








*class Hospital(models.Model):# hospital_id =
models.IntegerField(primary_key=True)doctor_name =
models.ForeignKey(DoctorProfile,on_delete=models.DO_NOTHING)permanent =
models.BooleanField(default = False)consultant =
 models.BooleanField(default = False)craeted_at =
models.DateTimeField(auto_now_add = True)updated_at =
models.DateTimeField(auto_now = True)*


I want to add profile details inside Hospital table ForeignKey column, but
I want to post opeartion by using this format:

*{*
* "id":2,*
*" permanent": true,*
* }*


*Thanks *


*Regards,*
*Soumen*

-- 
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/CAPUw6WYoYA1nrT7Ne%3DvT1%3Djmk1Omf%3DFo%2BiyuA_ZxsTd152t4EA%40mail.gmail.com.


styling tables in django

2019-08-31 Thread Kean
Hi,

New to Django, appreciate the guidance,

I'm looking to style template so both header and data records are note 
wrapped.
please see current setup.

Please can anyone help with the template code, appreciate, it's not quite 
django, but more bootstrap4 django.

Best,
K





-- 
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/ec35ddf7-12ff-47cc-a41e-4b6736faed22%40googlegroups.com.