Data dodania Pytanie
2017-02-18 22:02 User dependent field as many to many relationship in Django Rest Framework »
In my application I have some products, and a logged in user should be able to mark these products as favorites. I modeled them as a many to many rel...
(1) odpowiedzi
2017-02-18 22:02 Django - the effect on page load speed of using include tag inside for loop »
The odds are that this question will be banned, because this forum seems to me a site for "why it doesn't work"-type of questions, rather than "is it ...
(0) odpowiedzi
2017-02-18 19:02 Dynamic length Django model field »
I have one Django model field definition like this: landMark = models.CharField(max_length=50, blank=True) Can I define the landMark field dynamical...
(2) odpowiedzi
2017-02-18 15:02 Django mocking storage on model with update() throws error »
I have a small project and I'm working on some tests. Recently I asked a question: django-test-mocked-imagefield-prevent-upload-or-clean-after-test. I...
(0) odpowiedzi
2017-02-18 08:02 Django and HTML5 application cache: index page is loaded from cache and csrf token is not available »
I am using the latest django for my app, and recently I added application cache for the app to be available offline. I listed the necessary static res...
(0) odpowiedzi
2017-02-17 21:02 Django can't connect to Postgres in Docker setup »
I'm setting up an application in Docker that uses Django and Postgres. I'm unable to connect to Postgres from the app. When I run either: docker-com...
(1) odpowiedzi
2017-02-17 15:02 Serving Static content from Nginx but handling error pages in Django »
My static and media files are served by Nginx and other requests are served by Django. I have a custom 404 page which is served by Django. Since Ngi...
(1) odpowiedzi
2017-02-17 11:02 django-leaflet + django-geojson: I can't place a marker in Admin (TypeError: L.drawLocal.draw.toolbar.finish is undefined) »
This might be trivial but I can't find the mistake. I'm just getting the initial setup done following the documentation on GitHub. I've started a new ...
(0) odpowiedzi
2017-02-17 07:02 CSRF token AJAX based post in a Django Project »
So I found out the error and it was in my HTML. I just added {% csrf_token %} and it worked :) thanks for the assist guys! (I used the JS snippet ...
(2) odpowiedzi
2017-02-16 13:02 OR query in django-filter »
I am having difficulty to implement OR query using django-filter. I could find some example telling how to create OR query in django queryset. But, I ...
(2) odpowiedzi
2017-02-16 10:02 django 'LineChart' object has no attribute 'get' »
I am trying to make a line chart in django, I am using the jchart module, When I try and load the chart I get the below error. error 'LineChart' ...
(1) odpowiedzi
2017-02-16 07:02 Django Test mocked ImageField prevent upload or clean after tests »
I am working on a TestCase for my project, involving some Image and FileFields. Some objects are loaded with fixtures, some objects are created during...
(1) odpowiedzi
2017-02-16 01:02 Can't use django-compress with Heroku »
I have a Django 1.9.6 site deployed to Heroku. When DEBUG=False I was getting a server error (500). The logs contained no useful information, so I t...
(3) odpowiedzi
2017-02-15 11:02 Django - get model object attributes from ModelForm »
I have a ModelFormSet: TransactionFormSet = modelformset_factory(Transaction, exclude=("",)) With this model: class Transaction(models.Model): ...
(1) odpowiedzi
2017-02-15 09:02 Django object locking »
I'm using Django 1.8 and I have a model class ModelA(models.Model): some_field = models.PositiveIntegerField() Now, in my view I want to add a...
(2) odpowiedzi
2017-02-15 02:02 How to display an update that is pushed from the server to the webpage without a refresh? »
I am using Django 1.10 as the backend of a warehousing app we built. I am adding another new feature where a webpage that will be displayed on a gian...
(2) odpowiedzi
2017-02-14 19:02 Django find relationship "route" between two Vertexes in a Network »
This is mostly a logical question, but the context is done in Django. In our Database we have Vertex and Line Classes, these form a (neural)network, ...
(1) odpowiedzi
2017-02-14 16:02 Login required always render to home page »
when I am using login_required it does not rendering to appropriate url it always render to home page only login view def login_view(request): prin...
(1) odpowiedzi
2017-02-14 08:02 Pytest-django: set user permissions »
I work on a library for Django using pytest 3.0.6 and pytest-django 3.1.2. I have this very simple test failing, and I don't understand what happen: ...
(2) odpowiedzi
2017-02-13 20:02 Why django urls end with a slash? »
Django official documentation and other tutorials on the web always use a trailing slash at the end of url. ex: url(r'^accounts/login/', views.login)...
(3) odpowiedzi
2017-02-13 15:02 Django context : local variable referenced before assignment »
Good afternoon everybody, I'm getting a little problem with my context variables in my Django project. I have a function which let me to make some pr...
(2) odpowiedzi
2017-02-13 11:02 Django CSRF cross site AJAX issue »
I have a backend server at localhost:8000 and a frontend server at localhost:3000. Backend is Django and I have the corsheaders package installed and ...
(2) odpowiedzi
2017-02-13 09:02 Are prefetched tasks in celery being acknowledged? »
I have following setup: RabbitMQ broker + Django Celery with CELERYD_PREFETCH_MULTIPLIER=32 (I have a lot of small task thus prefetching them makes...
(1) odpowiedzi
2017-02-12 16:02 Bootstrap form showing error messages in a different style »
I have two forms in my django app, and I'm using bootstrap3 to custom them, But the error messages to the form aren't equal. It all is in portuguese ...
(2) odpowiedzi
2017-02-12 09:02 Django: move all previously uploaded media files to new location and rename »
So, I'm using Django (1.10) and I've got a few hundred uploaded (media) files. I want to move and rename all the files, because I want to slightly cha...
(1) odpowiedzi
2017-02-12 00:02 Is creating an accounts app in Django a good practice? »
I am wondering if creating an accounts app in Django is a good practice. Say you have a Django project named mysite and you create inside two apps: c...
(1) odpowiedzi
2017-02-11 18:02 Django form submit does not work »
I have an EventForm form that i want to populate. I use event_form.attributes so I can customize the CSS. But nothing happens when I click submit - th...
(1) odpowiedzi
2017-02-11 14:02 Doesn't work django-admin.py startproject mysite »
I want start a new django project, I use windows 10. If I write to console python -c "import django; print(django.get_version())" return 1.10.3 ...
(1) odpowiedzi
2017-02-11 00:02 Django excel save_book_to_database() broken in latest version using Django 1.8 »
I've been going through the django excel documentation using Django 1.8, but haven't been able to get save_book_to_database(...) to work. It either ...
(0) odpowiedzi
2017-02-10 15:02 Why does the admin site not care about my custom user's permissions? »
I started a Django (1.10.3) project with a custom user model, inherited from AbstractBaseUser. A couple of weeks into developing the thing, I saw that...
(1) odpowiedzi
2017-02-10 14:02 Search within nested Django JSONField (either via Django ORM or raw sql) »
Edit: Added solution below. No-one was able to suggest a native Postgres, one-hit search-and-replace so I had to parse the log in Python and then do a...
(2) odpowiedzi
2017-02-10 04:02 Django QuerySet select related objects »
I have searched around but have not found a situation like mine. Assuming the use of Django's User Profile method to extend the default user features,...
(1) odpowiedzi
2017-02-10 00:02 Django: adding two serializers together? »
How is it possible to add a serializer within another serializer? Here's what I mean: I have a UserProfile model as such: class UserProfile(models.M...
(1) odpowiedzi
2017-02-09 16:02 Django ajax 403 because of httponly cookie »
I have a strange issue with CSRF in Django. Here are the relevant portions: In my javascript file I have: function getCookie(name) { var cookieV...
(1) odpowiedzi
2017-02-09 09:02 Django JSON file to Pandas Dataframe »
I have a simple json in Django. I catch the file with this command data = request.body and i want to convert it to pandas datarame JSON: { "username...
(2) odpowiedzi