Data dodania Pytanie
2017-04-10 19:04 Ordering queryset by filtered child objects »
I have the following (simplified) data model, see visual representation below the post: Articles, which have Attributes Attributes refer by PK to a ...
(0) odpowiedzi
2017-04-10 16:04 How to avoid import-time database access in Django? »
My Django app has a number of categories for things which I store in a Category model. I reference these frequently in code, and so I've found it usef...
(2) odpowiedzi
2017-04-09 23:04 Django objects.all() doesn`t display any content »
Hi everybody! Im just starting a way of django programming so sometimes really get confused. I`m trying to display all my objects from DB, but when o...
(1) odpowiedzi
2017-04-09 20:04 How do I use the django-cms Python api to create a page? »
I'm trying to write a CMS content migration script that will create our pages for django-cms. However even with the default install of Django-cms, Dj...
(2) odpowiedzi
2017-04-09 13:04 Django, serving static files with nGinx gives error 404 »
I can't serve static files through nGinx and I am getting 404 instead. I can see the error (shown in the error.log), I just can't see how to fix it. ...
(1) odpowiedzi
2017-04-08 20:04 Django rest_social_auth log in. What to do with facebook token? »
I am using django-rest-social-auth package to allow users authenticate in my Django rest app. I was able to retrieve a token from facebook for an user...
(2) odpowiedzi
2017-04-08 17:04 Opening a new browser tab invalidates Django's CSRF token, preventing form submission »
Opening a Django 1.10 application in a second browser tab refreshes the CSRF token. This breaks all forms in the first tab -- i.e., previously opened...
(0) odpowiedzi
2017-04-08 14:04 Django form is adding characters when I am editing details »
Here is how my form is set up (all the fields are the same): class AddColourForm(forms.Form): colour = forms.CharField( widget=TextInput...
(1) odpowiedzi
2017-04-08 02:04 Need to extract the first letter of each item in a queryset and pass it to template »
I am passing the variable "first_letter" to a view and want to compare this letter to the first letter of each item returned from a query. I can't get...
(1) odpowiedzi
2017-04-07 14:04 How do relative imports work? »
I have a directory structure like this project/ __init__.py greetings.py script.py greetings.py def hello(): print('He...
(2) odpowiedzi
2017-04-07 11:04 Is it possible to get seconds remaining of scheduled celery task »
Is it possible to get seconds remaining to start scheduled celery task . eg: my_task.apply_async(countdown=100) ...
(1) odpowiedzi
2017-04-07 05:04 Can not connect to websocket using django-channels , nginx on docker as services »
I'm using docker compose to build a project with django, nginx as services. When I launch the daphne server, and a client tries to connect to the webs...
(1) odpowiedzi
2017-04-06 14:04 Why do I get a 'CSRF token missing or incorrect' error? »
I am trying to return a value from a View function in Django. That function is being called from a JavsScript code using Ajax, but I get thrown an err...
(1) odpowiedzi
2017-04-06 12:04 Django random sort list »
How I can sort rundom the list 'articles_list' when I get it from db? def article_theme(request, articleblock_id=2): return render_to_response('a...
(1) odpowiedzi
2017-04-06 10:04 Deadlock between Update and Insert queries »
I have faced a deadlock in my application between an Update and an Insert query and I am unable to understand why locks are given in a way which cause...
(1) odpowiedzi
2017-04-05 18:04 Django localize datetime fields in the queryset and not template »
I'm running Django with Postgres, and have USE_TZ=True set. I want timezone-aware datetimes returned from the database, which I get from USE_TZ...
(0) odpowiedzi
2017-04-05 17:04 Configuring Django/Wagtail media to use S3 »
I'm using the following guide: https://www.caktusgroup.com/blog/2014/11/10/Using-Amazon-S3-to-store-your-Django-sites-static-and-media-files/ At the...
(2) odpowiedzi
2017-04-05 12:04 How to set webhook for facebook lead creation? »
I am new facebook API.I need setup webhook for lead generating at my ads. I checked facebook developers docs but I didn't find any solution. I have f...
(0) odpowiedzi
2017-04-04 20:04 Loading decimal numbers from django form (formset) into number input »
I am creating a simple django app where you can create recipes with ingredients. On my RecipeCreate view I have a simple formset with a select input (...
(4) odpowiedzi
2017-04-04 14:04 How to display the edited profile picture in django »
I am able to upload the profile picture but i am not able edit it I have the form populating with the image browse option, but when I click save, it ...
(3) odpowiedzi
2017-04-04 05:04 Adding permissions to Django model without table »
I'm working on some Django Rest Framework based project (quite expected API for some web-app). It has as traditional Django models, and some kind of m...
(1) odpowiedzi
2017-04-04 03:04 Sending CSRF Tokens via Postman »
I'm trying to test my web server's login with Postman. First, I send a GET request to my login url, and I get a CSRF token as a cookie. Then, I make a...
(1) odpowiedzi
2017-04-03 21:04 Django's redirects app doesn't work with URL parameters »
I recently installed Django's default redirects app on my site using the exact instructions specified: Ensured django.contrib.sites framework is ins...
(1) odpowiedzi
2017-04-03 18:04 Angular 2 error 403 when trying to POST login information on Django backend »
For a project we are developing a web application, the frontend we make use of Angular 2 and Django for the backend. For the communication between fro...
(0) odpowiedzi
2017-04-03 18:04 URL based database routing »
I set up URL based database routing inspired by this answer in order to use the same app for different projects/databases. The projects do not need to...
(0) odpowiedzi
2017-04-03 05:04 How to include context variable in a wagtail cms field? »
I am looking for a way to render a variable that will be available in the context of the the page where the cms page will be rendered. Ex: I have in ...
(1) odpowiedzi
2017-04-02 23:04 Structuring Django application »
I am currently working on designing a web application to be used by researchers to conduct reviews. In this application there are two groups of users ...
(1) odpowiedzi
2017-04-02 15:04 Django - how to add data using conditional statement in a separate python script »
Purpose/Intension I have created Django Model with the result being an sqlite3 database. I now want to use a separate python script to add to that da...
(1) odpowiedzi
2017-04-02 07:04 Django: How to order a query set for a foreign key by a field of referencing class »
I've got two classes: class Manufacturer(models.Model): name = models.CharField(max_length=50) class Part(models.Model): name = models.Cha...
(1) odpowiedzi
2017-04-02 07:04 python comma separate values by thousands without trailing zeros »
I am trying to comma separate float amount by thousands. I am able to do that using the locale.format() function. But the expected output is not consi...
(1) odpowiedzi
2017-04-01 23:04 load part of the html page when filtering results with ajax »
I want to filter a search results using 3 checkboxs. The results are presented in the div with the id=posts_results <div class="checkbox"> ...
(2) odpowiedzi
2017-04-01 21:04 Django Model field needs to be unique over multiple models with shared abstract base class »
Suppose I want to have multiple kinds of articles, all reachable on site.com/news/article-slug (so depending on article-slug, it can be a video articl...
(1) odpowiedzi
2017-04-01 15:04 Wagtail Images Not Loading Once Deployed »
I'm not quite sure what's going on, but my images loaded fine on my local development server. However, once I deployed, the images will not load. I ch...
(1) odpowiedzi
2017-03-31 10:03 What template is loaded by Django? »
I was following Django tutorial, and got stuck where it asked me to replace the default template for administrative part of the site with my own. The...
(2) odpowiedzi
2017-03-31 09:03 how can I convert a string to ip address in python »
how can i convert a string ip address to a decimal number. e.g I have a data bytes= b'363,3,1778952384,7076' , here 1778952384 is my ip address and 70...
(1) odpowiedzi