Re: DatabaseRouter, add on runtime add new items to db.connections

2020-09-15 Thread Anton Melser
There appear to be relatively few references to this sort of thing peppered 
about the net, like this ancient stackoverflow 
post 
https://stackoverflow.com/questions/6585373/django-multiple-and-dynamic-databases,
 
the below email, or the now long abandoned db router mentioned below. 

Is there a "why this is completely unsupported and we won't answer any 
questions about it" post from one of the Django Masters somewhere? I also 
really want to do this... (actually am doing it but the dynamic dbs aren't 
managed by django, and I would really like them to be...). If it is a 
reasonable thing to do, is there some place with good advice on how to go 
about it? Thanks!

Le jeudi 23 février 2017 à 19:58:53 UTC+8, Matthieu Guffroy a écrit :

> Hello,
>
> We are using in our system for more than 2 years now, a specific 
> DatabaseRouter allowing us to use multiple databases depending on which 
> clients is connecting.
> It appears now, that the databases lists start to be really big, and that 
> it becomes bad to be forced to re-deploy our backend to add a new database 
> in the settings.
>
> So we add the configurations in a specific database, and add to our 
> middleware that was previously just setting the database to use in function 
> of the request, the ability to load dynamically new database configurations.
> With a function like this :
>
> from django.db import connections
> def add_db_connection(system_id, name, user, password, host, protocol):
> connections.databases[system_id] = {
> 'ENGINE': 'django.db.backends.' + protocol,
> 'NAME': name,
> 'USER': user,
> 'PASSWORD': password,
> 'HOST': host,
> 'CONN_MAX_AGE': 0
> }
>
> It appears we don't seams to be firsts to edit dynamically this, as it is 
> also the way works this extension : 
> https://github.com/ambitioninc/django-dynamic-db-router
>
> But before we put our new code in production, as we doesn't have found 
> some clear indication about if we can or if we cannot edit 
> django.db.connections in the documentation. We will be more confident, if 
> someone involved in django development can give us it's feedback about this 
> way of making things and if it's the recommended way ? or if their is a 
> better way ?
>
> Thanks a lot, for all you feedback,
>
> Matthieu
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b9f60727-30ae-4844-88e1-e4e030060c5bn%40googlegroups.com.


Re: Django Uploaded images not displayed in production

2020-06-21 Thread Anton Nyagolov
So guys I have found the problem. My Nginx server was only serving static 
files but not media ones, I have probably forgot about it. 
My Nginx settings were: 
The only thing I had to do is add a location for the media folder:


@MUGOYA DIHFAHSIH
At the begging of setting the server I also used apache2, it was pain in 
the ass and I switched to Nguix and Gunicorn. Setting the server over 
apache took me like 60-70 steps. With Nguix and Gunicorn it takes only 20 
steps, for 15 min you are all set up.
Watch this video and follow the guy: How to Deploy Python-Django serveer in 
20 min 

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/343c056c-cd83-4ce2-a898-ecf21ef0165fo%40googlegroups.com.


Re: Django Uploaded images not displayed in production

