Re: Python

2023-08-31 Thread Andréas Kühne
You should start by understanding a web framework with Python. I would recommend starting with Django - www.djangoproject.com - it’s a batteries included framework where you won’t need to handle all aspects by yourself.You can find a good tutorial at the following website:Introduction ·

Re: ANYONE TO HELP ME ON HOW TO CREATE AN AUTOMATIC NOTIFICATION SYSTEM THAT SENDS A MESSAGE WHENEVER AN OBJECT IS CREATED OR MODIFIED

2023-08-31 Thread Andréas Kühne
First of all - notification - what do you mean by notification? If you mean that the user should be notified in the instance when someone creates / updates / deletes your models - you will need to have either server side events or websockets to communicate with the frontend. You could also poll

Re: Django Resolve Choices Class

2023-08-31 Thread Andréas Kühne
If you want the string instead of the value, you just use: entity.get_gender_display() Django automatically adds these "magic methods" when you have fields that have choices. You can see this in the documentation: https://docs.djangoproject.com/en/4.2/ref/models/fields/#choices Regards,

Re: Installed Django 4.1 but version is 2.2

2023-03-21 Thread Andréas Kühne
I am guessing this is because you are running your systems installed django-admin for setting up the project and not in a virtualenvironment? Before running django-admin startproject mysite, make sure that you have created a virtualenvironment and install the version of django that you want.

Re: How to retrieve the latest object added (new one) in Django models and display it in the template?

2023-02-28 Thread Andréas Kühne
= ActionGame.objects.last() Den tis 28 feb. 2023 kl 15:04 skrev Dev Femi Badmus : > all_action=ActionGame.objects.all() > my_action = [] > for action in all_action: > my_action.append(action) > last_action = my_action[-1] > > > On Tue, Feb 28, 2023 at 1:05 PM Andréas Kühne > wr

Re: How to retrieve the latest object added (new one) in Django models and display it in the template?

2023-02-28 Thread Andréas Kühne
Se comments below. Den fre 24 feb. 2023 kl 12:14 skrev Byansi Samuel : > Hey everyone, l got a problem. Am trying to retrieve a single latest > object added everytime, and display it in the template. > Below is my codes but; > > Help me figure it out the source of the problem in these different

Re: How can I serve an Angular app from root?

2023-02-28 Thread Andréas Kühne
Hi, You shouldn't be serving your angular application that way. Running it in development, you run it and serve it from the "ng serve" command. Running in production, you need to have a webserver in front of your application any way, and should serve the angular files from the webserver. Med

Re: django model method

2023-02-09 Thread Andréas Kühne
< allaberdi16yazha...@gmail.com>: > understood, is there any way to filter objects by method value? > > On Thu, Feb 9, 2023 at 4:42 PM Andréas Kühne > wrote: > >> No. >> >> Ordering works by using the database to order the models. It therefore >> needs to

Re: django model method

2023-02-09 Thread Andréas Kühne
No. Ordering works by using the database to order the models. It therefore needs to be a database field - otherwise the database can't order by the field? Regards, Andréas Den tors 9 feb. 2023 kl 12:09 skrev Chelsea Fan < allaberdi16yazha...@gmail.com>: > hello guys, Is it possible to use

Re: How to pass "--runworker --asgi" to wsgi.py

2023-01-13 Thread Andréas Kühne
The simple answer is - you can't. Django can run in 2 separate ways: Synchronous - via a WSGI server - or asynchronous via an ASGI server. Websocket requests run via ASGI - so you need an ASGI server. You can read the official documentation and see your alternatives here:

Re: Basic questions about scaling a Django web app. (e.g. AppEngine solves all problems?)

2021-08-24 Thread Andréas Kühne
I would say that Google App Engine MIGHT solve some of your problems, but you will instead get more problems. App Engine is a good solution, but still is a big black box of functionality. I think you would be better suited with a solution like Elastic Beanstalk from AWS (there probably is an

Re: Django beginner

2021-07-05 Thread Andréas Kühne
Hi and welcome to the django community! The best way to learn django depends a lot on you skill and experience of python as well. If you don't know that much python, I would recommend starting with a good course or a book about fundamentals in Python. After that I would go to the following

A/B testing recommendations

2021-04-27 Thread Andréas Kühne
Hi all, I am working on a website where we now want to do A/B testing. Now I have previously looked into this - but have never found any good packages for doing that. The landscape may have changed now then, so I was wondering if anyone has any good suggestions for A/B testing packages? Or if

Re: Building reports in Django / Python

2021-04-24 Thread Andréas Kühne
el packages out there > (can’t think of a name off the top of my head), but even to that point, excel > will accept a CSV, which can very easily be constructed with python. > > Hope this helps, > Benny > >>> On Apr 24, 2021, at 3:04 PM, Andréas Kühne >>>

Building reports in Django / Python

2021-04-24 Thread Andréas Kühne
Hi all, I was wondering if anyone has any good resources for building reports in Django / Python. What I am trying to do is the following: * I have built a questionnaire motor - it works more or less like google forms and collects the input from 1 or more respondents to a questionnaire. So far so

Re: Try to connect Redis Channel in Django Chat Project

2021-04-09 Thread Andréas Kühne
You need to make sure that you have a redis server running and that you have the correct connection in django settings for the channels setup. See more here: https://channels.readthedocs.io/en/stable/topics/channel_layers.html?highlight=redis#redis-channel-layer Regards, Andréas Den fre 9

Re: how to publish django-reactnative app on google playstore

2021-04-06 Thread Andréas Kühne
Hi, It really depends on what you are looking for. There are several different platforms for doing what you want, the one that I currently am using is Ionic: www.ionicframework.com. You can use different frontends for creating the applications - but it is best with angular (I think). Regards,

Re: Saving xlsx on to the clients file folder

2021-04-02 Thread Andréas Kühne
Hi, Google download files and django. You will find more information about it. However in the officiell documents you can look here: https://docs.djangoproject.com/en/dev/ref/request-response/#telling-the-browser-to-treat-the-response-as-a-file-attachment Regards, Andréas Den fre 2 apr. 2021

Re: How to create a user to user message system using Django Rest frame work

2021-03-15 Thread Andréas Kühne
Hi, I did a quick google search and found the following package: https://django-messages.readthedocs.io/en/latest/ All you need to do is create the DRF views for it. Regards, Andréas Den sön 14 mars 2021 kl 23:06 skrev DAN DIGNITY : > I am trying to create a private messaging system using

Re: Okta implementation with djnago 1.8

2021-03-10 Thread Andréas Kühne
I am guessing you mean to use Okta as an identity provider? You should check the social-auth-app-django package. It has the required connections so that you can get what you want to do working. It's more or less just configuration. Regards Andréas Den ons 10 mars 2021 kl 21:31 skrev

Re: can we integrate html views that look far better then what is available with django

2021-02-18 Thread Andréas Kühne
Hi, This is a very strange question? You can create anything you want with Django. For example Instagram and Youtube are built with Django. The framework allows for any design that you really want yourself - you just need to design the HTML the way you want - I have personally used Django for

Re: how to split in multiple file class models.py?

2021-02-01 Thread Andréas Kühne
Sorry, BENNY M. Apologies. Regards, Andréas Den tis 2 feb. 2021 kl 08:44 skrev Andréas Kühne : > So, > > Boney M's assumption here is correct. > > You just need to import all of your models in the __init__.py file using > relative imports, so for example: > > from .c

Re: how to split in multiple file class models.py?

2021-02-01 Thread Andréas Kühne
So, Boney M's assumption here is correct. You just need to import all of your models in the __init__.py file using relative imports, so for example: from .car import Car and so on. This works perfectly and I usually try to split the models in that way as not to get a models.py that is over

Re: Using django cms in a model instance scenario rather than the whole site

2021-01-15 Thread Andréas Kühne
Hi Joel, I don't think you need to incorporate django cms for that use case. You would be better just to add a HTML editor of some sort and then saving the HTML in the database. That way you don't need to open up django admin for the cms handling either? At least that's the way I would do it?

Re: How can you do a for loop with a database?

2020-12-13 Thread Andréas Kühne
The context needs to be a dictionary. Something like this would work: context = { ‘items’: Model.objects.all() } Then in the template: {% for item in items %} {{ item.text }} {% endfor %} Here ‘text’ is the property on the database model you want to display. Regards, Andréas > 12

Re: Django error

2020-12-02 Thread Andréas Kühne
As far as I can see you haven't saved your changes in the urls.py and views.py files? Otherwise it should work? Regards, Andréas Den ons 2 dec. 2020 kl 22:02 skrev Ujala Asaf : > Hello, I am a beginner at Django..and I'm facing an error at the very > first step...Django is not displaying my

Re: Guidance for Django-React

2020-12-01 Thread Andréas Kühne
I would say that you can choose any of the 3 big javascript frameworks (angular, react and vue) and learn one of them. They all have their own pros and cons. It all depends on what you really want to do with them. DRF as a backend is not a bad thing to learn regardless - there are many places

Re: run terminal code inside project

2020-11-05 Thread Andréas Kühne
I would say that that's even worse? Django doesn't like changing the database when you are running. I think you need to rethink how you want to use django - because this isn't a usecase I think is even possible. What you would need to do is first create the models.py file, update the database

Re: run terminal code inside project

2020-11-05 Thread Andréas Kühne
You can't do that really. What is it you want to accomplish? You can call management commands from inside django - but it doesn't really make any sense to do so. Especially the migrate command? So what is it you want to do? Then perhaps we can help you with a solution? Regards, Andréas Den

Re: reusable App XOR custom user model?

2020-11-05 Thread Andréas Kühne
Like Ani said, There are different use cases. If you want to make a reusable app - that can be put up on pypi for example - then you shouldn't add a custom user model, but you can connect to the user model instead (this was previously recommended in django with the "UserProfile" solution).

Re: Can anyone help me fix this issue

2020-10-29 Thread Andréas Kühne
You are looking for a key in the response from youtube that doesn't exist - therefore you get this error. You will need to go to the youtube api and see what the response should be. Regards, Andréas Den tors 29 okt. 2020 kl 14:03 skrev Allen Yesudasan : > Environment: Request Method: POST

Re: Django session Through login/logout

2020-10-28 Thread Andréas Kühne
Hi, This is per default in django. The way the logout function works is that it completely clears the session (which is good practice, because you don't want to see anything there after a logout). Regards, Andréas Den tis 27 okt. 2020 kl 14:28 skrev kawsar sarker : > Hi, > Nice to be with

Re: Diffrence between two

2020-10-28 Thread Andréas Kühne
for i in grocery: if i.store_type=="Alcohol" or "Both":(1) This line checks if i.store_type is "Alcohol" or if the string "Both" is Truthy - which it is because it is not '' or None - this if statement will always be True. if i.store_type=="Alcohol" or i.store_type=="Both":(2) This line checks

Re: Patreon and Django-AllAuth Integration

2020-10-26 Thread Andréas Kühne
Hi, Django-allauth is used for handling login from SSO third party libraries - EXACTLY what you are getting a response from. Do you want to use Patreon as a login account provider or do you want to do something else? Regards, Andréas Den mån 26 okt. 2020 kl 20:47 skrev Andrew Stringfield <

Re: Restarting servers in development

2020-10-26 Thread Andréas Kühne
If you are running in production, make sure that you use something like https://docs.djangoproject.com/en/3.1/ref/contrib/staticfiles/#manifeststaticfilesstorage for handling the css and js files. This will solve the problem automatically for you be adding a MD5 hash to the url of the file, which

Re: Password see

2020-10-08 Thread Andréas Kühne
I hope you realize the security implecations of what you are asking? You should never store a password in a way that you can retrieve it - and django doesn't do that. It hashes the password with a salt and then stores the hash. The hash is then stored in the database. The hash should be one way -

Re: How to get logged in user location and save it in database

2020-10-01 Thread Andréas Kühne
You can use built in functionality for this. All you need is an up to date IP address database. You can find one here: https://www.maxmind.com/en/geoip2-services-and-databases The geoip handling in Django will then help you find where the IP address is:

Re: Want to get informations about bets Django hosting plateform

2020-09-21 Thread Andréas Kühne
I don't have any experience of them - so I really don't know. I have used heroku (or I am using it currently). Regards, Andréas Den mån 21 sep. 2020 kl 13:01 skrev Wesley Montcho : > Thanks you. > > > > What do you think about Scalingo ? > > Le lun. 21 sept. 2020 à

Re: Want to get informations about bets Django hosting plateform

2020-09-21 Thread Andréas Kühne
This isn't an easy question to answer. Unfortunately there is no real "goto" shop for django. There are however several ways to accomplish this. If you want a simple startup solution - try Heroku. It'll be sufficient for small to medium sized handling and you don't need to do any setup yourself.

Re: Sources for learning django

2020-08-21 Thread Andréas Kühne
Try the django girls tutorial: https://tutorial.djangogirls.org/en/ It's a good starting place. Regards, Andréas Den fre 21 aug. 2020 kl 03:53 skrev Mustafa Mahmoud : > ممكن محمد عيسي ليه كورس ع يوتيوب واقرا ال documention إلي في الموقع بتاع > جانكو وفي واحد تآني مش فاكر أسمو هشوفو وهقولق

Re: User registration with security features

2020-08-17 Thread Andréas Kühne
Hi, No, that is not available in django per default. Django doesn't know anything about "devices". You will need to write that code by yourself - or search for a plugin that handles devices. Regards, Andréas Den sön 16 aug. 2020 kl 23:59 skrev Ram : > Hi, > > Does DJango have built in

Re: Django storing byte string for image

2020-08-05 Thread Andréas Kühne
Hi, You don't need to store them in the database - just store them in the file system instead? Regards, Andréas ‪Den tis 4 aug. 2020 kl 21:02 skrev ‫را نيا‬‎ :‬ > Good evening > I want to import photos and PDF files from desktop app and display them in > web app, how can I do it without

Re: bug bulk_create

2020-08-05 Thread Andréas Kühne
Hi, Without seeing the code more, I would say that this is an error in the OrderedModel code. Check if you can update it to support the version of Django you are working on. Regards, Andréas Den tis 4 aug. 2020 kl 14:09 skrev nima salemahim : > Traceback (most recent call last): > File

Re: Django +Ajax + jQuery problem

2020-07-03 Thread Andréas Kühne
Hi, The reason for this is that you are replacing the buttons when you update the answer. The event listener that you attached is on the first one and not the second one. You can solve this in 2 ways: 1. Reregister the event listener when you have loaded the answer again. 2. Use a different way

Re: Can anybody answe how i can access infromation from the parent modell i my HTML template in Django?

2020-06-30 Thread Andréas Kühne
:06 skrev The Sha : > Ok i understand, how du i put the CustomUser in the render method so i > cant get {{ CustomUser.first_name }} in this case? > > Den tisdag 30 juni 2020 kl. 11:00:53 UTC+2 skrev Andréas Kühne: >> >> Hi, >> >> You need to pass the variables

Re: Can anybody answe how i can access infromation from the parent modell i my HTML template in Django?

2020-06-30 Thread Andréas Kühne
Hi, You need to pass the variables that you want to use in the template to the template itself. You do this here: return render(request, 'members/member_contact_form.html', {'ContactFormset':ContactFormset, 'AddressFormset':AddressFormset }) The dictionary you add to the render method there

Re: Is there a package that enables one Django project to authenticate via a second Django project?

2020-06-30 Thread Andréas Kühne
t; > > On Mon, Jun 29, 2020 at 5:10 AM Andréas Kühne > wrote: > >> The remote user functionality is still valid - however it is rarely used. >> I heard about it myself from one of the Django fellows - who are >> responsible for handling ticket triage on the djan

Re: Is there a package that enables one Django project to authenticate via a second Django project?

2020-06-29 Thread Andréas Kühne
The remote user functionality is still valid - however it is rarely used. I heard about it myself from one of the Django fellows - who are responsible for handling ticket triage on the django project itself. He said exactly what you are saying - that there isn't that much information about it and

Re: Is there a package that enables one Django project to authenticate via a second Django project?

2020-06-25 Thread Andréas Kühne
First of all - why separate the django apps into various projects? That seems a bit strange because you are depending on one user account and one database? There isn't really any benefit of doing it like that - why not use a single django project? But on the other hand - if you want to continue

Re: Why Should I use DRF over Django

2020-06-18 Thread Andréas Kühne
Like Shishir says it's not using DRF instead of django, It's DRF on top of django. The main reason for using DRF instead of using django by itself is that you get an enormous consistency. Serialization is really simple, you get validation on all fields with valid JSON results. You get all of the

Re: events calendar

2020-06-16 Thread Andréas Kühne
I would second using fullcalendar. It's a really capable frontend library for handling calendar events. All you would then need to do is have a backend that sends the events as json to the fullcalendar plugin. Regards, Andréas Den tis 16 juni 2020 kl 16:34 skrev Vivek Jha : > You can also

Re: Idea production with Django

2020-06-10 Thread Andréas Kühne
Very meta :) Regards, Andréas Den ons 10 juni 2020 kl 15:52 skrev Wim Olivier : > Build an app where people can post their ideas, and other people vote on > their ideas - whether they're good or not good. :-) > > On Wednesday, 10 June 2020 14:51:33 UTC+2, vchanel Hoang wrote: >> >> Please

Re: How to add entries dynamically

2020-06-05 Thread Andréas Kühne
Hi, This is a fairly common practice - I found this: https://dev.to/zxenia/django-inline-formsets-with-class-based-views-and-crispy-forms-14o6 When googling for "inline formsets" because that's what you want. You can of course choose some other tutorial - but I think this one explains it ok. You

Re: django-tenants domain issue

2020-06-03 Thread Andréas Kühne
You just need to add those to your hosts file locally on your computer. If you are using Mac: https://www.imore.com/how-edit-your-macs-hosts-file-and-why-you-would-want If you are using Linux: https://support.rackspace.com/how-to/modify-your-hosts-file/ If you are using Windows:

Re: Custom template tags - instance.templatetag

2020-06-03 Thread Andréas Kühne
Andréas Kühne : > Hi Jan, > > You can't do it like that. A templatetag is a simple function that is > handled in a special way by the django templating language. > > See here for an explanation: > > > Med vänliga hälsningar, > > Andréas > > > Den tis

Re: Custom template tags - instance.templatetag

2020-06-03 Thread Andréas Kühne
Hi Jan, You can't do it like that. A templatetag is a simple function that is handled in a special way by the django templating language. See here for an explanation: Med vänliga hälsningar, Andréas Den tis 2 juni 2020 kl 22:53 skrev Jan Gregorczyk : > Hi! How to change my template tag? >

Re: Issue with serving angular with django

2020-06-03 Thread Andréas Kühne
sunnexaj...@gmail.com * > > > > On Mon, Jun 1, 2020 at 6:24 PM Andréas Kühne > wrote: > >> Hi Sunday, >> >> No - you don't. What collectstatic does is it collects all of the static >> files to the path where they should be stored. This should be a directory >&

Re: Issue with serving angular with django

2020-06-01 Thread Andréas Kühne
Hi Sunday, No - you don't. What collectstatic does is it collects all of the static files to the path where they should be stored. This should be a directory that should be served from nginx or apache or any other webserver. When you run manage.py runserver - you run a development server that

Re: how to use **kwargs if filters contains list of values

2020-05-28 Thread Andréas Kühne
Simply put - you can't. not without if statements. What I would do is something like this: query = Q() for item in kwargs.items(): if isinstance(item[1], list): query &= Q(**{f"{item[0]}__in": item[1]}) else: query &= Q(**{item[0]: item[1]}) query_set = query_set.filter(query)

Re: HOW TO PROTECT SOURCE CODE DEPLOYED TO A REMOTE SERVER

2020-05-19 Thread Andréas Kühne
You can't really do that with Python - however - IF you want to go down that route, you can just use the pyc files - you can theoretically backwards compile them, but I think this is the most you can do Regards, Andréas Den tis 19 maj 2020 kl 03:36 skrev Sunday Iyanu Ajayi : > I get your

Re: Getting HTTP 301 on static resources

2020-05-19 Thread Andréas Kühne
You need to configure apache correctly and set up your static url in django. See here for an explanation: https://docs.djangoproject.com/en/3.0/howto/deployment/wsgi/modwsgi/#serving-files Regards, Andréas Den tis 19 maj 2020 kl 03:38 skrev jtaylor___ : > I'm setting up a Django instance

Re: How to over ride the get context data method in view

2020-05-14 Thread Andréas Kühne
.get_context_data(** >>> kwargs) >>> for post in context_data['posts']: >>> post.is_liked = post.likes.filter(user=user).exists() >>> <- name 'user' is not defined >>> return context >>> >>> I am also

Re: How to over ride the get context data method in view

2020-05-13 Thread Andréas Kühne
Den ons 13 maj 2020 kl 15:24 skrev Ahmed Khairy : > Hi Andréas Kühne, > > Regarding the first error > > I have a list of posts in the listView and want to add the like button to > each post so how should I fix it? > > Thank you > > On Wednesday, May 13, 2020 at 6:08:31

Re: How to over ride the get context data method in view

2020-05-13 Thread Andréas Kühne
Hi, There are a couple of errors in your code: 1. You are using a ListView and then trying to get an individual post? That is really strange 2. In your get_context_data method - you first get the context data, update it and then you set it to a new dict, so everything is reset in the dict. 3.

Re: timezone doesn't change

2020-05-08 Thread Andréas Kühne
Hi, That is actually the expected behaviour - django.utils.timezone.now() should always return a UTC time. You should always communicate in the backend with UTC time - saving everything to the database and so on - it should always be in UTC. When you want to present a time in a template or to

Re: didn't return an HttpResponse

2020-05-08 Thread Andréas Kühne
Hi, A couple of pointers: 1. If you are using class based views and want a Form, try using the FormView - you don't need to write that much code yourself (regarding validation of form and so on). 2. When you populate your context - you use a form class and not a form instance - you should be

Re: Django tutorial, HttpResponseRedirect, sending multiple arguments

2020-05-08 Thread Andréas Kühne
Cool! Keep learning - I think that django is probably one of the best COMPLETE frameworks there is - And now shortly with async support, it will be even better :) The way you can quickly prototype something that later on can continue into production is one of Pythons and Djangos strengths.

