twitter-bootstrap

Add CSS to form field in django template

Add CSS to form field in django template Question: I want to use bootstrap on django form. To do so I need to add .form-control class to each field. My workaround is: def __init__(self, *args, **kwargs): super(SomeForm, self).__init__(*args, **kwargs) for field in self.fields: self.fields[field].widget.attrs = { ‘class’: ‘form-control’ } {% for field in form %} …

Total answers: 2

django views – hyperlinks with thumbnails

django views – hyperlinks with thumbnails Question: I’m brand new to django front-end web development. I have an index.html in my templates folder which has two thumbnails for sign up or login, and clicking on them directs you to signup.html and login.html. I have included the respective urls for those in urls.py. I’m stuck as …

Total answers: 2

Django cannot find static files. Need a second pair of eyes, I'm going crazy

Django cannot find static files. Need a second pair of eyes, I'm going crazy Question: Django will not serve my static files. Here’s the error returned: [13/Jun/2014 06:12:09] “GET /refund/ HTTP/1.1” 200 2927 [13/Jun/2014 06:12:09] “GET /static/css/bootstrap.min.css HTTP/1.1” 404 1667 [13/Jun/2014 06:12:09] “GET /static/css/cover.css HTTP/1.1” 404 1643 [13/Jun/2014 06:12:09] “GET /static/js/bootstrap.min.js HTTP/1.1” 404 1661 [13/Jun/2014 …

Total answers: 6

Flask static files getting 404

Flask static files getting 404 Question: I am building a basic web app with following project structure. The app is fine but I am getting 404 errors for some of the static files. I don’t have any file like this bootstrap.css.map and not able to find enough docs related to this in flask. 127.0.0.1 – …

Total answers: 4

Changing the active class of a link with the twitter bootstrap css in python/flask

Changing the active class of a link with the twitter bootstrap css in python/flask Question: I got the following html snippet from my page template.html. <ul class=’nav’> <li class=”active”><a href=’/’>Home</a></li> <li><a href=’/lorem’>Lorem</a></li> {% if session[‘logged_in’] %} <li><a href=”/account”>Account</a></li> <li><a href=”/projects”>Projects</a> <li><a href=”/logout”>Logout</a></li> {% endif %} {% if not session[‘logged_in’] %} <li><a href=”/login”>Login</a></li> <li><a href=”/register”>Register</a></li> {% …

Total answers: 8

How can I use Bootstrap with Django?

How can I use Bootstrap with Django? Question: I’m learning python and Django coming from PHP. This is all really exciting, and I would love to use Bootstrap with Django to create sexy web pages. As I understand it (I’m following the Django tutorial on their website), Django uses “apps” which can be included in …

Total answers: 4