2020-06-21 Thread Anton Nyagolov
Thanks I will check out the group too for future reference and etc. Those 
images are uploaded to a database and are part of a model. I iterate 
through all the object and for each object I print some information 
including the images, therefore I cannot specify only one specific image. I 
use admin so I can add my (new future) projects and only by admin they 
should be able to display automatically on my website with all the 
information and structure required. 
Do you sugest changing the value of the imageField 
(upload_to="static//my_desired_path) ? 

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d4758123-f506-401b-b488-c3f17385d9fco%40googlegroups.com.


Django Uploaded images not displayed in production

2020-06-21 Thread Anton Nyagolov
Hello everyone, I just discovered this group through Google.I couldn't get 
any help on stack overflow and hopefully someone here can help. 

I have deployed a Django App on a Ubuntu server for the first time using 
Nginx and gunicorn. 
Before deployment, I used port 8000 to test if everything runs as it is 
supposed to and all was fine. Since I allowed 'Nginx Full' my database 
images are not showing up. 

This is my django project structure:



My virtual environment folder and my main project folder are both in the 
same directory. I have separated them. 

```python
# Create your models here.
class Project(models.Model):
project_name = models.CharField(max_length=120)
project_description = models.CharField(max_length=400)
project_link = models.CharField(max_length=500)
project_image = models.ImageField(upload_to='')

def __str__(self):
return self.project_name
``` 
I have set up my settings.py to :
```python
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static')


MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(os.path.dirname(__file__), '..', 
'media').replace('\\','/')
```

My view gets all the project object from a database and passes those to the 
template. The template renders successfully all other information related 
to project model except the image field . In my template I do: 
```html 
 

{% for project in projects %}
{% if forloop.counter|mod:2 == 0 %}

  {% else %}
  
{% endif %}



  {{ project.project_name }}
  {{ 
project.project_description}}
  Link


  

  {% if forloop.counter|mod:2 == 0 %}
  
  {% endif %}
  {% endfor%}

  
```
Uploading the images works, it sends them in the project's media directory, 
the problem is that they are not showing up, the alt="" is activated. 


My main urls.py: 
```python
urlpatterns = [
 path('', include('project.urls')),
path('admin/', admin.site.urls),
]  + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
```
The gunicorn system file:
```

[Unit]
Description=gunicorn daemon
After=network.target

[Service]
User=myusername
Group=www-data
WorkingDirectory=/home/myusername/myproject
ExecStart=/home/myusername/venv/bin/gunicorn --access-logfile - --workers 3 
--bind unix:/home/myusername/myproject/myproject.sock 
myproject.wsgi:application

[Install]
WantedBy=multi-user.target

```
Nginx setup:
```
  server {
listen 80;
server_name  ;
location = /favicon.ico { access_log off; log_not_found off; }
location /static/ {
root /home/myusername/myproject;
}
location / {
include proxy_params;
proxy_pass 
http://unix:/home/myusername/myproject/myproject.sock;
}
}
```


EDIT: When inspecting the image element of the webpage the source of the 
image it is "/media/imageNmae.png". 
Any help would be appreciated!

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/635fcf7e-6e53-425d-aad1-8638fef425c1o%40googlegroups.com.


Best option for wrapping a wsgi app

2019-02-19 Thread Anton Melser
Hi,

I searched high and low but my Google-foo must be lacking. I want to wrap a
wsgi app (https://github.com/tsudoko/anki-sync-server) and serve it under
my Django site. After wasting large amounts of time working around this
thinking it wasn't possible, I stumbled across
https://github.com/2degrees/django-wsgi, which does the trick nicely (at
least it appears to for what I need, though I have only tested locally).
Unfortunately, the last commit was 3-4 years ago, and it doesn't support
Django 1.10+ (is_authenticated() vs is_authenticated). I have submitted a
PR and am currently using a fork but the project appears completely dead.

What are other people using, if anything?

Cheers,
Anton
-- 
echo '16i[q]sa[ln0=aln100%Pln100/snlbx]sbA0D4D465452snlbxq' | dc
This will help you for 99.9% of your problems ...

-- 
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 django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAKywjPrsXNN1ve8PFYr9M%2BpbTHqA4T2xuwPAm%3DmJR13trp2meQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Messages rejected?

2019-02-13 Thread Anton Melser
Thanks for the reply. I thought there might be a moderation queue (I never
made it as far as the dedicate list docs). I would be quite interested in
finding out what was inappropriate about my first attempt at posting and
what changed so that my second attempt (with a different email) was
acceptable. I would like to make sure any future questions I post to the
list are in the right form. Is that possible somehow, do you know?

Thanks.

On Thu, 14 Feb 2019 at 02:38, Tim Graham  wrote:

> Messages from first time posters go through a moderation queue.
>
> On Tuesday, February 12, 2019 at 9:56:26 PM UTC-5, Anton Melser wrote:
>>
>> Hi,
>> I asked a question last night with a Google for business account and had
>> the message bounce - is that normal?
>>
>> Google also hasn't kept the message anywhere so it's completely lost :(.
>>
>> Anton
>>
>> ps. Also posted to see whether this will also bounce...
>>
> --
> 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 django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/2121f6d2-a61c-40e1-97e8-40591b6a7046%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/2121f6d2-a61c-40e1-97e8-40591b6a7046%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
echo '16i[q]sa[ln0=aln100%Pln100/snlbx]sbA0D4D465452snlbxq' | dc
This will help you for 99.9% of your problems ...

-- 
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 django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAKywjPrgiH6U7siMCwCFEMqA-vvQEjXrbmd4v2JJLmyD_KXRug%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Keeping/accessing the data Django generates during a test run

2019-02-13 Thread Anton Melser
>
> When you use django unittests commit is made as no-op. Use --keepdb and at
> the end of your tests run SQL commit against your database cursor
> connection.
>

Awesome, exactly the info I was missing. Thanks for your help.
Cheers,
Anton

-- 
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 django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAKywjPpYWa3D9KvB%3DzYoas_UNKgHxk%3DY4vJqeAGnjLE65Kq0Gg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Keeping/accessing the data Django generates during a test run

2019-02-12 Thread Anton Melser
Hi,

I can't work out whether it is expected or whether I am missing something. 
I would like to keep the DB data that I generate during a test run to 
inspect/persist it. --keepdb means I have empty tables at the end, 
strangely even if I ctrl-C a test run. It would also be logical for test 
data to get cleaned... Is there an option I can add to keep it?

I have a lot of calls to external services that should be mocked. The json 
returned from these calls is put in the DB as-is, so if I can just set up 
an initial run of the tests and then get the data from the DB that would be 
optimal. I could add file writes about the place to persist, but I want to 
evolve the test data over time and will need to do this often, so being 
able to do that from the DB would be very handy.

Any pointers?

Thanks,
Anton

-- 
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 django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f9d2dfe3-c832-45bd-a6d3-7f3415f1293d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Messages rejected?

2019-02-12 Thread Anton Melser
Hi,
I asked a question last night with a Google for business account and had 
the message bounce - is that normal? 

Google also hasn't kept the message anywhere so it's completely lost :(.

Anton

ps. Also posted to see whether this will also bounce...

-- 
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 django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/92d7059a-e711-45e0-9b06-053840b40991%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How to operate with two models in one view

2018-05-15 Thread Anton Smirnov


There are two models "Sensors" with information about them and 
"Measurments" .

class Sensor(models.Model):
date_start = models.DateField()
Latitude =  models.DecimalField(max_digits=18, decimal_places=15)
Longitude = models.DecimalField(max_digits=18, decimal_places=15)

def __str__(self):
return 'id:%s / %s' % (self.id, self.date_start)
class Measurment(models.Model):
sens = models.ForeignKey(Sensor, on_delete=models.PROTECT)
time_of_measurment = models.DateTimeField()
humidity = models.PositiveSmallIntegerField()
temperature1 = models.DecimalField(max_digits=5, decimal_places=2)
temperature2 = models.DecimalField(max_digits=5, decimal_places=2)
temperature3 = models.DecimalField(max_digits=5, decimal_places=2)

def __str__(self):
return 'sens_id:%s, time:%s' % (self.sens.id, self.time_of_measurment)

>From each sensor I serially recive measurments. On the page, it is 
necessary to display the sensor data and the latest measurement data from 
the "Measurments" model corresponding for each sensor.

for displaying data about sensor I used ListView:

view:

from .models import Sensor, Measurmentclass SenorsListView(generic.ListView):
model = Sensor, Measurment
context_object_name = 'sensors_list'
template_name = 'sensors_list.html'
queryset = Sensor.objects.all().order_by('-date_start')

template "sensors_list.html":

{% extends "base_generic.html" %}{% block content %}
Sensors List
{% if sensors_list %}

  
ID sens
Date of install
Latitude
Longitude
Data from last measurments
  
  {% for sensor in sensors_list %}
  
{{sensor.id}}
{{sensor.date_start}}
   {{sensor.Latitude}}
{{sensor.Longitude}}
{{}}
  
  {% endfor %}

{% else %}
  There are no sensors in the DB.
{% endif %} {% endblock %}

But dont know How to display data about last measurments. I think need 
using aggregate to calculate max of time_of_measurment for each id_sens.

How it can be done?

-- 
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 django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/9250b3a0-eab8-4259-8cf6-00fb17975b18%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How to operate with two models in one view?

2018-05-15 Thread Anton Smirnov


I have two models: "Sensors" with information about its and "Measurments" .

class Sensor(models.Model):
date_start = models.DateField()
Latitude =  models.DecimalField(max_digits=18, decimal_places=15)
Longitude = models.DecimalField(max_digits=18, decimal_places=15)

def __str__(self):
return 'id:%s / %s' % (self.id, self.date_start)
class Measurment(models.Model):
sens = models.ForeignKey(Sensor, on_delete=models.PROTECT)
time_of_measurment = models.DateTimeField()
humidity = models.PositiveSmallIntegerField()
temperature1 = models.DecimalField(max_digits=5, decimal_places=2)
temperature2 = models.DecimalField(max_digits=5, decimal_places=2)
temperature3 = models.DecimalField(max_digits=5, decimal_places=2)

def __str__(self):
return 'sens_id:%s, time:%s' % (self.sens.id, self.time_of_measurment)

>From each sensor I serially recive measurments. On the page, it is 
necessary to display the sensor data and the one latest measurement data 
from the "Measurments" model corresponding for each sensor.

for displaying sensors data I used ListView:

view:

from .models import Sensor, Measurmentclass SenorsListView(generic.ListView):
model = Sensor, Measurment
context_object_name = 'sensors_list'
template_name = 'sensors_list.html'
queryset = Sensor.objects.all().order_by('-date_start')

template "sensors_list.html":

{% extends "base_generic.html" %}{% block content %}
Sensors List
{% if sensors_list %}

  
ID sens
Date of install
Latitude
Longitude
Data from last measurments
  
  {% for sensor in sensors_list %}
  
{{sensor.id}}
{{sensor.date_start}}
   {{sensor.Latitude}}
{{sensor.Longitude}}
{{}}
  
  {% endfor %}

{% else %}
  There are no sensors in the DB.
{% endif %} {% endblock %}

But dont know How to display data about last measurments. I think need 
using aggregate to calculate last_time how Max(time_of_measurment) for each 
id_sens. And then get it whith filter(sens=id_sens, time_of_measurment = 
last_time )

How it can be done right?

-- 
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 django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/75f85eb9-0a7d-45cf-b50d-00add6a8cf51%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Displaying single-line progress while a management command runs

2017-04-29 Thread Anton Samarchyan
> Makes it easy to display a command line progress bar but, again, I end up 
with loads of progress bars displaying in my test output, and I assume 
it'll do the same when scheduling the task to run 

You can try a module I made to avoid this particular issue in django 
management command - https://pypi.python.org/pypi/django-tqdm 

On Monday, May 23, 2016 at 6:45:41 AM UTC-4, Phil Gyford wrote:
>
> Belated thanks for this Erik - that does work nicely. It gets 
> complicated/annoying trying to untangle other kinds of logging too, 
> including logging from third-party modules, but that's a separate problem :)
>
> On 9 May 2016 at 21:33, Erik Cederstrand  > wrote:
>
>>
>> > Den 9. maj 2016 kl. 14.23 skrev Phil Gyford > >:
>> >
>> > I have a custom management command which calls a method in another 
>> class, which fetches lots of data from a third-party API. Fetching the data 
>> could take a few seconds or it could take over an hour, depending on the 
>> quantity.
>> >
>> > [...]
>> > Things I've tried so far:
>> >
>> > 1) Using print(), e.g.:
>> >
>> > print('Fetched %d of %d' % (n, total), end='\r')
>> >
>> > In a loop, this nicely shows a single line that constantly updates with 
>> progress. But print() is nasty and when I run my unit tests, this output is 
>> displayed among the testing output. I assume it'll also be a pain to have 
>> that output when running the commands scheduled with cron (or whatever).
>>
>> I do this kind of progress reporting a lot. Usually, I get around the 
>> test/cron output pollution by adding a 'silent' argument to the management 
>> command which determines if the commend should print progress reports or 
>> not. See below.
>>
>> > 2) Using Django logging. This is "better" than print(), and doesn't 
>> mess up test output, but as far as I can tell there's no way to display a 
>> single, constantly updated, line showing progress. It's only going to show 
>> one line after another:
>> >
>> > Fetched 1 of 3000
>> > Fetched 2 of 3000
>> > Fetched 3 of 3000
>>
>> It's actually quite simple. You need to create a custom handler like so:
>>
>>   import logging
>>   import time
>>   from django.core.management.base import BaseCommand
>>
>>   class OverwriteHandler(logging.StreamHandler):
>>   # The extra spaces wipe previous output in case your messages are 
>> wariable-width
>>   terminator = ' '*80 + '\r'
>>
>>   log = logging.getLogger('')
>>   h = OverwriteHandler()
>>   log.addHandler(h)
>>
>>   class Command(BaseCommand):
>> def handle(self, silent=False, **options):
>>   log.setLevel(logging.DEBUG if silent else logging.INFO)
>>   log.info('1 of 2')
>>   time.sleep(1)
>>   log.info('2 of 2')
>>   time.sleep(1)
>>
>> If you want to mix normal and progress logging in your management 
>> command, you need to use two loggers with different handlers.
>>
>> Erik
>>
>> --
>> 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...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/463A7786-888C-4CB0-9C68-43F855401924%40cederstrand.dk
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> http://www.gyford.com/
>

-- 
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 django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f884503b-6567-45f4-b8c1-5a1a5387453a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to add\get data in admin via reversed relation using GenericTabularInline?

2016-10-14 Thread Anton Ponomarenko
If anyone needs to get dropdown list with selected object, instead of 
content_type and object_id fields, the solution is here 
.

-- 
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 django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/37a2b4a9-1092-4df6-85c8-d086e08df7d5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to replace content_type and object_id fields by a field with actual object in admin inline?

2016-10-14 Thread Anton Ponomarenko


Found solution.


Add form to admin.TabularInline:

class CriteriaPlacesInlineAdmin(admin.TabularInline):
model = PlacesToCriterias
form = CriteriaPlacesChoicesFieldForm  # <- ADDED FORM
class CriteriasAdmin(admin.ModelAdmin):
inlines = [CriteriaPlacesInlineAdmin]

admin.site.register(Criterias, CriteriasAdmin)


Form:

class CriteriaPlacesChoicesFieldForm(forms.ModelForm):
ct_place_type = ContentType.objects.get_for_model(PlaceTypesGroups)

object_id = forms.ModelChoiceField(PlaceTypesGroups.objects.all(), 
label='places')
content_type = forms.ModelChoiceField(ContentType.objects.all(), 
initial=ct_place_type, widget=forms.HiddenInput())

def clean_object_id(self):
return self.cleaned_data['object_id'].pk

def clean_content_type(self):
return self.ct_place_type

-- 
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 django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d6dd8a54-07f2-45b6-89bc-e92b1c56%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How to replace content_type and object_id fields by a field with actual object in admin inline?

2016-10-14 Thread Anton Ponomarenko


I have inline, which shows data of contenttype model, so instead of real 
objects, I see content_type and object_id fields. I can exclude these 
fields - this is not a problem, but also I want to get real current object 
as selected with other Places in a dropdown list. Could anyone tell me, how 
can I do this?


Model:

class Criterias(models.Model):
name = ...
class Places(models.Model):
name = ...
class PlacesToCriterias(models.Model):
content_type = models.ForeignKey(ContentType, on_delete=models.CASCADE)
object_id = models.PositiveIntegerField()
content_object = GenericForeignKey()

criteria_group = models.ForeignKey(Criterias)

Admin:

class CriteriaPlacesInlineAdmin(admin.TabularInline):
model = PlacesToCriterias
class CriteriasAdmin(admin.ModelAdmin):
inlines = [CriteriaPlacesInlineAdmin]

admin.site.register(Criterias, CriteriasAdmin)

I can add to CriteriaPlacesInlineAdmin a form, something like:

class CriteriaPlacesChoicesFieldForm(forms.ModelForm):
places = forms.ModelChoiceField(PlaceTypesGroups.objects.all(), 
label='place')

but how can I pass\add object_id to this form\query in order to get 
'selected' place in the dropdown list?

-- 
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 django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/240fdcdb-8083-4d5a-b116-a52144dded17%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to add\get data in admin via reversed relation using GenericTabularInline?

2016-10-13 Thread Anton Ponomarenko
It was quite easy. GenericTabularInline must be changed to 
admin.TabularInline


class CriteriaPlacesInlineAdmin(admin.TabularInline):
model = PlacesToCriterias
class CriteriasAdmin(admin.ModelAdmin):
inlines = [CriteriaPlacesInlineAdmin]

admin.site.register(Criterias, CriteriasAdmin)


-- 
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 django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5e6f6335-7ba4-480a-9981-48e2efada9b2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How to add\get data in admin via reversed relation using GenericTabularInline?

2016-10-13 Thread Anton Ponomarenko


Hi all.

I can add Criterias to a place. How can I add Places to a criteria?

Models:

class Criterias(models.Model):
name = ...
class Places(models.Model):
name = ...
class PlacesToCriterias(models.Model):
content_type = models.ForeignKey(ContentType, on_delete=models.CASCADE)
object_id = models.PositiveIntegerField()
content_object = GenericForeignKey()

criteria_group = models.ForeignKey(Criterias)

Admin - PLACES part:

class PlaceCriteriasInlineAdmin(GenericTabularInline):
model = PlacesToCriterias
class PlacesAdmin(admin.ModelAdmin):
inlines = [PlaceCriteriasInlineAdmin]

admin.site.register(Places, PlacesAdmin)

In this case, when I open Places admin change page, I can add Criterias items 
to my 'place'.

Admin - CRITERIAS part:

class CriteriaPlacesInlineAdmin(GenericTabularInline):
model = PlacesToCriterias
class CriteriasAdmin(admin.ModelAdmin):
inlines = [CriteriaPlacesInlineAdmin]

admin.site.register(Criterias, CriteriasAdmin)

In this case, when I open Criterias admin change page, I CAN NOT add Places 
item 
to my 'criteria', because instead of possible places I see criterias.

How to get Places items at Criterias admin page?
Thanks.

-- 
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 django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c0a69075-a933-44cc-946a-451b60a34a10%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


django-admin commands, diango 1.10 with python 2 & python 3 on windows installed

2016-09-26 Thread anton
Hi,

I am using django 1.10.1 with the following configuration:

- windows 7 64bit
- python 2.7.12 32 bit

Now I am switching to python 3 so I installed additionally
python 3.5.2 64 bit.

I still need to keep python 2 because I have
also trac (https://trac.edgewall.org) with mercurial
(https://www.mercurial-scm.org) installed both still needing python2.

Now my question:

 The windows PATH env variable contains python35 and python/scrips
 paths.

 With python 2.7 allone I could call on the console django
 admin-commands like:

>> manage.py showmigrations
or simply
>> manage.py
to see all commands

Now woth both pythons installed
>> manage.py
shows me all commands

But if I try to execute one command like

>> manage.py showmigrations

it does ... nothing, no error ... nothing.

If I call python like

>> python

on the command line the python 3.5.2 shell starts

The only way to make the django-admin commands work
is to call them like this:

>> py -3 manage.py showmigrations

Now it works.
( of course prepending the full python exe path works too
like
 >> c:\python35\python manage.py showmigrations )

Does somebody know the trick to use python 3.5 without the
need to use "py -3"?

Or is a simultanuously installation of python 2 and python 3 on windows
a no-go?

Thanks for a hint

 Anton

-- 
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 django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/nsbs5n%24sdk%241%40blaine.gmane.org.
For more options, visit https://groups.google.com/d/optout.


How to make properly choices based on two models?

2016-09-24 Thread Anton Ponomarenko
Hello.

I want to let users to choose their countries. I have 2 models = *Countries* 
with some figures and *CountriesTranslations*. I am trying to make tuple 
with *country* (because user has FK to this model) and its *translation*. 
In front-end I see dropdown list of countries, but when I try to save the 
form, I see error: *Exception Value: Cannot assign "'AF'": 
"UserProfile.country" must be a "Countries" instance.* Error happens at the 
line *if user_profile_form.is_valid():*

# admindivisions.models
class Countries(models.Model):
osm_id = models.IntegerField(db_index=True, null=True)
status = models.IntegerField()
population = models.IntegerField(null=True)

iso3166_1 = models.CharField(max_length=2, blank=True)
iso3166_1_a2 = models.CharField(max_length=2, blank=True)
iso3166_1_a3 = models.CharField(max_length=3, blank=True)

class Meta:
db_table = 'admindivisions_countries'
verbose_name = 'Country'
verbose_name_plural = 'Countries'


class CountriesTranslations(models.Model):
common_name = models.CharField(max_length=81, blank=True, db_index=True)
formal_name = models.CharField(max_length=100, blank=True)

country = models.ForeignKey(Countries, on_delete=models.CASCADE, 
verbose_name='Details of Country')
lang_group = models.ForeignKey(LanguagesGroups, on_delete=models.CASCADE
, verbose_name='Language of Country',
   null=True)

class Meta:
db_table = 'admindivisions_countries_translations'
verbose_name = 'Country Translation'
verbose_name_plural = 'Countries Translations'


# profiles.forms
class UserProfileForm(forms.ModelForm):

# PREPARE CHOICES
country_choices = ()
lang_group = Languages.objects.get(iso_code='en').group
for country in Countries.objects.filter(status=1):
eng_name = country.countriestranslations_set.filter(lang_group=
lang_group).first()
if eng_name:
country_choices += ((country, eng_name.common_name),)
country_choices = sorted(country_choices, key=lambda tup: tup[1])


country = forms.ChoiceField(choices=country_choices, required=False)

class Meta:
model = UserProfile()
fields = ('email', 'email_privacy',
  'profile_url',
  'first_name', 'last_name',
  'country',)


# profiles.views
def profile_settings(request):
if request.method == 'POST':
user_profile_form = UserProfileForm(request.POST, instance=request.
user)

if user_profile_form.is_valid():
user_profile_form.save()
messages.success(request, _('Your profile was successfully 
updated!'))

return redirect('settings')

else:
messages.error(request, _('Please correct the error below.'))

else:
user_profile_form = UserProfileForm(instance=request.user)

return render(request, 'profiles/profiles_settings.html', {
'user_profile_form': user_profile_form,
})

As I understand, *country* from *((country, eng_name.common_name),)* is 
converted to *str*. What is the right way to keep country instance in the 
form? or if I am doing it in the wrong way, what way is correct?

As a possible solution is to use *ModelChoiceField* with overriding 
*label_from_instance* as shown below:
class CountriesChoiceField(forms.ModelChoiceField):
def __init__(self, user_lang='en', *args, **kwargs):
super(CountriesChoiceField, self).__init__(*args, **kwargs)
self.user_lang = user_lang

def label_from_instance(self, obj):
return obj.countriestranslations_set.get(lang_group=self.user_lang)


class UserProfileForm(forms.ModelForm):
user_lang = user_lang_here
country = CountriesChoiceField(
queryset=Countries.objects.filter(
status=1, iso3166_1__isnull=False,
countriestranslations__lang_group=user_lang).order_by(
'countriestranslations__common_name'),
widget=forms.Select(), user_lang=user_lang)

class Meta:
model = UserProfile()
fields = ('email', 'email_privacy',
  'profile_url',
  'first_name', 'last_name',
  'country',)

but in this case there are too much queries because of the 
*label_from_instance* and page loads too slowly.
Would appreciate any advice how to solve this task.
Thanks.

-- 
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 django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b2b0e010-f549-4225-93a3-ee42249a6120%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Howto to create custom admin commands with subcommands

2016-09-19 Thread anton
Hi,

is there an possibility to use
https://docs.python.org/3/library/argparse.html#sub-commands

in the custom admin commands so I can have subcommands like

manage.py mycommand subcommand1 choice1-for-subcommand1
manage.py mycommand subcommand1 choice2-for-subcommand1
manage.py mycommand subcommand2 variable-param


Preferably an official way.

I tested an example which I found in the internet
(forgot where), it worked in python 2.7 but didn't in python 3.5
(even when using the same django 1.10 base)

-- 
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 django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/nrpnt4%24ogs%241%40blaine.gmane.org.
For more options, visit https://groups.google.com/d/optout.


Best way to switch from mysql to postgres?

2016-05-11 Thread anton
hi,

I have a django (1.8.13) project running
on windows 7 64 bit + python 2.7.10 (32bit).

Actually it runs with mysql (precise: mariadb)
and I tried the following:

1. commandline:> manage.py dumpdata -o dumpdata.json

2. then I switch the engine to postgres in my django settings file
  (the empty postgres is already prepared)

3. commandline:> manage.py loaddata dumpdata.json

Unfortunately it runs into an error.

Before I put here all the details, first one question:

Is this way supposed to work?

Or how would you do it?

Thanks

 Anton

-- 
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 django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/nh00dn%24hj7%241%40ger.gmane.org.
For more options, visit https://groups.google.com/d/optout.


Re: djangoproject.com https access problems

2015-02-28 Thread anton
OK, I will do that,

because even IE 11 doesn't work 
(by the way I use FF 36.0 on Win7 64bit).

Anton

James Schneider wrote:

> The proxy is likely forcing a TLS fallback in a way that Firefox doesn't
> like. Ensure you are using the latest version of FF, but even then, unless
> you have control off the proxy, there may not be much you can do except
> open a support ticket with your IT department.
> 
> https://bugzilla.mozilla.org/show_bug.cgi?id=1072382
> 
> -James
> On Feb 27, 2015 8:58 AM, "anton"  wrote:
> 
>> Hi,
>>
>> at home it works, but in my company
>> the proxy refuses the connection to:
>>
>> https://www.djangoproject.com
>>
>> and my firefox gives me an error:
>>
>> ssl_error_inappropriate_fallback_alert
>>
>> Question: since when did you switch the website to https
>> (or didn't I notice it)
>>
>> Other sites seems to work, is there anything special
>> with https://www.djangoproject.com ?
>>
>> All the time I had no problems.
>>
>>
>> Anton
>>
>> --
>> 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 django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/mcq7ng%24s55%241%40ger.gmane.org
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> 


-- 
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 django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/mcsnhj%242ob%241%40ger.gmane.org.
For more options, visit https://groups.google.com/d/optout.


djangoproject.com https access problems

2015-02-27 Thread anton
Hi,

at home it works, but in my company
the proxy refuses the connection to:

https://www.djangoproject.com

and my firefox gives me an error:

ssl_error_inappropriate_fallback_alert

Question: since when did you switch the website to https
(or didn't I notice it)

Other sites seems to work, is there anything special
with https://www.djangoproject.com ?

All the time I had no problems.


Anton

-- 
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 django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/mcq7ng%24s55%241%40ger.gmane.org.
For more options, visit https://groups.google.com/d/optout.


Release announcements?

2015-02-18 Thread Anton Melser
Hi,

I have started a new project on 1.8 and am looking for an RSS or mailing 
list that has release announcements for Django proper - is there anything? 
My understanding was that the first Beta was supposed to come out on the 16 
Feb, is that right?

Thanks!
Anton

-- 
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 django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1fd9766f-56f4-4661-af3f-89f3f27a1cc4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django.views.decorators.http.condition decorator

2014-10-20 Thread Anton Novosyolov
Opened, https://code.djangoproject.com/ticket/23695

-- 
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 django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/322e182b-ad9c-47f6-89da-1b4724fa3559%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


django.views.decorators.http.condition decorator

2014-10-17 Thread Anton Novosyolov


I have a question about this part:

elif (not if_none_match and request.method == "GET" and res_last_modified 
> and if_modified_since and res_last_modified <= if_modified_since): 
> response = HttpResponseNotModified()


If I don't use etag, and request method is HEAD then 200 is returned.

Some sites for checking 304 status (e.g. http://last-modified.com/en/ ) use 
HEAD for checking.

-- 
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 django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/8161a375-d0aa-4c1d-9370-f7aa4d4a7c67%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: What is *the* django 1.7 IDE which is opensource & multiplattform

2014-09-24 Thread anton
Wellington Cordeiro wrote:

> If you're doing serious development $70 for a very extensible editor is

I know this very well, but with my question I wanted
to find out if there is an open source solution.

Anton

> chump change. IDE's are in my opinion too much for Django and rarely do
> all the things you wish they would. If paying isn't for you, I would get
> Vim or Emacs.
> 
> On Wednesday, September 24, 2014 3:47:47 AM UTC-6, anton wrote:
>>
>> Jorge Andrés Vergara Ebratt wrote:
>>
>> > I actually use a text editor, I love Sublime Text 2 with the Djaneiro
>> > Plugin.
>> > 
>> hmm this is shareware not opensource as I see :-(
>>
>> > As far as IDEs go, I used to work with NINJA IDE, it's a Python IDE and
>> > it's pretty cool.
>> > 
>>
>> I will have a look ... but I do not see django & django template support.
>>
>> But thanks anyway
>>
>>  Anton
>>
>> > 2014-09-24 4:36 GMT-05:00 anton >:
>> > 
>> >> Hi,
>> >> 
>> >> actually I use Aptana Studio 3.4.1 (http://www.aptana.com/)
>> >> to develop Django apps (on Windows and Linux).
>> >> 
>> >> What I (personally) need from an ide:
>> >>  1. ability to debug (python code)
>> >>  2. support for django templates
>> >>  3. support for django (start a new project, adding a django app)
>> >>  4. support for refactoring (like rename and so on)
>> >>  5. support for mercurial
>> >>  6. multi plattform (at least windows/linux)
>> >> 
>> >> Starting with *django 1.7*, aptana marks some line
>> >> as errors which are not errors (undefined variables from import ..)
>> >> 
>> >> Now I have the following problem:
>> >> 
>> >>  - I tried the actual aptana 3.6.0, but it is buggy and does not work
>> >>    (no idea if and when it will be fixed, the development
>> >>speed is actually slow)
>> >> 
>> >>  - if I use eclipse + actual pydev 3.7.1 I have
>> >>no support for *django templates*
>> >> 
>> >>  - all other ides like PyCharm are commercial (the free pycharm does
>> >>not support django and django templates, only python)
>> >> 
>> >> Now the question: does somebody know a solution?
>> >> 
>> >> Thanks
>> >> 
>> >>  Anton
>> >> 
>> >> 
>> >> --
>> >> 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...@googlegroups.com .
>> >> To post to this group, send email to django...@googlegroups.com
>> .
>> >> Visit this group at http://groups.google.com/group/django-users.
>> >> To view this discussion on the web visit
>> >> 
>> https://groups.google.com/d/msgid/django-users/lvu3as%24pba%241%40ger.gmane.org
>> >> .
>> >> For more options, visit https://groups.google.com/d/optout.
>> >> 
>> > 
>> > 
>> > 
>>
>>
>>
> 


-- 
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 django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/lvutr2%2493o%242%40ger.gmane.org.
For more options, visit https://groups.google.com/d/optout.


Re: What is *the* django 1.7 IDE which is opensource & multiplattform

2014-09-24 Thread anton
Adam Stein wrote:

> Not sure what you are looking for in terms of Django template support.

I mean for example: syntax highlighting of the django template keywords.


> The only difference between pycharm community (free) and commercial in
> terms of Django support that I've noticed is that Django's development
> web server won't restart automatically when code changes in the
> community edition.  Haven't used community edition since last year, but
> I seem to recall, I was still able to have a task to start Django's dev
> web server (in debug mode so I can trace through my code as you'd
> expect), so as long as I restarted that after making changes, things
> were fine.
> 
> On Wed, 2014-09-24 at 11:36 +0200, anton wrote:
> 
>> Hi,
>> 
>> actually I use Aptana Studio 3.4.1 (http://www.aptana.com/)
>> to develop Django apps (on Windows and Linux).
>> 
>> What I (personally) need from an ide:
>>  1. ability to debug (python code)
>>  2. support for django templates
>>  3. support for django (start a new project, adding a django app)
>>  4. support for refactoring (like rename and so on)
>>  5. support for mercurial
>>  6. multi plattform (at least windows/linux)
>> 
>> Starting with *django 1.7*, aptana marks some line
>> as errors which are not errors (undefined variables from import ..)
>> 
>> Now I have the following problem:
>>  
>>  - I tried the actual aptana 3.6.0, but it is buggy and does not work
>>(no idea if and when it will be fixed, the development
>>speed is actually slow)
>> 
>>  - if I use eclipse + actual pydev 3.7.1 I have
>>no support for *django templates*
>> 
>>  - all other ides like PyCharm are commercial (the free pycharm does
>>not support django and django templates, only python)
>> 
>> Now the question: does somebody know a solution?
>> 
>> Thanks
>> 
>>  Anton
>>   
>> 
> 
> 


-- 
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 django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/lvuto4%2493o%241%40ger.gmane.org.
For more options, visit https://groups.google.com/d/optout.


Re: What is *the* django 1.7 IDE which is opensource & multiplattform

2014-09-24 Thread anton
Jorge Andrés Vergara Ebratt wrote:

> I actually use a text editor, I love Sublime Text 2 with the Djaneiro
> Plugin.
> 
hmm this is shareware not opensource as I see :-(

> As far as IDEs go, I used to work with NINJA IDE, it's a Python IDE and
> it's pretty cool.
> 

I will have a look ... but I do not see django & django template support.

But thanks anyway

 Anton

> 2014-09-24 4:36 GMT-05:00 anton :
> 
>> Hi,
>>
>> actually I use Aptana Studio 3.4.1 (http://www.aptana.com/)
>> to develop Django apps (on Windows and Linux).
>>
>> What I (personally) need from an ide:
>>  1. ability to debug (python code)
>>  2. support for django templates
>>  3. support for django (start a new project, adding a django app)
>>  4. support for refactoring (like rename and so on)
>>  5. support for mercurial
>>  6. multi plattform (at least windows/linux)
>>
>> Starting with *django 1.7*, aptana marks some line
>> as errors which are not errors (undefined variables from import ..)
>>
>> Now I have the following problem:
>>
>>  - I tried the actual aptana 3.6.0, but it is buggy and does not work
>>(no idea if and when it will be fixed, the development
>>speed is actually slow)
>>
>>  - if I use eclipse + actual pydev 3.7.1 I have
>>no support for *django templates*
>>
>>  - all other ides like PyCharm are commercial (the free pycharm does
>>not support django and django templates, only python)
>>
>> Now the question: does somebody know a solution?
>>
>> Thanks
>>
>>  Anton
>>
>>
>> --
>> 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 django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/lvu3as%24pba%241%40ger.gmane.org
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> 
> 
> 


-- 
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 django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/lvu3sn%249t%241%40ger.gmane.org.
For more options, visit https://groups.google.com/d/optout.


What is *the* django 1.7 IDE which is opensource & multiplattform

2014-09-24 Thread anton
Hi,

actually I use Aptana Studio 3.4.1 (http://www.aptana.com/)
to develop Django apps (on Windows and Linux).

What I (personally) need from an ide:
 1. ability to debug (python code)
 2. support for django templates
 3. support for django (start a new project, adding a django app)
 4. support for refactoring (like rename and so on)
 5. support for mercurial
 6. multi plattform (at least windows/linux)

Starting with *django 1.7*, aptana marks some line
as errors which are not errors (undefined variables from import ..)

Now I have the following problem:
 
 - I tried the actual aptana 3.6.0, but it is buggy and does not work
   (no idea if and when it will be fixed, the development
   speed is actually slow)

 - if I use eclipse + actual pydev 3.7.1 I have
   no support for *django templates*

 - all other ides like PyCharm are commercial (the free pycharm does
   not support django and django templates, only python)

Now the question: does somebody know a solution?

Thanks

 Anton
  

-- 
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 django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/lvu3as%24pba%241%40ger.gmane.org.
For more options, visit https://groups.google.com/d/optout.


Bug in django admin: list_editable should be not editable if appear in readonly_fields

2014-05-03 Thread Anton Danilchenko
Hello dev team!

I think that if some field set to *readonly_fields* than we should display 
disabled field in *list_editable*.

Now I have set field "*price*" into *list_editable* and *readonly_fields*. 
And I see this field not editable in "change view" in admin panel, but I 
see it editable in "list view".

If field not editable - I should not edit this field in admin site. But, as 
I can see - I can edit this field in "list view", that creates some 
problems. Because it isn't what I wan to see.

-- 
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 django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/702c9d44-a8b3-4826-a242-31e36ce27813%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: recommended fcgi way for django 1.6 on windows? Problems with https

2014-04-15 Thread anton
I also looked at nginx which is quite nice,

but now I found the mod_authn_ntlm SSPI win32 module
for apache

   http://www.apachelounge.com/viewtopic.php?p=25073 

which finally alows me to do SingleSigneOn  on windows,
and it works :-)

for nginx I did not find such a module 
(I saw something outdated somewhere)

But you are right  nginx is nice too

Anton


Andre Terra wrote:

> I've used nginx in windows with great results. In fact, I even compiled it
> on cygwin with additional modules (namely, to track large file uploads)
> and everything worked smoothly.
> 
> 
> Cheers,
> AT
> 
> 
> On Mon, Apr 14, 2014 at 1:48 PM, anton  wrote:
> 
>> Hi
>>
>> I did a test with modwsgi on windows with apache,
>> http and https work now both.
>>
>> Thanks :-)
>>
>> *BUT*: the modwsgi does not support Daemonmode on windows,
>> which means that I need to restart the whole apache Server every time
>> I update my django app.
>>
>> For a real productionserver its a nightmare, if there are different apps
>> hosted.
>>
>> Perhaps I find a solution .. :-(
>>
>> Anton
>>
>>
>> --
>> 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 django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/lih3hn%24sn4%241%40ger.gmane.org
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> 


-- 
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 django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/lik424%24k26%241%40ger.gmane.org.
For more options, visit https://groups.google.com/d/optout.


Re: recommended fcgi way for django 1.6 on windows? Problems with https

2014-04-14 Thread anton
Hi

I did a test with modwsgi on windows with apache,
http and https work now both.

Thanks :-)

*BUT*: the modwsgi does not support Daemonmode on windows,
which means that I need to restart the whole apache Server every time
I update my django app.

For a real productionserver its a nightmare, if there are different apps
hosted.

Perhaps I find a solution .. :-(

Anton


-- 
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 django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/lih3hn%24sn4%241%40ger.gmane.org.
For more options, visit https://groups.google.com/d/optout.


Re: recommended fcgi way for django 1.6 on windows? Problems with https

2014-04-10 Thread anton
Russell Keith-Magee wrote:

> On Wed, Apr 9, 2014 at 1:09 AM, anton  wrote:
> 
>> Hi ,
>>
>> I use:
>>  - windows 7 64 bit
>>  - python 2.7.6 (32bit)
>>  - apache 2.4.9 (32bit vc9 build from apachelounge)
>>  - django 1.6.2
>>  - flup for fcgi ( noted as prerequisite in django docs)
>>
>> I use flup for running django as fcgi,
>> unfortunately I have the problem that
.. snip snip cot off
>>
>> So what is the future for django and fcgi on windows,
>> or will this functionality be integrated in django 1.7 (would be nice).
>>
> 
> There *is* no future for FCGI on Django, on Windows or any other operating
> system. We've deprecated support for FCGI, and will be removing support
> for FCGI in the Django 1.9 release.
> 
> Third party projects may choose to maintain support for FCGI wrappers to
> Django, but that will be outside the official project.
> 
> If you want to deploy a Django site, you should be using WSGI. A wide
> range of servers and service providers support WSGI; However. I can't
> comment on which ones are especially good or bad under Windows.
> 
> Yours,
> Russ Magee %-)
> 

Hi Russ,

thanks for the advise, I didn't know that fcgi is deprecated.
I thought its nicer to use so I can have different 
apps ( = parts of my web intranet portal) running as
 - complete independent django instances
 - with different ( = independent) databases 

So if I have to do some more critical changes in one part of my
web portal I can shutdown only the one fcgi service do the work
and start it later again.

-> the rest of the services are not touched.

I am not sure if this is possible with wsgi.

I use apache 2.4.9 on windows with the modwsgi 
but I am unsure about the modwsgi for apache
(http://code.google.com/p/modwsgi/)
because the last code change is from october 2012
so it seems a little bit "abandonware".

(I looked at uwsgi, but it runs only on Linux/unix)

Is there any (even "semi") official best way to run django on windows
(which is up to date)?

Or is windows officially not supported for production?

Thanks

 Anton
of 

-- 
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 django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/li6rj4%24oum%241%40ger.gmane.org.
For more options, visit https://groups.google.com/d/optout.


recommended fcgi way for django 1.6 on windows? Problems with https

2014-04-08 Thread anton
Hi ,

I use:
 - windows 7 64 bit
 - python 2.7.6 (32bit)
 - apache 2.4.9 (32bit vc9 build from apachelounge) 
 - django 1.6.2
 - flup for fcgi ( noted as prerequisite in django docs)

I use flup for running django as fcgi,
unfortunately I have the problem that
my django app runs fine with http but not with https.

I saw that in https mode the request.path
variable in my view is not '/mydjangoapp/' (like in http mode)
but '/mydjangoapp/mydiangoapp/'.

So the links which are calculated with the reverse("myapp.myview") function
are wrong.

I looked a bit in flup bit did not fully understan why it builds the
request.path variable the way it does (add least in https mode 
the apache does not create a SCRIPT_URL = the env["SCRIPT_URL"] in flup
is empty, and this seems to cause the problem).

my questions are now:
 - Is there any special point to take care about when using https?
 - is there another reccomended way to do fcgi (on windows)??

I ask this because flup seems *dead*, and the flup website 
is down since *months* now (at least it was down every time I tried to
access the flup trac).

So what is the future for django and fcgi on windows,
or will this functionality be integrated in django 1.7 (would be nice).

Thanks

  anton


-- 
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 django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/li1ah2%24245%241%40ger.gmane.org.
For more options, visit https://groups.google.com/d/optout.


Question about Django & Msyql-python for windows

2014-02-08 Thread anton
Hi,

I am using Django 1.6.2 with:
 - python 2.7.6
 - mysql-python-1.2.3 
 - and mysql 5.5.36)
on windows 7 64 bit.

I just saw that there is a MySQL-python-1.2.5.win32-py2.7.exe
on https://pypi.python.org/pypi/MySQL-python/1.2.5

I tried it out but stumbled over the fact that the 
mysql connection over named pipes seems to be broken.
(via tcp port 3306 it works).

In the past I did a try to the 1.2.4 version but it did not work either 
(do not remember exaclty what)

Since the mysql-python project seems to move quite slowly (no python 3.x)
my question is:

 - is this the only way to run django & mysql on *windows*
   or are there alternatives

 - is mysql support on windows a bit deprecated?

Thanks

 anton

-- 
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 django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ld4rfo%247nb%241%40ger.gmane.org.
For more options, visit https://groups.google.com/groups/opt_out.


Fixture extraction

2013-11-14 Thread Anton Pirker
Hello!

I have a fairly large production database (about 40GB) and I want to
extract a sample of it as fixtures so I can use this sample for
development.

The optimal solution would be that I can give a number of auth_users to a
script, and it will extract all data neccessary to have a complete set of
data for the given users.

A plus would be, if the email addresses of the users would be anonymized
and the password would be set to some default password.

Has anybody used any of the fixture packages [1] available?
Can anybody recommend a package, or an approach on how to do this?

Thanks in advance,
Anton

1: https://www.djangopackages.com/grids/g/fixtures/



-- 

DI(FH) Anton Pirker

-
IGNAZ Softwaremanufaktur
agile software development

wurlitzergasse 58/20
a-1160 wien
tel: +43 699 1234 0 456
skype: antonpirker
http://anton-pirker.athttp://ignaz.at

Currently working on: Relaunch of http://bikemap.net
My latest project: http://creativesociety.com

-- 
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 django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACu05bUWgwKAJB0jP_63uEubfEmx5qmm90d-_YPZrCAjz%3DCJxA%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: What is the right location for my django translation files?

2013-10-08 Thread Anton Melser

>
> I'm giving my first steps with python/django/mezzanine so please bear with 
> me.
>
> I modified a translation file of the mezzanine's blog application and 
> compiled it OK. Mind you: I literally only modified a couple of words and 
> left the rest intact.
>
> The only place I found out I could place them in order to test was at the 
> blog app's locale folder 
> (~/MY_VIRTUAL_ENV/lib/python2.7/site-packages/mezzanine/blog/locale/es/LC_MESSAGES).
>
> It worked fine, but my guts tell me there has to be a better way so I can 
> have this file(s) in some other location WITHIN my own mezzanine 
> application so:
>
>1. I can easily maintain them and
>2. I don't have to keep my whole virtual environment in my SCM's 
>repository.in order to keep track of this single file with just a 
>couple or words modified and that will hardly ever get modified again.
>
> Great minds think alike? :-). I am in *exactly* the same situation - there 
are a couple of translations I would like to change slightly in Mezzanine 
(a capitalisation here, pluralisation there) and I had exactly the same 
thought. I don't want to have to maintain something completely separately. 
Did you find an elegant solution?

-- 
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 django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/80e29974-637f-49d4-83e8-f176829cb18e%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: CMS base to start with?

2013-09-28 Thread Anton Melser


> Hey Anton,
>
> From my experience if it's a 2 year project you're building don't use a 
> CMS. Start with a plain Django project and then add apps you need. All 
> these CMSs will just lock you in and become more of a hinderance then help. 
>
> I also recommend building your own admin before you invest too much time 
> into customising the default admin. 
>
> Certainly very wise advice. I guess my problem is that I wanted to have a 
solid guide for overall project structure (not having done a major project 
in Django before), something which a good CMS can often provide. That and 
some first versions of apps so we can start with something and evolve. It's 
definitely the lock-in that I'm looking to minimise though... FeinCMS seems 
to be the project that puts itself across as what I'm looking for - a solid 
skeleton that doesn't assume too much. I'll look more into that.
Thanks for your insight,
A

-- 
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 django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: CMS base to start with?

2013-09-28 Thread Anton Melser

>
>
> Might be an idea to write a one page business plan. Amazing how quickly 
> it all becomes clear as soon as the business objectives are nailed down. 
> After that I would guess only one of those would stand out for you. 
>
> We have a pretty solid business plan, or at least one that the startup 
incubator is happy with :-). The only problem is that they are necessary to 
create but only really for crystallising thinking rather than laying out a 
solid roadmap. We have far too many ideas and we want to let things evolve 
through test-and-learn and customer development. Basically we just want an 
MVP that we won't have to throw out 6 mths in. Maybe it's a pipe dream 
though...
Thanks,
A

-- 
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 django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: CMS base to start with?

2013-09-27 Thread Anton Melser


> Are you try with https://www.djangopackages.com/ ??
>

The problem is the amount of choice. There seem to be many great packages 
there but I was hoping someone from the community with more intimate 
knowledge of what is there might be able to shed some light on the subject. 
>From my investigations, Django-CMS, FeinCMS and Mezzanine all have their 
strong points for what I want. I guess there is no "right" choice but there 
might be a "righter" one :-).
Cheers,
A
 

-- 
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 django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


CMS base to start with?

2013-09-27 Thread Anton Melser
Hi,

I'm pretty new to Django/Python and I'm starting a fairly major project 
(hopefully next 2+ years of my life :-)). If all goes well, there will be 
several developers on the project in a year or two - getting our hands 
dirty is what it's all about. Use something I know? PHP/.NET/Java - no 
thanks! It's going to be a long road and I've quickly seen the superiority 
of Python and the ease of development with Django and I'm definitely in for 
the long haul so... 

There is quite a bit of functionality that has been written 50k times 
before and I'd rather not reinvent, like advanced user management (social 
everything yadda yadda), some nice templates to start with (supporting 
bootstrap 3 within the next 2-3 months or so) and dynamic theming, blog, 
article management, easy plugging to search backends, content and user 
rating, unit tests, etc.

Beta versions are fine as long as the latest sexy version will go stable 
within 2-3 months and contributing back is a given, at least while it 
remains viable.

So I've been looking around at what to start with and there is quite a bit 
of choice. Django-CMS, Mezzanine, FeinCMS to name but a few... 

The stuff I refer to above is stuff I would REALLY like to have out of the 
box (ie, it's what we're starting with), for the rest (marketplace, 
mapping, geo-location, kitchen sink, etc.) we just need for it to be easy 
to add new modules which by then I/we should be able to write from scratch 
anyway, if needed. Other stuff we probably don't need at all like 
multi-lang.

I guess the only other particularity is that we are going to need excellent 
caching - we are expecting around 90% of the traffic on 2-3 days and 
serious peaking within that. Going PAAS is not out of the question but if 
we can get away with some advanced caching then I'd rather start with that 
and then if cashflow warrants it re-evaluate the situation later. 

So, should I start with a CMS? If so, which one? What I'm really looking 
for is a base to start with that I don't end up saying "why the #!@& did I 
start with X" in 12 months time...

Any opinions or insults are most welcome!

Thanks,
Anton

-- 
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 django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: django1.5 - url resolver vs i18n_patterns : wrong behaviour

2013-08-23 Thread uniqe . klmov . anton
For those who also suffers: yes its a bug.
https://code.djangoproject.com/ticket/17734
it was fixed in 1.6b2

вторник, 4 июня 2013 г., 13:23:23 UTC+4 пользователь Ivan Tatarchuk написал:
>
> When I using i18n_patterns in my project urls.py I have strange behaviour 
> of url resolver:
>   expected behaviour: 
>  - if pattern defined in django.conf.urls.patterns, url resolver 
> doesn't add language prefix
> - ip pattern defined in django.conf.urls.i18n.i18n_patterns, url 
> resolver adds language prefix at the begining of url
>  
>   actual behaviour
>   if NO patterns defined in i18n_patterns, all work fine
>   but if some pattern defined in  i18n_patterns, url resolver add 
> language prefix to ALL urls resoved by url resolver regardless of place of 
> pattern defenition (django.conf.urls.patterns or 
> django.conf.urls.i18n.i18n_patterns)
>
> Example:
>
> * urls.py *
> from django.conf.urls import patterns, include, url
> from django.conf.urls.i18n import i18n_patterns
>
> urlpatterns = patterns('',
> url(r'^admin/', include(admin.site.urls)),
> )
>
> urlpatterns += i18n_patterns('',
> #   url(r'^other/', include('apps.other.urls')),
> }
>
> now {% url 'admin:password_change' %} resolved as 'admin/password_change' 
> (normal behaviour)
> but if we uncomment line in i18n_patterns it will be resolved  as 
> 'curr_lang/admin/password_change'
>
> Can somebody explaine my why?
> Thanks
>
>
>

-- 
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 django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Django Meeting in Vienna, Austria!

2013-08-22 Thread Anton Pirker
Hello fellow Djangonauts and Djangonistas!

This message is especially for Django developers and friends from Austria.

At the last two DjangoCons in Europe a few people from Austria got to know
each other and at last years conference in Warsaw we spontaneously founded
the Django Friends of Austria. (The only activity until now was standing
around in a group between talks at DjangoCircus in Warsaw and twaddle...)

But now Stephan, a friend of mine is planning a real Django Meetup in
Vienna! Yay!

So if you are into Django and want to meet other Djangonauts and
Djangonistats in Vienna head over to this Doodle and tell us, when you have
to time to meet: http://doodle.com/2hs77khscrkuc4ba

Depending of how many people sign up the meeting will be held in WerkzeugH
[1] or at Sektor 5 [2]. The first meeting should be more like a 'getting to
know each other' event, so there are no big talks planned at the moment. At
the meeting we can decide how the meetings should be in the future.

Looking forward in meeting you!

Bye,
Anton

1: http://doodle.com/2hs77khscrkuc4ba
2: http://www.sektor5.at/
<http://doodle.com/2hs77khscrkuc4ba>--

DI(FH) Anton Pirker

-
IGNAZ Softwaremanufaktur
agile software development

wurlitzergasse 58/20
a-1160 wien
tel: +43 699 1234 0 456
skype: antonpirker
http://anton-pirker.athttp://ignaz.at
My latest project: http://bikemap.net

-- 
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 django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Can't run manage.py runserver (Django 1.5.1)

2013-08-04 Thread Anton Yermolenko
Hi guys

i'm new to python as well as django. Seeking help for this problem

I have python 3.3 installed and django 1.5.1 on win 7
so when i run manage.py runserver i got this error message

c:\mysite>python manage.py runserver
Validating models...

0 errors found
August 04, 2013 - 18:51:37
Django version 1.5.1, using settings 'mysite.settings'
Development server is running at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.
Error: 'utf-8' codec can't decode byte 0xc0 in position 0: invalid start 
byte

Googling didn't help, unfortunately

-- 
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 django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Right way to modify contrib auth package?

2013-05-02 Thread Anton Baklanov
Hi.

I think that subclassing PasswordChangeForm and doing password length check
in child's clean method is more "correct" way to do this.

Note that contrib.auth's views accept form class as parameter (
https://github.com/django/django/password_resetblob/master/django/contrib/auth/views.py#L242<https://github.com/django/django/blob/master/django/contrib/auth/views.py#L242>),
so you can pass your custom form class to view at urls.py, like that:

url(r'^/url/$', view, {'password_change_form': CustomPasswordResetForm})

On Thu, May 2, 2013 at 5:45 AM,  wrote:

> Hi,
>
> I'm fairly new to Django, and would like to enforce a minimum password
> length for my site's users. I'm using James Bennett's registration package
> and have made the needed changes to forms.py. It works great.
>
> Now I'd like to apply the same password requirements when a user changes
> or resets their password. This functionality is handled by the contrib.auth
> package, and at first blush it looks like all I need to do is edit the
> forms.py there.
>
> But I'm wondering if that's the "correct" way to fold changes into a core
> package like auth. Is there a better way to do this?
>
> Thanks in advance,
>
> Spork
>
> --
> 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 django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>



-- 
Regards,
Anton Baklanov

-- 
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 django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re:

2013-04-16 Thread Anton Parkhomenko
Actually, I don't think that any of Django-based CMS' (mezzazine, 
django-cms or feincms) is something like drupal or wordpress. Anyway you 
need to know django or python at some level, because there isn't plenty of 
ready-to-use themes and plugins. You always need to develop some parts by 
yourself.

On Tuesday, April 16, 2013 6:12:49 PM UTC+8, vinoth job wrote:
>
> i installed mezzanine.and  this is django based cms .by using we can 
> create websites .like what we can do with drupal and wordpress. my doubt is 
> how to get host for my mezzanine project .is it anything that i want to 
> change in codings.or is there any websites providing hostings for mezzanine 
> projects.and i need your help  to start my  website using mezzanine
>
> and currently i posting my articles in localhost : 127.0.0.1:8000.and 
> there is no usage in this . to get hosting what i seriously want to do
>
> so this is http://mezzanine.jupo.org/  .
>  

-- 
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 django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Django IO exceptions through times

2013-04-16 Thread Anton Parkhomenko
UPD. I found that on TemplateDoesNotExist Django notice me that templates 
are actually exists <http://pastebin.com/fgd0vRdv> (3rd and 29th strings). 
But why they didn't not loaded?

On Tuesday, April 16, 2013 2:51:18 PM UTC+8, Anton Parkhomenko wrote:
>
> Hi.
> I have a strange problem with Django. It raise exceptions like 
> TemplateDoesNotExist or ImportError, while actually files and modules are 
> exists and have proper rights. This error appears not everytime, but in 
> ~1/20 cases (not regular), thus I thought about to blame my VDS, but other 
> projects with older software works correct on this server.
> On this project I'm using Django 1.4.4, django-CMS 2.4.0-RC1 and uWSGI 
> 1.2.6 (for all other projects) with virtualenvs.
> How do you think, what's the problem?
> P.S. There's a not small set of "lost" files. They're all the same almost 
> each time, only 6-8 of templates and modules.
>
>

-- 
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 django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Django IO exceptions through times

2013-04-15 Thread Anton Parkhomenko
Hi.
I have a strange problem with Django. It raise exceptions like 
TemplateDoesNotExist or ImportError, while actually files and modules are 
exists and have proper rights. This error appears not everytime, but in 
~1/20 cases (not regular), thus I thought about to blame my VDS, but other 
projects with older software works correct on this server.
On this project I'm using Django 1.4.4, django-CMS 2.4.0-RC1 and uWSGI 
1.2.6 (for all other projects) with virtualenvs.
How do you think, what's the problem?
P.S. There's a not small set of "lost" files. They're all the same almost 
each time, only 6-8 of templates and modules.

-- 
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 django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Impossible? Django with NTLM SSO auth on windows?

2013-03-05 Thread Anton
Hmmm

the bad support (as you mention "it hasn't been updated in quite some time")
seems to be a major problem in this domain.

I just looked at (for apache)
http://mod-auth-sspi.sourceforge.net/docu/mod_ntlm/

Here they say mod_ntlm is obsolete and 
" mod_auth_sspi is the version of mod_ntlm for Apache-2.0"

but on the other side mod_auth_sspi seems to be dead too,
so actually I am still not sure if its possible,
if you don't want to use pure Microsoft technologies 
(like asp.net IIS server & other tools from ms)

I am looking ..

Bye

 anton


Andre Terra wrote:

> FYI, I found a nginx module for Kerberos authentication too:
> https://github.com/fintler/nginx-mod-auth-kerb
> http://michaelshadle.com/2010/01/17/spnego-for-nginx-a-start-at-least
> 
> It hasn't been updated in quite some time, but it is apparenlty working
> and perhaps one of you will feel like taking a swing at it.
> 
> 
> Cheers,
> AT
> 
> On Mon, Mar 4, 2013 at 6:24 PM, Avraham Serour  wrote:
> 
>> Hi,
>>
>> Does anyone think using ntlm instead of/on top of oauth/social logins.
>> Ideally this could be given as another choice of login/authentication on
>> top of oauth options, this would be a solution to the user not having to
>> remember yet another password. does linux have anything like that?
>>
>> would this be practical, has anyone thought of this?
>>
>> avraham
>>
>>
>> On Mon, Mar 4, 2013 at 11:19 PM, Anton  wrote:
>>
>>> @Branko,
>>>
>>> no...I didn't think about Kerberos, I only realised
>>> in the last day that Ad use this system which I don't know either)
>>>
>>> Do you know some tutorial/howto describing this SSO
>>>
>>> with Django/apache on windows?
>>>
>>> Or I am the only one on this planet with this ides?
>>>
>>> Thanks
>>>
>>>   Anton
>>>
>>> Branko Majic wrote:
>>>
>>> > On Mon, 25 Feb 2013 21:06:33 +0100
>>> > Anton  wrote:
>>> >
>>> >> Hi,
>>> >>
>>> >> I am using my django in the following way:
>>> >>
>>> >> OS: Windows 7 (64 bit)
>>> >>
>>> >>  + Python 2.7.3 (32bit)
>>> >>
>>> >>  + apache 2.4.3 (32 bit) from apachelounge
>>> >>(I use the version which was build with vs2008 like python 2.7.3)
>>> >> http://www.apachelounge.com/download/win32/binaries/httpd-2.4.3-
>>> win32-
>>> >> VC9.zip
>>> >>
>>> >>  + django 1.4.5
>>> >>
>>> >>  + mod_wsgi 3.4 (32 bit) from http://code.google.com/p/modwsgi/
>>> >>(compiled manually with vs2008 since no binaries available)
>>> >>
>>> >> I would like to use the typical Windows intranet scenario
>>> >> where you have a single-sign-on with the internet explorer.
>>> >>
>>> >> At least in our company the ASP .NET powered intranet sites
>>> >> work fine with this.
>>> >>
>>> >> I googled around, as if I understood right, this auth system
>>> >> is called NTLM and if you want to use it, you need
>>> >> the apache module "mod-auth-sspi".
>>> >>
>>> >> If I look at the project page
>>> >> http://sourceforge.net/projects/mod-auth-sspi/?source=dlp
>>> >> I see only stuff dated from 2011 and only for *apache 2.2*.
>>> >>
>>> >> And if I read this article on apachelounge:
>>> >>
>>> >> http://www.apachelounge.com/viewtopic.php?t=4548
>>> >>
>>> >> then there will be *never* a support for Apache 2.4.
>>> >>
>>> >> In the Django docs:
>>> >> "Authentication using REMOTE_USER"
>>> >> https://docs.djangoproject.com/en/1.4/howto/auth-remote-user/
>>> >>
>>> >> you get links to mod_auth_sspi but its has be forgotten to mention
>>> >> that this module (seems) now obsolete.
>>> >>
>>> >> So the question is:
>>> >>
>>> >> Is it possible to obtain SSO with Django on a Windows powered
>>> >> machine, or do I have to give up and try my luck with ASP.NET or
>>> >> perhaps php for windows or whatever.
>>> >>
>>> >> I love Django & python, but I am here in a dead end.
>>> >>
>>> >> Is there somebody usin

Re: Impossible? Django with NTLM SSO auth on windows?

2013-03-04 Thread Anton
@Branko,

no...I didn't think about Kerberos, I only realised
in the last day that Ad use this system which I don't know either)

Do you know some tutorial/howto describing this SSO

with Django/apache on windows?

Or I am the only one on this planet with this ides?

Thanks

  Anton

Branko Majic wrote:

> On Mon, 25 Feb 2013 21:06:33 +0100
> Anton  wrote:
> 
>> Hi,
>> 
>> I am using my django in the following way:
>> 
>> OS: Windows 7 (64 bit)
>> 
>>  + Python 2.7.3 (32bit)
>> 
>>  + apache 2.4.3 (32 bit) from apachelounge
>>(I use the version which was build with vs2008 like python 2.7.3)
>> http://www.apachelounge.com/download/win32/binaries/httpd-2.4.3-
win32-
>> VC9.zip
>> 
>>  + django 1.4.5
>> 
>>  + mod_wsgi 3.4 (32 bit) from http://code.google.com/p/modwsgi/
>>(compiled manually with vs2008 since no binaries available)
>>  
>> I would like to use the typical Windows intranet scenario
>> where you have a single-sign-on with the internet explorer.
>> 
>> At least in our company the ASP .NET powered intranet sites
>> work fine with this.
>> 
>> I googled around, as if I understood right, this auth system
>> is called NTLM and if you want to use it, you need
>> the apache module "mod-auth-sspi".
>> 
>> If I look at the project page
>> http://sourceforge.net/projects/mod-auth-sspi/?source=dlp
>> I see only stuff dated from 2011 and only for *apache 2.2*.
>> 
>> And if I read this article on apachelounge:
>> 
>> http://www.apachelounge.com/viewtopic.php?t=4548
>> 
>> then there will be *never* a support for Apache 2.4.
>> 
>> In the Django docs:
>> "Authentication using REMOTE_USER"
>> https://docs.djangoproject.com/en/1.4/howto/auth-remote-user/
>> 
>> you get links to mod_auth_sspi but its has be forgotten to mention
>> that this module (seems) now obsolete.
>> 
>> So the question is:
>> 
>> Is it possible to obtain SSO with Django on a Windows powered machine,
>> or do I have to give up and try my luck with ASP.NET or perhaps php
>> for windows or whatever.
>> 
>> I love Django & python, but I am here in a dead end.
>> 
>> Is there somebody using this scenarion (which is quit common in big
>> companies)?
>> 
>> Thanks.
>> Anton
>> 
> 
> Hm... Did you maybe think about using Kerberos part of the AD for
> authentication instead?
> 
> Best regards
> 


-- 
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 django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Impossible? Django with NTLM SSO auth on windows?

2013-02-25 Thread Anton
Hi,

I am using my django in the following way:

OS: Windows 7 (64 bit)

 + Python 2.7.3 (32bit)

 + apache 2.4.3 (32 bit) from apachelounge 
   (I use the version which was build with vs2008 like python 2.7.3)
http://www.apachelounge.com/download/win32/binaries/httpd-2.4.3-win32-
VC9.zip

 + django 1.4.5 

 + mod_wsgi 3.4 (32 bit) from http://code.google.com/p/modwsgi/
   (compiled manually with vs2008 since no binaries available)
 
I would like to use the typical Windows intranet scenario
where you have a single-sign-on with the internet explorer.

At least in our company the ASP .NET powered intranet sites
work fine with this.

I googled around, as if I understood right, this auth system
is called NTLM and if you want to use it, you need
the apache module "mod-auth-sspi".

If I look at the project page
http://sourceforge.net/projects/mod-auth-sspi/?source=dlp
I see only stuff dated from 2011 and only for *apache 2.2*. 

And if I read this article on apachelounge:

http://www.apachelounge.com/viewtopic.php?t=4548

then there will be *never* a support for Apache 2.4.

In the Django docs:
"Authentication using REMOTE_USER"
https://docs.djangoproject.com/en/1.4/howto/auth-remote-user/

you get links to mod_auth_sspi but its has be forgotten to mention
that this module (seems) now obsolete.

So the question is:

Is it possible to obtain SSO with Django on a Windows powered machine,
or do I have to give up and try my luck with ASP.NET or perhaps php for 
windows or whatever.

I love Django & python, but I am here in a dead end.

Is there somebody using this scenarion (which is quit common in big 
companies)?

Thanks.
Anton

-- 
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 django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: What exactly does order_with_respect_to do?

2013-01-24 Thread Anton Agestam
Thanks for the correction, found this thread when Googleing for an 
explanation.

On Tuesday, December 15, 2009 5:28:10 PM UTC+1, smcoll wrote:
>
> This is probably a dead thread, but...  i think the answer given is 
> incorrect. 
>
> 'order_with_respect_to' adds an '_order' integer field to the model. 
> Each set of instances that share a parent object of the relation 
> specified by 'order_with_respect_to' get ordered as a set.  So in the 
> example, three Answer instances with fk's to one Question instance 
> will have '_order' values of 0, 1, and 2, which represent their 
> (specified) ordering "with respect to" that Question instance. 
>
> i'd be curious to know if anyone has seen an admin implementation for 
> reordering with this field.  i'd also heard some chatter a while back 
> that this might be removed in future releases of Django, because it 
> leans toward the "magic" end of things. 
>
> shannon 
>
> On Nov 30, 3:20 pm, Preston Holmes  wrote: 
> > On Nov 29, 4:50 pm, Continuation  wrote: 
> > 
> > > In the doc (http://docs.djangoproject.com/en/dev/ref/models/options/ 
> > > #order-with-respect-to) it is mentioned that  order_with_respect_to 
> > > marks an object as "orderable" with respect to a given field. 
> > 
> > > What exactly does that mean? Can someone give me an example of how 
> > > this could  be used? 
> > 
> > > The doc's example is: 
> > >  order_with_respect_to = 'question' 
> > 
> > > How is that different from 
> > > ordering = ['question'] 
> > 
> > order_with_respect_to uses the Question classes' ordering, where just 
> > ordering would use the string representation of that question. 
> > 
> > So using the example of questions and answers from the docs 
> > 
> > if Question had a 'sequence' field, and Question meta.ordering was set 
> > to use sequence, the answers would use that sequence.  If using 
> > ordering instead of order_with_respect_to, then the questions would be 
> > in alphabetical question order. 
> > 
> > At least thats how I understand it. 
> > 
> > -Preston 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/YD6CMvh3rJUJ.
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 1.6.0: admin pages not using unicode methods declared in my model

2012-11-27 Thread Anton Baklanov
Hi Héctor.

check this out
https://docs.djangoproject.com/en/dev//topics/python3/#str-and-unicode-methods

--
Regards,
Anton Baklanov

-- 
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 1.6.0: admin pages not using unicode methods declared in my model

2012-11-26 Thread Anton Baklanov
Hi. I've just checked - it uses __unicode__() to display object names.

Please show us your full admin.py and models.py

-- 
Regards,
Anton Baklanov

-- 
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 1.6.0: admin pages not using unicode methods declared in my model

2012-11-26 Thread Anton Baklanov
__str__ method works fine with python 3.

i will continue searching the truth here and will create ticket (if it will
be required after finding truth)

thanks

On Mon, Nov 26, 2012 at 6:56 PM, ajendrex  wrote:

> Yes, I'm using python 3. I think there is no ticket for this yet, but I
> would prefer someone with better english and more time using django posted
> it.
>
>

-- 
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 1.6.0: admin pages not using unicode methods declared in my model

2012-11-26 Thread Anton Baklanov
No need for that. I've reproduced your problem. With python 3 __unicode__
method is ignored.

We should search for corresponding ticket on trac, or create new one.

On Mon, Nov 26, 2012 at 6:31 PM, Anton Baklanov wrote:

> Hi. I've just checked - it uses __unicode__() to display object names.
>
> Please show us your full admin.py and models.py
>
> --
> Regards,
> Anton Baklanov
>
>


-- 
Regards,
Anton Baklanov

-- 
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.



howto Single Sign-On with django on windows

2012-11-17 Thread Anton
Hi,

I am using in windows 7 64bit:
 - python 2.7.3 32bit !!
 - django 1.4.2

If use my internet explorer in my company,
it does an automatic login on some services.

Is there a possibilty to:
 - add an user named "john" to my django
 - if john goes to my django app with his
   internet explorer:
   to check that he is john and authenticated
   (without to need the knowledge of his
windows password)?

Any hint would be helpful :-)

Anton


-- 
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: How to implement a form to update the quantity?

2012-10-01 Thread Anton Baklanov
it *is good idea* to submit...

missed some words, lol

On Mon, Oct 1, 2012 at 9:52 PM, Anton Baklanov wrote:

> it to submit forms with ajax, to not reload entire page every time.
>



-- 
Regards,
Anton Baklanov

-- 
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: How to implement a form to update the quantity?

2012-10-01 Thread Anton Baklanov
Hi!

You can use something like:

{% for item in garage.garagecar_set.all %}
Car:  {{item.car.name}}
Price:{{item.car.price}}
Quantity: {{item.quantity}}
ID:   {{item.car.id}}

  {{form.q}}
  

 {% endfor %}

and view like

def update_q(request, garagecar_id):
# get garagecar by id here, create form from request, set new value, save()


it to submit forms with ajax, to not reload entire page every time.


P.S.

it looks you are implementing Many-to-Many-Through relation. Django
has support for it out of the box
https://docs.djangoproject.com/en/dev/topics/db/models/#extra-fields-on-many-to-many-relationships



-- 
Regards,
Anton Baklanov

-- 
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: Best free web hosting portal

2012-09-10 Thread Anton Popovine
Hello,

http://www.appfog.com/  came out of closed beta recently. They support 
python and django.

You get quite alot for free. (2Gb ram, unlimited # of instances, 10 
services)

Anton

On Monday, September 10, 2012 10:51:07 AM UTC+2, Somnath wrote:
>
> Hello friends,
>
>I want to host my site on free web hosting for testing purpose,
> so anyone give me suggestion on best free web hosting site for django 
> website.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/wpKvLXGL9gwJ.
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: How many attempts to generate a unique ID?

2012-09-09 Thread Anton Popovine
Yes it needs to be short. This will be an invitation string most likely 
written on a chalk board for kids.

Also there was an error in my initial post : I forgot to increment size += 
1 inside the while loop. Noticed right after posting.

thanks

On Monday, September 10, 2012 1:27:37 AM UTC+2, george wrote:
>
> Do you need this identifier to be so short? If that's not a problem, why 
> don't you use something tried and that's proven that will succeed: GUIDS 
> (or UUIDs).
>
> http://en.wikipedia.org/wiki/Globally_unique_identifier
>
> http://docs.python.org/library/uuid.html
>
> On Sun, Sep 9, 2012 at 8:10 PM, Anton Popovine 
> 
> > wrote:
>
>> Hi everyone! First time posting to this group!
>>
>> I have a model Class where each row has a unique alphanumeric ID string 
>> like 'EX39H'.
>>
>> This is the function I use to generate the code.
>>
>> def gen_class_code():
>>   import string
>>   import random
>>   size = 5
>>   max_size = 16
>>attempts = 1000
>>   chars = string.ascii_uppercase + string.digits 
>>
>>   # lets try  times to generate unique id, else increase code 
>> length
>>   res = ""
>>   while (size <= max_size):
>> for i in range(attempts):
>>   temp = ''.join(random.choice(chars) for i in range(size)) 
>>   if not Class.objects.filter(code=temp).exists():
>> res = temp
>> break
>> if res : break
>>
>>   return res 
>>
>> How much would you set the attempts variable to and why?
>>
>> Thanks in advance
>> Anton
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msg/django-users/-/-JYyShU_ciUJ.
>> To post to this group, send email to django...@googlegroups.com
>> .
>> To unsubscribe from this group, send email to 
>> django-users...@googlegroups.com .
>> For more options, visit this group at 
>> http://groups.google.com/group/django-users?hl=en.
>>
>
>
>
> -- 
> George R. C. Silva
>
> Desenvolvimento em GIS
> http://geoprocessamento.net
> http://blog.geoprocessamento.net
>  
>  

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/sXE0uvWcK2IJ.
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.



How many attempts to generate a unique ID?

2012-09-09 Thread Anton Popovine
Hi everyone! First time posting to this group!

I have a model Class where each row has a unique alphanumeric ID string 
like 'EX39H'.

This is the function I use to generate the code.

def gen_class_code():
  import string
  import random
  size = 5
  max_size = 16
  attempts = 1000
  chars = string.ascii_uppercase + string.digits 

  # lets try  times to generate unique id, else increase code 
length
  res = ""
  while (size <= max_size):
for i in range(attempts):
  temp = ''.join(random.choice(chars) for i in range(size)) 
  if not Class.objects.filter(code=temp).exists():
res = temp
break
if res : break

  return res 

How much would you set the attempts variable to and why?

Thanks in advance
Anton

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/-JYyShU_ciUJ.
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 development running on 127.0.0.1:8000 not accessible from same machine

2012-08-27 Thread Anton Baklanov
oh, i misunderstood your question.

try to type url with schema into browser's address bar. i mean, use '
http://localhost:8000/' instead of 'localhost:8000'.
also it's possible that some browser extension does this, try disabling
them all.

On Mon, Aug 27, 2012 at 10:53 AM, nav  wrote:

> Dear Folks,
>
> I am running my django development server on 127.0.0.1:8000 and accessing
> this address from my web browser on the same machine. In the past few days
> I have found thet the web browsers keep prepending the address with "www."
> when using the above address. 127.0.0.1 without the prot number works fine
> but the django development server requires a port number.
>
> I have not encountered this problem before and am puzzled by what is
> happening. I am working on a Kubuntu 12.04 linux box and my /etc/hosts/
> file is below if that helps:
>
> 
> 127.0.0.1   localhost
> 127.0.1.1   
>
> # The following lines are desirable for IPv6 capable hosts
> ::1 ip6-localhost ip6-loopback
> fe00::0 ip6-localnet
> ff00::0 ip6-mcastprefix
> ff02::1 ip6-allnodes
> ff02::2 ip6-allrouters
> 
>
> TIA
> Cheers,
> nav
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/EZzlz6iQOGoJ.
> 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.
>



-- 
Regards,
Anton Baklanov

-- 
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 development running on 127.0.0.1:8000 not accessible from same machine

2012-08-27 Thread Anton Baklanov
try running dev server with command like "./manage.py runserver 0.0.0.0:8000"
- 0.0.0.0 means that socket will listen for connections on all interfaces.
other people in your network will be able to connect your box using your ip.

if this does not help - show us output of 'sudo iptables-save' and 'sudo
ifconfig'

On Mon, Aug 27, 2012 at 10:53 AM, nav  wrote:

> Dear Folks,
>
> I am running my django development server on 127.0.0.1:8000 and accessing
> this address from my web browser on the same machine. In the past few days
> I have found thet the web browsers keep prepending the address with "www."
> when using the above address. 127.0.0.1 without the prot number works fine
> but the django development server requires a port number.
>
> I have not encountered this problem before and am puzzled by what is
> happening. I am working on a Kubuntu 12.04 linux box and my /etc/hosts/
> file is below if that helps:
>
> 
> 127.0.0.1   localhost
> 127.0.1.1   
>
> # The following lines are desirable for IPv6 capable hosts
> ::1 ip6-localhost ip6-loopback
> fe00::0 ip6-localnet
> ff00::0 ip6-mcastprefix
> ff02::1 ip6-allnodes
> ff02::2 ip6-allrouters
> 
>
> TIA
> Cheers,
> nav
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/EZzlz6iQOGoJ.
> 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.
>



-- 
Regards,
Anton Baklanov

-- 
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: skip fixtures loading on 'manage.py test myapp'

2012-08-22 Thread Anton Baklanov
exactly

On Wed, Aug 22, 2012 at 2:24 AM, Karen Tracey  wrote:

> That link doesn't really explain why south would be loading fixtures that
> Django itself wouldn't ordinarily load. Unless...do you have migrations
> that are loading fixtures?
>



-- 
Regards,
Anton Baklanov

-- 
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: skip fixtures loading on 'manage.py test myapp'

2012-08-20 Thread Anton Baklanov
and, if anyone is interested, here is the answer -
http://south.readthedocs.org/en/latest/settings.html#south-tests-migrate

On Mon, Aug 20, 2012 at 7:36 PM, Anton Baklanov wrote:

> Hi Melvyn!
>
> Just tested it on dummy project, and you are right - django itself does
> not do anything like that.
> Problem is in South - when i remove it from INSTALLED_APPS 'manage.py test
> myapp' does not load any fixtures except 'initial_data'.
>
> So, i'm going to south sources now.
>
> Thanks!
>
>
> On Mon, Aug 20, 2012 at 12:01 PM, Melvyn Sopacua wrote:
>
>> On 19-8-2012 19:05, Anton Baklanov wrote:
>>
>> > When I'm running 'manage.py test myapp' it loads all fixtures that are
>> in
>> > 'myapp/fixtures' directory.
>>
>> Are you sure about that? I think it only loads what is loaded also with
>> syncdb, so initial_data.*.
>>
>> > And what I want is to find a way to tell django skip this fixtures and
>> > instead load some other ones or maybe no fixtures at all for certain
>> tests.
>> > Is it possible?
>>
>> Set the fixtures class attribute on your test class.
>>
>>
>> --
>> Melvyn Sopacua
>>
>> --
>> 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.
>>
>>
>
>
> --
> Regards,
> Anton Baklanov
>
>


-- 
Regards,
Anton Baklanov

-- 
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: skip fixtures loading on 'manage.py test myapp'

2012-08-20 Thread Anton Baklanov
Hi Melvyn!

Just tested it on dummy project, and you are right - django itself does not
do anything like that.
Problem is in South - when i remove it from INSTALLED_APPS 'manage.py test
myapp' does not load any fixtures except 'initial_data'.

So, i'm going to south sources now.

Thanks!

On Mon, Aug 20, 2012 at 12:01 PM, Melvyn Sopacua wrote:

> On 19-8-2012 19:05, Anton Baklanov wrote:
>
> > When I'm running 'manage.py test myapp' it loads all fixtures that are in
> > 'myapp/fixtures' directory.
>
> Are you sure about that? I think it only loads what is loaded also with
> syncdb, so initial_data.*.
>
> > And what I want is to find a way to tell django skip this fixtures and
> > instead load some other ones or maybe no fixtures at all for certain
> tests.
> > Is it possible?
>
> Set the fixtures class attribute on your test class.
>
>
> --
> Melvyn Sopacua
>
> --
> 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.
>
>


-- 
Regards,
Anton Baklanov

-- 
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.



skip fixtures loading on 'manage.py test myapp'

2012-08-19 Thread Anton Baklanov
Hi!

When I'm running 'manage.py test myapp' it loads all fixtures that are in
'myapp/fixtures' directory.
And what I want is to find a way to tell django skip this fixtures and
instead load some other ones or maybe no fixtures at all for certain tests.
Is it possible?

-- 
Regards,
Anton Baklanov

-- 
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: login or login_decorator issue

2012-08-08 Thread Anton Baklanov
1) i can't see in your code where you are creating some kind of session and
set some cookies to save auth state between requests.
2) is it login_required from django.contrib.auth? if yes - use login from
django.conrib.auth or create your own decorator to check user auth.

anyway - django provides ready for use user auth mechanism and maybe it's
better to use it https://docs.djangoproject.com/en/dev/topics/auth/

On Wed, Aug 8, 2012 at 1:37 PM, Jian Chang  wrote:

> what's your  '@login_required(login_url='/login/')'?
> seems like the decorator leads to the redirection.
>
> 2012/8/8 mapapage 
>
>>  for the login I do (username must be the id field(pk) of an 'owners'
>> table and password is a  field of the same table):
>>
>> def login_user(request):
>> c = {}
>> c.update(csrf(request))
>> state = ""
>>
>> if request.POST:
>> password = request.POST.get('password')
>> id = request.POST.get('id')
>> try:
>> user = Owners.objects.get(id = id)
>> if user:
>> if user.simple_check_password(password):
>> url = reverse('main', kwargs={ 'user_id': user.id })
>> return HttpResponseRedirect(url)
>> else:
>> state = 'Incorrect username or password'
>> else:
>> state = 'Incorrect username or password'
>> except Exception as e:
>> state = 'Incorrect username or password'
>> print state
>>  return render_to_response('index.html', locals(), context_instance=
>> RequestContext(request))
>>
>> and I also define:
>>
>> def set_password(self, raw_password):
>> self.password = make_password(raw_password)
>>
>> def check_password(self, raw_password):
>> """
>> Returns a boolean of whether the raw_password was correct. Handles
>> hashing formats behind the scenes.
>> """
>> def setter(raw_password):
>> self.set_password(raw_password)
>> self.save()
>> return check_password(raw_password, self.password, setter=None)
>>
>> def simple_check_password(self,raw_password):
>>
>> return raw_password == self.password
>>
>> and at least it seems to me that it works, I mean the user logs in to the
>> main.html page.
>>
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msg/django-users/-/oPmX_2NBchQJ.
>>
>> 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.
>>
>
>  --
> 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.
>



-- 
Regards,
Anton Baklanov

-- 
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: login or login_decorator issue

2012-08-08 Thread Anton Baklanov
On Wed, Aug 8, 2012 at 11:15 AM, mapapage  wrote:

> I wrote a somehow custom login that works when the user inserts his
> credentials.


can give us more details on how did you implement login?



> He is simply redirected to a page with url:
>
> url(r'^(?P\d+)/$', 'auth.views.main', name='main'),
>
> Now that I try to add @login_decorators but I'm facing problems.
> For example, I have the view def main(request,user_id): where the
> redirected template after the login listens.
> When I add @login_required(login_url='/login/') to that main, when the
> user tries to login nothing happens, I remain to the login page and in the
> terminal I get:
>  "GET /1000/ HTTP/1.1" 302 0
>  "GET /login/?next=/1000/ HTTP/1.1" 200 6201
>
> What happens?
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/T4a3yrBm140J.
> 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.
>



-- 
Regards,
Anton Baklanov

-- 
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: Working with a Custom, Dynamic Form (using BaseForm)

2012-08-04 Thread Anton Baklanov
>
>
>
> I am hoping to add an additional field, "Photographers" (from the
> 'Photographer' model) to AForm so that users can select a Photographer to
> become part of an instance of the 'A' model.
>
> Does that make sense?
>

yes, you need to add field and I'm guessing that ModelChoiceField will work
for you.
https://docs.djangoproject.com/en/dev/ref/forms/fields/#modelchoic
efield<https://docs.djangoproject.com/en/dev/ref/forms/fields/#modelchoicefield>

looks like you are using some additional layer before django.forms and
don't just create fields directly, so you may need to extend it too.


>
>
> Thank you very much for any ideas!
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/JMg7nHwI44sJ.
>
> 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.
>



-- 
Regards,
Anton Baklanov

-- 
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.



object.create speed, creating 3 objects takes 1 sec in sqlite

2012-08-03 Thread Anton
Hi I am new to Django.

I worked through the tutorial.

I created a small test app on:
 - Win7 64bit
 - python 2.7.3 (32bit)
 - Django 1.4.1
 - using the development server
 

Now I wanted to populate the (sqlite backend) database
with a python script.

My Problem:

I Insert 3 Object (like MyModel.objects.create(name="..", comment="..") ).

They consts only of 2 strings.

Inserting these 3 items take roughly 1 sec.

In settings.py I set DEBUG = False, but this doesnt help much
(I readed something about this on the net).

I retried with the mysql backend:
 -  mysql 5.5.27 (64bit)
 - using sockets (named pipe on windows)

Now the time varies between 0.2 sec and 0.8 sec every time
I insert suche a 3 object tripplet.


My Problem: I will populate it with 5 items.

Has Django really such a bad performance for data insertion?

I can't believe it, so ... can somebody give me a hint?
Is there a doc page dedicated to speed/performance issues??

Otherwise I have to look for an other system.

Thanks 

Anton





-- 
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: combobox prepopulated to only related objects to "self"

2012-08-01 Thread Anton Baklanov
you can try something like that:

group = ...
choices = [(product.pk, product.name) for product in
group.product_set.all()]
form.fields["myfield"].choices = choices

On Wed, Aug 1, 2012 at 1:17 AM, Ignacio Soto  wrote:

> Hi everyone
>
> i have this model
>
> GROUP and Product
>
>
> product has a group field thath is foreignkey to GROUP.
>
>
> and Group has foreignKey to Product to select primary product.
>
> so i want to have a group with many products and one is the "primary
> product".
>
>
> so...i could do this by select inline products with "trough" and search an
> intermediary Model (boolean field).
>
> but it let me select  more than one promary,
>
>
> the solution is the model this way:.
>
> product has a group field thath is foreignkey to GROUP.
>
>
> and Group has foreignKey to Product to select primary product.
>
> so i want to have a group with many products and one is the "primary
> product".
>
> but the primaryproduct field in group will be prepopulated with only the
> related products to this group.
>
>
> how i prepopulate the select(combobox) with the reverse query ?
>
>
>
>
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/d3UpfhONEWwJ.
> 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.
>



-- 
Regards,
Anton Baklanov

-- 
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: Working with a Custom, Dynamic Form (using BaseForm)

2012-07-31 Thread Anton Baklanov
what is going on here:
self.base_fields = fields_for_a(self.instance) ?



On Tue, Jul 31, 2012 at 8:14 PM, Nick_B  wrote:

> Hi,
>
> Have hit a huge roadblock trying to implement a custom, dynamic form into
> my django project. Although I am more familiar with using ModelForms, I
> need to use BaseForm to work with the structure I already have in place.
>
> I have a dictionary of objects inside of my Model 'Photographer' that I am
> trying to pass into my form. The objects from 'Photographer' will be a drop
> down option for the user to select from, then will become part of an
> instance of another model 'A' after the user submits the form. I cannot
> figure out how to include the objects from 'Photographer' into my form,
> given the following form structure:
>
> class AForm(BaseForm):
> def __init__(self, data=None, files=None, instance=None,
> auto_id='id_%s',
>  prefix=None, initial=None, error_class=ErrorList,
>  label_suffix=':', empty_permitted=False):
>
> if not instance:
> raise NotImplementedError("Instance must be provided")
>
> self.instance = instance
> object_data = self.instance.fields_dict()
> self.declared_fields = SortedDict()
> self.base_fields = fields_for_a(self.instance)
>
> # if initial was provided, it should override the values from
> instance
> if initial is not None:
> object_data.update(initial)
>
> BaseForm.__init__(self, data, files, auto_id, prefix,
> object_data,
>   error_class, label_suffix, empty_permitted)
>
> cleaned_data = self.cleaned_data
>
> # save fieldvalues for self.instance
> fields = field_list(self.instance)
>
> for field in fields:
> if field.enable_wysiwyg:
> value = unicode(strip(cleaned_data[field.name]))
> else:
> value = unicode(cleaned_data[field.name])
>
> return self.instance
>
> For a more full representation of the problem in general, including all of
> the models and a lot of the view code, please see my stack overflow
> question:
> http://stackoverflow.com/questions/11548992/adding-values-to-complex-django-view
> .
>
> I cannot thank you enough for any advice given. I have been struggling
> with this issue for over a month, sadly. I appreciate any commentary.
>
>
> Thank you!
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/GkiNhsL225kJ.
> 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.
>



-- 
Regards,
Anton Baklanov

-- 
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.



Freelance Django Developer needed!

2011-10-11 Thread Anton Pirker
Hi!

(First to everyone not searching for a job: sorry for the shameless job 
advertisement!)

We are searching for a Freelance Django developer to help us out!

We are:
- creativesociety.com
- based in Vienna, Austria
- small team of 4
- pretty cool


What you should have:
- passion for writing beautiful code
- getting things done attitude
- knowledge of django, postgres, json, rest,
- some knowledge of html/css
- good english (talking and reading/writing documentation)


What you will have to do:
- develop a RESTful api that talks to a partner site
- talk to the partners (humands,  based in london and/or paris) to specify 
the api
- import a LOT of data from the partner site
- implement an upload and post the video files to the partner site
- implement a single sign on solution so if the users are logged in on one 
site, are automatically logged in on the other site.
- implement some html templates in django


We think the project will take about 8-12 weeks, starting November 1th.


If you are interested, send your CV, a "why i am the best for the 
job"-letter and your rates to:
development [at] creativesociety [dot] com


Thanks,
Anton

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/nCeDRk1fwLgJ.
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-utils @async decorator and gunicorn

2011-06-28 Thread Anton Pirker

Hi!

On 06/28/2011 02:45 PM, Javier Guerra Giraldez wrote:

another thing I don't know about is gunicorn; but the 'g' in the name
comes from 'green threads'.  do you (or anybody else) know if that
means that it patches the python thread implementation?  if so, that
could be interfering with the @async thread.
"g" stands for green unicorn. and we use gevent with gunicorn. so it 
could be that there is a problem with the threading implementation..

OTOH, now that you have the daemon running, maybe it would be easier
to use the djutils task queue.  try changing the @async with
@queue_command (found in djutils.queue.decorators)


i have tried this, but it resulted in an strange error.

i think i will skip the asynchronous stuff from djutils. tomorrow i will 
install celery [1] and try my luck with that. :)


thanks for your help,
Anton

[1] http://celeryproject.org/




--
DI(FH) Anton Pirker

-
IGNAZ Softwaremanufaktur
mobile . web . usability . project management

kranzgasse 2/15
a-1150 wien
tel: +43 699 1234 0 456
skype: antonpirker

http://ignaz.at


--
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: Help

2011-06-28 Thread Anton Pirker

Hi!

On 06/28/2011 08:15 AM, Smoltok41 wrote:

Hey wats up
Im a django newbie and im working on this small project so i need help
on how to add an attachment form so that i can be uploading
attachments.
thanx


I am sure here you find everything you need:
https://docs.djangoproject.com/en/1.3/topics/http/file-uploads/


Regards,
Anton





--
DI(FH) Anton Pirker

-
IGNAZ Softwaremanufaktur
mobile . web . usability . project management

kranzgasse 2/15
a-1150 wien
tel: +43 699 1234 0 456
skype: antonpirker

http://ignaz.at


--
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-utils @async decorator and gunicorn

2011-06-28 Thread Anton Pirker

Hi!

On 06/27/2011 03:47 PM, Javier Guerra Giraldez wrote:

On Mon, Jun 27, 2011 at 4:50 AM, Anton Pirker  wrote:

But when i run my django app under gunicorn and i call the function with the
@async decorator nothing happens at all...

are you running the queue consumer daemon?


Ah! There is a queue consumer daemon! ;)  Thank's for this hint!

I have now the queue consumer configured in my supervisord.conf like this:

[program:preview_queue_consumer]
environment=PYTHONPATH="/home/preview/.virtualenvs/preview/source/myproject/:/home/preview/.virtualenvs/preview/lib/python2.6/site-packages/djutils/:$PYTHONPATH"
directory=/home/preview/source/myproject/
command=python manage.py queue_consumer --settings=myproject.settings -l 
logs/queue_consumer.log --verbosity=2 -t 2

user=preview
autostart=true
autorestart=true


when i start the daemon the logs says this:

delay: 0.1
backoff: 1.15
threads: 2
2011-06-28 09:18:06,329:djutils.queue.logger:INFO:Loaded classes:
djutils.commands.queuecmd_delayed_resize
djutils.queue.queue.QueueCommand
djutils.queue.queue.PeriodicQueueCommand
2011-06-28 09:18:06,329:djutils.queue.logger:INFO:Starting periodic 
command execution thread
2011-06-28 09:18:06,329:djutils.queue.logger:INFO:created thread 
"1098918224"
2011-06-28 09:18:06,329:djutils.queue.logger:INFO:created thread 
"1107310928"


so i assume the daemon is started.

but when i run my @async function nothing happens. in the log output 
above i can see that QueueCommand and PeriodicQueueCommand are loaded.
can it be, that the consumer can only consume this sort of functions and 
not functions with @async?


i tried to add the @queue_command instead of the @async to my function, 
but then i get the error:

"can't pickle StringO objects"
and i do not have a clue what this means. (maybe it's my lack of english 
skills, but what should 'pickle' in this context mean?)



anyone an idea or hint where i should look next, to get my @async 
functions running in gunicorn?


thank's in advance,
Anton



--
DI(FH) Anton Pirker

-
IGNAZ Softwaremanufaktur
mobile . web . usability . project management

kranzgasse 2/15
a-1150 wien
tel: +43 699 1234 0 456
skype: antonpirker

http://ignaz.at


--
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.



Django-utils @async decorator and gunicorn

2011-06-27 Thread Anton Pirker
Hello! 

I use djutils [1] @async decorator for calling a function asynchronous. This 
works well when i start my server with the standard ./manage.py runserver 
command. But when i run my django app under gunicorn and i call the function 
with the @async decorator nothing happens at all... 

Do i have to configure djutils or gunicorn in a special way so i can run 
function asynchronous? 

Any hints are greatly appreciated! 

Thank's 
Anton 

[1] http://charlesleifer.com/docs/djutils/ 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/RQOAZ_lgUlwJ.
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.



Django-utils @async decorator and gunicorn

2011-06-27 Thread Anton Pirker

Hello!

I use djutils [1] @async decorator for calling a function asynchronous. 
This works well when i start my server with the standard ./manage.py 
runserver command. But when i run my django app under gunicorn and i 
call the function with the @async decorator nothing happens at all...


Do i have to configure djutils or gunicorn in a special way so i can run 
function asynchronous?


Any hints are greatly appreciated!

Thank's
Anton

[1] http://charlesleifer.com/docs/djutils/

--
DI(FH) Anton Pirker

-
IGNAZ Softwaremanufaktur
mobile . web . usability . project management

kranzgasse 2/15
a-1150 wien
tel: +43 699 1234 0 456
skype: antonpirker

http://ignaz.at


--
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: Our new startup site build on Django and GAE is now live!

2011-06-03 Thread Anton de Winter
If you use something like Firebug you can remove the blur layer and have a
look around (it's the actual site behind the blur).  In Chrome it detected
my location just fine and showed relevant content.  It didn't appear to need
any info from Facebook to function properly.

On Fri, Jun 3, 2011 at 3:50 PM, Doug Ballance  wrote:

> I actually authorized, but got a little creeped out by being asked for
> three cities in which I'd lived before being able to continue.  I
> entered one, but it still wouldn't let me pass without another two.  I
> couldn't conceived of ANY legitimate reason to need anything more than
> my current location aside from data mining, so I cancelled/logged out
> and removed authorization from facebook. Behind the blur it looked
> interesting, but you'll have to convince me you need all that info
> before I'd ever register. I haven't even -lived- in three different
> cities.
>
> --
> 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.
>
>

-- 
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: Include form in template tag

2010-09-23 Thread Anton Danilchenko
In my case this work well:

from ..forms import MessageSearchForm

Maybe we have other solution for this?

On 23 сен, 16:46, Anton Danilchenko 
wrote:
> Hi!
>
> I have created templatetag (used Django 1.2.3) in templatetags/
> board.py file. I need import form class from application.
>
> Structure of project is:
> + board/
> +++ views.py
> +++ forms.py
> +++ templatetags/
> + board.py
> + ... some other project applications ...
>
> How can I do import of form from the file forms.py?
>
> I try to do this:
> 1) from models import Message
> 2) from board.models import Message
> 3) from myprojectname.board.models import Message
>
> All this not work and show error message like this: "'board' is not a
> valid tag library: ImportError raised loading
> board.templatetags.board: No module named models"
>
> Please help.

-- 
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 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.



Include form in template tag

2010-09-23 Thread Anton Danilchenko
Hi!

I have created templatetag (used Django 1.2.3) in templatetags/
board.py file. I need import form class from application.

Structure of project is:
+ board/
+++ views.py
+++ forms.py
+++ templatetags/
+ board.py
+ ... some other project applications ...

How can I do import of form from the file forms.py?

I try to do this:
1) from models import Message
2) from board.models import Message
3) from myprojectname.board.models import Message

