Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Ian Waring
@ianwaring
Fwiw I thought the base.html was going to go under the projects main /static.
However, the process I followed didn’t leave them there - so I was wondering if I had to install materializeCSS and place the files in my static hierarchy myself. 75km away from my Mac at a Django meetup, but will look in the morning.
emihir0
@emihir0
the supplied templates are just.. templates. However you setup your templates is up to you and it can be changed in project settings TEMPLATES. As for the static files, you have to run manage.py collectstatic in your production. Regarding the FredConfig, well, before installing django-material you should have had FredConfig in the installed apps already, otherwise your project would not know that it should use/display the fred app.
lastly, the index is not a file but a view, or rather a name that can be resolved into a view (e.g. it can be a redirect to other view). the specific example shown in the guide uses actual index.html, not a redirect. That index.html is simply a template and usually you put it in project/fred/templates/fred/index.html OR project/templates/fred/index.html. I suggest the first one as it means you will be able to locate all your app templates quickly (ie. each app has template folder), as opposed to having 1 massive templates folder in your project directory (it's still useful to have it, for some project wide stuff).
emihir0
@emihir0
the demo is a bit confusing, it should have called the app not MyAppConfig but SalesConfigso it's clear it's a sales app and so it refers to sales/index.html for template and for views as sales:index
also, if you prefer to refer to your fred app as simply fred instead of 'fred.apps.FredConfig'in your settings, then you can, in your __init__.py file in your fred app add line: default_app_config = 'fred.apps.FredConfig'
(that's why you only have to refer to django.contrib.admin for example instead of django.contrib.admin.apps.AdminConfig because the __init__.py file contains default_app_config = 'django.contrib.admin.apps.AdminConfig' - but it doesn't matter in the end
Ian Waring
@ianwaring
Really helpful, thank you. I have everything working on admin, just got to tweak the URL defs to pick up the index view. Agree with you about the demo SalesConfig name. Happy to publish the whole process end to end (from firing up a Dev Mac+ Production Digital Ocean Ubuntu instance through to having Django + PostgreSQL + Python 3 + MaterializeCSS + Django-Material + Nginx http/HTTPS working) - if indeed it would be useful to anyone.
Digital Oceans one click install of Nginx, PostgreSQL, Python, Django was good - 30 mins from running it up to being able to add template code - but Django 1.8 and Python 2.7, hence having to build it piecemeal instead. It'd be nice to automate things a bit :)
emihir0
@emihir0
why do you run a new project on python 2.7? it's not supported in django 2.0
and yes, publish it; I'll gladly check it out later when I have some time. I'm myself new to django in general, so I'm curious to see how/what other people do
Ian Waring
@ianwaring
Exactly - it was old version city, so I scrapped it and built the whole thing bit by bit from the ground up. Now Ubuntu 16.04 LTS, Django 1.11 - and hopefully Django-Material when it supports 1.11 and 2.0
And Python 3.5 or 3.6 of course
emihir0
@emihir0
I want to switch to django 2 ASAP as there are some neat features available that make life easy. Pretty much the last major library i'm working with that is not updated to 2.0 is django-material
so I'm waiting patiently :D
Ian Waring
@ianwaring
It's a moving target. I first looked at Django years ago - nice Apress book but the pre-1.0 releases kept slipping. Only back now after doing some Python work in Dash (by the authors of D3 based Library Plot.ly) - and a stint around building my personal home project single page app in JavaScript on AWS, then using Polymer, then Firebase. Django looking good.
Ian Waring
@ianwaring
Anyone got an example of a project with one app that can display one template (and the admin page with /admin) with Django-material in place? I’m trying to add routing in but seem to have screwed up name spaces or view types - getting name errors on generic.TemplateView.as_view in my app
Ian Waring
@ianwaring
Think I just need to get my head around FBV's vs CBV's.
Ian Waring
@ianwaring
Back on it doing the whole app using CBVs in the morning.
Ian Waring
@ianwaring
All working now :-). Reconciled all the flow against the directory structure, now seeing MaterializeCSS on both the app and admin panel. Just updating my procedure documentation accordingly.
Ian Waring
@ianwaring
Submitted it to Digital Ocean - happy to share if anyone wants a copy or to improve it. ian.waring@software-enabled.com
emihir0
@emihir0
well, you can use both fbv and cbv, it doesn't really matter although fbv is somewhat limited in a sense that you keep repeating stuff over and over
wheras with cbv your whole view can be sometimes done in 2 lines
Ian Waring
@ianwaring
I'm using cbv by default now
Ian Waring
@ianwaring
Did I see that the new version of django-materialize with Django 1.11 and 2.0 was done? Any ideas when we can download it?
emihir0
@emihir0
you can download it already (for django 2.0). django 1.11 was supported for a while
just pip install django-material --upgrade should do the magic (I believe it's now version 1.2 that is the newest, at least for django-material-pro)
Ian Waring
@ianwaring
Tried the pip install yesterday and got a "nothing changed" status. Will try again...
emihir0
@emihir0
what's your current version you are using right now? pip freeze?
Ian Waring
@ianwaring
1.1.1 - but the pip install django-material --upgrade just updated it to 1.2 :-).
Kamran hossain
@Kamran_hossain_twitter
Material Design Color Palette include in django-material or I need to add separately for work? Thanks.
Voxmundi
@Voxmundi
in admin fieldset classes': ('collapse',) is not working. Does material support this functionaltiy?
Ian Waring
@ianwaring
Django-material 1.2.2 released apparently :-)
mendesdouglas
@mendesdouglas
Hi Guys! I'm beginner in django-material. How can I change the Image of admin-login(with django-material) and change favicon of admin panel. thx
Ian Waring
@ianwaring
I'm moving stuff over from a Firebase/Polymer project. I have CSS in there for setting the width and various color attributes of an input field (paper-input-container-color, -focus-color, invalid-color, input-color. Any equivalent in django-material?

