Re: Pasting images versus uploading

2020-10-08 Thread Ryan Nowakowski
Maybe you could swap out the default ImageField widget for TinyMCE-lite 
HTMLField?  Security-wise you probably want to sanitize the input from 
HTMLField in Django to make sure only img tags are allowed.

On October 7, 2020 7:02:16 PM CDT, Mike Dewhirst  wrote:
>Users need to include an image of a molecular structure in a project
>I'm
>building. These are small enough that I could limit the size without
>restricting functionality. The image needs to be printed out for a
>report.
>
>What is the best approach?
>
>I have implemented a TinyMCE-lite HTMLField which accepts a pasted
>image
>and in other systems I have used a Django ImageField for uploading.
>ImageField is obviously easier on database size but pasting is easier
>on
>the users.
>
>I'm keen to make the UI easier (by pasting) but I worry it is a
>vulnerability if abused.
>
>Thanks for any advice
>
>Cheers
>
>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/6df3667e-f9cf-eab2-acab-b3e415af1969%40dewhirst.com.au.

-- 
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/0F5DF089-E571-4730-9D46-7DD41216F4D4%40fattuba.com.


Re: cinema booking

2020-10-08 Thread Ryan Nowakowski
Perhaps something like this?

seat = Seat.objects.first()
seat.seat_status == 'BOOKED'



On October 8, 2020 12:46:14 PM CDT, feysel abdu  wrote:
>am sorry for not making it clear, i want to know how to know whether
>the is 
>booked or not  my exiting model is this 
>
>
>class Movies(models.Model):
>MOVIE_GENERE =(
>('A', ' Action'),
>('C','Comedy'),
>('F','Fantasy'),
>('H','Horror'),
>('M','Mystery'),
>('R', 'Romance'),
>('T', 'Thriller'),
>)
>title = models.CharField(max_length=20)
>age = models.IntegerField(default=None)
>description = models .TextField(blank=True )
>movie_start_showing_date_since = models.DateTimeField()
>movie_end_showing_date_till= models.DateTimeField()
>movie_genre = models.CharField(max_length=1, choices=MOVIE_GENERE)
>release_data= models.DateField()
>rating = models.IntegerField()
>movie_runtime = models.CharField(max_length=15, default='2:00:00', 
>help_text='film length')
>movie_normal_price = models.FloatField()
>movie_vip_price= models.FloatField()
>movie_poster = models.ImageField(upload_to ='uploads/')
>MOVIE_SHOWING_IN =(
>('3D','3D'),
>('2D','2D'),
>)
>movie_showing_in =
>models.CharField(max_length=2,choices=MOVIE_SHOWING_IN)
>rated = models.CharField(max_length=15, default=1, null=True,
>blank=True)
>
>
>class Cinema (models.Model):
>cinema_name = models.CharField(max_length=20)
>cinema_total_seat = models.IntegerField()
>
>class Hall (models.Model):
>hall_id = models.IntegerField()
>hall_name =models.CharField()
>number_of_seats = models.IntegerField()
>
>
>
>class Seat(models.Model):
>STATUS =(
>('CANCELED','Canceled'),
>('CONFIRMED','Confirmed'),
>('BOOKED','Booked'),
>)
>seat_no = models.PositiveSmallIntegerField(blank=False, null=False, 
>unique=True)
>row_no = models.PositiveSmallIntegerField(blank=False, null=False)
>seat_name = models.CharField(max_length=3, unique=True)
>booked_by = models.CharField(max_length=200, blank=True)
>seat_status = models.CharField(max_length=20, choices=STATUS)
>number_of_seats= models.IntegerField()
>
>class Reservation (models.Model):
>user_name = models.CharField(max_length=100,unique=True)
># ticket_no =models.ForeignKey(Ticket, on_delete=models.CASCADE, 
>related_name="details")
>row = models.PositiveSmallIntegerField()
>col = models.PositiveSmallIntegerField()
>def __str__(self):
>return "{} - {} - row:{} - col:{}".format(self.username, 
>self.projection_id.time, self.row, self.col)
>
>
>
>
>
>
>On Thursday, October 8, 2020 at 7:06:40 PM UTC+3 Kasper Laudrup wrote:
>
>> On 08/10/2020 13.52, feysel abdu wrote:
>> > I Was building a cinema  booking app and I am using Django , I want
>to 
>> > know available seats and booked seats
>> > 
>>
>> Consider sharing your existing code and be a bit more specific on
>where 
>> you need help.
>>
>> I don't know what kind of answer you expect to get to a question like
>
>> that, if it's even a question?
>>
>> Kind regards,
>>
>> Kasper Laudrup
>>
>
>-- 
>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/fded2fc3-704e-4346-9ae0-ca2f8b778037n%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/65251996-02A4-4F99-968D-E59FF7F63C98%40fattuba.com.