All this not work and show error message like this: "'board' is not a
valid tag library: ImportError raised loading
board.templatetags.board: No module named models"

Please help.

-- 
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 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: ManyToManyField to Phones model for enter phones manually (not select from list)

2010-09-22 Thread Anton Danilchenko
Ihave found solution.

I have changed only Form class:

1) added field for show text input field
phones = forms.CharField()

2) I have create in my Form instance method clear_phones() where I
check phones and save it all to database and get Phone model ids for
this phone numbers. And return this ids

All work well. Simple solution for this task.  Thank you for help!

-- 
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 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: ManyToManyField to Phones model for enter phones manually (not select from list)

2010-09-22 Thread Anton Danilchenko
Now I have next solution (but still need your help).

1) I have added to my form custom field CharField for render field as
input 

2) I have created Form method clean_phones() for check all values is
valid

3) in views.py I have get field contents, split it by comma and delete
all non-numbers. In result I have list of phones in format 01234567

4) in views.py I create Phone model record for each phone
phones = ['01234567', '45678921']
ids = []
for phone in phones:
  ids.append(Phone.objects.get_or_create(number=phone))

5) pass ids to real form field - ManyToManyField called phones


Please, help me understand how to pass all this logic in one place -
in custom field.

-- 
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 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: ManyToManyField to Phones model for enter phones manually (not select from list)