Re: Django tutorial, HttpResponseRedirect, sending multiple arguments

2020-05-07 Thread Andréas Kühne
Hi, Sorry for mixing those things up - I was writing from the top of my head and not really paying that much attention perhaps :) I would like to give you a few other pointers: 1. This is a bit biased but I would try to get away from function based views - because they tend to make you do a lot

Re: Django tutorial, HttpResponseRedirect, sending multiple arguments

2020-05-07 Thread Andréas Kühne
Hi Peter, The thing is you need to handle this with your url files, your view function (or class) and your reverse call. So for example: urls.py path('blog///', detail) views.py: def detail(request, category, question_id): and finally the call to reverse: reverse('polls:results',

Re: How to send dict to template and use it

2020-05-07 Thread Andréas Kühne
Hi, If you want to see something in the queryset you need to query it :) For example: {% for question in latest_question_list %} {{question.id }}{%endfor%} Or you can take the last or first item? {{ latest_question_list.first.id }} Regards, Andréas Den tors 7 maj 2020 kl 07:55 skrev

Re: register_converter

2020-05-06 Thread Andréas Kühne
. The line that causes > this is the line return {**DEFAULT_CONVERTERS, **REGISTERED_CONVERTERS} > in get_converters() in Django. > > אורי > u...@speedy.net > > > On Wed, May 6, 2020 at 3:04 PM Andréas Kühne > wrote: > >> Hi, >> >> You register your converter

