start using less (and bootstrap!)

1,261 views
Skip to first unread message

Ric

unread,
Feb 2, 2012, 2:28:46 PM2/2/12
to Django developers
hi, i want to propose a long term idea.

start using a less framework inside django.

i'm using bootstrap for my django app. it's really cool.

what i'am doing now is writing with less a new css to style django
admin.

my idea is that django should provide a faster way to write an app,
and while django is absolutely awesome for writing server side code,
it does nothing to speed up css/html.

my idea is to write an app, with a setting object containing variables
for less (colors and so on, font style ecc) and then compile a less
for your current app.

a command like manage.py compileless could do the trick, and compile
css code for your app.

django should provide an html base template (used in admin too) that
is styled with a customizable less app.

it would be a great thing for django to give developers a fast start
for new apps with a built in less framework.

i'm using bootstrap, and it's great, with a few settings an user could
customize a base css, and do very cool things with few line of code.

i'm actually working to make it work with django, i hope it will be a
cool app.

Brendan Smith

unread,
Feb 2, 2012, 2:56:03 PM2/2/12
to django-d...@googlegroups.com
for what's it worth, i really like the idea of this.

i am also starting to use less for all of my projects and i love it.

and for the record, with less.js it's not actually necessary to compile the .less files on the backend every time you make changes, you can have the compilation done on the front end and the browser will catch the results for future requests.

> --
> You received this message because you are subscribed to the Google Groups "Django developers" group.
> To post to this group, send email to django-d...@googlegroups.com.
> To unsubscribe from this group, send email to django-develop...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.
>

Donald Stufft

unread,
Feb 2, 2012, 2:59:21 PM2/2/12
to django-d...@googlegroups.com
I don't think this is really appropriate in core. Django itself is completely agnostic as to what you output, it doesn't pay attention to html, xml, csv, css, or anything.

However if this is just an app you are making then sure. For what it's worth Pinax (a sort of collection of apps/conventions built on top of Django) has "themes" in 0.9a2, and the default theme is a bootstrap theme/app somewhat like you are suggesting.

Idan Gazit

unread,
Feb 2, 2012, 3:07:56 PM2/2/12
to django-d...@googlegroups.com
The next major revision of the admin will definitely use either less or sass, because it is uncivilized to work without such lovely tools nowadays.

I'm less certain about bootstrap. It has some pros and cons:

Pros:
* widely used (and thus widely understood)
* We won't need to invent our own style guide for the new admin. If you're developing a plugin or an extension and you're using the bootstrap styles, your thing willl mesh nicely with the rest of the admin.
* less.js has the distinct advantage of being easier to develop for than sass for our purposes.If we go with a less.js solution (like bootstrap), we might not need to require that all edits to admin "source" stylesheets (less/scss) come with the recompiled CSS. This lowers the barrier to contribution significantly, at the cost of a bit of site performance as less gets compiled client-side. That being said, the admin isn't supposed to be used as a a high-traffic site (or shouldn't be, I can't say how people abuse it).

Cons:
* less has no equivalent to compass, which is chock full of reusable stuff.
* I'm already having a bit of a negative reaction to the ubiquity of the bootstrap "look" on the web. That being said, it's relatively easy to alter some styles, but then we make the job of 3rd party admin extenders harder, because they must deviate from the default bootstrap style to fit into the admin.
 
-I

Donald Stufft

unread,
Feb 2, 2012, 3:10:46 PM2/2/12
to django-d...@googlegroups.com

On Thursday, February 2, 2012 at 3:07 PM, Idan Gazit wrote:

The next major revision of the admin will definitely use either less or sass, because it is uncivilized to work without such lovely tools nowadays.

I'm less certain about bootstrap. It has some pros and cons:

Pros:
* widely used (and thus widely understood)
* We won't need to invent our own style guide for the new admin. If you're developing a plugin or an extension and you're using the bootstrap styles, your thing willl mesh nicely with the rest of the admin.
* less.js has the distinct advantage of being easier to develop for than sass for our purposes.If we go with a less.js solution (like bootstrap), we might not need to require that all edits to admin "source" stylesheets (less/scss) come with the recompiled CSS. This lowers the barrier to contribution significantly, at the cost of a bit of site performance as less gets compiled client-side. That being said, the admin isn't supposed to be used as a a high-traffic site (or shouldn't be, I can't say how people abuse it).
It should only get compiled the first time, after then it get's cached client side IIRC (for less.js). 

Cons:
* less has no equivalent to compass, which is chock full of reusable stuff.
* I'm already having a bit of a negative reaction to the ubiquity of the bootstrap "look" on the web. That being said, it's relatively easy to alter some styles, but then we make the job of 3rd party admin extenders harder, because they must deviate from the default bootstrap style to fit into the admin.
 
-I

--
You received this message because you are subscribed to the Google Groups "Django developers" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-developers/-/QxpHySYhgDgJ.

Adrian Holovaty

unread,
Feb 2, 2012, 3:36:54 PM2/2/12
to django-d...@googlegroups.com
On Thu, Feb 2, 2012 at 2:07 PM, Idan Gazit <id...@gazit.me> wrote:
> * less.js has the distinct advantage of being easier to develop for than
> sass for our purposes.If we go with a less.js solution (like bootstrap), we
> might not need to require that all edits to admin "source" stylesheets
> (less/scss) come with the recompiled CSS. This lowers the barrier to
> contribution significantly, at the cost of a bit of site performance as less
> gets compiled client-side. That being said, the admin isn't supposed to be
> used as a a high-traffic site (or shouldn't be, I can't say how people abuse
> it).

Two points:

* If we decide to change the admin site to use LESS, we should ship
compiled CSS. No need to introduce the less.js overhead.

* I have been working on a Python LESS compiler in my spare time, and
there could be a use for it in here.

Adrian

Sean Brant

unread,
Feb 2, 2012, 3:49:08 PM2/2/12
to django-d...@googlegroups.com

<Slightly Off Topic>
Is this up somewhere public? I've been fighting the urge to do this as
well. Using django-compressor with less on Heroku is a non-starter
since you can't install node. Having this as a Python module would be
handy.
</Slightly Off Topic>

> Adrian


>
> --
> You received this message because you are subscribed to the Google Groups "Django developers" group.

Adam "Cezar" Jenkins

unread,
Feb 2, 2012, 4:16:15 PM2/2/12
to django-d...@googlegroups.com
A note that if you use the project django-compressor you can put something like the following into your templates and it will automatically compile the less

{% compress css %}
    <link type="text/less" rel="stylesheet" href="{{ STATIC_URL }}css/style.less" charset="utf-8">
{% endcompress %}

No need to compile by hand.

A note about bootstrap. I'm using it for my project and I've run across some pretty glaring bugs in the javascript it ships with. They don't keep the master branch stable, and are in the middle of merging the 2.0 work in progress branch into master. So there is a little bit of instability. Not the end of the world though, I still recommend it.

As far as core. Bootstrap should be a 3rd party app, but possibly having less support in core might be helpful.

On Thu, Feb 2, 2012 at 2:36 PM, Adrian Holovaty <adr...@holovaty.com> wrote:
--
You received this message because you are subscribed to the Google Groups "Django developers" group.

Paul Egges

unread,
Feb 2, 2012, 4:27:25 PM2/2/12
to django-d...@googlegroups.com


On Thu, Feb 2, 2012 at 2:16 PM, Adam "Cezar" Jenkins <empero...@gmail.com> wrote:
 ... 
As far as core. Bootstrap should be a 3rd party app, but possibly having less support in core might be helpful.



Funny how that reads. Perhaps for clarity it should say but ' ... possibly having support for "less" in core might be helpful.'  But then again, my English usually leaves a lot to be desired.   

Adrian Holovaty

unread,
Feb 2, 2012, 5:01:24 PM2/2/12
to django-d...@googlegroups.com
On Thu, Feb 2, 2012 at 2:49 PM, Sean Brant <brant...@gmail.com> wrote:
> Is this up somewhere public? I've been fighting the urge to do this as
> well. Using django-compressor with less on Heroku is a non-starter
> since you can't install node. Having this as a Python module would be
> handy.

Not yet, alas, but hopefully soon.

Adrian

Alex Gaynor

unread,
Feb 2, 2012, 5:17:56 PM2/2/12
to django-d...@googlegroups.com

Adrian

--
You received this message because you are subscribed to the Google Groups "Django developers" group.
To post to this group, send email to django-d...@googlegroups.com.
To unsubscribe from this group, send email to django-develop...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.