2010-09-22 Thread Anton Danilchenko
Thanks. I have read this article.

In my Form I have added validation for check phone numbers. All right
- I show user error message if given incorrect phone number. This is
simple.

I need to save this phone numbers  in model Phone if all phone numbers
valid and all other fields in this form is valid. If one of the fields
in this form is incorrect I don't save any phone in Phone model.

As I see, ManyToManyField need get list of Phone IDs. But, actually I
have only full phone numbers in format 01234567. I need to get ID for
each phone (or create new record in table Phone). After this I need to
get list of Phone IDs and pass this data to ManyToManyField.

How can I do this? Thanks.

On 21 сен, 23:21, "nick.l...@gmail.com"  wrote:
> read this here I think this'll explain what you're wanting.
>
> http://docs.djangoproject.com/en/dev/ref/forms/validation/
>
> On Tue, Sep 21, 2010 at 1:50 PM, Anton Danilchenko <
>
>
>
>
>
> anton.danilche...@gmail.com> wrote:
> > Message - this is a rental proposition (rooms, floor, cost, area,
> > country, cirty and contact phones).
>
> > Visitors can create new messages (message - this is a rent
> > proposition) and enter list of own phones (one or more phones). My
> > application store this phones not in char field, but save each phone
> > number to separate Phone morel - one phone in one model). If phone
> > already exists - message attached to this phone. If phone not exists -
> > we create new phone and attach message to this phone number.
>
> > In future, I tell to people - and see that this people not a good
> > man :-). I go to my application and mark this phone number to black
> > list. All future messages from this people to be marked as bad
> > messages.
>
> > Now I need to create own Form field called MultiPhoneField based on
> > CharField widget, but implenet logic of ManyToManyField. I need show
> > for user CharField where user enter comma separated phone numbers. I
> > check this numbers and if all numbers correct - store this numbers in
> > database in Phone model (each phone in separate record) and associate
> > message with list of this phones.
>
> > Can you please help me in this. I not understand how to create my own
> > Field based on ManyToManyField.
>
> > Thanks!
>
> > On 21 сен, 21:16, "nick.l...@gmail.com"  wrote:
> > > PersonallyI don't like the idea of adding multiple phone numbers as
> > > comma separated values.  What happens when a user's trying to add more
> > phone
> > > numbers than your charField's max_length?
>
> > > So let me see if I understand what's going on here...
>
> > > You have a problem where exists apartments for rent. People who want to
> > rent
> > > these apartments will send messages to the owner of said apartment
> > (through
> > > your website). This message will have associated to it, a User and
> > Multiple
> > > Phone Numbers.
>
> > > This message is then checked to see if the phone numbers associated to it
> > > have been black listed...
> > > And then finally deliver the message?
>
> > > n
>
> > > On Tue, Sep 21, 2010 at 12:15 PM, Anton Danilchenko <
>
> > > anton.danilche...@gmail.com> wrote:
> > > > I describe my task more reallistical.
>
> > > > This is application for rent an apartment. User can create new message
> > > > with information about apartment, and also add one or more contact
> > > > phone numbers. One user, without registration, can create more that
> > > > one message on the site. For one message can add one phone number, for
> > > > other message add two phones.
>
> > > > I need to save only one copy of phone number in database in format
> > > > . For each phone I can set if this phone in black list or not
> > > > (model Phone have property "blocked" by default setted to False).
>
> > > > I want to save phone numbers in model Phone, and messages in model
> > > > Message. But, people can see input text field (CharField) where enter
> > > > one or more phone numbers separated by comma.
>
> > > > class Phone(models.Model):
> > > >  number = models.CharField(max_length=20)
> > > >   blocked = models.BooleanField(default=False)
>
> > > > class Message(models.Model):
> > > >  # ... information about count of rooms, floor, cost, etc ...
> > > >  phones = models.ManyToManyField(Phone)
>
> > > > Nick, thank you for you help. You