Re: register_converter

2020-05-06 Thread Andréas Kühne
Hi, You register your converter in the main urls.py file (which is usually in the main project name, alongside settings.py). That's all you need to do. I don't know about the slug converter though - I would just reregister it and see what happens :) Regards, Andréas ‪Den ons 6 maj 2020 kl

Re: How to refer to another translation in a translation?

2020-05-03 Thread Andréas Kühne
akes people feel > angry." > > In this msgstr, is it possible to refer to the string colour? > > In this way, in case later my boss says color should be translated to tint > in en-UK, I only need to change one place. > > > > 在 2020年5月2日星期六 UTC-7上午11:44:41,Andréas Kü

Re: How to refer to another translation in a translation?

2020-05-02 Thread Andréas Kühne
Hi, Your idea isn't that good. The problem is the following: _("My name is {name}").format(name='Andréas') This is a translation in a python context. So say that that translation gets translated into another language, where the name should come first: msgid "My name is {name}" msgstr "{name}

Re: App Dev wanted

2020-04-30 Thread Andréas Kühne
Hi Arne, I would also be interested in helping you. I have 7 years of experience developing in Django and it sounds as though the solution is pretty easy to finish? Regards, Andréas Den ons 29 apr. 2020 kl 16:08 skrev Arne Bollinger : > Hey, > We came with a project out of a Covid-19

