set current user value in Django admin for Foreign Key

2014-12-10 Thread Akshay Mukadam
Hi, I just want to show the current logged in user in for foreign key in Django admin. Following are the approach used buy me: 1-> def formfield_for_foreignkey(self, db_field, request, **kwargs): if db_field.name == "user": "set the current user as a default value for drop dow

I can't syncdb via django_pyodbc of Django.

2014-12-10 Thread Sugita Shinsuke
Hi there. Could you tell me a good way to use Django with Micro Soft DB SQL server. I tried django_pyodbc. Any suggestion is appreciated. my PC of Environment is below. Database: SQL Server 2014 Express OS: Windows 7 Home Premium SP1 I used the django module, django_pyodbc. And, I tried to

unable to create translation files

2014-12-10 Thread gerard
hello all, i'm using Django 1.4 LTS, and try to add localisation to my project. According the doc: https://docs.djangoproject.com/en/1.4/topics/i18n/translation/#localization-how-to-create-language-files i have to do: django-admin.py makemessages --all i did it and have the error: django-admin.

Re: set current user value in Django admin for Foreign Key

2014-12-10 Thread Vijay Khemlani
Hmmm... why are you showing the user field in the first place? I would exclude it from the form and set it programatically after the user as submitted the form. On Wed, Dec 10, 2014 at 5:38 AM, Akshay Mukadam wrote: > Hi, > I just want to show the current logged in user in for foreign key in > D

Re: modelformst save

2014-12-10 Thread Collin Anderson
Hi, This might be a complicated enough case where a functional view might help make things more clear what's going on. Collin On Friday, December 5, 2014 8:22:07 PM UTC-5, Brad Rice wrote: > > For the life of me I can't figure out how to use a modelformset with class > view. I get it to displ

Re: django, multi-tenancy and urls

2014-12-10 Thread Collin Anderson
Hi, Are you using nginx or apache? The especially tricky part about this is handling the local-machine case. Collin On Friday, December 5, 2014 6:10:36 AM UTC-5, vijay shanker wrote: > > am writing a e-commerce application where different people can have > stores with urls like this: www.stor

Re: Changes to Model does not migrate to sqlite with Django 1.7?

2014-12-10 Thread Collin Anderson
Hi, Storing your files in dropbox _should_ be fine, unless it's a problem with *.pyc or __pycache__ files. Collin On Tuesday, December 9, 2014 2:38:31 PM UTC-5, Tobias Dacoir wrote: > > Hi, > > I'm afraid I don't have them. Apparently after deleting my database file > and then just running man

Re: unable to create translation files

2014-12-10 Thread Tom Evans
On Wed, Dec 10, 2014 at 9:57 AM, gerard wrote: > hello all, > > i'm using Django 1.4 LTS, and try to add localisation to my project. > According the doc: > https://docs.djangoproject.com/en/1.4/topics/i18n/translation/#localization-how-to-create-language-files > > i have to do: > django-admin.py m

Re: unable to create translation files

2014-12-10 Thread gerard
Le 10/12/2014 16:02, Tom Evans a écrit : "python manage.py makemessages --settings=agenda.settings" I suspect the difference is between running manage.py and running django-admin.py - manage.py might add the directory containing it to sys.path. you're right: $ python manage.py makemessages -

Django-compressor manifest.json problem on Heroku

2014-12-10 Thread Guy Tamir
Hey all, I'm trying to add django-compressor into my app. I'm deploying to Heroku. This is the code in my Settings file AWS_QUERYSTRING_AUTH = False AWS_STORAGE_BUCKET_NAME = os.environ.get('BUCKET_NAME') conn = S3Connection(AWS_ACCESS_KEY, AWS_SECRET_KEY,host= "s3-us-west-1.amazonaws.com") STAT

Re: Advice on creating an SFTP frontend in Django

2014-12-10 Thread Raj Kairam
Please stop sending these emails to my gmail account On Tue, Dec 9, 2014 at 1:07 PM, Андрей Максимов wrote: > Hi Paul. > I hope you moved to your final goal. Now before me there is the same > objective is to make a simple Client Area that allows the downloading of > files hosted on SFTP. > Unfor

PostGis, GeoDjango. How to install a updated version?

2014-12-10 Thread Bruno Messias
Someone managed to install postgis 2.4 and gdal 1:11 on a Ubuntu distribution 14. I followed several tutorials. I fixed many errors, but the only thing I can do is instal an older postgis, 2.0.3 (2009) version. Atualmente, I'm deploying a project that needs of postgis. -- You received this m