Re: ManyToManyField to Phones model for enter phones manually (not select from list)

2010-09-21 Thread Anton Danilchenko
Message - this is a rental proposition (rooms, floor, cost, area,
country, cirty and contact phones).

Visitors can create new messages (message - this is a rent
proposition) and enter list of own phones (one or more phones). My
application store this phones not in char field, but save each phone
number to separate Phone morel - one phone in one model). If phone
already exists - message attached to this phone. If phone not exists -
we create new phone and attach message to this phone number.

In future, I tell to people - and see that this people not a good
man :-). I go to my application and mark this phone number to black
list. All future messages from this people to be marked as bad
messages.

Now I need to create own Form field called MultiPhoneField based on
CharField widget, but implenet logic of ManyToManyField. I need show
for user CharField where user enter comma separated phone numbers. I
check this numbers and if all numbers correct - store this numbers in
database in Phone model (each phone in separate record) and associate
message with list of this phones.

Can you please help me in this. I not understand how to create my own
Field based on ManyToManyField.

Thanks!

On 21 сен, 21:16, "nick.l...@gmail.com"  wrote:
> PersonallyI don't like the idea of adding multiple phone numbers as
> comma separated values.  What happens when a user's trying to add more phone
> numbers than your charField's max_length?
>
> So let me see if I understand what's going on here...
>
> You have a problem where exists apartments for rent. People who want to rent
> these apartments will send messages to the owner of said apartment (through
> your website). This message will have associated to it, a User and Multiple
> Phone Numbers.
>
> This message is then checked to see if the phone numbers associated to it
> have been black listed...
> And then finally deliver the message?
>
> n
>
> On Tue, Sep 21, 2010 at 12:15 PM, Anton Danilchenko <
>
>
>
>
>
> anton.danilche...@gmail.com> wrote:
> > I describe my task more reallistical.
>
> > This is application for rent an apartment. User can create new message
> > with information about apartment, and also add one or more contact
> > phone numbers. One user, without registration, can create more that
> > one message on the site. For one message can add one phone number, for
> > other message add two phones.
>
> > I need to save only one copy of phone number in database in format
> > . For each phone I can set if this phone in black list or not
> > (model Phone have property "blocked" by default setted to False).
>
> > I want to save phone numbers in model Phone, and messages in model
> > Message. But, people can see input text field (CharField) where enter
> > one or more phone numbers separated by comma.
>
> > class Phone(models.Model):
> >  number = models.CharField(max_length=20)
> >   blocked = models.BooleanField(default=False)
>
> > class Message(models.Model):
> >  # ... information about count of rooms, floor, cost, etc ...
> >  phones = models.ManyToManyField(Phone)
>
> > Nick, thank you for you help. You are really very good people!
>
> > On 21 сен, 18:12, "nick.l...@gmail.com"  wrote:
> > > Maybe I don't understand your problem.
>
> > > It sounds to me like your trying to make this way more difficult than it
> > > needs to be.
>
> > > Also it sounds to me like your trying to assign the same phone number to
> > > multiple people. (which is fine) But doesn't make a lot of sense to me in
> > a
> > > practical application.
>
> > > n
>
> > > On Tue, Sep 21, 2010 at 9:59 AM, Anton Danilchenko <
>
> > > anton.danilche...@gmail.com> wrote:
> > > > In my case, I have Users with equal phone numbers. And I need only
> > > > ManyToMany relationship.
>
> > > > I need create custom field for get information from CharFiels,
> > > > validate this data, clean and save to datastore in separate model. If
> > > > this phone already exists - we get ID of this phone. And, if this is a
> > > > new phone number - we insert this phone to separate model and get new
> > > > ID.
>
> > > > --
> > > > 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 unsubscribe from this group, send email to
> > > > django-users+unsubscr...@googlegroups.com > > >  groups.com>
> > 
&