Re: urgent help needed with my rest

2020-04-24 Thread Andréas Kühne
Hi, The problem you are having is that the ID you are sending to your deleteTask angular method is undefined - that's what the log shows. Check the angular code to see why you are not sending a valid id to the deleteTask method. This has nothing to do with the rest api - it is functioning

Re: Whats the best package for Django-admin styling

2020-04-22 Thread Andréas Kühne
Hi, I think grappelli does a great job regarding styling the admin pages - I use it all the time. It is also (currently) actively developed. However there are other solutions: https://djangopackages.org/grids/g/admin-interface/ The main thing I would look for is to make sure that the package I

Re: Expecting JSON object instead of JSON Array

2020-04-22 Thread Andréas Kühne
You are doing a get to the default route for the viewset I am guessing? That would return a list - because you are getting ALL records and not one specific record. If you added more records to the database you will also see more in the list. See here for more information:

Re: CSRF token still needed today?

2020-04-20 Thread Andréas Kühne
Why is it a problem to have? You add one specific command on all forms - or you disable it in the view What do you want to accomplish by removing it? Regards, Andréas Den sön 19 apr. 2020 kl 22:12 skrev guettli < guettli.goo...@thomas-guettler.de>: > iI look at this page:

Re: problem with admin panel

2020-04-17 Thread Andréas Kühne
This sounds like you are having problems with the static files - check so that you have run "manage.py collectstatic" correctly and that the command works. Regards, Andréas Den fre 17 apr. 2020 kl 03:57 skrev Cristhian Heredia Claure < cris94@gmail.com>: > > Hello everyone Sorry if it's