Likewise various iron attributes in CSS to make the view occupy the whole window -

    display: block;
    @apply(--layout-fit);
    @apply(--layout-vertical);
    @apply(--layout-center);
    @apply(--layout-center-justified);

... or do I need to do this in JavaScript instead?

Ian Waring
@ianwaring
Also looking to limit the user-input field to a specific width, but will probably try to put it occupying central 4 columns, with 4 empty cells either side of it...
Ian Waring
@ianwaring
The "fill the whole window" thing is done in CSS:
*{
  box-sizing: border-box;
  padding: 0;
  margin: 0;
}
.myblockname {
    display: block;
    position: absolute;
    width: 100vw;
    height: 100vh;
    background: #1e88e5;
    color: white;
    text-align: center;
    font-family: Roboto;
  }
Having trouble with the input fields taking the whole view width (when I want them in a subset of the 12-cell grid), but that's a straight MaterializeCSS and not a django-material question.
just10minutes
@just10minutes
Hi Guys, where can i find the documentation or some details about django-material-admin?
just10minutes
@just10minutes
is django-material-frontend contains admin as well?
just10minutes
@just10minutes
Anyone has implemented django signup/login/password_reset using django material? any sample code around?
just10minutes
@just10minutes
Earlier I had seen some documentation on how to apply material admin on Django app but that document is missing now
Ian Waring
@ianwaring
Hiya, it's at docs.viewflo.io
Admin is there too. I'm just in the middle of doing the sign up with a MaterializeCSS rendered login
Ian Waring
@ianwaring
Had to explode out the form.as_p directive into component parts (matching the form fields it iterates through) to put MaterializeCSS formatting around, including fields to show error text. Using raw MaterializeCSS for this rather than the forms work. For what it's worth, I also have the mod to use email address as the username in place, but the admin interface works fine with that.
just10minutes
@just10minutes
@ianwaring thank you for your response.
as per this issue, i thought django-admin is no more supported or works
viewflow/django-material#373
Ian Waring
@ianwaring
That's fine, agree with the author. I do hope he keeps forms and django-material in place though :-)