Re: ManyToManyField to Phones model for enter phones manually (not select from list)

2010-09-21 Thread Anton Danilchenko
Also I need get list of all phones as with many-to-many relationship:

m = Message.objects.get(1)
for phone in m.phones:
  ptint phone


On 21 сен, 20:15, Anton Danilchenko 
wrote:
> I describe my task more reallistical.
>
> This is application for rent an apartment. User can create new message
> with information about apartment, and also add one or more contact
> phone numbers. One user, without registration, can create more that
> one message on the site. For one message can add one phone number, for
> other message add two phones.
>
> I need to save only one copy of phone number in database in format
> . For each phone I can set if this phone in black list or not
> (model Phone have property "blocked" by default setted to False).
>
> I want to save phone numbers in model Phone, and messages in model
> Message. But, people can see input text field (CharField) where enter
> one or more phone numbers separated by comma.
>
> class Phone(models.Model):
>   number = models.CharField(max_length=20)
>   blocked = models.BooleanField(default=False)
>
> class Message(models.Model):
>   # ... information about count of rooms, floor, cost, etc ...
>   phones = models.ManyToManyField(Phone)
>
> Nick, thank you for you help. You are really very good people!
>
> On 21 сен, 18:12, "nick.l...@gmail.com"  wrote:
>
>
>
> > Maybe I don't understand your problem.
>
> > It sounds to me like your trying to make this way more difficult than it
> > needs to be.
>
> > Also it sounds to me like your trying to assign the same phone number to
> > multiple people. (which is fine) But doesn't make a lot of sense to me in a
> > practical application.
>
> > n
>
> > On Tue, Sep 21, 2010 at 9:59 AM, Anton Danilchenko <
>
> > anton.danilche...@gmail.com> wrote:
> > > In my case, I have Users with equal phone numbers. And I need only
> > > ManyToMany relationship.
>
> > > I need create custom field for get information from CharFiels,
> > > validate this data, clean and save to datastore in separate model. If
> > > this phone already exists - we get ID of this phone. And, if this is a
> > > new phone number - we insert this phone to separate model and get new
> > > ID.
>
> > > --
> > > 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 unsubscribe from this group, send email to
> > > django-users+unsubscr...@googlegroups.com > >  groups.com>
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/django-users?hl=en.
>
> > --
> > Guadajuko! Vamos a correr!
> >  -"Cool! we are going to run!"