Re: Name clashes on custom commands

2020-04-10 Thread Andréas Kühne
Hi Tim, You need to make sure that your commands are unique in your project. Otherwise like you have discovered one overwrites the other. This is actually a good thing though - we use it in one of our projects to override the "runserver" command. The order of the applications in your project

Re: ORM from the command line

2020-04-09 Thread Andréas Kühne
Hi Tim, What you probably should do is use a custom command on the manage.py command interface. You till then get access to all of djangos goodness - and it can be run from the command line. See here: https://docs.djangoproject.com/en/3.0/howto/custom-management-commands/ This is how I would

Re: Can upload a directory structure as file upload using django?

2020-04-08 Thread Andréas Kühne
Hi, You can't do that with a django form field - you need to handle that in some other way. What I would do is zip the directory and upload the zip file. Python can handle zip files without any problem - so it shouldn't be that hard. Regards, Andréas Den tis 7 apr. 2020 kl 14:20 skrev Ashok

Re: seeking experts guidance

2020-04-05 Thread Andréas Kühne
For learning angular, I would go to udemy and take the angular complete guide there - the guy who does that is good. Learning django - basics: django tutorial and the django girls tutorial. They give you the right idea how to use Django. You will also need a tutorial for django rest framework if

Re: image not showing on page

2020-04-03 Thread Andréas Kühne
What I stated earlier is probably your issue: You have the following: style="background-image: img src="{% static 'images/image_name.png' %};"> You see the ";" at the end? The path to your image is then "images/image_name.png;" <- which is incorrect because of the extra semicolon. I would at