Re: Pasting versus uploading

2020-10-08 Thread Mike Dewhirst
On 8/10/2020 10:05 pm, Thiago Luiz Parolin wrote:
> i am using uppy to allow user make this task more comfortable
> calling the view (that process upload) by ajax
> https://uppy.io

Obrigado Thiago, Uppy looks really brilliant but I have a problem with
javascript. I know I should bite the bullet and really get into it but I
fear my teeth would not survive.

I don't know for sure but I think it would be easier to build a single
purpose uploader for a known small image file using Django/python (which
I have done previously) than to restrict Uppy using a language in which
I would definitely mess up. I'm also a bit worried about TinyMCE.

My real concern is security ... What could possibly go wrong if I permit
drag and drop or pasting and storing the result in the database versus a
controlled file upload using Django ImageField?

Thanks

Mike

>
> Em qua., 7 de out. de 2020 às 21:11, Mike Dewhirst
> mailto:mi...@dewhirst.com.au>> escreveu:
>
> Users need to include an image of a molecular structure in a model
> so it
> can be shown on a report the system produces. They are small
> enough so I
> can restrict the size without bothering them.
>
> I have implemented a TinyMCE-lite HTMLField for pasting an image and
> that works. I have also used Django ImageField (and FileField) in
> other
> projects.
>
> What is the best approach?
>
> ImageField is easier on the database (PostgreSQL) but pasting is
> easier
> on the users.
>
> Is there a third way?
>
> Thanks for any advice
>
> Cheers
>
> 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/b7464b8e-0ad4-c8a6-6bfc-2312ff234021%40dewhirst.com.au.
>
>
>
> -- 
> Thiago Luiz Parolin
>
> -- 
> 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/CANbmKyvd7Z652h8wtsuKQt5gQdgE2DbPE96vEoDTqSdMcrFLNQ%40mail.gmail.com
> .


-- 
Signed email is an absolute defence against phishing. This email has
been signed with my private key. If you import my public key you can
automatically decrypt my signature and be sure it came from me. Just
ask and I'll send it to you. Your email software can handle signing.


-- 
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/d3dea857-18bf-4228-be86-c6e61fc0a4c3%40dewhirst.com.au.


signature.asc
Description: OpenPGP digital signature


Re: Retrieval of Date and data in select text field

2020-10-08 Thread Allison Tretina
Can you show us your template, displaying your tags, and your views?

On Thu, Oct 8, 2020 at 12:37 PM Eugene TUYIZERE 
wrote:

> No one to assist please?
>
> Sent from my iPhone
>
> On 7 Oct 2020, at 19:02, Eugene TUYIZERE  wrote:
>
> I always struggle to retrieve from database to html text field or date
> field data when I want to edit these data. Only text field data display.
> Please advise how to display these fields.
>  When I use:
>
>  value = "{{ list.date_of_birth }}" or
>  value = "list.gender"  for example,  I get an empty field and this works
> for fields other than date and select.
>
> Thank you
> --
> *TUYIZERE Eugene*
>
>
>
> *Msc Degree in Mathematical Science*
>
> *African Institute for Mathematical Sciences (AIMS Cameroon)Crystal
> Garden-Lime, Cameroon*
>
> Bsc in Computer Science
>
> *UR-Nyagatare Campus*
>
> Email: eugene.tuyiz...@aims-cameroon.org
>eugenetuyiz...@gmail.com
>
> Tel: (+250) 7 88 26 33 38, (+250) 7 22 26 33 38
>
> --
> 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/3AEBE172-FD06-4D26-9A3D-50FD46250D78%40gmail.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/CAJrG93CDdEYchjiK96G%2BvZEdzUXifYHnY1g58%3DvC_qxQmvL8_g%40mail.gmail.com.