-- 
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 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: ManyToManyField to Phones model for enter phones manually (not select from list)

2010-09-21 Thread Anton Danilchenko
I describe my task more reallistical.

This is application for rent an apartment. User can create new message
with information about apartment, and also add one or more contact
phone numbers. One user, without registration, can create more that
one message on the site. For one message can add one phone number, for
other message add two phones.

I need to save only one copy of phone number in database in format
. For each phone I can set if this phone in black list or not
(model Phone have property "blocked" by default setted to False).

I want to save phone numbers in model Phone, and messages in model
Message. But, people can see input text field (CharField) where enter
one or more phone numbers separated by comma.

class Phone(models.Model):
  number = models.CharField(max_length=20)
  blocked = models.BooleanField(default=False)

class Message(models.Model):
  # ... information about count of rooms, floor, cost, etc ...
  phones = models.ManyToManyField(Phone)


Nick, thank you for you help. You are really very good people!


On 21 сен, 18:12, "nick.l...@gmail.com"  wrote:
> Maybe I don't understand your problem.
>
> It sounds to me like your trying to make this way more difficult than it
> needs to be.
>
> Also it sounds to me like your trying to assign the same phone number to
> multiple people. (which is fine) But doesn't make a lot of sense to me in a
> practical application.
>
> n
>
> On Tue, Sep 21, 2010 at 9:59 AM, Anton Danilchenko <
>
>
>
>
>
> anton.danilche...@gmail.com> wrote:
> > In my case, I have Users with equal phone numbers. And I need only
> > ManyToMany relationship.
>
> > I need create custom field for get information from CharFiels,
> > validate this data, clean and save to datastore in separate model. If
> > this phone already exists - we get ID of this phone. And, if this is a
> > new phone number - we insert this phone to separate model and get new
> > ID.
>
> > --
> > 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 unsubscribe from this group, send email to
> > django-users+unsubscr...@googlegroups.com > groups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/django-users?hl=en.
>
> --
> Guadajuko! Vamos a correr!
>  -"Cool! we are going to run!"