Re: image not showing on page

2020-04-03 Thread Andréas Kühne
Why do you have a ; in the src part of the img tag? I am guessing that you get a 404 now? Regards, Andréas Den fre 3 apr. 2020 kl 12:08 skrev John McClain : > html page > > [image: image.png] > > [image: image.png] > > > settings.py > > [image: image.png] > > > any suggestions would be

Re: Associating comments with images

2020-04-01 Thread Andréas Kühne
Yeah ok - so you should use the pictures variable to iterate over to get the pictures and you should be fine! Regards, Andréas Den ons 1 apr. 2020 kl 15:26 skrev Jeff Waters : > Thank you Andreas. > > This is the views.py - >

Re: Associating comments with images

2020-04-01 Thread Andréas Kühne
Ok - so you are not really doing this correctly - I am guessing now. Can you send the code for your view as well. Because I am guessing that you aren't sending anything to the context variable "pictures". I think the other things are more or less correct (even though there are some issues with

Re: Associating comments with images

2020-04-01 Thread Andréas Kühne
Add the photo id to the url - so instead of having the form like this: you add it like this: and make sure that the photo_id variable is in the current context and that the comment view accepts an id. Regards, Andréas Den tis 31 mars 2020 kl 16:58 skrev Jeff Waters : > I am creating a

