Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Django F expression with foreign key
I want to order model using F expression. On same model (idmm), long attribute is working ExpressionWrapper( (lat - Func(F('long'), function='x')), output_field=FloatField() ) but on foreign model (foreign) with accessor idmm__long ExpressionWrapper( (lat - Func(F('idmm__long'), function='x')), output_field=FloatField() ) it is not working. Running this query foreing.objects.all()[0].idmm.long in shell is working fine. Any suggestions are welcome. -
Django tutorial 5 , 1044 Access denied for user @'localhost' database error
I am working on tutorial 5 , i tried running a test: $ python manage.py test polls Creating test database for alias 'default'... Got an error creating the test database: (1044, "Access denied for user 'myprojectuser'@'localhost' to database 'test_myproject'") Type 'yes' if you would like to try deleting the test database 'test_myproject', or 'no' to cancel: yes Destroying old test database for alias 'default'... Got an error recreating the test database: (1044, "Access denied for user 'myprojectuser'@'localhost' to database 'test_myproject'") I have tried mentioning the test_name in settings.py DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': 'myproject', 'USER': 'myprojectuser', 'PASSWORD': 'password', 'HOST': 'localhost', 'PORT': '', 'TEST_NAME': 'test_database_myprojecttest', } } I also ran ,"GRANT ALL PRIVILEGES ON test_myproject TO 'myprojectuser'@'localhost';" and CREATE USER 'myprojectuser'@'localhost' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON myproject TO 'myprojectuser'@'localhost'; The two query commands above were run while setting up the database. Still the same error. What should i do ? -
Django - Google Calendar integration. Use Git fetch to compare local & origin?
I am working on a Django project which has Google Calendars integrated into it. I followed the tutorial on Google for integrating its Calendars into the Django app, but it seems that doing this has somehow 'blocked' my user profile from accessing the Django app... When I now try to browse to my website, I get a NameError that says: user is not defined, and that there was an error during template rendering. The error messages in the browser seem to indicate that my 'user' is not defined- specifically when the view below is trying to use it: def get_invite_details(user, responded=False): from calendar_api.manager import get_event from django.utils.dateparse import parse_datetime from events.models import Meeting # if responded: responded = True if user.is_authenticated(): employee = user.employee if responded: e_invites = employee.event_notifications.all() else: e_invites = employee.event_notifications.filter(responded=False) events_data = [get_event(i.calendar_id, i.event_id) for i in e_invites] """ events_data = [ {u'status': u'confirmed', 'kind': u'calendar#event', 'end': {u'dateTime': u'2016-09-16T13:00:00+01:00'}, 'description': u'Client names: Camilla Cuell\n\t\t\t\t\tPhone: 7779133737\n\t\t\t\t\tNone\n\t\t\t\t', 'created': u'2016-09-09T17:30:16.000Z', 'iCalUID': u'rp6khosg92m67961e942vh5e7c@google.com', 'reminders': {u'useDefault': True}, 'htmlLink': u'https://www.google.com/calendar/event?eid=cnA2a2hvc2c5Mm02Nzk2MWU5NDJ2aDVlN2MgbnRpb3VlMTZrNHRtY2txdHZmYW85Zm9vZG9AZw', 'sequence': 0, 'updated': u'2016-09-09T17:30:16.203Z', 'summary': u'New Project: Camilla Cuell', 'start': {u'dateTime': u'2016-09-16T12:00:00+01:00'}, 'etag': u'"2946884432406000"', 'location': u'full address', 'attendees': [{u'displayName': u'Person', 'email': u'bj1lanevhgvgtra071u0s1m7ec@group.calendar.google.com', 'responseStatus': u'needsAction'}], 'organizer': {u'self': True, 'displayName': u'Person2', 'email': u'ntioue16k4tmckqtvfao9foodo@group.calendar.google.com'}, 'creator': {u'email': … -
Django: LogoutView doesn't work
I hvae the url.py with: url(r'^logout/', views.LogoutView.as_view(), name='logout'), and the views.py from django.contrib.auth.views import logout class LogoutView(RedirectView): permanent = True url = reverse_lazy('login') def get(self, request, *args, **kwargs): logout(request) return super(LogoutView, self).get(request, *args, **kwargs) But if I try to log out myself, it doesn't work and I also don't get a error message. I tried also: def logout_view(request): logout(request) return HttpResponseRedirect('login') But I can still access to all pages. I use class-based views and use @method_decorator(login_required). I use for the login the django module django-ldap-auth. -
How to add a new group but teacher has to come from a list
I want to add a new group but for the teacher they have to choose from a list that is in the table Teacher because it has a relation with Groups. tables: Teacher, Group Relation: Teacher 1 to many Group models.py class Teacher(models.Model): name = models.CharField(max_length=100) def __str__(self): return '%s' % (self.name) class Group(models.Model): name = models.CharField(max_length=100) teacher = models.ForeignKey(Leraren, on_delete=models.CASCADE) def __str__(self): return '%s %s' % (self.name, self.teacher) forms.py class TeacherForm(forms.Form): name = forms.CharField(required=True, label='name', max_length=100) class GroupForm(forms.Form): name = forms.CharField(required=True, label='name', max_length=100) teacher = # choose from list of teachers that are in the db Teachers # -
Getting Error, But the package is installed
I am trying to set a little report system up on the system to allow admin to produce reports as Csv documents. I found Django-import-export installed it changed my INSTALLED_APPS, everything worked. Like the documnetation suggests i'm adding from import_export import resources Into admin.py but i get an error each time Traceback (most recent call last): File "/home/vagrant/env/local/lib/python2.7/site-packages/django/utils/autoreload.py", line 229, in wrapper fn(*args, **kwargs) File "/home/vagrant/env/local/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 107, in inner_run autoreload.raise_last_exception() File "/home/vagrant/env/local/lib/python2.7/site-packages/django/utils/autoreload.py", line 252, in raise_last_exception six.reraise(*_exception) File "/home/vagrant/env/local/lib/python2.7/site-packages/django/utils/autoreload.py", line 229, in wrapper fn(*args, **kwargs) File "/home/vagrant/env/local/lib/python2.7/site-packages/django/__init__.py", line 18, in setup apps.populate(settings.INSTALLED_APPS) File "/home/vagrant/env/local/lib/python2.7/site-packages/django/apps/registry.py", line 115, in populate app_config.ready() File "/home/vagrant/env/local/lib/python2.7/site-packages/django/contrib/admin/apps.py", line 22, in ready self.module.autodiscover() File "/home/vagrant/env/local/lib/python2.7/site-packages/django/contrib/admin/__init__.py", line 24, in autodiscover autodiscover_modules('admin', register_to=site) File "/home/vagrant/env/local/lib/python2.7/site-packages/django/utils/module_loading.py", line 74, in autodiscover_modules import_module('%s.%s' % (app_config.name, module_to_search)) File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module __import__(name) File "/vagrant/twm/component/admin.py", line 11, in <module> from import_export import * ImportError: No module named import_export**strong text** Can anyone help me get this working? -
Querying PostgreSQL database (with Django) for only objects with relations
I'm presently learning about Django by working through the official tutorial, and decided to try adding some additional features and tests as suggested here. I have two models in the DB right now that look basically like this: class Question(models.Model): question_text = models.CharField(max_length=200) pub_date = models.DateTimeField('date published') class Choice(models.Model): question = models.ForeignKey(Question, on_delete=models.CASCADE) choice_text = models.CharField(max_length=200) votes = models.IntegerField(default=0) I have a view set up to display a list of questions. What I want to do is create a query for the view which will only include question objects that have associated choices. Any question object that has no related choice object should not be included in the result set. This query also ignores questions dated in the future and sorts them, but that part is fine and right out of the tutorial. This is what I came up with so far. It seems to work, but I can't help thinking I've done it in a really backwards and inefficient way. Is it possible to make one query that handles everything in the database instead of two queries and a list comprehension?? choices = Choice.objects.prefetch_related( 'question').distinct('question') question_ids = [x.question.id for x in choices] return Question.objects.filter( id__in=question_ids).filter( pub_date__lte=timezone.now()).order_by('-pub_date')[:5] -
Django Admin RESTful answer
I have a running django project that basically runs in "normal" mode. (No js frontend, no restapi). Now for exposing some of my data for further processing I want to expose a particular part of my database using the data that is already configured and available through the django admin through a rest like interface. For this purpose I would imagine simply subclassing parts of the admin package and returning a json instead of rendering a template. Where would I start with this? -
How to load the static files in Django Web project
I am very Confused that how to load the CSS files in Actual Html code in Django i have seen some documentation but it's out of my mind. Please Guide me to load the static files in the Django framework and please tell me all the steps used in loading the static files.Thank you -
How to add dynamic app into INSTALLED_APPS?
I created a middleware.py file and I try add "suit" into INSTALLED_APPS in this file, I print INSTALLED_APPS despite have in list but no have effect in admin page, style of admin still default. this is my code in middleware.py file from django.core.urlresolvers import resolve from django.conf import settings from django.db.models import loading from django.core import management from django.shortcuts import redirect class CustomeAppMiddleware(object): def process_response(self, request, response): if 'admin' in request.path_info and 'suit' not in settings.INSTALLED_APPS: print request.path_info tmp = ('suit',)+settings.INSTALLED_APPS settings.INSTALLED_APPS = tmp print settings.INSTALLED_APPS loading.cache.loaded = False management.call_command('syncdb', interactive=False) return response please help me to solve this problem. thanks all. -
OperationalError: FATAL: password authentication failed for user
Yesterday I was attempting to setup a django website on an Ubuntu 16.04 server on Digital Ocean. I was having some problems with Potsgresql particularly when I thought I had it all installed and tried to migrate the files, eventually I found this thread and followed the chosen answer which worked perfectly for me django.db.utils.OperationalError: could not connect to server: No such file or directory after doing that I was able to get my site running (but with no css) on my site on :8000, I called it a day at that point. After returning to it today about 24hrs later and trying to do python manage.py runserver so that I can finish the setup I am now getting this error File "/home/david/.local/lib/python2.7/site- packages/psycopg2/__init__.py", line 164, in connect conn = _connect(dsn, connection_factory=connection_factory, async=async) django.db.utils.OperationalError: FATAL: password authentication failed for user "django_user" FATAL: password authentication failed for user "django_user" I tried recreating the steps from the other thread but that hasn't worked, Ive open the psql shell and reset the password and double checked that the password in my keys file is correct, I also checked that the user 'django_user' is still there and the correct db has the permissions etc. … -
Negative number in database always positive when fetched (django)
I am working on a CRM - build on django-xadmin, and need to work with a negative number in the database (PostgreSQL). Submitting the value into the database works properly. The field is an IntegerField (which is always signed) I have checked the value in PGAdmin3, and shows a proper negative number as desired. Fetching the records from the database, the number suddenly is always positive. I just can't figure out why this happens, so any advice on the situation is welcome. hours = models.IntegerField(default=0, blank=True, null=True) Fetching and displaying the records: changes = HoursChange.objects.filter(coworker=coworker, hours__isnull=False) import ipdb; ipdb.set_trace() For testing I added a value of -13 hours During check in PGAdmin the value is a proper -13 Ipdb: changes[0].hours returns 13, which is an unexpected positive integer First thing I tried is to change the IntegerField to a FloatField, but it would return 13.0 - also an unwanted postive number. Any suggestions what I am doing wrong or what I could try? Thank you. -
What is the default Django session lifetime and how to change it?
Can't find a setting for it in https://docs.djangoproject.com/en/1.10/ref/settings/. I know this can be done manually (How to expire Django session in 5minutes?). -
Django How to create credi Debit and total balance in view or mobel
I was Created Tables 1) Beneficiary, Fix_Deposit, Biller, Transaction for transfer Amount 2)How Update Total balance in each table 3)I simple created Table 4)How credit,Debit and total Balance in view.py class Transaction(models.Model): account = models.ForeignKey(Account) Account_Number = models.PositiveIntegerField() Account_Type = models.CharField(max_length=30) Transaction_Date = models.DateTimeField(default=datetime.datetime.now) Reference_Number = models.CharField(max_length=30) Transaction_Description = models.CharField(max_length=30) Credit = models.DecimalField(max_digits=10,decimal_places=2) Debit = models.DecimalField(max_digits=10,decimal_places=2) Balance = models.DecimalField(max_digits=10,decimal_places=2) class Beneficiary(models.Model): account = models.ForeignKey(Account) Name = models.CharField(max_length=30) Account_Number = models.IntegerField() Bank_Name = models.CharField(max_length=30, blank=True) Branch = models.CharField(max_length=30, blank=True) IFSC_Code = models.IntegerField() phone_regex = RegexValidator(regex=r'^\+?1?\d{9,15}$', message="Phone number must be entered in the format: '+999999999'. Up to 15 digits allowed.") Mobile_Number = models.CharField(validators=[phone_regex], blank=True ,max_length=10) # validators should be a list Email_Id = models.EmailField(default='') -
How to order a serializers.ListField on Django Rest Framework
How can I order a serializers.ListField at a ViewSet? class FooSerializer(serializers.ModelSerializer): bar = serializers.ListField() -
"post" method condition not working in django form edit and save
After Clicking on a edit method in a form the data of the model gets loaded in the form view but when I click on the save button the value is not saved instead the page is again reloaded with the same values. Saving the New form in database via form works fine views.py def sessioncreate(request): if request.method=="GET": form=SessionForm(); return render(request,'app/sessions_form.html',{'form':form}); elif request.method=="POST": form=SessionForm(request.POST); form.save(); return HttpResponseRedirect('/sessions'); def SessionUpdate(request,pk): post = get_object_or_404(Sessions, pk=pk) if request.method == "post": form = SessionForm(request.POST) form.save() return RedirectView('/sessions',pk=form.pk); else: form = SessionForm(instance=post) return render(request,'app/sessions_form.html',{'form':form}); models.py class Sessions(models.Model): title=models.CharField(max_length=50) abstract=models.CharField(max_length=2000) track=models.ForeignKey(Track) speaker=models.ForeignKey(Speaker) status=models.CharField(max_length =1, choices=SESSION_STATUSES) # returning name in site def __str__(self): return self.title def get_absolute_url(self): return reverse('sessions_detail', kwargs={'pk':self.pk}) class SessionForm(forms.ModelForm): class Meta: model=Sessions; fields=['title','abstract','track','speaker']; url.py url(r'^sessions/$',views.SessionList.as_view(),name='sessions_list'), url(r'^sessions/(?P<pk>[0-9]+)/$',views.SessionDetail.as_view() , name='sessions_details'), url(r'^sessions/create/$',views.sessioncreate, name='sessions_create'), url(r'^sessions/update/(?P<pk>[0-9]+)/$',views.SessionUpdate , name='sessions_update'), url(r'^sessions/delete/(?P<pk>[0-9]+)/$',views.SessionDelete.as_view() , name='sessions_delete'), session_form.html {% extends 'layout.html' %} {% block content %} <form method="post"> {% csrf_token%} {{form.as_table}} <button type="submit">Save</button> </form> {% endblock %} -
how to pass the values from drop down to URL in django
I am trying to prepare a simple UI . In which user will select the roboid from a dropdown on clicking the submit button he should get the robot details using a rest API URL.If i hardcode the roboid i am getting the results.But my doubt here is how to pass the value from drop down to URL.And how to display that json in tabular form in same window. Here is my code: Views.py from django.shortcuts import render from django.http import HttpResponseRedirect import ast from django.http import HttpResponse import requests from .form import NameForm def get_name(request): # if this is a POST request we need to process the form data title = 'welcome' k = {} form = NameForm(request.POST or None) context = { "form": form, "title": title, "roboid": 2} if form.is_valid(): robotid = request.POST.get('roboid', '') print robotid resp = requests.get('https://r0p1i0hwdh.execute-api.us-west-2.amazonaws.com/testhp/?roboid=%s' % robotid) l = ast.literal_eval(resp.content) di = ast.literal_eval("".join(map(str, l))) for k, v in di.iteritems(): items = "{:<25} {:<50}".format(k, v) context = { "robotid": robotid} return render(request, "name.html", context) name.html class a: < !DOCTYPE html > < html < head > < / head > < body bgcolor = "#f5f5dc" > < center > <h1 > {{title}} < / h1 … -
Django image upload form not working
I am having trouble uploading the image in Django Form. The following form fails to validate due to some issue in the image uploading Here is the code : forms.py from django import forms from .models import Description, Bill class BForm(forms.ModelForm): party = forms.CharField(widget=forms.TextInput(attrs={'class':'form-control','placeholder':'Party'})) inovice = forms.FloatField(widget=forms.TextInput(attrs={'class':'form-control','placeholder':'Invoice#'})) amount = forms.FloatField(widget=forms.TextInput(attrs={'class':'form-control','placeholder':'Bill-Amount'})) image = forms.ImageField() image_caption = forms.CharField(widget=forms.TextInput(attrs={'class':'form-control','placeholder':'Invoice#'})) class Meta: db_table = 'inventory_bill' model = Bill fields = ('party', 'inovice', 'amount','image','image_caption') models.py from __future__ import unicode_literals #from django.utils.encoding import python_2_unicode_compatible from django.db import models #@python_2_unicode_compatible class Description(models.Model): desc = models.CharField(max_length = 200,default = "Suits") bill = models.FloatField(max_length = 200) length = models.FloatField(max_length = 200) quality = models.CharField( max_length=200,default = "custom") rate = models.FloatField(max_length = 200) def __str__(self): return self.desc class Bill(models.Model): party = models.CharField(max_length = 200) inovice = models.FloatField(max_length = 200) amount = models.FloatField(max_length = 200) image = models.ImageField(upload_to='images/products/main',null=True, blank=True) image_caption = models.CharField(max_length=200,default = "null") def __str__(self): return self.party+','+str(self.inovice)+','+str(self.amount) def bill_id(self): return self.id; index.html {% load staticfiles %} <!-- test --> <html> <head> <title></title> <link href="{%static "./styles/bootstrap.min.css" %}" rel="stylesheet" /> </head> <body> <h1 style="text-align: center;">Rahul's Shop</h1> <h2 style="text-align: center;">Inventory</h2> <form enctype="multipart/form-data" id="bill" action ="{% url 'front:commitbill' %}" method = "post" class="form-horizontal"> {% csrf_token %} {% for field in form %} <div class="form-group"> … -
How to give the information about request.user to clean method
I have a form: class CreateConferenceForm(forms.ModelForm): class Meta: model = Conference fields = ['name', 'participants'] def clean(self): cleaned_data = super(CreateConferenceForm, self).clean() if not request.user.id in cleaned_data.get('participants'): raise forms.ValidationError('Error') But I don't know how to import a request object from view, because method is_valid hasn't additional arguments. How I can do it? -
Why Django forces me to upload an image if I upload a file?
I have this really simple Django-Rest-Framework task app which does now behave the way I expect. Both image and file upload work so does the url routing their urls. However when I upload only Doc to new Task I get following error > { "image": [ "The submitted data was not a file. Check the encoding type on the form." ] } Note that I just added the blank=True field behaviour was same without it. the default No-img.jpg and No-doc.pdf files exist and route fine. Here is my TaskApp/models.py from django.db import models class Task(models.Model): task_name = models.CharField(max_length=20) task_desc = models.TextField(max_length=200) completed = models.BooleanField(default=False) date_created = models.DateTimeField(auto_now_add=True, auto_created=True) image = models.ImageField(upload_to='Images/', default='Images/None/No-img.jpg', blank=True) doc = models.FileField(upload_to='Doc/', default='Doc/None/No-doc.pdf') def __str__(self): return '{}'.format(self.task_name) # TODO try to understand why this model requires image upload Here is my TaskApp/serializers.py from rest_framework import serializers from .models import Task class TaskSerializer(serializers.ModelSerializer): image = serializers.ImageField(max_length=None, use_url=True) doc = serializers.FileField(max_length=None, use_url=True) class Meta: model = Task fields = ('id', 'task_name', 'task_desc', 'completed', 'date_created', 'image', 'doc') Here is my TaskApp/views.py from rest_framework import viewsets, filters from .models import Task from .serializers import TaskSerializer class TaskViewSet(viewsets.ModelViewSet): queryset = Task.objects.all() # We use filters for ordering by part serializer_class = … -
Django development server on LAN
It's my first time creating a django project. Now i'm at the point where i need to run the development server in the LAN. Except i can't get it to work. My computer is connected with ethernet and the other computers in the network are connected via Wifi don''t know if that's relevant though. What i tried is running the following: The ip adress i found using ifconfig and copying inet addr: under ens33. - python manage.py runserver myipadrres:8000 - python manage,py runserver 0.0.0.0:8000 The 0.0.0.0 doesn't even work on the windows os on my own computer. The ipadress does work for that. Django settings debug is set to True. Like i said it's the first time creating such a project and i don't know much about web related stuff. So i might have forgot to install something that i don''t know about. Thanks in advance for your help Greetings, Dani -
how to ignore missing statemet in jenkins test coverage in django
Is it possible to ignore the missing branch coverage? I am using jenkins for test coverage and pylint testing. Is there any possibility to ingore missing statements and get 100% branch coverage? Maybe a property that can be set in project setting? -
createsuperuser didn't ask for username
I've got an error after I modified the User Model in django. when I was going to create a super user, it didn't prompt for username, instead it skipped it, anyway the object propery username still required and causing the user creation to failed. import jwt from django.db import models from django.contrib.auth.models import (AbstractBaseUser, BaseUserManager, PermissionsMixin) from datetime import datetime, timedelta from django.conf import settings # from api.core.models import TimeStampedModel class AccountManager(BaseUserManager): def create_user(self, username, email, password=None, **kwargs): if not email: raise ValueError('Please provide a valid email address') if not kwargs.get('username'): # username = 'what' raise ValueError('User must have a username') account = self.model( email=self.normalize_email(email), username=kwargs.get('username')) account.set_password(password) account.save() return account def create_superuser(self,username, email, password, **kwargs): account = self.create_user(username, email, password, **kwargs) account.is_admin = True account.save() return account class Account(AbstractBaseUser): email = models.EmailField(unique=True) username = models.CharField(max_length=40, unique=True) first_name = models.CharField(max_length=40) last_name = models.CharField(max_length =40, blank=True) tagline = models.CharField(max_length=200, blank=True) is_admin = models.BooleanField(default=False) USERNAME_FIELD = 'email' REQUIRED_FIELD = ['username'] objects = AccountManager() def __str__(self): return self.username @property def token(self): return generate_jwt_token() def generate_jwt_token(self): dt = datetime.now + datetime.timedelta(days=60) token = jwt.encode({ 'id': self.pk, 'exp': int(dt.strftime('%s')) }, settings.SECRET_KEY, algorithm='HS256') return token.decode('utf-8') def get_full_name(self): return ' '.join(self.first_name, self.last_name) def get_short_name(self): return self.username it results … -
Assign permissions of group to the user in django
I read in Django documentation that when I add an User in a group, it will automatically have the permissions granted to that group. So, in my application I created a group called "admin" via admin interface and I gave the permission I needed to it. Now if I create a new User and add it to the group "owners", it doesn't have the permissions of the group. Then I tried to experiment it in django shell and it ran well The permissions of the group really assigned to the user_permissions That's my code in django user model class UserAccount(AbstractUser): def __str__(self): # __unicode__ for Python 2 return str(self.username) def __unicode__(self): return str(self.username) def save(self, *args, **kwargs): super(UserAccount, self).save(*args, **kwargs) for group in set(self.groups.all()): self.user_permissions = group.permissions.all() Another Try class UserAccount(AbstractUser): def __str__(self): # __unicode__ for Python 2 return str(self.username) def __unicode__(self): return str(self.username) def save(self, *args, **kwargs): super(UserAccount, self).save(*args, **kwargs) for group in set(self.groups.all()): for perm in group.permissions.all(): self.user_permissions.add(perm) Both not working when I save the user from the admin panel interface but both working well at the django shell I tried to debug ipdb and the code executed but permissions not assigned Then I try to add permissions … -
Django: cannot import name migrations
I had an issue I just posted here. I saw an answer to a similar question which said uninstalling and installing requirements.txt would help because the root of the issue was a bad dependency chain. So I did that and now, of course, I ran into a new issue. When running the migrations, I am getting the following error: File "C:\Python27\lib\site-packages\genericm2m\migrations\0001_initial.py", line 5, in <module> from django.db import migrations, models ImportError: cannot import name migrations According to another answer, this is caused because I am using the migrations module, which my Django version (1.4) doesn't support yet. It seems like the django-generic-m2m module (version 0.3.1) is using migrations. I don't understand why this issue is happening now, as I have always used the same requirements.txt file and I never had this problem. I used to have similar problems with dependencies using migrations while my Django couldn't handle them. But these deps also had a south_migrations folder, so just renaming it to migrations and getting rid of the actual migrations folder would do the trick. However, I don't see any south_migrations directory in the generic2m2 installation dir. Has anybody had this issue before?