CSS with Django forms

33 views
Skip to first unread message

Anubhav Madhav

unread,
May 12, 2020, 9:41:18 PM5/12/20
to Django users
My problem is, that I've made a beautiful 'Sign Up' and 'Login' Page using HTML and CSS. Later on, in my project, I had to use 'forms' for registration and login.
Is there any way to display the forms with my HTML CSS files.
Please Help!!

Bighnesh Pradhan

unread,
May 13, 2020, 1:27:36 PM5/13/20
to django...@googlegroups.com
you can use javascript it is good

--
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/d53c8101-9243-47b2-9ca5-a727888034ca%40googlegroups.com.

Clive Bruton

unread,
May 13, 2020, 1:28:08 PM5/13/20
to django...@googlegroups.com

On 12 May 2020, at 22:41, Anubhav Madhav wrote:

> Is there any way to display the forms with my HTML CSS files.

Use {% include %} (https://docs.djangoproject.com/en/3.0/ref/
templates/builtins/#include) in your HTML template files for an
embedded style sheet, or just use a link in the head of your template
to serve the .css from the "static" folder (or other remote server
location).


-- Clive

Kasper Laudrup

unread,
May 13, 2020, 1:32:46 PM5/13/20
to django...@googlegroups.com


On 13/05/2020 06.17, Bighnesh Pradhan wrote:
> you can use javascript it is good
>

Oh yes, we all love javascript:

https://www.destroyallsoftware.com/talks/wat

:-)

Seriously though, javascript has nothing to do with using static CSS in
django templates.

Anubhav Madhav

unread,
May 14, 2020, 6:37:58 PM5/14/20
to Django users
Thankyou Bighnesh


On Wednesday, 13 May 2020 18:57:36 UTC+5:30, Bighnesh Pradhan wrote:
you can use javascript it is good

On Wed, May 13, 2020 at 3:13 AM Anubhav Madhav <anubhav...@gmail.com> wrote:
My problem is, that I've made a beautiful 'Sign Up' and 'Login' Page using HTML and CSS. Later on, in my project, I had to use 'forms' for registration and login.
Is there any way to display the forms with my HTML CSS files.
Please Help!!

--
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...@googlegroups.com.

Anubhav Madhav

unread,
May 14, 2020, 6:38:35 PM5/14/20
to Django users
Thankyou Kasper :)

Anubhav Madhav

unread,
May 14, 2020, 6:40:16 PM5/14/20
to Django users
Thankyou Clive!! I know I can use CSS like that, but if I do that the problem I'll face is that the 'form' or the 'input' tags or 'submit' button, which are rendered using django forms, cannot be modified using CSS in this way. Is there any other way to fix it?

Devansh Chaubey

unread,
May 15, 2020, 2:16:51 PM5/15/20
to django...@googlegroups.com
Hey Anubhav 
You can use django-widget-tweaks package 
https://pypi.org/project/django-widget-tweaks/ 
See this.
You can make own css styling using class on forms.

--
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/d9650e11-31a1-44ff-a4c4-2a59e7ac27cf%40googlegroups.com.

Anubhav Madhav

unread,
May 15, 2020, 7:45:37 PM5/15/20
to Django users
Thankyou so much Devansh!! This is really very helpful.


On Friday, 15 May 2020 19:46:51 UTC+5:30, Devansh Chaubey wrote:
Hey Anubhav 
You can use django-widget-tweaks package 
https://pypi.org/project/django-widget-tweaks/ 
See this.
You can make own css styling using class on forms.

On Fri, 15 May 2020 at 00:10, Anubhav Madhav <anubhav...@gmail.com> wrote:
Thankyou Clive!! I know I can use CSS like that, but if I do that the problem I'll face is that the 'form' or the 'input' tags or 'submit' button, which are rendered using django forms, cannot be modified using CSS in this way. Is there any other way to fix it?

On Wednesday, 13 May 2020 18:58:08 UTC+5:30, Clive Bruton wrote:

On 12 May 2020, at 22:41, Anubhav Madhav wrote:

> Is there any way to display the forms with my HTML CSS files.

Use {% include %} (https://docs.djangoproject.com/en/3.0/ref/
templates/builtins/#include) in your HTML template files for an  
embedded style sheet, or just use a link in the head of your template  
to serve the .css from the "static" folder (or other remote server  
location).


-- Clive

--
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...@googlegroups.com.

Clive Bruton

unread,
May 16, 2020, 1:24:57 AM5/16/20
to django...@googlegroups.com
You can use bootsrap4, or look at the output from the forms and set
up your CSS around that.


-- Clive
> --
> 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.

Anubhav Madhav

unread,
May 16, 2020, 2:29:22 PM5/16/20
to Django users
Okay!! I'll look into it, Thanks!!


On Saturday, 16 May 2020 06:54:57 UTC+5:30, Clive Bruton wrote:
You can use bootsrap4, or look at the output from the forms and set  
up your CSS around that.


-- Clive

On 14 May 2020, at 19:40, Anubhav Madhav wrote:

> Thankyou Clive!! I know I can use CSS like that, but if I do that  
> the problem I'll face is that the 'form' or the 'input' tags or  
> 'submit' button, which are rendered using django forms, cannot be  
> modified using CSS in this way. Is there any other way to fix it?
>
> On Wednesday, 13 May 2020 18:58:08 UTC+5:30, Clive Bruton wrote:
> On 12 May 2020, at 22:41, Anubhav Madhav wrote:
>
> > Is there any way to display the forms with my HTML CSS files.
>
> Use {% include %} (https://docs.djangoproject.com/en/3.0/ref/
> templates/builtins/#include) in your HTML template files for an
> embedded style sheet, or just use a link in the head of your template
> to serve the .css from the "static" folder (or other remote server
> location).
>
>
> -- Clive
>
> --
> 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...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages