Django deployment

2018-03-24 Thread Goran Radanovic
erver. Do the environments have to be the same in development and production? Is it possible to develop locally with f.ex SQLite and then deploy to the server that runs Postgres? I don't know if I'm totally out of bounds here, please help me understand deployment. Regards Goran -

SQL query to authenticate user from non-django app

2014-04-28 Thread Goran Mekic
Hi, I have a Django project with its DB. How can I use Django DB users to auth, for example, vsftpd? I mean, I couldn't find suitable SQL query to check the password. Thank you! signature.asc Description: Digital signature

Re: How to store position of current/active navigation entry

2013-08-04 Thread Goran
There is no usual way to do this because you can have anything behind menu item. So here is what I do in the same situations. Let say that we have some categories listed in your navi. Every category must have unique ID so in navi view pass some variable with that ID for example "foo = entry.pk"

Re: [Errno 13] Permission denied: '.cache' - where is the directory I need to change permission

2013-08-04 Thread Goran
>From my opinion you as user don't have appropriated permissions. Ask from your server administrator to upgrade your permissions. You will have the same problem later when django apps try to create folders to store images or something other but it depend from your installed apps. On Saturday,

Re: forloop breaking

2013-06-26 Thread Goran
You can always use IF for foo in bar: if foo == 1: do something even redirect else: foo On Wednesday, June 26, 2013 5:09:58 PM UTC+2, Harjot Mann wrote: > > What are the methods to break forloop? > -- You received this message because you are subscribe

Re: How i can get real value of ForeingKey?

2013-06-26 Thread Goran
It's because class A doesn't have unicode defined, so by default primary key is used to present objects of the class A. Create unicode function and return any field you need. class A (models.Model): field1 = models.CharField (max_length = 10) def __unicode__(self): return sel

Re: Count the number of drawings each artist has?

2013-06-22 Thread Goran
Just add related name to the artist field in the Drawinds model artist = models.ForeignKey(Artist, related_name='drawings') Then you can use X.drawings.count() when is needed. It also works in the template, Let say that you have list with some artists named 'foo' so in the template you can coun

Re: embedding an HTML file.

2013-06-22 Thread Goran
Try to use "safe" filter in which case table will be interpreted as HTML {{ dftable|safe }} or as second solution, call dftable.allow_tags=True in the view. On Saturday, June 22, 2013 9:35:01 AM UTC+2, Nigel Legg wrote: > > I want to allow users to upload a file and then view the data from it.

Re: Delete after specific date

2011-08-29 Thread Goran
Thanks Bill, seems that cron is the easiest way even if I don't like it. I was looking for more pythonic way. Anyway thanks for reply. Goran On Aug 29, 7:26 pm, Bill Freeman wrote: > Presuming deleted sometime on the day is close enough, write a > management command that querie

Re: Error was: No module named io

2011-08-28 Thread Goran
maybe it is path problem, try to use: from projectname.base.view import io not base.view import io in INSTALLED_APPS use: 'projectname.base', not just 'base', hope it helps, Goran On Aug 28, 2:59 am, CrabbyPete wrote: > I developed my code with python 2.6 and dj

Delete after specific date

2011-08-28 Thread Goran
I have model with DateTimeField where I store date when object will be deleted. class Something(models.Model): ... end_date = models.DateTimeField(editable=False, blank=True, null=True) after some request my app store future date in that field using: something.end_date = datetime.dat

Re: home page menu view variables cross every view?

2010-09-11 Thread Goran
Works great! Thank you very much! Goran On Sep 8, 3:51 pm, bagheera wrote: > Dnia 08-09-2010 o 15:41:13 Goran napisał(a): > > > > > Thanks for your help but I think that understand how template works. > > My menu is drop down menu with menu items which comes from vari

Re: home page menu view variables cross every view?

2010-09-08 Thread Goran
Thanks for your help but I think that understand how template works. My menu is drop down menu with menu items which comes from variable {{ for menuitem in myvariable }} {{ menuitem.title }} {{ endfor }} and myvariable is in my view: myvariable = Item.objects.all() So if I extend base.html menu i