Re: cinema booking

2020-10-08 Thread feysel abdu
am sorry for not making it clear, i want to know how to know whether the is 
booked or not  my exiting model is this 


class Movies(models.Model):
MOVIE_GENERE =(
('A', ' Action'),
('C','Comedy'),
('F','Fantasy'),
('H','Horror'),
('M','Mystery'),
('R', 'Romance'),
('T', 'Thriller'),
)
title = models.CharField(max_length=20)
age = models.IntegerField(default=None)
description = models .TextField(blank=True )
movie_start_showing_date_since = models.DateTimeField()
movie_end_showing_date_till= models.DateTimeField()
movie_genre = models.CharField(max_length=1, choices=MOVIE_GENERE)
release_data= models.DateField()
rating = models.IntegerField()
movie_runtime = models.CharField(max_length=15, default='2:00:00', 
help_text='film length')
movie_normal_price = models.FloatField()
movie_vip_price= models.FloatField()
movie_poster = models.ImageField(upload_to ='uploads/')
MOVIE_SHOWING_IN =(
('3D','3D'),
('2D','2D'),
)
movie_showing_in = models.CharField(max_length=2,choices=MOVIE_SHOWING_IN)
rated = models.CharField(max_length=15, default=1, null=True, blank=True)


class Cinema (models.Model):
cinema_name = models.CharField(max_length=20)
cinema_total_seat = models.IntegerField()

class Hall (models.Model):
hall_id = models.IntegerField()
hall_name =models.CharField()
number_of_seats = models.IntegerField()



class Seat(models.Model):
STATUS =(
('CANCELED','Canceled'),
('CONFIRMED','Confirmed'),
('BOOKED','Booked'),
)
seat_no = models.PositiveSmallIntegerField(blank=False, null=False, 
unique=True)
row_no = models.PositiveSmallIntegerField(blank=False, null=False)
seat_name = models.CharField(max_length=3, unique=True)
booked_by = models.CharField(max_length=200, blank=True)
seat_status = models.CharField(max_length=20, choices=STATUS)
number_of_seats= models.IntegerField()

class Reservation (models.Model):
user_name = models.CharField(max_length=100,unique=True)
# ticket_no =models.ForeignKey(Ticket, on_delete=models.CASCADE, 
related_name="details")
row = models.PositiveSmallIntegerField()
col = models.PositiveSmallIntegerField()
def __str__(self):
return "{} - {} - row:{} - col:{}".format(self.username, 
self.projection_id.time, self.row, self.col)






On Thursday, October 8, 2020 at 7:06:40 PM UTC+3 Kasper Laudrup wrote:

> On 08/10/2020 13.52, feysel abdu wrote:
> > I Was building a cinema  booking app and I am using Django , I want to 
> > know available seats and booked seats
> > 
>
> Consider sharing your existing code and be a bit more specific on where 
> you need help.
>
> I don't know what kind of answer you expect to get to a question like 
> that, if it's even a question?
>
> Kind regards,
>
> Kasper Laudrup
>

-- 
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/fded2fc3-704e-4346-9ae0-ca2f8b778037n%40googlegroups.com.


Re: How to create sidenav bar in an already created blog

2020-10-08 Thread Odedele Temitayo
i have done it to that extent,just need some codes to make some navbar(like
menu,where I will place some other things in it)

On Thu, Oct 8, 2020, 4:11 PM Adithya Gowli 
wrote:

> 
>
> 
> Django Central
> https://fonts.googleapis.com/css?family=Roboto:400,700; 
> rel="stylesheet">
> 
> 
>  href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css; 
> integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm"
> crossorigin="anonymous" />
> 
>
> 
> 
> body {
> font-family: "Roboto", sans-serif;
> font-size: 17px;
> background-color: #fdfdfd;
> }
> .shadow {
> box-shadow: 0 4px 2px -2px rgba(0, 0, 0, 0.1);
> }
> .btn-danger {
> color: #fff;
> background-color: #f0;
> border-color: #dc281e;
> }
> .masthead {
> background: #3398E1;
> height: auto;
> padding-bottom: 15px;
> box-shadow: 0 16px 48px #E3E7EB;
> padding-top: 10px;
> }
> 
>
> 
>  id="mainNav">
> 
> Django 
> central
>  type="button" data-toggle="collapse" data-target="#navbarResponsive"
> aria-controls="navbarResponsive" aria-expanded="false" 
> aria-label="Toggle navigation">
> 
> 
> 
> 
> 
>  href="#">About
> 
> 
>  href="#">Policy
> 
> 
>  href="#">Contact
> 
> 
> 
> 
> 
> {% block content %}
> 
> {% endblock content %}
> 
> 
> Copyright  Django 
> Central
> 
> 
>
> This is a regular HTML file except for the tags inside curly braces { } these
> are called template tags.
>
> The {% url 'home' %} Returns an absolute path reference, it generates a
> link to the home view which is also the List view for posts.
>
> The {% block content %} Defines a block that can be overridden by child
> templates, this is where the content from the other HTML file will get
> injected.
>
> Next, we will make a small sidebar widget which will be inherited by all
> the pages across the site. Notice sidebar is also being injected in the
> base.html file this makes it globally available for pages inheriting the
> base file.
>
> {% block sidebar %}
> 
> .card{
> box-shadow: 0 16px 48px #E3E7EB;
> }
>
>  class="card my-4">
> About Us
> 
>  This awesome blog is made on the top of our 
> Favourite full stack Framework 'Django', follow up the tutorial to learn how 
> we made it..!
>  href="https://djangocentral.com/building-a-blog-application-with-django;
>class="btn btn-danger">Know more!
> 
>
> {% endblock sidebar %}
>
> Next, create the index.html file of our blog that’s the homepage.
>
> {% extends "base.html" %}
> {% block content %}
> body {
> font-family: "Roboto", sans-serif;
> font-size: 18px;
> background-color: #fdfdfd;
> }
>
> .head_text {
> color: white;
> }
>
> .card {
> box-shadow: 0 16px 48px #E3E7EB;
> }
> 
> 
> 
> 
> 
> 
>  Welcome 
> to my awesome Blog 
> We Love Django As much as you do..! 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> {% for post in post_list %}
> 
> 
> {{ post.title }}
> {{ post.author }} | {{ 
> post.created_on}} 
> {{post.content|slice:":200" }}
> Read More 
> 
> 
> {% endfor %}
> 
> {% block sidebar %} {% include 'sidebar.html' %} {% endblock sidebar 
> %}
> 
> {%endblock%}
>
> With the {% extends %} template tag, we tell Django to inherit from the
> base.html template. Then, we are filling the content blocks of the base
> template with content.
>
> Notice we are using for loop
>  in HTML that’s the
> power of Django templates it makes HTML Dynamic. The loop is iterating
> through the posts and displaying their title, date, author, and body,
> including a link in the title to the canonical URL of the post.
>
> In the body of the post, we are also using template filters to limit the
> words on the excerpts to 200 characters. Template filters allow you to
> modify variables for display and look like {{ 

Re: Retrieval of Date and data in select text field

2020-10-08 Thread Eugene TUYIZERE
No one to assist please?

Sent from my iPhone

> On 7 Oct 2020, at 19:02, Eugene TUYIZERE  wrote:
> 
> I always struggle to retrieve from database to html text field or date field 
> data when I want to edit these data. Only text field data display. Please 
> advise how to display these fields. 
>  When I use:
> 
>  value = "{{ list.date_of_birth }}" or 
>  value = "list.gender"  for example,  I get an empty field and this works for 
> fields other than date and select.
> 
> Thank you
> -- 
> TUYIZERE Eugene
> 
> Msc Degree in Mathematical Science
> 
> African Institute for Mathematical Sciences (AIMS Cameroon)
> Crystal Garden-Lime, Cameroon
> 
> Bsc in Computer Science
> 
> UR-Nyagatare Campus
> 
> Email: eugene.tuyiz...@aims-cameroon.org
>eugenetuyiz...@gmail.com
> 
> Tel: (+250) 7 88 26 33 38, (+250) 7 22 26 33 38

-- 
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/3AEBE172-FD06-4D26-9A3D-50FD46250D78%40gmail.com.


Re: cinema booking

2020-10-08 Thread Kasper Laudrup

On 08/10/2020 13.52, feysel abdu wrote:
I Was building a cinema  booking app and I am using Django , I want to 
know available seats and booked seats




Consider sharing your existing code and be a bit more specific on where 
you need help.


I don't know what kind of answer you expect to get to a question like 
that, if it's even a question?


Kind regards,

Kasper Laudrup

--
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/47b1c7d9-e388-ea54-cc10-d8e31bec7d49%40stacktrace.dk.


Re: Keep showing required field

2020-10-08 Thread Kasper Laudrup

On 08/10/2020 15.18, Odedele Temitayo wrote:
After creating my register view,when trying to register it keeps 
bringing there's a required field,what can i do?




Obviously remove the field if its not required or fill in the required 
information?


It's hard for anyone to help you without having any idea on what you are 
trying to achieve or seeing any of your code.


Try so spend some time on writing a proper question if you expect people 
to spend time on giving you a proper answer.


Kind regards,

Kasper Laudrup

--
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/7f8c66a2-54f6-aaa6-0406-2551a66b2c62%40stacktrace.dk.


Re: How to create sidenav bar in an already created blog

2020-10-08 Thread Adithya Gowli



Django Central
https://fonts.googleapis.com/css?family=Roboto:400,700;
rel="stylesheet">


https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css;
integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm"
crossorigin="anonymous" />




body {
font-family: "Roboto", sans-serif;
font-size: 17px;
background-color: #fdfdfd;
}
.shadow {
box-shadow: 0 4px 2px -2px rgba(0, 0, 0, 0.1);
}
.btn-danger {
color: #fff;
background-color: #f0;
border-color: #dc281e;
}
.masthead {
background: #3398E1;
height: auto;
padding-bottom: 15px;
box-shadow: 0 16px 48px #E3E7EB;
padding-top: 10px;
}





Django
central






About


Policy


Contact





{% block content %}

{% endblock content %}


Copyright 
Django Central



This is a regular HTML file except for the tags inside curly braces { } these
are called template tags.

The {% url 'home' %} Returns an absolute path reference, it generates a
link to the home view which is also the List view for posts.

The {% block content %} Defines a block that can be overridden by child
templates, this is where the content from the other HTML file will get
injected.

Next, we will make a small sidebar widget which will be inherited by all
the pages across the site. Notice sidebar is also being injected in the
base.html file this makes it globally available for pages inheriting the
base file.

{% block sidebar %}

.card{
box-shadow: 0 16px 48px #E3E7EB;
}
   

About Us

 This awesome blog is made on the top of
our Favourite full stack Framework 'Django', follow up the tutorial to
learn how we made it..!
https://djangocentral.com/building-a-blog-application-with-django;
   class="btn btn-danger">Know more!


{% endblock sidebar %}

Next, create the index.html file of our blog that’s the homepage.

{% extends "base.html" %}
{% block content %}
body {
font-family: "Roboto", sans-serif;
font-size: 18px;
background-color: #fdfdfd;
}

.head_text {
color: white;
}

.card {
box-shadow: 0 16px 48px #E3E7EB;
}







Welcome to my awesome Blog 
We Love Django As much as
you do..! 








{% for post in post_list %}


{{ post.title }}
{{ post.author
}} | {{ post.created_on}} 
{{post.content|slice:":200" }}
Read More 


{% endfor %}

{% block sidebar %} {% include 'sidebar.html' %} {% endblock sidebar %}

{%endblock%}

With the {% extends %} template tag, we tell Django to inherit from the
base.html template. Then, we are filling the content blocks of the base
template with content.

Notice we are using for loop
 in HTML that’s the power
of Django templates it makes HTML Dynamic. The loop is iterating through
the posts and displaying their title, date, author, and body, including a
link in the title to the canonical URL of the post.

In the body of the post, we are also using template filters to limit the
words on the excerpts to 200 characters. Template filters allow you to
modify variables for display and look like {{ variable | filter }}.

Now run the server and visit http://127.0.0.1:8000/ you will see the
homepage of our blog.

[image: blog made with django]

Looks good..!

You might have noticed I have imported some dummy content to fill the page
you can do the same using this lorem ipsum generator tools.

Now let’s make an HTML template for the detailed view of our posts.

Next, Create a file post_detail.html and paste the below HTML there.

{% extends 'base.html' %} {% block content %}

  

  
{% block title %} {{ object.title }} {% endblock title %}
{{ post.author }} | {{ post.created_on }}
{{ object.content | safe }}
  

{% block sidebar %} {% include 'sidebar.html' %} {% endblock sidebar %}
  

{% endblock content %}


On 

Re: How to create sidenav bar in an already created blog

2020-10-08 Thread Adithya Gowli
   Django Central https://fonts.googleapis.com/css?family=Roboto:400,700; 
rel="stylesheet">   https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css; 
integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm"
 
crossorigin="anonymous" />body { font-family: 
"Roboto", sans-serif; font-size: 17px; background-color: #fdfdfd; } .shadow 
{ box-shadow: 0 4px 2px -2px rgba(0, 0, 0, 0.1); } .btn-danger { color: 
#fff; background-color: #f0; border-color: #dc281e; } .masthead { 
background: #3398E1; height: auto; padding-bottom: 15px; box-shadow: 0 16px 
48px #E3E7EB; padding-top: 10px; }
 Django central   About   Policy   Contact  {% block content %} 
 {% endblock content %}   Copyright 
 Django Central

This is a regular HTML file except for the tags inside curly braces { 
} these are called template tags.

The {% url 'home' %} Returns an absolute path reference, it generates a 
link to the home view which is also the List view for posts.

The {% block content %} Defines a block that can be overridden by child 
templates, this is where the content from the other HTML file will get 
injected.

Next, we will make a small sidebar widget which will be inherited by all 
the pages across the site. Notice sidebar is also being injected in 
the base.html file this makes it globally available for pages inheriting 
the base file.
{% block sidebar %}  .card{ box-shadow: 0 16px 48px #E3E7EB; } 
About Us   This awesome blog is made on the 
top of our Favourite full stack Framework 'Django', follow up the tutorial 
to learn how we made it..! https://djangocentral.com/building-a-blog-application-with-django; 
class="btn btn-danger">Know more!{% endblock 
sidebar %}

Next, create the index.html file of our blog that’s the homepage.
{% extends "base.html" %} {% block content %}  body { font-family: 
"Roboto", sans-serif; font-size: 18px; background-color: #fdfdfd; } 
.head_text { color: white; } .card { box-shadow: 0 16px 48px #E3E7EB; } 
Welcome to my awesome Blog  We Love 
Django As much as you do..!   
 {% for post in post_list %} 
  {{ 
post.title }} {{ post.author }} | 
{{ post.created_on}}  {{post.content|slice:":200" 
}} Read More{% endfor %}  {% 
block sidebar %} {% include 'sidebar.html' %} {% endblock sidebar %}  
 {%endblock%}

With the {% extends %} template tag, we tell Django to inherit from the 
base.html template. Then, we are filling the content blocks of the base 
template with content.

Notice we are using for loop 
 in HTML that’s the power 
of Django templates it makes HTML Dynamic. The loop is iterating through 
the posts and displaying their title, date, author, and body, including a 
link in the title to the canonical URL of the post.

In the body of the post, we are also using template filters to limit the 
words on the excerpts to 200 characters. Template filters allow you to 
modify variables for display and look like {{ variable | filter }}.

Now run the server and visit http://127.0.0.1:8000/ you will see the 
homepage of our blog.

Looks good..!

You might have noticed I have imported some dummy content to fill the page 
you can do the same using this lorem ipsum generator tools.

Now let’s make an HTML template for the detailed view of our posts.

Next, Create a file post_detail.html and paste the below HTML there.
{% extends 'base.html' %} {% block content %} {% block title %} {{ object.title }} {% endblock 
title %} {{ post.author }} | {{ post.created_on 
}} {{ object.content | safe }}   
{% block sidebar %} {% include 'sidebar.html' %} {% endblock sidebar %} 
  {% endblock content %}  

On Thursday, October 8, 2020 at 7:01:21 PM UTC+5:30 temita...@gmail.com 
wrote:

> What do i need to do?,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/ee0778d3-7bec-4a70-9541-ab14868e1ccbn%40googlegroups.com.


Re: cinema booking

2020-10-08 Thread Mohammad Ahshan Danish
you need to have available seat in database

On Thu, Oct 8, 2020 at 6:29 PM feysel abdu  wrote:

> I Was building a cinema  booking app and I am using Django , I want to
> know available seats and booked seats
>
> --
> 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/e21cefa9-8127-4ddd-ac74-3400b36eef17n%40googlegroups.com
> 
> .
>


-- 
Thanks & Regards

Regards,
Danish

-- 
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/CAPQdaF2zLvSy2_rOwz1NhMBGj9PCNEgxiqHEds%2B3_UkHSXykiA%40mail.gmail.com.


Keep showing required field

2020-10-08 Thread Odedele Temitayo
After creating my register view,when trying to register it keeps bringing
there's a required field,what can i do?

-- 
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/CALb%2BdgT0PMtfSMaGnPZyLjVrZ0dtAKW%3DQtLCQ%2Bd64V8m5peZwQ%40mail.gmail.com.


How to create sidenav bar in an already created blog

2020-10-08 Thread Odedele Temitayo
What do i need to do?,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/CALb%2BdgR%2Bpri78ihS2oNe%3Djw2kRKZ3pdOmEnNR%3Dehg8TBLoMzow%40mail.gmail.com.


cinema booking

2020-10-08 Thread feysel abdu
I Was building a cinema  booking app and I am using Django , I want to know 
available seats and booked seats 

-- 
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/e21cefa9-8127-4ddd-ac74-3400b36eef17n%40googlegroups.com.


Re: Password see

2020-10-08 Thread Andréas Kühne
I hope you realize the security implecations of what you are asking? You
should never store a password in a way that you can retrieve it - and
django doesn't do that. It hashes the password with a salt and then stores
the hash. The hash is then stored in the database. The hash should be one
way - and therefore you should not be able to retrieve the password in any
way. When you login the password you use gets sent through the same
algorithm and if the hashes are the same - the user is logged in.

Regards,

Andréas


Den tors 8 okt. 2020 kl 13:41 skrev kkwaq...@gmail.com :

> *How to se password admin *,
> *Django in store password encrypted format* ,
> *How to retrieve password and decrypted password* .
>
> --
> 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/954b7aa9-ab05-48d1-8e79-e9f7ca35407an%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/CAK4qSCc1kiNfOHfK2VyEm%2BWZY%3Ds95a5yQh-hRty_W%3Duc0H8Axg%40mail.gmail.com.


Re: Password see

2020-10-08 Thread Mohammad Ahshan Danish
you can create new superuser.

I think there is way to reset superuer password.

you can't retrieve old passwords. it gets stored in using Hash algo and not
possible to decode.


On Thu, Oct 8, 2020 at 5:11 PM kkwaq...@gmail.com 
wrote:

> *How to se password admin *,
> *Django in store password encrypted format* ,
> *How to retrieve password and decrypted password* .
>
> --
> 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/954b7aa9-ab05-48d1-8e79-e9f7ca35407an%40googlegroups.com
> 
> .
>


-- 
Thanks & Regards

Regards,
Danish

-- 
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/CAPQdaF1utMvtgD5w%2BMa1Ygt7hS92KdRjmj4dwseD6syctP95WA%40mail.gmail.com.


Password see

2020-10-08 Thread kkwaq...@gmail.com
*How to se password admin *,
*Django in store password encrypted format* ,
*How to retrieve password and decrypted password* .

-- 
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/954b7aa9-ab05-48d1-8e79-e9f7ca35407an%40googlegroups.com.


Re: Pasting versus uploading

2020-10-08 Thread Thiago Luiz Parolin
i am using uppy to allow user make this task more comfortable
calling the view (that process upload) by ajax
https://uppy.io

Em qua., 7 de out. de 2020 às 21:11, Mike Dewhirst 
escreveu:

> Users need to include an image of a molecular structure in a model so it
> can be shown on a report the system produces. They are small enough so I
> can restrict the size without bothering them.
>
> I have implemented a TinyMCE-lite HTMLField for pasting an image and
> that works. I have also used Django ImageField (and FileField) in other
> projects.
>
> What is the best approach?
>
> ImageField is easier on the database (PostgreSQL) but pasting is easier
> on the users.
>
> Is there a third way?
>
> Thanks for any advice
>
> Cheers
>
> 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/b7464b8e-0ad4-c8a6-6bfc-2312ff234021%40dewhirst.com.au
> .
>


-- 
Thiago Luiz Parolin

-- 
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/CANbmKyvd7Z652h8wtsuKQt5gQdgE2DbPE96vEoDTqSdMcrFLNQ%40mail.gmail.com.