Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
How come django with 1 thread can serve concurrent access?
I have some doubt in my mind, currently I confused to determine concurrent access of the server. Let say I am not using uwsgi/gunicorn for my django application, it means I am running application with 1 thread and 1 worker right ? , so it means that we just can open 1 connection in a time, which means that it is impossible to create concurrent access right ? , so how come that default django can serve concurrent access ? -
Differentiate GET and POST in a ModelViewset Django Rest Framework
I would like to know what I have to do to differentiate GET and POST in a ModelViewSet in Django Rest Framework becouse it mix bought and I have no idea how to do it. Basically I want to make an api that allows to upload two images and the response of a POST call is a number depending on the degree of similarity of the uploaded images. For this I intend by means of the POST call to get the path where the images are stored to be able to work with them in OpenCV in another script. Then I put the code I have, which allows you to upload the two images. ## Models.py ## class Task(models.Model): task_name = models.CharField(max_length=20) image1 = models.ImageField(upload_to='Images/',default='Images/None/No-img.jpg') image2 = models.ImageField(upload_to='Images/', default='Images/None/No-img.jpg') def __str__(self): return "%s" % self.task_name ## Serializers.py ## class TaskSerializer(serializers.ModelSerializer): image1 = serializers.ImageField(max_length=None,use_url=True) image2 = serializers.ImageField(max_length=None, use_url=True) class Meta: model = Task fields = ('id','task_name','image1','image2') ## Views.py ## class TaskViewSet(viewsets.ModelViewSet): queryset = Task.objects.all() serializer_class = TaskSerializer ## Urls.py ## router = routers.DefaultRouter() router.register(r'task', views.TaskViewSet) urlpatterns = [ url(r'^',include(router.urls)), url(r'^admin/', include(admin.site.urls)), ] -
How to translate drop down menu django-filter
I have many colors in my django-filter. color is a ForeignKey for Yarn model. class YarnFilter(django_filters.FilterSet): color = django_filters.AllValuesFilter(name="color__name") class Meta: model = Yarn fields = [ 'color', ] i want all color named to be translates in template. <form action="" method="get"> {{ filter.form.as_p }} <input type="submit" /> </form> i don't get where and how should i use django translation. -
Django object.filter is not loading all results
I am using Django 1.10.4 and MySQL 5.7. So, I have following models: class Image(models.Model): request = models.ForeignKey(Request, on_delete=models.CASCADE) customID = models.CharField(max_length=128, null=True) status = models.IntegerField(default=0) row = models.IntegerField(default=0) column = models.IntegerField(default=0) class Request(models.Model): name = models.CharField(max_length=128, null=True) Then I am loading all Image objects for some Request (this can run in a few threads): images = models.Image.objects.filter(request_id=req_id).order_by('column', 'row') The problem is, I am not always getting correct set of Image objects. Sometimes it loads them all, sometimes it kinda stops in the middle of loading. What I mean is that I get for example 4 out of 10, or 11 out of 12 Image objects. The row-column pair is always uniqe for Image in single Request, but when this problem occurs, the last loaded Image object have row and column = 0 (when the correct ones, saved in DB are for example 1, 8). How is this possible? And why I don't get any exceptions or errors? -
command cl.exe failed upon pip install django_compressor
im posting this because im encountering this problem and had been trying to solve this issue for days but failed to. I faced the following error (refer to attached) when i try to install django_compressor (pip install django_compressor) i searched online for solutions but is unable to rectify the problem.figure 1 Im currently have python 3.6 with visual studio 14.0 and visual C++ build tools installed. I had referred to stackoverflow.com/questions/32740319/error-command-cl-exe-failed-no-such-file-or-directory-python-3-4 to attempt to try the command "C:\Windows\System32\cmd.exe /E:ON /V:ON /T:0E /K "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /RELEASE /x64" from one of the answer posted but i still face problem with x64 compilers not installed. And i tried to solve the x64 compilers issue by installing the Microsoft Visual C++ 2010 Service Pack 1 Compiler Update for the Windows SDK 7.1 referencing from help.appveyor.com/discussions/problems/1266-no-64bit-compiler-in-the-71-windows-sdk And also uninstalling visual studio service pack 1 to rectify the x64 compilers issue referencing from Visual Studio 2010 Service Pack 1 and Windows SDK for Windows 7 and .NET Framework 4 Issue in the microsoft visual studio site. Right now i do not know how to proceed on solving the problem of installing django_compressor (cl.exe) as well as the x64 compilers when i try to retify the … -
Segmentation fault (core dumped) on bulk deletion of objects
I am trying to delete large number of entries (approximately 1 million entries) from PostgreSQL database table. I am using a management command to execute this. Using Foo.objects.delete() errors giving response as "Killed". When I tried to delete it as batches of 10000, it deletes the first couple of batches and then results in error Segmentation fault (core dumped)" I then tried giving a delay of a few seconds time.sleep(10)but to no effect. Please help. -
Django: Images/Absolute URLS from not displaying in html
I have a block of code on my template which does not show up on my html nor does it give any error on Chromes console. I am trying to display a list of images which when clicked takes you to the detail of that image. Here is the key part of my HTML(base.html): <div class="container-fluid"> <h2>Popular</h2> #only this shows up {% for obj in object_list %} <img src = "{{ obj.mpost.url}}" width="300"><br> <a href='/m/{{ obj.id }}/'> {{obj.username}} </a><br/> {% endfor %} </div> views.py: from django.shortcuts import render,get_object_or_404 from .models import m # Create your views here. def home(request): return render(request,"base.html",{}) def m_detail(request,id=None): instance = get_object_or_404(m,id=id) context = { "mpost": instance.mpost, "instance": instance } return render(request,"m_detail.html",context) def meme_list(request): #list items not showing queryset = m.objects.all() context = { "object_list": queryset, } return render(request, "base.html", context) urls.py: urlpatterns = [ url(r'^$', home, name='home'), url(r'^m/(?P<id>\d+)/$', m_detail, name='detail'),#issue or not? ] models.py: class m(models.Model): username = "anonymous" mpost = models.ImageField(upload_to='anon_m') creation_date = models.DateTimeField(auto_now_add=True) def __str__(self): return m.username Thank you so much for your time. :) -
how to query in nested foreignKey
The idea is pretty simple, I've got to query several models in my func. In order to keep it clean in my template, I've decided to abstract a new model that would contain my data. I'm creating the model via a lambda. Here are the models. class Contact(models.Model): created_date = models.DateTimeField(auto_now_add=True) updated_date = models.DateTimeField(auto_now=True) lastname = models.CharField(max_length=50, null=True, blank=True) firstname = models.CharField(max_length=50, null=True, blank=True) email = models.EmailField(null=True, blank=True) class CRecord(models.Model): created_date = models.DateTimeField(auto_now_add=True) updated_date = models.DateTimeField(auto_now=True) place = models.ForeignKey(Place, related_name="record") contact = models.ForeignKey(Contact, blank=True, null=True, related_name="records") class Place(models.Model): created_date = models.DateTimeField(auto_now_add=True) updated_date = models.DateTimeField(auto_now=True) deleted_date = models.DateTimeField(blank=True, null=True) name = models.CharField(max_length=100, db_index=True) lat = models.FloatField(db_index=True) lon = models.FloatField(db_index=True) Here is my lambda to create my new object: tr_contact = lambda x: dict(first_name=x.firstname, last_name=x.lastname, owned_place=?) Basically the ones I wanna get for owned_place are the place contained in CRecord. The part I'm struggling with is the fact that for each contact, there are several record, and in each record, there are several places. the field owned_place should be equal to every place contained in every record. I've tried a few and even wondered if really it is possible in one request.. -
OSError at 'app/page/'. [Errno 13] Permission denied: '/app/static/browserconfig.xml'
I am getting this error when I try to open page after I deploy it to the server. What could be the problem? Anyone got the same error? -
Django File Upload issue
I'm sending JS form when user click send button, without file it works fine, but when user attach file, I get this error. MultiValueDictKeyError at /about/addComment/ "'uploadFile'" models.py class ScComments(models.Model): id = models.FloatField(blank=True, null=True, primary_key=True) req_id = models.FloatField(blank=True, null=True) ans_id = models.CharField(max_length=200, blank=True, null=True) document = models.FileField(upload_to='documents/',blank=True, null=True) ins_date = models.CharField(max_length=40, blank=True, null=True) file_path = models.CharField(max_length=2000, blank=True, null=True) comment_text = models.CharField(max_length=4000, blank=True, null=True) class Meta: managed = True db_table = 'sc_comments' def __getitem__(id): return self.name def __str__(id): return self.name def __unicode__(self): return unicode(self).encode('utf-8') views.py def addComment(request): request_id = request.POST.get("request_id", "") message = request.POST.get("message", "") form = CommentForm(request.POST, request.FILES) if form.is_valid(): obj = ScComments() obj.req_id = request_id obj.ans_id = request.user.username i = datetime.datetime.now() obj.document = request.FILES['uploadFile'] obj.ins_date = "%s" % i obj.file_path = "" obj.comment_text = message obj.save() singleRequest = getRequestByID(request,request_id) comments = getCommentsByID(request,request_id) data = {'singleRequest':singleRequest,'comments':comments} template = "about.html" return render(request,template,data) JS <script> $("#writeRequest").click(function() { var dataObj = document.getElementById("inputMessage"); var data = dataObj.value; var filePath = document.getElementById("fileupload"); var file = filePath.files[0]; function isEmpty( obj ) { for ( var prop in obj ) { return false; } return true; } alert(isEmpty(file)); if(data){ var request_id = {{singleRequest.id}}; var url = "addComment/"; var form = $('<form action="' + url + '" method="post" … -
Unable to display ImageField within Django template
I hope you can help me withmy Django project. I am able to upload an images under a media_cdn folder, inside a folder based on the name of the slug. The problem occurs when I try to display the image inside my post list and post. Can you please have a look at my code and offer a solution. I spent hours trying to get it to work. Please help. settings.py STATIC_URL = '/static/' STATIC_ROOT = os.path.join(BASE_DIR, 'static/') MEDIA_URL = "/media/" MEDIA_ROOT = os.path.join(BASE_DIR, 'media_cdn/') models.py def upload_location(instance, filename): return "%s/%s" %(instance.slug, filename) class Post(models.Model): category = models.ForeignKey(Category) title = models.CharField(max_length=250) slug = models.SlugField(max_length=250, unique=True) image = models.ImageField(upload_to=upload_location, null=True, blank=True, width_field="width_field", height_field="height_field") height_field = models.IntegerField(default=0) width_field = models.IntegerField(default=0) body = models.TextField() date = models.DateTimeField() updated = models.DateTimeField(auto_now=True) postlist.html {% block content %} {% for post in posts %} <div class="container w3-card-4"> {% if post.image %} <img src="{{ post.instance.image.url }}"> {% endif %} ... post.html {% block content %} <div class="row"> <div class="container w3-card-4"> {% if instance.image %} <img src= "{{ instance.image.url }}" class="img-responsive"> {% endif %} ... url.py from django.conf.urls import include, url from django.contrib import admin from django.conf.urls.static import static from django.conf import settings urlpatterns = [ url(r'^admin/', admin.site.urls), … -
Django Payu integration in my app
need help in payumoney integration. i took a refrence from this link - http://my-django-python.blogspot.in/2015/04/payu-payment-gateway-integration-with.html?m=1 Here i almost integrate this package in my app however i am stuck only in 1 thing which is Hash generate. i am using this function for hash generate. from hashlib import sha512 from django.conf import settings KEYS = ('key', 'txnid', 'amount', 'productinfo', 'firstname', 'email', 'udf1', 'udf2', 'udf3', 'udf4', 'udf5', 'udf6', 'udf7', 'udf8', 'udf9', 'udf10') def generate_hash(data): keys = ('key', 'txnid', 'amount', 'productinfo', 'firstname', 'email', 'udf1', 'udf2', 'udf3', 'udf4', 'udf5', 'udf6', 'udf7', 'udf8', 'udf9', 'udf10') hash = sha512('') for key in KEYS: hash.update("%s%s" % (str(data.get(key, '')), '|')) hash.update(settings.PAYU_INFO.get('merchant_salt')) return hash.hexdigest().lower() def verify_hash(data, SALT): keys.reverse() hash = sha512(settings.PAYU_INFO.get('merchant_salt')) hash.update("%s%s" % ('|', str(data.get('status', '')))) for key in KEYS: hash.update("%s%s" % ('|', str(data.get(key, '')))) return (hash.hexdigest().lower() == data.get('hash')) but i am getting a error like this - Error Reason Transaction failed due to incorrectly calculated hash parameter. Corrective Action Please ensure that the hash used in transaction request is calculated using the correct formula. Please note the correct formula for calculating the value of hash: sha512(key|txnid|amount|productinfo|firstname|email|udf1|udf2|udf3|udf4|udf5||||||SALT) Based on above formula and applying for this transaction, hash should be calculated as mentioned below : hash = sha512(gtKFFx|77430fe3cf66ecb2650b|399|this is product|vikash|vikash.g@vsynergize.com|||||||||||eCwWELxi) = … -
Referencing Meta optoins in models.py
I can't reference Meta Ordering option in model as it pops up error message "type object 'ProductImage' has no attribute 'Meta'". Can anyone help to fix this because as per design strategy I have to reference Meta on many occasions for this project. I just need to be able to reference Meta option in ProductImage model. Following is the ProductImage model: class ProductImage(models.Model): product = models.ForeignKey( 'catalogue.Product', related_name='images', verbose_name=_("Product")) original = models.ImageField( _("Original"), upload_to=settings.MARKET_IMAGE_FOLDER, max_length=255) caption = models.CharField(_("Caption"), max_length=200, blank=True) display_order = models.PositiveIntegerField( _("Display order"), default=0, help_text=_("An image with a display order of zero will be the primary" " image for a product")) date_created = models.DateTimeField(_("Date created"), auto_now_add=True) class Meta: app_label = 'catalogue' ordering = ["display_order"] unique_together = ("product", "display_order") verbose_name = _('Product image') verbose_name_plural = _('Product images') def __str__(self): return u"Image of '%s'" % self.product def is_primary(self): return self.display_order == 0 Following is the Product models: class Product(models.Model): STANDALONE, PARENT, CHILD = 'standalone', 'parent', 'child' STRUCTURE_CHOICES = ( (STANDALONE, _('Stand-alone product')), (PARENT, _('Parent product')), (CHILD, _('Child product')) ) structure = models.CharField( _("Product structure"), max_length=10, choices=STRUCTURE_CHOICES, default=STANDALONE) upc = NullCharField( _("UPC"), max_length=64, blank=True, null=True, unique=True, help_text=_("Universal Product Code (UPC) is an identifier for " "a product which is not specific … -
FormView setting context for form_invalid
I am trying to assign a value to the context if the form is invalid. This is what I am doing. However incase the form is invalid my response is weird and I do not get a form. {'key': 'Val', 'form': <MainLoginForm bound=True, valid=True, fields=(user_name;user_category;user_password)>, u'view': <mainApp.views.MainLoginFormView object at 0x107553c10>} Submit This is the class class MainLoginFormView(FormView): template_name = 'login.html' form_class = MainLoginForm success_url = "login.hrml" args = {} def ValidateAccount(self,form): if(valid) #Some Condition to confirm if valid form return super(MainLoginFormView, self).form_valid(form) else: return self.form_invalid(form) def form_invalid(self, form): MainLoginFormView.args = super(MainLoginFormView, self).get_context_data(**MainLoginFormView.args) MainLoginFormView.args["key"] = "Val" MainLoginFormView.args["form"] = form #return self.render_to_response(context=MainLoginFormView.args) return super(MainLoginFormView,self).form_invalid(MainLoginFormView.args) def form_valid(self, form, **kwargs): MainLoginFormView.args = kwargs ..... return self.ValidateAccount(form) -
How to save css changes made in an $.ajax() call?
I have an $.ajax() call to increase the height of my div every time .comment_form is submitted (ajax comment). So this works fine but it doesn't save the new height so when I refresh the page it reverts back to its initial height. Here's my js: base.js $('.comment_form').on('submit', function(e) { e.preventDefault(); var url = window.location.href.split('?')[0]; $.ajax({ type: 'POST', url: url, data: { text: $('.comment_text').val(), csrfmiddlewaretoken: $("input[name='csrfmiddlewaretoken']").val(), }, success: function(data) { console.log(data.text_length); if(data.text_length < 15) { var increaseHeight = 30; } else { increaseHeight = (data.text_length) + 20; } $('.commentsContainer').append("<div class='comment_div'><h3>" + data.username + "</h3><p>" + data.text + "</p></div>"); $('.commentsContainer').css('height', '+=' + increaseHeight); }, }); css .commentsContainer { height: 600px; } django views.py ... ajax_comment = request.POST.get('text') comment_length = len(str(ajax_comment)) comments = Comments.objects.all() if request.is_ajax(): if comment.is_valid(): comment = Comments.objects.create(comment_text=ajax_comment, author=str(request.user)) comment.save() username = str(request.user) return JsonResponse({'text': ajax_comment, 'text_length': comment_length, 'username': username}) return render(request, 'article.html', context) -
DoesNotExist: [Model] matching query does not exist at id (ObjectId)
I am trying to query a unique document using its ObjectId. However the error comes up: DoesNotExist: Route matching query does not exist When, upon passing this to my view as request, it prints out the corresponding ObjectId in ObjectId typeform. Therefore there shouldn't be a problem with the line route_test = Route.objects.get(id=_id). I have the following code: views.py def update(request): if request.method == "POST": _id = request.POST.get('_id',ObjectId()) print(_id) route_id = request.POST.get('route_id','') geometry = request.POST.get('geometry', '') properties = request.POST.get('properties','') #r = Route.objects.get(route_id='LTFRB_PUJ2616') --> I cannot use this #because it has 5 instances (Not Unique) #print (r["id"],r["properties"]) test = Route.objects.get(id = ObjectId('587c4c3b203ada19e8e0ecf6')) print (test["id"], test["properties"]) try: route_test = Route.objects.get(id=_id) print(route_test) Route.objects.get(id=_id).update(set__geometry=geometry, set__properties=properties) return HttpResponse("Success!") except: return HttpResponse("Error!") ajax var finishBtn = L.easyButton({ id:'finish', states: [{ icon:"fa fa-check", onClick: function(btn){ selectedFeature.editing.disable(); layer.closePopup(); var editedFeature = selectedFeature.toGeoJSON(); alert("Updating:" + editedFeature.route_id); $.ajax({ url: "/update/", data: {id:editedFeature.id, route_id: JSON.stringify(editedFeature.route_id), geometry: JSON.stringify(editedFeature.geometry), properties: JSON.stringify(editedFeature.properties) }, type: 'POST' }); } model.py from __future__ import unicode_literals from mongoengine import * class Route(Document): type = StringField(required=True) route_id = StringField(required=True) geometry = LineStringField() properties = DictField() meta = {'collection':'routes'} What should be done? Even the line test = Route.objects.get(id = ObjectId('587c4c3b203ada19e8e0ecf6')) where I directly supplied the incoming _id has the … -
TypeError while uploading image using REST api in OpenShift V3
I have a Django App that accept images through REST-api. I tested the api using POSTMAN locally, it's working perfect with image uploads. Later I deployed it on OpenShift V3 and when I tried the same for uploading process using POSTMAN , it's saying Note: I can do uploading process through DRF-Browsable api -
how to add Django OneToOneField/ForeignKey new field at the location I want?
FfDirectBusiness will get the field TransactionPrimaryKey added at the end. Is that possible I can make it added as the location shown below? let's say, the third field class VAActivity(models.Model): TransactionPrimaryKey = models.CharField(max_length=50, primary_key=True) Pass class FfDirectBusiness(models.Model): FfDirectBusinessID = models.IntegerField(null=False) DataSource = models.CharField(max_length=50) vaactivity = models.OneToOneField(VAActivity, db_column='TransactionPrimaryKey', on_delete=models.CASCADE, primary_key=True) AsOfDate Pass -
Django URL use string in regex
Currently my regex takes a question id like so (working): url(r'^(?P<college_id>[0-9]+)/$', views.detail, name="detail") But I want it to instead take college_name which is a string with no spaces. How would I set that up? -
Django block multiple registration by one user
I have a webpage in Django. In the page I have things like contest. And I need prevent multiple registration by one user. I have simple 'by-ip' system. But it fails when user from the same local network (they have the same public IP) trying to register. Do you know better solution for this? -
What is the correct way to extend Wagtail abstract models with extra fields?
I have an abstract Wagtail model with a few StreamFields. Two of these StreamFields are in a separate tab in the admin view, which are added to the edit_handler. class AbstractHomePage(Page): body = StreamField( HomePageStreamBlock(), default='' ) headingpanel = StreamField( HeadingPanelStreamBlock(), default='' ) sidepanel = StreamField( SidePanelStreamBlock(), default='' ) class Meta: abstract = True search_fields = Page.search_fields + [index.SearchField('body')] content_panels = Page.content_panels + [ StreamFieldPanel('body'), ] pagesection_panels = [ StreamFieldPanel('headingpanel'), StreamFieldPanel('sidepanel'), ] edit_handler = TabbedInterface([ ObjectList(content_panels), ObjectList(pagesection_panels, heading='Page sections'), ObjectList(Page.promote_panels), ObjectList(Page.settings_panels, classname='settings'), ]) I want to extend this model and add a field: class Foo(AbstractHomePage): extra = models.TextField() Meta: verbose_name='Foo' content_panels = [ AbstractHomePage.content_panels[0], # title FieldPanel('extra'), AbstractHomePage.content_panels[-1] # streamfield ] When adding a new Foo page, the only fields available in the admin panel are the fields from the AbstractHomePage. The newly added field isn't available until I update Foo's edit_handler: class Foo(AbstractHomePage): extra = models.TextField() Meta: verbose_name='Foo' content_panels = [ AbstractHomePage.content_panels[0], # title FieldPanel('extra'), AbstractHomePage.content_panels[-1] # streamfield ] edit_handler = TabbedInterface([ ObjectList(content_panels), ObjectList(AbstractHomePage.pagesection_panels, heading='Page sections'), ObjectList(Page.promote_panels), ObjectList(Page.settings_panels, classname='settings'), ]) And now to my question: Have I done something wrong or not followed good coding practices? If I do have to update the edit_handler for each extending model, is … -
Django, apache and ssl - correct configuration
I have a page, with news, articles, etc, etc. I implemented payments and I need https:// link to get callback from external payment system. So I need buy ssl certificate. And on server I have something like this: superpage.com beta.superpage.com How can I configure ssl to works on production and beta page? And another question. Do I must showing whole page by ssl? Or only 'sub-page' to payments? -
Django Heroku Postgres ProgrammingError: relation does not exist
I am struggling to get my Django 1.10 app deployed to Heroku. When I push this site to Heroku, I get the application error: ProgrammingError at /homelibrary/ relation "catalog_book" does not exist LINE 1: SELECT COUNT(*) AS "__count" FROM "catalog_book" Ever since I changed the default Sqlite3 database to Postgres, it hasn't run locally and I get errors every time I migrate. I have tried: python3 manage.py makemigrations python3 manage.py makemigrations catalog python3 manage.py syncdb python3 manage.py migrate catalog --fake python3 manage.py migrate --fake To get this error every time: Traceback (most recent call last): File "manage.py", line 22, in <module> execute_from_command_line(sys.argv) File "/usr/local/lib/python3.5/dist-packages/django/core/management/__init__.py", line 367, in execute_from_command_line utility.execute() File "/usr/local/lib/python3.5/dist-packages/django/core/management/__init__.py", line 359, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/usr/local/lib/python3.5/dist-packages/django/core/management/base.py", line 294, in run_from_argv self.execute(*args, **cmd_options) File "/usr/local/lib/python3.5/dist-packages/django/core/management/base.py", line 345, in execute output = self.handle(*args, **options) File "/usr/local/lib/python3.5/dist-packages/django/core/management/commands/makemigrations.py", line 95, in handle loader = MigrationLoader(None, ignore_no_migrations=True) File "/usr/local/lib/python3.5/dist-packages/django/db/migrations/loader.py", line 52, in __init__ self.build_graph() File "/usr/local/lib/python3.5/dist-packages/django/db/migrations/loader.py", line 268, in build_graph raise exc File "/usr/local/lib/python3.5/dist-packages/django/db/migrations/loader.py", line 238, in build_graph self.graph.validate_consistency() File "/usr/local/lib/python3.5/dist-packages/django/db/migrations/graph.py", line 261, in validate_consistency [n.raise_error() for n in self.node_map.values() if isinstance(n, DummyNode)] File "/usr/local/lib/python3.5/dist-packages/django/db/migrations/graph.py", line 261, in <listcomp> [n.raise_error() for n in self.node_map.values() if isinstance(n, DummyNode)] File "/usr/local/lib/python3.5/dist-packages/django/db/migrations/graph.py", line 104, in raise_error … -
Last activity field in Django's user sessions
How and when exactly does last_activity in Django sessions get updated? I've been testing a Django app, and my last activity in user sessions is logged as several days ago, even though I logged in yesterday as well. What could be going on? -
How to view Django test server errors log?
Tester complains about errors that force to restart django test server several times.However never logged the actual errors from the terminal. Is there a way to view a log and to get the errors that forced the server to fail? (I am not able to reproduce error that will force server to fail)