Re: Extending AdminSite
Try those : *Concept ,Ideas and Basics :* http://www.theotherblog.com/Articles/2009/06/02/extending-the-django-admin-interface/ Tom explain the main concept . *Slideshow ( reference ) :*and this slideshow is outstanding as well : http://www.slideshare.net/lincolnloop/customizing-the-django-admin *CSS and Template *: and This is how to extend the style and add your custom extra css : http://blog.montylounge.com/2009/jul/5/customizing-django-admin-branding/ *Doing more with the Django admin* http://www.ibm.com/developerworks/opensource/library/os-django-admin/index.html Also Django`s Docs are pretty cool , though no enough examples so you may check some other projects as Django-CMS . to see what is done and how they made it ! P.s : if you stuck at some point , don't worry shortly you'll get your way out , its Django :) Regards . On Fri, Jul 24, 2009 at 2:14 AM, Jan-Herbert Damm wrote: > > Hi, > > Daniel Roseman wrote: > > > ... http://www.webmonkey.com/tutorial/... > > > This is a very misleading tutorial, and I wouldn't recommend it. > > > You could make this work, though. ... > Not being the OP i still want to thank you for these hints, Daniel. Makes a > beginner catch a glimpse ... > > Could you recommend a tutorial (in addition to the official one), that > teaches > more of these basics? > > jan > > > > -- Hamza E.e Mousa www.neoxero.com www.goomedic.com www.medpeek.com www.freewaydesign.com http://www.twitter.com/hamzamusa http://twitter.com/goomedic --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Django-admin {{ root_path }} problem !
reinstall the django to the latest development version of the trunk solve the issue , thank you On Thu, Jul 23, 2009 at 10:39 AM, Dr.Hamza Mousa wrote: > Thanks again Russell > > The admin templates i put in /templates/admin is working very well the css > is extended and also customize the base template file ( still working thu ) > ( forget to say i already set the template dir in settings.py : sorry ) , i > also registered the application . > > yes the admin working correctly and still working thu :) > > about old files of django RC 1.1 somewhere i think so cause this issue is > not happening on Windows Django 1.1 !!! > > will check if reinstalling django will work ! > > Thanks > > > > > On Thu, Jul 23, 2009 at 10:22 AM, Russell Keith-Magee < > freakboy3...@gmail.com> wrote: > >> >> On Thu, Jul 23, 2009 at 2:30 PM, Dr.Hamza Mousa >> wrote: >> > Hi Russell >> > >> > The admin templates i copied into /templates/admin/ . >> > >> > The idea : i need to customize the admin for a project am working on . >> > >> > -details : >> > >> > installed django RC 1.1 , ubuntu linux 9.04 . >> > >> > so i ran : >> > >> > django-admin.py startproject emr_admin >> > >> > , python manage.py startapp emr >> > >> > defined my first model in the emr/models.py >> > >> > added the django.contrib.admin in emr_admin/settings.py >> > >> > then ran : python manage.py syncdb >> > >> > urls.py : >> > >> > - >> > from django.contrib import admin >> > admin.autodiscover() >> > >> > and in : urlpatterns i added the admin urls >> > >> > >> > (r'^admin/', include(ad >> > >> > min.site.urls)), >> > >> > >> > >> > >> > >> > >> > Django admin Template files : >> > >> > to extend the admin css style i copied the admin template from the >> django RC >> > 1.1 to /templates/admin/ like base.html , base_site.html , index.html >> .. >> > >> > so now they are in >> > >> > /templates/admin/ >> >> I should point out that unless you make a modification to >> TEMPLATE_DIRS in your settings file, copying the template files will >> have no effect at all. From the point of view of these instructions, >> copying the template files is a no op - the admin won't pay any >> attention to the files in /templates. >> >> > >> > >> > emr/admin.py : >> > >> > so it all runs so fine , >> >> To clarify - Are you saying that at this point in the process, the >> admin site URLs are displayed correctly? >> >> > register my app models in emr/admin.py >> >> I presume you have also put emr into INSTALLED_APPS at some point in >> this process? >> >> > : >> > from django.contrib import admin >> > from django import forms >> > >> > from emr_admin.emr.models import * >> > >> > class PatientForm(forms.ModelForm): >> > comment = forms.CharField(widget=forms.Textarea(attrs={'rows':4, >> > 'cols':60}),label='Comment',help_text="") >> > sex = >> forms.CharField(widget=forms.RadioSelect(choices=SEX),label='Sex') >> > smoking = >> > >> forms.CharField(widget=forms.RadioSelect(choices=SMOKING),label='Smoking') >> > maritalstatus = >> > forms.CharField(widget=forms.RadioSelect(choices=Marital_STATS)) >> > >> > >> > >> > class PatientAdmin(admin.ModelAdmin): >> >list_display = ( 'name', 'sex','maritalstatus', 'bdate','jobtitle') >> >list_display_links = ( 'name', 'sex','maritalstatus', >> 'bdate','jobtitle') >> >search_fields = ('name', 'jobtitle') >> >list_filter = ('jobtitle','sex') >> >list_per_page = 25 >> >ordering = ['name'] >> >form = PatientForm >> > >> > >> > admin.site.register(Patient , PatientAdmin) >> > >> > >> > >> > - >> > everything working so fine at the admin side , however the only thing is >> not >> > working is the logout and change passw
Re: Django-admin {{ root_path }} problem !
Thanks again Russell The admin templates i put in /templates/admin is working very well the css is extended and also customize the base template file ( still working thu ) ( forget to say i already set the template dir in settings.py : sorry ) , i also registered the application . yes the admin working correctly and still working thu :) about old files of django RC 1.1 somewhere i think so cause this issue is not happening on Windows Django 1.1 !!! will check if reinstalling django will work ! Thanks On Thu, Jul 23, 2009 at 10:22 AM, Russell Keith-Magee < freakboy3...@gmail.com> wrote: > > On Thu, Jul 23, 2009 at 2:30 PM, Dr.Hamza Mousa > wrote: > > Hi Russell > > > > The admin templates i copied into /templates/admin/ . > > > > The idea : i need to customize the admin for a project am working on . > > > > -details : > > > > installed django RC 1.1 , ubuntu linux 9.04 . > > > > so i ran : > > > > django-admin.py startproject emr_admin > > > > , python manage.py startapp emr > > > > defined my first model in the emr/models.py > > > > added the django.contrib.admin in emr_admin/settings.py > > > > then ran : python manage.py syncdb > > > > urls.py : > > > > - > > from django.contrib import admin > > admin.autodiscover() > > > > and in : urlpatterns i added the admin urls > > > > > > (r'^admin/', include(ad > > > > min.site.urls)), > > > > > > > > > > > > > > Django admin Template files : > > > > to extend the admin css style i copied the admin template from the django > RC > > 1.1 to /templates/admin/ like base.html , base_site.html , index.html > .. > > > > so now they are in > > > > /templates/admin/ > > I should point out that unless you make a modification to > TEMPLATE_DIRS in your settings file, copying the template files will > have no effect at all. From the point of view of these instructions, > copying the template files is a no op - the admin won't pay any > attention to the files in /templates. > > > > > > > emr/admin.py : > > > > so it all runs so fine , > > To clarify - Are you saying that at this point in the process, the > admin site URLs are displayed correctly? > > > register my app models in emr/admin.py > > I presume you have also put emr into INSTALLED_APPS at some point in > this process? > > > : > > from django.contrib import admin > > from django import forms > > > > from emr_admin.emr.models import * > > > > class PatientForm(forms.ModelForm): > > comment = forms.CharField(widget=forms.Textarea(attrs={'rows':4, > > 'cols':60}),label='Comment',help_text="") > > sex = > forms.CharField(widget=forms.RadioSelect(choices=SEX),label='Sex') > > smoking = > > > forms.CharField(widget=forms.RadioSelect(choices=SMOKING),label='Smoking') > > maritalstatus = > > forms.CharField(widget=forms.RadioSelect(choices=Marital_STATS)) > > > > > > > > class PatientAdmin(admin.ModelAdmin): > >list_display = ( 'name', 'sex','maritalstatus', 'bdate','jobtitle') > >list_display_links = ( 'name', 'sex','maritalstatus', > 'bdate','jobtitle') > >search_fields = ('name', 'jobtitle') > >list_filter = ('jobtitle','sex') > >list_per_page = 25 > >ordering = ['name'] > >form = PatientForm > > > > > > admin.site.register(Patient , PatientAdmin) > > > > > > > > - > > everything working so fine at the admin side , however the only thing is > not > > working is the logout and change password , when i direct the url to the > > change password form and change my password , it redirect me to the wrong > > url as well : > > > > http://localhost:8000/admin/password_change/admin/password_change/done/ > > > > > > thats what happend so far : > > I don't experience any problems when I follow these instructions. I am > shown links to /admin/password_change/ and /admin/logout/; I get > redirected to /admin/password_change/done/ when I change my password. > > The fact that your instructions don't include any reference to > changing TEMPLATE_DIRS leads me suspect that one of three things is > happening: > > 1) You&
Re: Django-admin {{ root_path }} problem !
Hi Russell The admin templates i copied into /templates/admin/ . The idea : i need to customize the admin for a project am working on . -details : installed django RC 1.1 , ubuntu linux 9.04 . so i ran : django-admin.py startproject emr_admin , python manage.py startapp emr defined my first model in the emr/models.py added the django.contrib.admin in emr_admin/settings.py then ran : python manage.py syncdb *urls.py* : - from django.contrib import admin admin.autodiscover() and in : urlpatterns i added the admin urls (r'^admin/', include(ad min.site.urls)), *Django admin Template files :* to extend the admin css style i copied the admin template from the django RC 1.1 to /templates/admin/ like base.html , base_site.html , index.html .. so now they are in /templates/admin/ *emr/admin.py :* *so it all runs so fine , register my app models in emr/admin.py * : from django.contrib import admin from django import forms from emr_admin.emr.models import * class PatientForm(forms.ModelForm): comment = forms.CharField(widget=forms.Textarea(attrs={'rows':4, 'cols':60}),label='Comment',help_text="") sex = forms.CharField(widget=forms.RadioSelect(choices=SEX),label='Sex') smoking = forms.CharField(widget=forms.RadioSelect(choices=SMOKING),label='Smoking') maritalstatus = forms.CharField(widget=forms.RadioSelect(choices=Marital_STATS)) class PatientAdmin(admin.ModelAdmin): list_display = ( 'name', 'sex','maritalstatus', 'bdate','jobtitle') list_display_links = ( 'name', 'sex','maritalstatus', 'bdate','jobtitle') search_fields = ('name', 'jobtitle') list_filter = ('jobtitle','sex') list_per_page = 25 ordering = ['name'] form = PatientForm admin.site.register(Patient , PatientAdmin) - everything working so fine at the admin side , however the only thing is not working is the logout and change password , when i direct the url to the change password form and change my password , it redirect me to the wrong url as well : http://localhost:8000/admin/password_change/admin/password_change/done/ thats what happend so far : best regards Hamza -- thats what i did so far On Thu, Jul 23, 2009 at 8:49 AM, Russell Keith-Magee wrote: > > On Thu, Jul 23, 2009 at 1:42 PM, Dr.Hamza Mousa > wrote: > > do you mean admin templates ?! i think its the template file of the RC ! > > Saying "I think" isn't quite the help we're looking for - are you > using the default admin templates, or not? Have you taken _any_ copies > of the admin templates? When you say you are "customizing" the admin - > what modifications have you made? > > We need _exact_ and _explicit_ instructions for how to reproduce your > problem - i.e., starting with running django-admin.py startproject, > what do I have to do in order to reproduce this problem. It may help > if you start from scratch yourself - start with an empty project, and > then bring over configurations and files from your 'broken' project > until the problem appears. > > Please try to keep in mind that I have many running Django projects, > and _none_ of them are exhibiting the problem you describe. I don't > deny that you are experiencing this problem, but If I'm going to fix > this problem, I need to be able to reproduce it first. > > Yours, > Russ Magee %-) > > > > -- Hamza E.e Mousa www.neoxero.com www.goomedic.com www.medpeek.com www.freewaydesign.com http://www.twitter.com/hamzamusa http://twitter.com/goomedic --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Django-admin {{ root_path }} problem !
do you mean admin templates ?! i think its the template file of the RC ! Thanks Hamza On Thu, Jul 23, 2009 at 8:37 AM, Alex Gaynor wrote: > Did you by any chance copy the text of the old templates, from before the > rc? If so you'll need to update them for thr changes. > > Alex > > On Jul 23, 2009 12:35 AM, "Dr.Hamza Mousa" wrote: > > Hello > > > Thanks Russ for the fast reply , > > The url for the admin is the same as the default : (r'^admin/', > include(admin.site.urls)), > > about trying to fix the issue and override this by adding the absolute url > in " base.html " admin template temporary till i figure out what is causing > this . > > I am trying to customizing the admin for a project am working on now , and > my admin templates files in /templates/admin/ . > didn't add any custom views yet . > > Regards : > > Hamza M > > On Thu, Jul 23, 2009 at 8:13 AM, Russell Keith-Magee < > freakboy3...@gmail.com> wrote: > > > On Thu... > Hamza E.e Mousa > > www.neoxero.com > www.goomedic.com > www.medpeek.com > www.freewaydesign.com > > http://www.twitter.com/hamzamusa > http://twitter.com/goomedic > > > > -- Hamza E.e Mousa www.neoxero.com www.goomedic.com www.medpeek.com www.freewaydesign.com http://www.twitter.com/hamzamusa http://twitter.com/goomedic --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Django-admin {{ root_path }} problem !
Hello Thanks Russ for the fast reply , The url for the admin is the same as the default : (r'^admin/', include(admin.site.urls)), about trying to fix the issue and override this by adding the absolute url in " base.html " admin template temporary till i figure out what is causing this . I am trying to customizing the admin for a project am working on now , and my admin templates files in /templates/admin/ . didn't add any custom views yet . Regards : Hamza M On Thu, Jul 23, 2009 at 8:13 AM, Russell Keith-Magee wrote: > > On Thu, Jul 23, 2009 at 12:57 PM, Hamza wrote: > > > > Hello , > > > > i have an issue in Django-Admin , when i click on logout and change > > password , it add /admin/logout and /admin/change_password/ to the > > current path as in http://localhost:8000/admin/posts/admin/logout/ and > > does the same to password_change . > > > > when trying to manually override this by adding /admin/logout/ and / > > admin/password_change/ it redirect to /admin/password_change/admin/ > > password_change/done/ > > > > How can i fix this issue ?! > > > > am using django RC 1.1 ! > > This sounds like it might be related to the last ticket that was > blocking the v1.1 release - #10061. I was under the impression that > these problems had been solved, but if I'm wrong, this will need to be > corrected before we release v1.1 final. > > However, while you have described the problem you are having, you > haven't provided enough detail for others to reproduce the same > problem. In particular, how have you deployed your admin site? Can you > provide the urls.py, and any configuration of the admin site that you > may have done? When you say "manually override by adding > /admin/logout...", what _exactly_ have you done, and where? > > Yours, > Russ Magee %-) > > > > -- Hamza E.e Mousa www.neoxero.com www.goomedic.com www.medpeek.com www.freewaydesign.com http://www.twitter.com/hamzamusa http://twitter.com/goomedic --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Auto-populate fields in django?
Hello , am wondering , how to auto-populate fields as ( User field , and current datetime filed ) , i follow up those tips , and created a custom manager / and manipulator http://www.b-list.org/weblog/2006/nov/02/django-tips-auto-populated-fields/, though am wondering if there is another way around !!! -- Hamza --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Generic View for create , update and delete !
Thanks a lot André , already tried it , somehow the problem was not in my tries or code , but in the server , its somehow stuck at certain pages . so i could not see the effects . Also now the post_save_redirect and post_delete_redirect don't redirect me to the specific page i assigned :( also how can replace the delete confirm page with JavaScript alert confirmation message ?! On Sun, Mar 29, 2009 at 4:10 AM, André Santos wrote: > > Try this one: > > http://www.b-list.org/weblog/2006/nov/16/django-tips-get-most-out-generic-views/ > > 2009/3/28 Hamza : > > > > Hello , > > > > am trying to use Generic view instead of using the old view way , > > however am a django newbie , i tried several tutorials , documentation > > and non seems works with me yet . can anyone point me an example > > ( full working good example ) of using generic view > > > > Regards > > > > > > > > > > > -- > André Santos Teixeira de Carvalho > Graduando em Ciência da Computação - DCC/UFRJ > > > > -- Hamza E.e Mousa www.neoxero.com www.goomedic.com www.medpeek.com www.freewaydesign.com http://www.twitter.com/hamzamusa http://twitter.com/goomedic --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Installing Django
You need to define " Environment Variables " parameter in windows , In User Variable : PATH : C:\Python26\Lib\site-packages\django\bin ( add the path to your django binary directory ) . - and also in System Variable , make sure you have the Python path as well On Sat, Mar 28, 2009 at 10:22 PM, Dougal Matthews wrote: > > Your not giving us anything to go on here. How far do you get? do you > get any errors? > > I am assuming you followed the very detailed instructions here; > http://docs.djangoproject.com/en/dev/topics/install/#topics-install > > Dougal > > > --- > Dougal Matthews - @d0ugal > http://www.dougalmatthews.com/ > > > > > 2009/3/28 stars : > > > > I'm totally new at Python and Django and I'm having trouble with the > > installation. I'm running windows vista and I have downloaded pyhton > > 2.6. So basically, I went through the install directions a millon > > times, and nothing worked.. > > > > I need someone to walk me through it, step by step so I know exactly > > what I'm doing. > > > > thanks! > > > > > > > > > > > -- Hamza E.e Mousa www.neoxero.com www.goomedic.com www.medpeek.com www.freewaydesign.com http://www.twitter.com/hamzamusa http://twitter.com/goomedic --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---