Django and SSL

2014-12-10 Thread pythonista
I am getting a request from the security infrastructure and I could use some advice/recommendation. This is a 3 tier application. Apache/Django/Sql Server Apache is https and there is a proxy server between. The security team is saying that the communication from Django should also be ssl enc

Re: I can't syncdb via django_pyodbc of Django.

2014-12-10 Thread pythonista
I can actually help you here. I had the same problem and tried 4 different modules. The only module that works with sql server is https://github.com/michiya/django-pyodbc-azure I am running it both on windows and linux, simultaneously. The settings components are displayed on the web site.

Re: Django and SSL

2014-12-10 Thread Brian Schott
Hopefully you aren’t using Django runserver command for actually running Django. This is really a configuration question relating to your WSGI application server. Gunicorn is popular and supports SSL. http://gunicorn-docs.readthedocs.org/en/latest/settings.html#ssl

Re: Django and SSL

2014-12-10 Thread pythonista
Is there a need for ssl if apache (https) and a proxy are between django and the outside world. Doesn't the apache server/proxy provide a sufficient layer of security. isn't it true that the data is being served through the server securely via https? Thanks On Wednesday, December 10, 2014 11:5

Re: Django and SSL

2014-12-10 Thread Javier Guerra Giraldez
On Wed, Dec 10, 2014 at 1:22 PM, pythonista wrote: > Is there a need for ssl if apache (https) and a proxy are between django and > the outside world. if they're serving Django with apache, they should be using mod_wsgi, in that case not only there's no more needs for SSL, there's no space for S

Re: Seeking for advise on usage MySQL together with MongoDB

2014-12-10 Thread Artie
I would like to thank you a lot for so detailed answers, actually I didn't expect to get so much information on my question. That really great and inspiring. So thank you very much again. Guess now I need to start learning PostgreSQL, cause that is not first time when I hear that Python and Post

Re: Seeking for advise on usage MySQL together with MongoDB

2014-12-10 Thread Artie
Can you please advise why actually you hate Django ORM and what should be considered instead of it? суббота, 6 декабря 2014 г., 23:18:06 UTC+2 пользователь Cal Leeming написал: > > Hi Artie, > > First, I would strongly recommend reading some of the work by David Mytton > at Server Density, he an

Re: Seeking for advise on usage MySQL together with MongoDB

2014-12-10 Thread Cal Leeming
If you're using Django, then there isn't really an alternative, as it's really a key selling point of Django. Some people recommend SQLAlchemy, but I dislike that even more for it's over-engineered complexity. Peewee [1] shows some good potential, but I haven't tried it for myself yet. As for wh

Re: I can't syncdb via django_pyodbc of Django.

2014-12-10 Thread Sugita Shinsuke
Hello pythonista, Thank you for replying. I tried django-pyodbc-azure But syncdb didn't run yet. As the website says, since I use Django 1.6.4, I installed django-pyodbc-azure as "pip install "django-pyodbc-azure<1.2"" I checked the odbc driver by Control Panel > Administrative Tools > Data S

Adding annotations to raw sql

2014-12-10 Thread Ruslan Batukaev
Suppose I have the following SQL query: SELECT a.id, ct, 1 as one FROM article a LEFT JOIN ( SELECT article_id, count(distinct(tag)) AS ct FROM article_tag WHERE tag IN ('football', 'tennis', 'django', 'mma') GROUP BY article_id ORDER BY ct

fdv

2014-12-10 Thread Kadhir Mani
what purpose using admin.py -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to djang

Re: I can't syncdb via django_pyodbc of Django.

2014-12-10 Thread Sugita Shinsuke
I use SQL Server Japanese edition. So, I also wrote Japanese error message here. django.db.utils.ProgrammingError: ('42000', '[42000] [Microsoft][ODBC SQL Server Driver][SQL Server]このログインで要求されたデータベース "db_test" を開けません。ログインに失敗しました。 (4060) (SQLDriverConnect); [01S00] [Microsoft][ODBC SQL Server Dri

Re: Adding annotations to raw sql

2014-12-10 Thread john
should that be "t.ct" Johnf On 12/10/2014 03:23 PM, Ruslan Batukaev wrote: Suppose I have the following SQL query: SELECT a.id, ct, 1 as one FROM article a LEFT JOIN ( SELECT article_id, count(distinct(tag)) AS ct FROM article_tag WHERE tag IN ('football', 'te