Perhaps this is too far in the future looking.  But at a certain point the admin must become a separate project.  One of the major goals of newforms-admin ('lo those years ago) was to demote the admin from special status, with hooks inside core left and right, to "just an app".  Let's carry that to the logical conclusion: just an app *outside of Django*.

That gives the maintainers the freedom to reinvent it, and use tools like less or bootstrap without it needing to be an issue of policy for all of Django.  Because when I first read saw this thread my thought was, "Hmm, what unholy mess of requirements am I going to need if I want to just run the test suite.  Will I still be able to write new features in forms without needing to learn what the hell less or compass is?".  Several years ago, I opposed using jQuery in the admin, on the principle that Django should be completely free of entangling alliances.  I made that argument more or less out of habit, just because I felt it was an argument that ought to be made, but really I was pretty happy to get to use jQuery.  Now I'm saying, it's pretty clear that admin 2.0 (or 3.0, or 4.0, anyone counting?) is going to be a beast that far outstrips almost anything else in Djanog (besides the ORM ;)) in complexity, with more dependencies, more associated tooling, and more usecases (i.e. it's not just a tool for developers to use, it's also something for end users of *our* users' apps to use).  Keeping that in Django itself is going to stunt it's growth, and it's going to suck for new developers to Django who, like many of us (or at least myself), were and still are, Python developers at heart, who can write some HTML, badly.

Alex

--
"I disapprove of what you say, but I will defend to the death your right to say it." -- Evelyn Beatrice Hall (summarizing Voltaire)
"The people's good is the highest law." -- Cicero

Travis Swicegood

unread,
Feb 2, 2012, 5:37:02 PM2/2/12
to django-d...@googlegroups.com
I'm sure Idan can add to this if he cares to, but at Djangocon kicking the admin out of django.contrib for admin2 was something that was actively considered, both during development and, depending on how it worked out, possibly as its new home.

I'm massively +1 on that because it does allow a lot of "freedom" to people wanting to experiment with it and new ways of handling administrative tasks.

-T
--
Travis Swicegood | @tswicegood (most everywhere) | Senior Open Source Engineer @ Texas Tribune / Armstrong | 512.693.7051

Sean Brant

unread,
Feb 2, 2012, 5:38:27 PM2/2/12
to django-d...@googlegroups.com

+1

Given how flexible the admin is doing somethings is still pretty
annoying. I feel like if it was a external project with its own
release schedule more progress could be made. FWIW i'm experimenting
with an admin interface that relies heavily on class based views. So
far I like it. CBVs seem to have more useful hooks then the admin
currently has. At the very least I think the new admin needs to not be
backwards compatible with the current admin.

So my vote is for django-admin2 as an external project.

Harris Lapiroff

unread,
Feb 3, 2012, 1:25:03 AM2/3/12
to Django developers
The Django admin is a major—if not *the* major—selling point to
budding developers. I worry that externalizing it (hence making it a
*separate* piece of software that needs to be discovered and
installed, which seems simple but can be quite a challenge to new
coders) might take away Django's non-expert appeal. When I started
using Django, I knew no python. The only reason I was able to make
that work was because of the Django admin. If the admin gets kicked
out, I think it should be made *very* obvious where to find one.

I'd be wary of putting them in core but I think using Bootstrap and
Less for a new admin (whether internal or external) would make its
development much faster. Dependencies should not be a problem. I think
jQuery is a pretty apt analogy here. You probably won't write much
javascript for the Django admin without learning jQuery. You can if
you want to. But most people don't need or want to write javascript
for the Django admin anyway. I think a framework like Bootstrap it
would actually simplify adding new features. It provides so many CSS
classes that there's a pretty good chance your feature wouldn't
require you to write even a line of CSS. I was able to convert an
unstyled app that I've been working on to functionally using Bootstrap
in just about an hour after starting to learn it.

That having been said, I'd still be cautious with Bootstrap. It is a
young piece of software that is incredibly impressive and mind-
bogglingly easy to use, but obviously still in flux.

On Feb 2, 5:38 pm, Sean Brant <brant.s...@gmail.com> wrote:
> On Thu, Feb 2, 2012 at 4:17 PM, Alex Gaynor <alex.gay...@gmail.com> wrote:
>
> > On Thu, Feb 2, 2012 at 5:01 PM, Adrian Holovaty <adr...@holovaty.com> wrote:
>

Brendan Smith

unread,
Feb 3, 2012, 8:35:10 AM2/3/12
to django-d...@googlegroups.com
I give +1 to the idea of separating out the admin and letting people fork and modify to their hearts content

I also still give my +1 to having it utilize less, but I am also cautious like others about prescribing bootstrap specifically , especially the JS since as others have pointed out is somewhat unstable right now and not very easy to use at times (took me a long time to figure out modals)

Sent from my iPhone

Adam "Cezar" Jenkins

unread,
Feb 3, 2012, 10:18:29 AM2/3/12
to django-d...@googlegroups.com
I heard this before from others. When someone installs Django from pypi it can install things like the admin without admin being inside the Django codebase. This is the simplest solution in my opinion.

Adrian Holovaty

unread,
Feb 3, 2012, 11:20:16 AM2/3/12
to django-d...@googlegroups.com
On Fri, Feb 3, 2012 at 12:25 AM, Harris Lapiroff
<harrisl...@gmail.com> wrote:
> The Django admin is a major—if not *the* major—selling point to
> budding developers. I worry that externalizing it (hence making it a
> *separate* piece of software that needs to be discovered and
> installed, which seems simple but can be quite a challenge to new
> coders) might take away Django's non-expert appeal. When I started
> using Django, I knew no python. The only reason I was able to make
> that work was because of the Django admin. If the admin gets kicked
> out, I think it should be made *very* obvious where to find one.

I agree with this sentiment. I think separating the admin into a
standalone app would be a step backward, at least at this point.

It strikes me that "the Django admin is hard for people to fork and
modify" is a symptom of something else, not a problem in itself. The
bigger problem is that our current development infrastructure
(Subversion/Trac) doesn't allow for easy forking workflow. We're going
to solve that with our move to Git/GitHub, which will make it much
easier for people to fork and much easier for core developers to
integrate contributions.

Before making any final judgment on separating the admin, we should
see how our community's move to GitHub goes. I'm suspecting the pain
points around forking will vanish at that point.

P.S. In case you haven't heard about the GitHub move, here's a blog
post you should read: http://www.holovaty.com/writing/back-to-django/
ETA is sometime soon after we launch 1.4.

Adrian

Max Thayer

unread,
Feb 3, 2012, 9:21:15 AM2/3/12
to django-d...@googlegroups.com
The point about admin's appeal to new people is important, but externalizing it and keeping new people from ever seeing it are very different. Consider: admin isn't even enabled by default. You have to follow the tutorial on how to enable it. If admin weren't included in Django proper, we could just change the tutorial to "Apps are awesome; here's how to download and install one written by someone else." New users could meet pip sooner, and otherwise understand how to integrate with the broader python/django community's various creations.

Actually, a friend of mine and I have been plotting out externalizing various parts of contrib, like admin and auth. Are any groups currently pursuing those goals as well?

Best regards,
Max

Brendan Smith

unread,
Feb 3, 2012, 11:52:37 AM2/3/12
to django-d...@googlegroups.com
I had not heard about the move to GitHub but I am +10 on that move.

Ryan D Hiebert

unread,
Feb 3, 2012, 2:07:18 PM2/3/12
to django-d...@googlegroups.com
I think that Django's admin app is a killer feature for two main reasons:
1. It is automatically installed, and integrated into the tutorial.
2. It is used all over in third-party apps, because they can expect it to be there.

While I appreciate that there may be differences in core vs admin that may slow down development of the admin, I'm wary of removing it from the django install, thinking that it might hurt reason 2, even if it is integrated in the tuturial, and possibly even installed automatically.

Although as far as the automatic install goes, I'm not sure how that would work. Would it be a dependency? That doesn't make sense.

Ric

unread,
Feb 3, 2012, 6:07:11 PM2/3/12
to Django developers
a less compiler is needed to make developers add custom variables to
match color scheme they like.

i prefeer using an existing framework, a lot of work less to do, no
docs to make, just a link.
bootstrap it's fantastic, it's well done and is flexible.

django should use a base style, already compiled for backward
compatibility.

i would make a theme framework, something like django.contrib.themes,
a css/js/less framework to customize every view and the admin.

imagine a subclass of django.forms.Media

class MediaMiddleware(object):

def process_exception(self, request, e):
request.media = GlobalMedia()

user can add css doing

>>> request.media.add_css(

django admin could do this to add media it gets from admin forms doing

request.media += self.media + adminForm.media

and then push media in context


we could create a GlobalMediaContextProcessor, it import an instance
of global_media and put it in every template with a namespace of
"global_media".

def base(request):

return {
'media':request.media,
}

and than in template use

{{ media.css }}

now, with this kind of hook, user can choose, site wide, what media
use.
with a context_processor, a media class is injected in every template,
and views can add js and css on the fly, pushing them over
request.media

with some less rule, admin template could be reskinned, and user can
select a different type of themes

THEME_CLASS = "django.contrib.themes.DefaultTheme"

then wu could add a "django.contrib.themes.Bootstrap"

a globalmedia class that host less definition for a bootstrap theme.

with an app like this users could choose if continue to use default
theme or switch to a bootstrap template, to develop faster a front-end
interface.

no backward compatibility issues, just one more possibility for
developers.


what views can do is to
On 3 Feb, 20:07, Ryan D Hiebert <vgac...@gmail.com> wrote:
> I think that Django's admin app is a killer feature for two main reasons:
> 1. It is automatically installed, and integrated into the tutorial.
> 2. It is used all over in third-party apps, because they can expect it to be there.
>
> While I appreciate that there may be differences in core vs admin that may slow down development of the admin, I'm wary of removing it from the django install, thinking that it might hurt reason 2, even if it is integrated in the tuturial, and possibly even installed automatically.
>
> Although as far as the automatic install goes, I'm not sure how that would work. Would it be a dependency? That doesn't make sense.
>
> On Feb 3, 2012, at 6:21 AM, Max Thayer wrote:
>
>
>
>
>
>
>
> > The point about admin's appeal to new people is important, but externalizing it and keeping new people from ever seeing it are very different. Consider: admin isn't even enabled by default. You have to follow the tutorial on how to enable it. If admin weren't included in Django proper, we could just change the tutorial to "Apps are awesome; here's how to download and install one written by someone else." New users could meet pip sooner, and otherwise understand how to integrate with the broader python/django community's various creations.
>
> > Actually, a friend of mine and I have been plotting out externalizing various parts of contrib, like admin and auth. Are any groups currently pursuing those goals as well?
>
> > Best regards,
> > Max
>
> > On Fri, Feb 3, 2012 at 8:35 AM, Brendan Smith <bren...@nationalpriorities.org> wrote:
> > I give +1 to the idea of separating out the admin and letting people fork and modify to their hearts content
>
> > I also still give my +1 to having it utilize less, but I am also cautious like others about prescribing bootstrap specifically , especially the JS since as others have pointed out is somewhat unstable right now and not very easy to use at times (took me a long time to figure out modals)
>
> > Sent from my iPhone
>
> > > For more options, visit this group athttp://groups.google.com/group/django-developers?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups "Django developers" group.
> > To post to this group, send email to django-d...@googlegroups.com.
> > To unsubscribe from this group, send email to django-develop...@googlegroups.com.
> > For more options, visit this group athttp://groups.google.com/group/django-developers?hl=en.

Anssi Kääriäinen

unread,
Feb 3, 2012, 6:53:24 PM2/3/12
to Django developers
Just adding my point of view to this thread. I haven't even heard of
Bootstrap before. I know less (and other similar systems) but haven't
ever used them. I do need to do frontend work. I am not good at all in
it, and I do not enjoy it. But I need to do it.

Now, if Admin would begin using less and bootstrap, that would be a
problem for me. I would need to learn those tools to effectively
customize the Admin. While CSS and HTML can be expected to be known, I
don't think you can expect people to know less or bootstrap.

My viewpoint (in general, not just related to admin) is that Django
should contain as much hooks as possible and no, or only simple,
implementations. It might be possible to design the Admin in such a
way that you could completely overhaul how it looks and maybe even
behaves by subclassing. So, external projects could rely that there is
an Admin application, and that it has a common API. External projects
could customize it. I don't know the admin well, and I really don't
know the latest tools in the frontend development world. So, maybe
what I just said is impossible to do in practice.

I do feel that there needs to be some data editing application
inbuilt. Maybe admin has just become too complex. Make it simpler,
while allowing external projects to extend it (as said, if at all
possible).

About Github and forking. This is all good and well, but customize-by-
forking tends to have the problem that internal parts become de-facto
public. Something like the situation with model._meta. I really feel
that if Django encourages forking, then there must be strong consensus
that the non-public parts of Django really are non-public. I am
worried that otherwise changing anything in Django will become harder
than it needs to be. For example, if the ORM internals were to be
refactored, but this resulted in breaking django-nonrel and maybe
other projects like that, would that be OK?

- Anssi

Joe & Anne Tennies

unread,
Feb 3, 2012, 7:55:22 PM2/3/12
to django-d...@googlegroups.com
I'll throw in my 2 cents.

Please, please do not remove auth or admin. They really are the selling point and reason to use Django over something else. That being stated, you do not have to keep auth or admin in their current forms. I have no problem whatsoever with making them more of an API than an implementation.

Figure out the signals an auth backend should have and the basic things expected to be implemented. For instance, a User should have a user_id, human-readable name (optional), email address (optional), profile?, permissions, auth_groups, and backend authenticated with (I'm sure there may be others that should be here). I think the current signals are probably fine. Also needed would be some sort of "backend plugin loader" (like the one for the ORM allowing MySQL, Postgres, etc.) Then include a very basic implementation that just does username/password authentication with the database as an app that can be used. (Others can maintain an open id, facebook, etc. outside the core of Django, but the standard is there.) PS: Something like Twisted.cred may a good reference for such an abstract thing.

Ditto for the admin. So what if it's not ajax or less, just make a simple one that works and let others extend/reimplement to get a fancy version.

This to me is congruent with the answer I had heard thrown around for South. Don't include South in Django, but include a base specification that South and nashvegas can agree to. (required parts needed in the ORM and schema revision tracking, etc.) Then include a simple implementation that can migrate databases via some script but not autodetect changes.


Basically, I see a big need for Django to start providing specifications to how things
--
Joe & Anne Tennies
ten...@gmail.com

Adam "Cezar" Jenkins

unread,
Feb 4, 2012, 4:26:14 AM2/4/12
to django-d...@googlegroups.com
In this thread. There is a lot of mistaking of an app being installed with Django vs. an app being in the same code repo as Django.

Don't worry people. I don't think anyone is seriously considering throwing away the admin.

Anssi Kääriäinen

unread,
Feb 4, 2012, 5:16:04 AM2/4/12
to Django developers
On Feb 4, 11:26 am, "Adam \"Cezar\" Jenkins" <emperorce...@gmail.com>
wrote:
> In this thread. There is a lot of mistaking of an app being installed with
> Django vs. an app being in the same code repo as Django.

Wouldn't this mean there are all the same dependencies for default
install? What about backwards compatibility, can Django include
something by default which has its own versioning policy? How does
this even work with regards to tarball downloads, which is probably
still the most common way to install Django in the new users category.
That happens to be the category who are most hit by removal of Django
from contrib.

If this would be done, it would mean a radical sift in the way Django
is distributed. Tutorial step 3 should be changed from talking about
the admin to talking about how to use PIP, virtualenv and where to
find nice packages. Using django-admin2 as an example. Maybe this
could work and would actually benefit Django development. But this is
a radical change from "download this tarball and off you go, batteries
included, backwards compatibility for 2 releases guaranteed"
philosophy.

- Anssi

Ric

unread,
Feb 4, 2012, 5:23:55 AM2/4/12
to Django developers
no no, my point is not to remove admin, you misunderstood me...

what i'm talking about is the extend the current admin version, with a
theme framework.

the theme framework got a default theme, that is the current admin
theme, but then developers can add their own theme.

now making a theme for django is an hack, and not an hook, because
some javascript are hard coded inside django admin.

i'm thinking about jquery, django use 1.4, i need 1.7 for my
javascript, and i've done a terrbile hack to remove js from admin.

what i'm talking about is creating a single place in django to
register stylesheet and javascripts, and then inject them in every
context with an optional context processor.

using a request.media attr, would allow admin to add on the fly style
and js for horizontal filters and fancy widget.

then for developers would be more simple to create and mantain a
separete bootstrap theme.

Mateusz Marzantowicz

unread,
Feb 4, 2012, 10:10:30 AM2/4/12
to django-d...@googlegroups.com
On Sat, Feb 4, 2012 at 11:23 AM, Ric <riccardod...@gmail.com> wrote:
no no, my point is not to remove admin, you misunderstood me...

what i'm talking about is the extend the current admin version, with a
theme framework.

the theme framework got a default theme, that is the current admin
theme, but then developers can add their own theme.
 
now making a theme for django is an hack, and not an hook, because
some javascript are hard coded inside django admin.

So there is a need for code cleanup. I haven't checked if it's possible yet (no need so far), but I think such split of JS and Python code is possible.


i'm thinking about jquery, django use 1.4, i need 1.7 for my
javascript, and i've done a terrbile hack to remove js from admin.

The solution is to upgrade jQuery in Django admin. More effort is to be taken to include the newest jQuery with each Django release. It looks, it is simpler then themes. I'm using completely different jQuery version in my sites then what is included in Django admin and I have no problem with this. I don't need to touch anything in Django admin UI (like about 90% of regular django users).
 

what i'm talking about is creating a single place in django to
register stylesheet and javascripts, and then inject them in every
context with an optional context processor.


Currently there is django-sekizai used e.g. by django-cms project. Introduction of another media handling framework would complicate things.
To be honest I hate using this framework because it makes a lot of mess in my templates. After all I have my CSS and JavaScript placed in static files served from different web server. Using jQuery it is easy to hook to HTML to fire some js function etc. and it should be equally easy to do it with Django admin.
 

using a request.media attr, would allow admin to add on the fly style
and js for horizontal filters and fancy widget.

then for developers would be more simple to create and mantain a
separete bootstrap theme.


---
Mateusz Marzantowicz

zalew

unread,
Feb 9, 2012, 7:49:22 AM2/9/12
to django-d...@googlegroups.com

We're going
to solve that with our move to Git/GitHub, which will make it much
easier for people to fork and much easier for core developers to
integrate contributions.

a bit offtopic: why not http://bitbucket.org? similar features, it's on python/django and already popular in django community.

Jonathan Paugh

unread,
Feb 13, 2012, 12:23:33 PM2/13/12
to django-d...@googlegroups.com
There's a big rift here between what people want to do with admin and
what people want to do with django itself. To summarize: the admin
should be amazing by itself and chock full of features, while django
should be empowering without getting in the way.

I've seen a lot of good ideas for admin rejected recently because they
couldn't fit into Django's overall vision. I don't think there is any
way to resolve this rift: it will persist. Django and admin should be
developed separately, likely by separate teams. They could still live in
the same codebase, with an "subofficial" admin fork. Then, the official
django repo could pull in changes according to some suitable policy.

However, maintaining it as a separate project wouldn't hurt, either:
In address to Anssi's concerns: conteaching pip is as easy as `pip
install django-admin`, and the two projects could be tarball-ed together
somehow. (Could it be that hard to teach setup.py to install another
package from a subdir? Or to tar up them separately?) (And what is
virtualenv? Do I need it to install admin? Let's address that in a
separate tutorial, with a link and a notation.)

Peace,
Jonathan

P.S. I'm fairly new here (~1 month), and my perspective is
proportionally skewed.

On 02/03/2012 02:07 PM, Ryan D Hiebert wrote:
> I think that Django's admin app is a killer feature for two main reasons:
> 1. It is automatically installed, and integrated into the tutorial.
> 2. It is used all over in third-party apps, because they can expect it to be there.
>
> While I appreciate that there may be differences in core vs admin that may slow down development of the admin, I'm wary of removing it from the django install, thinking that it might hurt reason 2, even if it is integrated in the tuturial, and possibly even installed automatically.
>
> Although as far as the automatic install goes, I'm not sure how that would work. Would it be a dependency? That doesn't make sense.
>
> On Feb 3, 2012, at 6:21 AM, Max Thayer wrote:
>
>> The point about admin's appeal to new people is important, but externalizing it and keeping new people from ever seeing it are very different. Consider: admin isn't even enabled by default. You have to follow the tutorial on how to enable it. If admin weren't included in Django proper, we could just change the tutorial to "Apps are awesome; here's how to download and install one written by someone else." New users could meet pip sooner, and otherwise understand how to integrate with the broader python/django community's various creations.
>>
>> Actually, a friend of mine and I have been plotting out externalizing various parts of contrib, like admin and auth. Are any groups currently pursuing those goals as well?
>>
>> Best regards,
>> Max
>>
>> On Fri, Feb 3, 2012 at 8:35 AM, Brendan Smith <bre...@nationalpriorities.org> wrote:
>> I give +1 to the idea of separating out the admin and letting people fork and modify to their hearts content
>>
>> I also still give my +1 to having it utilize less, but I am also cautious like others about prescribing bootstrap specifically , especially the JS since as others have pointed out is somewhat unstable right now and not very easy to use at times (took me a long time to figure out modals)
>>
>> Sent from my iPhone
>>
>> On Feb 3, 2012, at 1:25 AM, Harris Lapiroff <harrisl...@gmail.com> wrote:
>>

>>> The Django admin is a major�if not *the* major�selling point to

Juan Pablo Martínez

unread,
Feb 14, 2012, 10:02:00 PM2/14/12
to django-d...@googlegroups.com
+1 to separate django and admin o other contrib app.
-0 to mantain another/alternative admin on contrib

It is understandable at first that was maintained at par for order and security in the project itself.

But today, after Django 1.3.1 I think it's time to review the situation of contrib.

With teams in each Django contrib application would be a little more flexible.

That is my humble opinion :)

Regards,

>>> The Django admin is a major—if not *the* major—selling point to



--
juanpex

Buddy Lindsey

unread,
Feb 14, 2012, 10:12:38 PM2/14/12
to django-d...@googlegroups.com
There seems to be 2 key issues, as mentioned before:

1. Admin isn't moving forward fast enough.
2. It is hard to contribute.

It seems that there is enough resistance to not moving Admin out that it seems like it would be a
bad idea if it was moved. However, I am sure many contributions haven't been submitted because
people aren't sure what they can do for admin.

There seems to be a lot of change right now and am partial to the wait and see approach. With the
move to github I can forsee many many more contributions taking place than there are now, simply
because it is easier to do so. I personally saw it as very daunting to contribute until I learned I could
submit a pull request on github. I chose to test the waters with a simple documentation pull request,
but it was super simple in the end.

Maybe wait 6 months and see what evolves out of the move to github before� taking a scalpel to the
admin and trying to break it up? I mean sometime inaction _is_ an actual solution while letting dust
settle on multiple things.

Like Jonathan I am new here so feel free to ignore me if you want.

Thanks,
Buddy

�

On 2/14/12 9:02 PM, Juan Pablo Mart�nez wrote:
+1 to separate django and admin o other contrib app.
-0 to mantain another/alternative admin on contrib

It is understandable�at first that�was maintained�at par for�order and security�in the�project itself.

But today, after�Django�1.3.1�I think�it's time�to review�the situation of�contrib.

With�teams in�each�Django�contrib�application�would be a little�more�flexible.

That is my�humble opinion�:)

Regards,

>>> The Django admin is a major�if not *the* major�selling point to
>>>>> Perhaps this is too far in the future looking. �But at a certain point the
>>>>> admin must become a separate project. �One of the major goals of

>>>>> newforms-admin ('lo those years ago) was to demote the admin from special
>>>>> status, with hooks inside core left and right, to "just an app". �Let's

>>>>> carry that to the logical conclusion: just an app *outside of Django*.
>>>>
>>>>> That gives the maintainers the freedom to reinvent it, and use tools like
>>>>> less or bootstrap without it needing to be an issue of policy for all of
>>>>> Django. �Because when I first read saw this thread my thought was, "Hmm,

>>>>> what unholy mess of requirements am I going to need if I want to just run
>>>>> the test suite. �Will I still be able to write new features in forms without
>>>>> needing to learn what the hell less or compass is?". �Several years ago, I

>>>>> opposed using jQuery in the admin, on the principle that Django should be
>>>>> completely free of entangling alliances. �I made that argument more or less

>>>>> out of habit, just because I felt it was an argument that ought to be made,
>>>>> but really I was pretty happy to get to use jQuery. �Now I'm saying, it's

>>>>> pretty clear that admin 2.0 (or 3.0, or 4.0, anyone counting?) is going to
>>>>> be a beast that far outstrips almost anything else in Djanog (besides the
>>>>> ORM ;)) in complexity, with more dependencies, more associated tooling, and
>>>>> more usecases (i.e. it's not just a tool for developers to use, it's also
>>>>> something for end users of *our* users' apps to use). �Keeping that in



--
juanpex

is_null

unread,
Feb 15, 2012, 3:56:44 AM2/15/12
to Django developers
Testifying:

0) migrating the current admin theme to bootstrap is easy (3-4 hours
of template hacking)
1) the result is great (bye bye 90's theme)
2) it requires minor work in many admin template
3) doesn't force to use less at all
4) found two things that sucks during my journey which are
definitively worth some love: 0) admindoc templates follow worst
practice and 1) impossible to make 2 admin sites with different
templates and use django-mobileadmin in the other site

Using a CSS framework would be a step forward comparable to the use of
a JS framework. Think of the reasons you decided to use jQuery in the
admin: it's the same for bootstrap.

If you like the vintage style and want Django admin to be behind the
other projects out there then my advice is: don't integrate bootstrap
nor any sexy CSS framework.

Cheers from Spain
(<3 our bootstrap themed admin)

Victor Hooi

unread,
Feb 16, 2012, 9:07:17 AM2/16/12
to django-d...@googlegroups.com
heya,

Are you willing to share your Bootstrap-themed admin, so others can see what it's about, and contribute?

Cheers,
Victor

Stan

unread,
Feb 16, 2012, 10:02:40 AM2/16/12
to Django developers


On Feb 9, 1:49 pm, zalew <zal...@gmail.com> wrote:
> > We're going
> > to solve that with our move to Git/GitHub, which will make it much
> > easier for people to fork and much easier for core developers to
> > integrate contributions.
>
> a bit offtopic: why nothttp://bitbucket.org?similar features, it's on
> python/django and already popular in django community.

+1 :-)

Victor Hooi

unread,
Feb 16, 2012, 2:49:39 PM2/16/12
to django-d...@googlegroups.com
heya,

You know what, I have to say the same thing =).

BitBucket/Mercurial would seem like a better match.

Also, with the buy-out by Atlassian, they seem to be iterating more frequently, in terms of features, and I would love to see a major Python project, like Django, behind them.

Cheers,
Victor

--
You received this message because you are subscribed to the Google Groups "Django developers" group.

Brendan Smith

unread,
Feb 16, 2012, 3:49:57 PM2/16/12
to django-d...@googlegroups.com
i also regrettably give a +1 to github over bitbucket.   while I like others would love to see a python based solution, especially django, give github a run for it's money, i think github is years ahead of bitbucket in terms of features and ease of use.

i also think git itself is going to remain the king of the source control world for some time to come.  

Juan Pablo Martínez

unread,
Feb 16, 2012, 3:56:58 PM2/16/12
to django-d...@googlegroups.com
The topic is: start using less (and bootstrap!)
Please, no more offtopic.

Thanks
juanpex

hunter

unread,
Feb 17, 2012, 10:37:48 AM2/17/12
to Django developers
+1 on using a Dynamic Stylesheet Language for the Admin.

Would there only be one flavor? LESS or SCSS? Does it matter? Would
providing a means to implement either be necessary?





On Feb 16, 3:56 pm, Juan Pablo Martínez <jpm...@gmail.com> wrote:
> The topic is: start using less (and bootstrap!)
> Please, no more offtopic.
>
> Thanks
>
> On Thu, Feb 16, 2012 at 6:49 PM, Brendan Smith <
>
>
>
>
>
>
>
>
>
> bren...@nationalpriorities.org> wrote:
> > i also regrettably give a +1 to github over bitbucket.   while I like
> > others would love to see a python based solution, especially django, give
> > github a run for it's money, i think github is years ahead of bitbucket in
> > terms of features and ease of use.
>
> > i also think git itself is going to remain the king of the source control
> > world for some time to come.
>
> > On Feb 16, 2012, at 2:49 PM, Victor Hooi wrote:
>
> > heya,
>
> > You know what, I have to say the same thing =).
>
> > BitBucket/Mercurial would seem like a better match.
>
> > Also, with the buy-out by Atlassian, they seem to be iterating more
> > frequently, in terms of features, and I would love to see a major Python
> > project, like Django, behind them.
>
> > Cheers,
> > Victor
>
> > On Fri, Feb 17, 2012 at 02:02, Stan <stanislas.gue...@gmail.com> wrote:
>
> >> On Feb 9, 1:49 pm, zalew <zal...@gmail.com> wrote:
> >> > > We're going
> >> > > to solve that with our move to Git/GitHub, which will make it much
> >> > > easier for people to fork and much easier for core developers to
> >> > > integrate contributions.
>
> >> > a bit offtopic: why nothttp://bitbucket.org?similar<http://bitbucket.org/?similar>features, it's on
Reply all
Reply to author
Forward
0 new messages