home page menu view variables cross every view?

2010-09-07 Thread Goran
I'm Django novice and I want to have some menu (top menu) which have some dynamically populated items. So inside home page view I have some variables to get these menu items. But because it's top menu I need it on every page on the site and i have about 20 views. So I'm place these variables ( db

third party application with Django

2010-09-03 Thread Goran
I need to install some php application (forum) in some folder domain/ forum How can I do this? Django 1.2 Appache with FastCgi, shared hosting. Is it possible to exclude url "domain/forum" from django somehow? -- You received this message because you are subscribed to the Google Groups "Django u

Re: Overriding flatpages class meta

2010-08-31 Thread Goran
Thanks Owen but is doesn't work. The similar Error message: contribute_to_class if self.meta: AttributeError: 'Options' object has no attribute 'meta' On Aug 30, 8:03 pm, Owen Nelson wrote: > Sorry to be guessing here, but I was looking at something similar recently. > My attempt (untested a

Re: prepopulated_fields do not work at all Django 1.2

2010-08-30 Thread Goran
Finally problem is fixed. In the admin/media/js was been files from Django 1.1 after uplod 1.2 files everything works as expected. On Aug 30, 6:52 pm, Goran wrote: > I agree with you but it is the situation. I didn't know Django version > on the production server (shared) befor

Re: Overriding flatpages class meta

2010-08-30 Thread Goran
I was try class Meta(FlatPage.Meta): but when runserver there is following error: AttributeError: type object 'FlatPage' has no attribute 'Meta' any other solution to try? Thanks On Aug 30, 12:53 am, Steve Holden wrote: > On 8/29/2010 6:51 PM, Goran wrote: >

Re: prepopulated_fields do not work at all Django 1.2

2010-08-30 Thread Goran
Django and any third-part app - at > least you'd have a chance to find out what happens when something goes > wrong. > > On 29 août, 23:58, Goran wrote: > > > I have strange problem, on my development server everything is fine > > but I'm use Dja

Re: Overriding flatpages class meta

2010-08-29 Thread Goran
Holden wrote: > On 8/25/2010 8:26 PM, Goran wrote:> I need another verbose_name_plural for > Flat pages so i need to > > overrideclassmetafor it right? How can I do that? > > [Caveat: this is a guess from general Python knowledge] > > Have you tried creating a sub

prepopulated_fields do not work at all Django 1.2

2010-08-29 Thread Goran
I have strange problem, on my development server everything is fine but I'm use Django 1.1 but on the production server (Django 1.2) prepopulated_fields don't work. Does anyone have the same problem? Any suggestion? class UniverzitetAdmin(admin.ModelAdmin): prepopulated_fields = {"url": ("nazi

Overriding flatpages class meta

2010-08-25 Thread Goran
I need another verbose_name_plural for Flat pages so i need to override class meta for it right? How can I do that? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscrib

Extract ForeignKey value from QuerySet

2010-08-22 Thread Goran
I'm Django novice and trying to get some search page. I'm lost almost all day trying to extract ForeignKey value from my QuerySet without success. Have city name which is ForeignKey in MyModel and I always get result = []. Here is my last view. from django.db.models import Q from django.shortcuts

Re: submit form to the db table with ForeignKey value

2010-05-22 Thread Goran
> Are you talking about: > # in your template >           {{ reg }} > > Does works for you? > > ~Rolando > Yes! It works! Thank you very much Rolando -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us

submit form to the db table with ForeignKey value

2010-05-21 Thread Goran
Hi, I'm novice with django and I use simple form with select option method. Options come from db and it works fine. When user submit form i have selected option as string and can not save it to db because this table is models.ForeighKey(AnotherTable) and I need ID of selected option to pass it to

Re: Model Formsets.save(commit=False) behaviour

2009-05-10 Thread goran
t appears to be working properly! I looked into it and it could have had to do with this ticket: http://code.djangoproject.com/ticket/10750 which was recently fixed. Thanks again for your help Goran On May 10, 4:58 pm, Margie wrote: > I've used that a lot and never had a problem. >