Re: End of extended support for Django 1.11

2020-03-26 Thread Andréas Kühne
You can rely on April 2020, but not beyond that is the way I would interpret it. However - you should be migrating off it anyway - it's an old version. Regards, Andréas Den tors 26 mars 2020 kl 00:11 skrev Daniela Kim : > Hi everyone, > > When exactly is the *end of extended support* for

Re: Creating a new Django project, Stuck with the very first steps

2020-03-24 Thread Andréas Kühne
it working! Regards, Andréas Den tis 24 mars 2020 kl 15:58 skrev Rodolphe Gohard : > Hello, thanks for your answer. > > I installed python 3.6 from another PPA and it works fine now. I just wish > pip were aware of those requirements. > > > > > > On Tuesday, March 24, 202

Re: Creating a new Django project, Stuck with the very first steps

2020-03-24 Thread Andréas Kühne
Hi, First of all - you need to make sure you are using the python 3 version for everything - you can't mix and match python versions. So make sure that python 3 is the version you are using for everything, Second - python 3.5.2 is an old version of python 3 - you need at least version 3.6 for

Re: It is Possible to send html File through Django Rest api? Please suggest

2020-03-20 Thread Andréas Kühne
This is of course possible. If you look at the restframework examples you can run it in a html browser that returns different values than the api itself. Regards, Andréas Den fre 20 mars 2020 kl 09:47 skrev Sai Sandeep Rayanuthala < rayanutha...@gmail.com>: > Yeah possible. Use content

Re: Django IRC...Is it Active?

2020-03-20 Thread Andréas Kühne
Currently the django project recommends using the forums: forum.djangoproject.com Regards, Andréas Den fre 20 mars 2020 kl 14:59 skrev Shishir Jha : > Yes I also want to ask for django official discord server > > On Fri, Mar 20, 2020 at 7:23 PM B.Ramburn wrote: > >> we could use a discord

Re: New to Django to select between 3.0 and 2.2

2020-03-13 Thread Andréas Kühne
Hi Mrinal, Django is a very mature framework - new releases rarely have any issues that hinder them from being used in production. For a new project you should definitely go for 3.0 - you will start with the correct structure for the new async features and you will also not have any issues with

Re: Documentation misspelling - Django 3 - maybe

2020-03-05 Thread Andréas Kühne
If you check the code for the PasswordChangeView, the default template is 'registration/password_change_form.html'. So you are incorrect. Regards, Andréas Den ons 4 mars 2020 kl 18:19 skrev Norbert Rácz : > Here: >

Re: Stuck with Django on a Synology Diskstation

2020-03-03 Thread Andréas Kühne
Hi, I don't think this is actually possible. Django runs python and not only simple html. Nginx and apache are simple webservers. So unless you can get good access to the terminal on the diskstation - I wouldn't even try this. Why do you want to have the application running on a disk station?

Re: Project directory management

2020-02-28 Thread Andréas Kühne
If it is a flask app question, you should ask it on a flask mailing list. You will probably get better responses :-) Regards, Andréas Den fre 28 feb. 2020 kl 12:08 skrev Devender Kumar : > Hi, > BTW it is flask app question. > > dir structure > service > config/__init__.py >

Re: Django values_list queryset returns queryset object instead of list

2020-02-28 Thread Andréas Kühne
HI Santhosh, This is expected behaviour because it is a queryset until you query the results - or iterate over them. For example: for item in View.objects.all().values_list('name',flat=True).order_by('id'): print(item) will iterate over the list of values. BUT if you want to evaluate the list

Re: send django channels 2 messages to an individual user who might have more than one browser tab or device connected

2020-02-26 Thread Andréas Kühne
ation for that? > > We use: > channels==2.3.1 > channels-redis==2.4.1 > Django==2.2.4 > Python 3.6.9 > > > BR > > Levent > > > > Andréas Kühne , 14 Şub 2020 Cum, 11:08 > tarihinde şunu yazdı: > >> Regardless of how the user is connected - if you s

  1   2   3   4   5   >