Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Django duplicate ON_DELETE rule
I'm having a problem in my model design. I have 2 models implemented for my forum + User model. User Topic - User (on_delete CASCADE) Post - Topic (on_delete CASCADE) - User (on_delete CASCADE) The Post model is referenced in a CASCADE on_delete rule 2 times, and Django seems to be having problems with this when deleting User (just for tests). The problem here is, that I also want to store the author of the Topic on the Topic model, but that seems to be necessary in my implementation. I also tried different values for the User relation on Post, but it didn't seem to work. The only think I could probably try is DO_NOTHING, but with that, I'm getting the same issue as with CASCADE. Exception: Cannot resolve keyword 'max' into field. Join on 'added' not permitted. -
Installing jinja2 on a server returns an error says (system file is read only) on hostgator
I am trying to install jinja2 on a hosted server on Hostgator through SSH. When I type pip install jinja2 in a linux terminal, I get an error informs me that the file is set on read only. As far as I know, django and python2 are installed. I'm just trying to install jinja2 to fix the error in the picture below. (https://i.stack.imgur.com/RqTmm.png) -
Is it advisable to use PIL with Django to create a website which will generate images based on user upload?
I am Creating a website to cut and merge images uploaded by the user. The website was fast enough in virtualenv on the local machine, but as soon as I started using S3 for Media and static files, I noticed the following There was a huge time gap between the pages being loaded, I had to change the code to open and save images from S3. The website wasn't as responsive as before So it forced me to wonder if there is a better way to make such a website? Tech Used AWS S3 (for Static and Media storage) Heroku (for hosting) requirements boto==2.48.0 boto3==1.4.7 botocore==1.5.29 Django==1.11.5 django-storages==1.5.2 Pillow==4.2.1 requests==2.18.4 s3transfer==0.1.11 urllib3==1.22 -
how to use request_finished in Django signals
As the title says I'm confused on the implementation of request_finished. What I'm trying to setup is that when my function finishes (say an ajax call that returns some json and creates a model or the default (non-ajax) view finishes...) I want create a model instance (say a log) How would I set this up? Can anyone provide an example. I thought request_finished would be the best to use to try to avoid duplicate creations as the documentation talks about -
'TemplateDoesNotExist at /' Error in django?
The server is working fine, however while using extend for this 'home.html' file unable to link the template : In 'home.html': { % extends "/template1/personal/header.html" % } While loading localhost: Django tried loading these templates, in this order: `Using engine django: django.template.loaders.app_directories.Loader: /usr/local/lib/python2.7/dist-packages/django/contrib/admin/templates/ffgg/home.html (Source does not exist). django.template.loaders.app_directories.Loader: /usr/local/lib/python2.7/dist-packages/django/contrib/auth/templates/ffgg/home.html (Source does not exist)` -
How to Improve a report processing time (Django/MySQL)?
I'm looking for ideas on how to improve a report that takes up to 30 minutes to process on the server, I'm currently working with Django and MySQL but if there is a solution that requires to change the language or SQL database I'm open to it. The report I'm talking about reads multiple excel files and insert all the rows from those files into a table (the report table) with a range from 12K to 15K records, the table has around 50 columns. This part doesn't take that much time. Once I have all the records on the report table I start applying multiple phases of business logic so I end having something like this: def create_report(): business_logic_1() business_logic_2() business_logic_3() business_logic_4() Each function of the business_logic_X does something very similar, it starts by doing a ReportModel.objects.all() and then it applies multiple calculations like checking dates, quantities, etc and updates the record. Since it's a 12K record table it quickly starts adding time to the complete report. The reason I'm going multiple functions separately and no all processing in one pass it's because the logic from the first function needs to be completed so the logic on the next functions … -
Django Rest Framework. How Retrieve works
I am fairly new to Django rest framework and I had a couple questions that would really clear up a lot of stuff for me. I was looking at docs for simple CRUD generic views like ListAPIView, Retrieve... etc. For my list view I created it like this: class CourseListApiView(ListAPIView): queryset = Course.objects.all() serializer_class = CourseListSerializer Which makes sense because of the queryset returns Course.objects.all() so all the courses appear. What I am not clear about is how the queryset in RetrieveApi works class CourseRetrieveAPIView(RetrieveAPIView): queryset = Course.objects.all() serializer_class = CourseRetrieveSerializer This is my retrieve view, it takes pk from my link and returns a corresponding course. What is unclear to me is why the queryset is Course.objects.all(), not a filtered query that gets the kwargs from the URL and filters my Courses. I tried it my way and got the same results, my view was: class CourseRetrieveAPIView(RetrieveAPIView): serializer_class = CourseRetrieveSerializer def get_queryset(self): queryset = Course.objects.filter(pk=self.kwargs.get('pk')) return queryset This makes more sense since the queryset is Course.objects.filter(pk=self.kwargs.get('pk')) instead of Course.objects.all() which to me doesn't make sense since I am filtering my courses by the pk in the URL Hope my question made sense. Leave a comment if you need any … -
whi If I make new tax in djanggo admin the tax and all_tax value in Names table stil 0
I have a problem in django admin I have this 2 class enter code here class Names(models.Model): name = models.CharField(max_length=200) tax = models.IntegerField(default=0) all_tax = models.IntegerField(default=0) class Taxs(models.Model): name = models.ForeignKey(Names , on_delete=models.CASCADE) value = models.IntegerField() all_value = models.IntegerField() in admin.py enter code here class TaxsAdmin(admin.ModelAdmin): def save_model(self, request, obj, form, change): q=obj.name.name if obj.case == 'start': r = Names.objects.get(name=q) vv=obj.value vvv=obj.all_value r.taxs=vv r.all_taxs=vvv r.save() else: r = Names.objects.get(name=q) r.taxs=0 r.all_taxs=0 r.save() super(TaxsAdmin, self).save_model(request, obj, form, change) If I make new tax in djanggo admin the tax and all_tax value in Names table stil 0 -
How do I properly use SignUp Form in Django All Auth?
I am using django allauth to register and login users. I have started with the signup functionality. The wrinkle here is that I want to display the sign up form in a modal. To achieve that, I have the following in home.html: <button class="nav-item nav-link" id="sign-up" onclick="showSignUpModalForm()"><i class="fa fa-edit nav-icon" aria-hidden="true"></i>Sign Up</button> {% include "account/sign_up_modal_form.html" %} <script src="/static/account/js/signUpModal.js"></script> Pushing the button, runs signUpModal.js which shows the modal: function showSignUpModalForm() { $('#signUpModalForm').modal('show');} You can see below the afforementioned modal which contains the sign up form. The form is hardcoded and I am not using something like {{ form.as_p}}: {% load static %} {% load widget_tweaks %} <link rel="stylesheet" href="{% static "account/css/signup.css" %}"> <div class="modal fade" id="signUpModalForm" tabindex="-1" role="dialog" aria-labelledby="signUpModalFormLabel" aria-hidden="true"> <div class="modal-dialog" role="document"> <form class="signup" id="sign_up_form" method="post" action="{% url 'account_signup' %}"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="signUpModalFormLabel">Create your new account</h5> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">&times;</span> </button> </div> <div class="modal-body"> {% csrf_token %} <div class="form-group"> <h4><label for="id_username">Username</label></h4> <input type="text" name="username" placeholder="eg. profitablebettor10" autofocus="autofocus" minlength="1" maxlength="150" class="form-control" required id="id_username" /> </div> <div class="form-group"> <h4><label for="id_email">E-mail</label></h4> <input type="email" name="email" placeholder="eg. seriousbets@gmail.com" class="form-control" required id="id_email" /> </div> <div class="form-group"> <h4><label for="id_password1">Password</label></h4> <input type="password" name="password1" placeholder="Case sensitive, min. 12 characters" class="form-control" required id="id_password1" … -
in django1.11.6, settings.py INSTALLTED_APPS not find my modules?
settings.py my modules: apps/users/apps.py from django.apps import AppConfig class UserConfig(AppConfig): name = 'apps.users' error: error i scan django1.11.6 doc, not find INSTALLED_APPS change , and i dont't know how to resolve? -
fatal error C1083: Cannot open include file: 'magic.h': No such file or directory
trying to run a django server on my windows 10 computer. When I execute python manage.py runserver, I get the following error: fatal error C1083: Cannot open include file: 'magic.h': No such file or directory I'm running 64 bit python 3.5, on Windows 10. Here is the picture of the error: -
D3 graph is not loading in Django when pulled from another template
I am trying to load the content of a template inside a div in my index page in Django am using load from jquery. The HTML loads well, but the D3 graph script doesn't, and shows the following error in the console: [Deprecation] Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/. This is the function I am using to load it: $(document).ready(function() { $("#loader_growth").on("click", function() { $("#container").load("{% url 'dashboard:growth' %}"); }); }); This is my view in Django for the growth.html I want to insert in the dive in the index: def growth(request): growth_data = requests.get('https://www.ons.gov.uk/economy/grossdomesticproductgdp/timeseries/ihyp/qna/data') parsed_json = json.loads(growth_data.content) return render(request, 'dashboard/growth.html', { 'growth_json': json.dumps(parsed_json['years'][60:]) }) -
AngularJs Http get json file working with Django
i'm trying to make an angular http get to load a json file that is in the same location than my controller, both are in the static Django folder (i don't know if that is wrong). I have one view and one url registered in my urls.py file it just load the index.html template. The issue is when i try to make the http get to "leyes.json" file, the response.data shows me the code of my index.html; it doesn't happend to me without using Django and that's the reason what i think that my django code is wrong. I don't know what is happening :'v <div ng-controller="ToolbarController" id="header" ng-include="'{%static "toolbar.html" %}'"></div> <div ng-controller="ContentController" layout="row" layout-margin> <div flex="20" ng-include="'{%static "content.html" %}'"></div> <div flex="80"> <!--span ng-bind-html="$sce.trustAsHtml(msg)"></span--> </div> my controller into app.js file controller('ContentController', function($http,$sce,$scope) { $http({ method: 'GET', url: 'leyes.json' }).then(function successCallback(response) { console.log("return :V"); console.log(response.data); }, function errorCallback(response) { console.log("error"); }); }); and a screenshot of my directory as you can see, app.js and leyes.json are in the same directory urlpatterns = [ url(r'^login/',loginIndex), ] def loginIndex(request): template = loader.get_template('index.html') context = { } return HttpResponse(template.render((context), request)) console.log(response.data) Thank you so much -
Django Rest Framework 3.6.4 required field error behaviour
I have .sql file DROP TABLE IF EXISTS `param_yearly`; CREATE TABLE `param_yearly` ( `ID` int(11) NOT NULL, `HELP_ID` int(11) DEFAULT NULL, `HELP_TEXT` text DEFAULT NULL, `TYPE` varchar(50) DEFAULT NULL, `LABEL` varchar(255) DEFAULT NULL, `DESCRIPTION` varchar(255) DEFAULT NULL, `GROUPNAME` varchar(255) DEFAULT NULL, `ROWNUM` int(11) DEFAULT NULL, `WIDGET` varchar(50) DEFAULT NULL, `OPTIONS` varchar(50) DEFAULT NULL, `PARAM` varchar(255) DEFAULT NULL, `P2012` varchar(50) DEFAULT NULL ) ENGINE=InnoDB AUTO_INCREMENT=1599 DEFAULT CHARSET=utf8; A models.py with the following fields class param_yearly(models.Model): ID = models.AutoField(primary_key=True) HELP_ID = models.IntegerField(default=None) HELP_TEXT = models.TextField(max_length=15000) TYPE = models.CharField(max_length=50) LABEL = models.CharField(max_length=255) DESCRIPTION = models.CharField(max_length=255) GROUPNAME = models.CharField(max_length=255) ROWNUM = models.IntegerField() WIDGET = models.CharField(max_length=50) OPTIONS = models.CharField(max_length=50) PARAM = models.CharField(max_length=255) P2012 = models.CharField(max_length=50) A serializers.py class ParamYearlySerializer(serializers.ModelSerializer): class Meta: model = param_yearly fields = ('ID', 'HELP_ID', 'TYPE', 'LABEL', 'DESCRIPTION', 'GROUPNAME', 'ROWNUM', 'HELP_TEXT', 'WIDGET', 'OPTIONS','PARAM', 'P2012') def create(self, validated_data): """ Create and return a new `Snippet` instance, given the validated data. """ return param_yearly.objects.create(**validated_data) def update(self, instance, validated_data): """ Update and return an existing `ModelInput` instance, given the validated data. """ instance.ID = validated_data.get('ID', instance.ID) instance.HELP_ID = validated_data.get('HELP_ID', instance.HELP_ID) instance.TYPE = validated_data.get('TYPE', instance.TYPE) instance.LABEL = validated_data.get('LABEL', instance.LABEL) instance.DESCRIPTION = validated_data.get('DESCRIPTION', instance.DESCRIPTION) instance.GROUPNAME = validated_data.get('GROUPNAME', instance.GROUPNAME) instance.ROWNUM = validated_data.get('ROWNUM', instance.ROWNUM) instance.HELP_TEXT = validated_data.get('HELP_TEXT', instance.HELP_TEXT) instance.WIDGET … -
indexing custom Django model fields in wagtail
We're using Django MarkupField to store Markdown text and it works quite well. However, when we try to index these fields in Wagtail we get serialization errors from Elasticsearch, like this: File "/usr/local/lib/python3.5/dist-packages/wagtail/wagtailsearch/management/commands/update_index.py", line 120, in handle self.update_backend(backend_name, schema_only=options.get('schema_only', False)) File "/usr/local/lib/python3.5/dist-packages/wagtail/wagtailsearch/management/commands/update_index.py", line 87, in update_backend index.add_items(model, chunk) File "/usr/local/lib/python3.5/dist-packages/wagtail/wagtailsearch/backends/elasticsearch.py", line 579, in add_items bulk(self.es, actions) File "/usr/local/lib/python3.5/dist-packages/elasticsearch/helpers/__init__.py", line 195, in bulk for ok, item in streaming_bulk(client, actions, **kwargs): File "/usr/local/lib/python3.5/dist-packages/elasticsearch/helpers/__init__.py", line 162, in streaming_bulk for bulk_actions in _chunk_actions(actions, chunk_size, max_chunk_bytes, client.transport.serializer): File "/usr/local/lib/python3.5/dist-packages/elasticsearch/helpers/__init__.py", line 61, in _chunk_actions data = serializer.dumps(data) File "/usr/local/lib/python3.5/dist-packages/elasticsearch/serializer.py", line 50, in dumps raise SerializationError(data, e) elasticsearch.exceptions.SerializationError: ({'_partials': [<markupfield.fields.Markup object at 0x7faa6e238e80>, <markupfield.fields.Markup object at 0x7faa6dbc4da0>], 'pk': '1', 'research_interests': <markupfield.fields.Markup object at 0x7faa6e238e80>, 'bio': <markupfield.fields.Markup object at 0x7faa6dbc4da0>}, TypeError("Unable to serialize <markupfield.fields.Markup object at 0x7faa6e238e80> (type: <class 'markupfield.fields.Markup'>)",)) One workaround is to index callables that return field.raw but then we'd have to write one such callable for each and every Markdown field property we have in our models. I thought we could get around this by extending the field property (i.e., the django-markupfield Markup class that replaces the MarkupField) with a get_searchable_content(value) method but the serialization errors persist. Does anyone have any tips for indexing custom … -
Thousands of extraneous gunicorn workers
I'm using gunicorn 19.7.1 appserver with nginx reverse proxy for a Django project (Ubuntu 14.04 machine). ps aux | grep gunicorn | grep -v grep | wc -l yields 3043 at the moment. Whereas in /etc/init/gunicorn.conf, I've always had -w 33. Yet these extra workers persist even if I do sudo service gunicorn stop and sudo service gunicorn start. How do I kill the extraneous workers? How did this happen? The worker count of 33 has always been properly configured on my busy production system. However a few hours ago, I was trying python's multiprocessing on the server and things went south. Gunicorn ate up all the memory and took out the resident redis instances as well. I reverted the change and have managed to get everything back online, except all memory hasn't been released and I've had to cope with these extra gunicorn workers. -
Can't access Django site in production
I can't access my Django website on production. It returns me "ERR_CONNECTION_REFUSED". I use Nginx + Gunicorn + Supervisor in Ubuntu 16.04. Here's my sitepro.conf (supervisor) [program:sitepro] command = /home/chuck/sitepro/bin/gunicorn wsgi.py:application -w 4 -b :8001 --$ directory = /home/chuck/sitepro/site/sitepro user = chuck stdout_logfile = /home/chuck/sitepro/site/logs/gunicorn/gunicorn_stdout.log stderr_logfile = /home/chuck/sitepro/site/logs/gunicorn/gunicorn_stderr.log redirect_stderr = True environment = PRODUCTION=1 And my Nginx configuration file : server { listen 80; server_name www.mywebsite.com; return 301 https://www.mywebsite.com$request_uri; } server { listen 443 ssl; server_name mywebsite.com; root /home/chuck/sitepro/site; access_log /home/chuck/sitepro/site/logs/nginx/access.log; error_log /home/chuck/sitepro/site/logs/nginx/error.log; location / { proxy_set_header X-Forward-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_redirect off; if (!-f $request_filename) { proxy_pass http://127.0.0.1:8001; break; } } } My root folder is in /home/chuck/sitepro/site/ and sitepro is my main application, containing Django default wsgi.py. Did I miss something ? Thanks :) -
Django images uploaded by admin will not display in production or development
I have Django 1.10 and whitenoise 3.3 and the website is deployed on Heroku. My static files are fine in development and production. My media files, however do not load in production and development. When debug = True, the media files render properly in both production and development. What I really want is for the media files to render properly even when debug = False. Everything was fine and dandy until I realized I deployed my site with debug = True. So, I changed it to debug = False. Now the static and media files failed. I did some research and went to whitenoise docs to follow setup. Then the static files worked. However, the media files still failed. I read the docs on media and static files on Django, but unfortunately only saw some samples with nginx and the doc says there are many ways to do this and can only provide structure. I am seeking a solution that will allow me to continue to add things to my site in production via admin and still allow my to run my website with heroku. settings.py BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) INSTALLED_APPS = [ 'polls.apps.PollsConfig', 'blog.apps.BlogConfig', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', … -
Django: Set is_active = True manually, no way?
For a slew of reasons that detailing will make this post too long, I'm using a custom user model, alongside django-registration, and guardian. Everything is working quite alright, but I'm trying to make it so every user registered is automatically set to active, so "they" (right now it's only me emulating users) can login instantly. The way I did so far is by manually setting that field to "1" (True) in the SQL table. It seems that no matter how I arrange things, the is_active flag is always False until I change it manually in SQL, even though I'm printing it to my console and it's showing True when I register. I did get it to work by changing user.save() to user.save(commit=True), that does make the is_active flag True and allows the user to log-in, but it always throws an error that says: TypeError: save() got an unexpected keyword argument 'commit' Of course this is all for testing purposes and I do intend to introduce email verification, but I'm very intrigued on why I'm not able to simply set the flag and save(). Here's my register/forms.py: class GeneralUserForm(UserCreationForm): business_name = forms.CharField(required=True) class Meta: model = GeneralUser fields = ['username', 'email', … -
Is there way I can fake a fk in django
One of the django apps is using a database that django isn't maintaining. In these tables, the DBA decided not use FK's instead just use Int fields. Is there a way I can pretend these are foreignkeys in django app? I would like to use the orm still. For example, the tables look like this class PrimaryTable(models.Model): global_id = models.BigAutoField(db_column='_id', primary_key=True) class RelatedTable(models.Model): global_id = models.BigIntegerField() # this is the id for the primary table title = models.CharField(max_length=10) Is there way I can put a flag on the fields? Or can Django support joins that aren't specified as a FK? -
'InMemoryUploadedFile' object has no attribute 'get'
I'm having trouble getting images to upload to an S3 bucket from Django The error I'm getting is: 'InMemoryUploadedFile' object has no attribute 'get' I've looked at similar questions, but haven't found a solution from them (or others not listed below): ModelForm has no attribute get Django image uploading django 'User' object has no attribute 'get' error Here's my code: forms.py from django import forms from .models import UploadImage, UploadAudio class ImageForm(forms.ModelForm): class Meta: model = UploadImage fields = ['myimage'] views.py from django.contrib import messages from django.shortcuts import render, get_object_or_404, redirect from django.http import HttpResponse, HttpResponseRedirect from django.shortcuts import redirect from .forms import ImageForm, AudioForm from .models import UploadImage def ImageCreate(request): if request.method == 'POST': form = ImageForm(request.POST, request.FILES['myimage']) if form.is_valid(): image = form.save(commit=False) image.author = request.user image.save() messages.success(request, "Uploaded successfully") return redirect('mytimer') else: messages.error(request, "Unable to upload at this time") else: form = ImageForm() return render(request, "myimages.html", {'form': form}) models.py from __future__ import unicode_literals from django.db import models from django.conf import settings class UploadImage(models.Model): """ Define how the user will upload images """ # link author to registered user author = models.ForeignKey(settings.AUTH_USER_MODEL) myimage = models.ImageField(upload_to='myimages/') uploaded_at = models.DateTimeField(auto_now_add=True) Thank you so much in advance for any help. traceback Environment: … -
Getting import error while using pyfcm
installed pyfcm using : pip install pyfcm from pyfcm import FCMNotification ImportError: cannot import name 'FCMNotification' getting this import error in both python2.7 and python3.5 -
What's the correct way to implement create/update methods using the DjangoRestAPI Framework?
I've been slowly migrating my API from standard view methods to using the Django Rest Framework. Right now this is the way I have things set up: urls.py ... url(r'^delete_entities', views.delete_entities), url(r'^entities/$', views.EntitiesView.as_view()), url(r'^create_entity', views.create_entity), ... views.py class EntitiesView(ListAPIView): serializer_class = EntitySerializer def get_queryset(self): parameters = get_request_params(self.request) qs = Entity.objects if 'ordering' in parameters: qs = qs.order_by(parameters['ordering']) del parameters['ordering'] qs = qs.filter(entity_instance__entity_type__strong_entity=True, **parameters).distinct() return qs def delete_entities(request): entity_ids = map(int, request.POST.getlist('entity_ids[]')) return HttpResponse( json.dumps({'response': Entity.objects.delete_entities(entity_ids)}, cls=DjangoJSONEncoder), content_type='application/json') def create_entity(request): entity_label = request.POST.get('entity_label') entity_type_label = request.POST.get('entity_type') entity = Entity.objects.create_entity(entity_label, entity_type_label) return HttpResponse( json.dumps(EntitySerializer(entity).data, cls=DjangoJSONEncoder), content_type='application/json') I imagine this isn't the correct way to handle this if I'm using the Django Rest Framework. Any direction as to how to refactor my code would be great. -
"python manage.py runserver" doesn't work
I'm new to Django and I've tried running the "python manage.py runserver" this was the result: Performing system checks... System check identified no issues (0 silenced). October 20, 2017 - 19:40:13 Django version 1.9, using settings 'newpro.settings' Starting development server at http://127.0.0.1:8000/ Quit the server with CONTROL-C. I've tried accessing the url http://127.0.0.1:8000/ and it didn't work. I would be happy for some help. Thank you! -
Wagtail: cannot import name pages
I'am using Vagrant for virtualization, everything worked fine until today, when my friend cloned a repo which worked fine on my computer he started to getting cannot import name pages Environment: Request Method: GET Request URL: http://127.0.0.1:8017/ Django Version: 1.8.14 Python Version: 2.7.6 Installed Applications: ['django.contrib.admin', 'django.contrib.auth', 'django.contrib.humanize', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.sitemaps', 'django.contrib.staticfiles', 'compressor', 'django_common', 'djrill', 'taggit', 'modelcluster', 'wagtail.wagtailcore', 'wagtail.wagtailadmin', 'wagtail.wagtaildocs', 'wagtail.wagtailsnippets', 'wagtail.wagtailusers', 'wagtail.wagtailimages', 'wagtail.wagtailembeds', 'wagtail.wagtailsearch', 'wagtail.wagtailredirects', 'wagtail.wagtailforms', 'wagtail.wagtailsites', 'wagtail.contrib.wagtailsitemaps', 'wagtail.contrib.wagtailfrontendcache', 'django.contrib.gis', 'froala_editor', 'dal', 'dal_select2', 'home', 'accounts', 'ads', 'staff', 'common', 'search', 'blog', 'article', 'center', 'slideshow', 'legacy', 'django_quiz', 'django_quiz.essay', 'django_quiz.quiz', 'django_quiz.multichoice', 'django_quiz.true_false', 'polls', 'wagtailoverrides', 'rate_system', 'dovescore_system', 'social_django', 'django_extensions', 'wagtail.contrib.wagtailstyleguide'] Installed Middleware: ['django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'social_django.middleware.SocialAuthExceptionMiddleware', 'wagtail.wagtailcore.middleware.SiteMiddleware', 'wagtail.wagtailredirects.middleware.RedirectMiddleware'] Traceback: File "/home/vagrant/webapps/dovemed/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response 119. resolver_match = resolver.resolve(request.path_info) File "/home/vagrant/webapps/dovemed/local/lib/python2.7/site-packages/django/core/urlresolvers.py" in resolve 365. for pattern in self.url_patterns: File "/home/vagrant/webapps/dovemed/local/lib/python2.7/site-packages/django/core/urlresolvers.py" in url_patterns 401. patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module) File "/home/vagrant/webapps/dovemed/local/lib/python2.7/site-packages/django/core/urlresolvers.py" in urlconf_module 395. self._urlconf_module = import_module(self.urlconf_name) File "/usr/lib/python2.7/importlib/__init__.py" in import_module 37. __import__(name) File "/vagrant/dovemed/dovemed/urls.py" in <module> 14. from wagtail.wagtailadmin import urls as wagtailadmin_urls File "/home/vagrant/webapps/dovemed/local/lib/python2.7/site-packages/wagtail/wagtailadmin/urls/__init__.py" in <module> 4. from wagtail.wagtailadmin.urls import pages as wagtailadmin_pages_urls Exception Type: ImportError at / Exception Value: cannot import name pages I'm using wagtail 1.8 and django 1.8.14