-- 
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 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: ManyToManyField to Phones model for enter phones manually (not select from list)

2010-09-21 Thread Anton Danilchenko
In my case, I have Users with equal phone numbers. And I need only
ManyToMany relationship.

I need create custom field for get information from CharFiels,
validate this data, clean and save to datastore in separate model. If
this phone already exists - we get ID of this phone. And, if this is a
new phone number - we insert this phone to separate model and get new
ID.

-- 
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 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.



ManyToManyField to Phones model for enter phones manually (not select from list)

2010-09-21 Thread Anton Danilchenko
Hi all!

Please, help me undestand, how to solve next task.

I am show for user form with two fields: user name and text field,
where user input list of phones, separated by comma. User sholud enter
one or more phones separated by comma. If user enter not valid number
- we show error message like this "Phone 12345 is not valid. Please,
enter valid phone numbers separated by comma".

I have next two models:

class Phone(models.Model):
  number = models.CharField(max_length=20)

class UserInfo(models.Model):
  name = models.CharField(max_length=70)
  phones = models.ManyToManyField(Phone)

User should enter numbers in CharField in format 0XX XXX . But, I
need save phone in database in format 0XX (only number without
spaces and other non-numbers digits).

Please, can you help me in this. I am new in Django, and I am read
more articles and not found solution. I think that I need create
custom fields for form and model.

P.S. Also, in admin section I should see CharField instead of
ManyToManyField.

-- 
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 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: Spam filters for Django?

2010-09-04 Thread Anton Bessonov



the three most common ways are to only allow logged in users to post,
captchas or akismet or a combination of the three.
  

Sometimes Honey pot is very effective in combination with captcha.

--
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 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: Мобильная версия

2010-08-29 Thread Anton Bessonov
Де факто - Вам не нужен полный список. Но если так хочется, то 
достаточно инициально поддерживать список самых распростанённых агентов 
и сделать ссылки "нормальная/мобильная версия". Каждый клик 
протоколировать и из этой информации модифицировать список.

Спасибо за перевод моего вопроса, но тут дело в том, что я уже видел
эту страницу, и список там далеко не полный, и тем более, список этот
постоянно пополняется, с выходом новых ОС для мобильников.
Как реализовать универсальный проверку? Создать свой словарь из кусков
возможных User Agent'ов без использования цифр версий ОС и тд и
проверять его вхождение в полученный User Agent зашедшего на сайт
пользователя?


  


--
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 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: Install Django in a Production server!

2010-03-11 Thread Anton Bessonov
Using Django on Apache with mod_python in production - it's a bad idea! 
wsgi or fcgi is better start point.

http://docs.djangoproject.com/en/dev/howto/deployment/


Massimiliano Bertinetti schrieb:

If I understand, you want information about installing python/django in
a production enviroment (ex-novo).

I recently do this on a Linode Virtual Ubuntu Server and I think you can
do the same.

Here a tutorial: http://library.linode.com/web-frameworks/django

I'm not a Linode man! What you find on this tutorial you can apply on
other virtual / phisical server, but I found Linode a good choice for
me: http://www.swap-hq.com (only italian - sorry!!).

Max-B

Il giorno gio, 11/03/2010 alle 09.56 -0800, Tiago ha scritto:
  

I want to keep my dedicated server for my company, where can i find a
tutorial, the best choices for OS.

Thanks





  


--
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 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.



django & wsgi: what is the preferred webserver?

2010-03-07 Thread anton
Hi,

I am new to django and wanted to set up a webserver
and use apache or lighttpd.

As I understood wsgi is the preffered ( most performant) way
to use python & a web server.

I heard that apache has a mod_wsgi and wanted to ask if 
there exists such a module for lighttpd too?

What would you propose to use:
 - apache + mod_wsgi
 - or lighttpd + ??

Anton

-- 
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 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 IDE

2010-02-15 Thread Anton Bessonov

http://www.vim.org/

dj_vishal schrieb:

Hello

   Hi to all am new to the Django Framework.am learning django
   Which IDE is suitable for Django ..plz help me in right way

   Thanks in Advance
   vishal
   2009vis...@gmail.com
  


--
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 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: Get name from request.path

2009-12-30 Thread Anton Bessonov
django.core.urlresolvers.resolve?


kelvan.mailingl...@gmail.com schrieb:
> request.META['HTTP_HOST'] just return the webadress from the server, I 
> need the name I gave an url un urls.py.
> Like reverse just the other way
>
> florian
>
> 2009/12/25 Shawn Milochik 
>
> Try this:
>
> request.META['HTTP_HOST']
>
> If not, check the docs for the request object:
>
> 
> http://docs.djangoproject.com/en/dev/ref/request-response/#httprequest-objects
> 
> 
>
> Shawn
>
> --
>
> 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
> .
>
>
>

--

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 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 editor for Debian

2009-12-16 Thread Anton Bessonov
Nano.

NMarcu schrieb:
> Hello all,
>
>Can you tell me a good Django editor for Debian? Something more
> pretty then default text editor. Something to can edit templates also.
> Thanks.
>
> --
>
> 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 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.
>
>
>
>   

--

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 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: Make the makemessages command more open

2009-12-14 Thread Anton Bessonov
Hi Kevin,
> I am using Jinja2 instead of the Django template system
>   
I'm too. Django Templates is really slow and unhandily.
> Would it be a good idea suggest this in a ticket?
>   
Yes. + create option "nocomments" because is bad to merge.

--

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 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.




  1   2   >