vaseem cholakkan
anybody made shopify embedded apps with django ? can you give me some tutorials or docs. Thanks.
Nema
hi, I am trying to use the django-allauth package in my project following the instructions at https://docs.allauth.org/en/latest/installation/quickstart.html and I am encountering the following error when I try to run the server: ModuleNotFoundError: No module named 'allauth.account.middleware' The above exception was the direct cause of the following exception: ... django.core.exceptions.ImproperlyConfigured: WSGI application 'my_project.wsgi.application' could not be loaded; Error importing module. I am unsure of where the problem resides. I have crawled most of the stackoverflow threads with these errors mentioned in them, but nothing they propose seems to fix the issue (like checking that the packages are installed, that the project structure is correct and syntax errors such as forgetting "," in INSTALLED_APPS). What do you think could be the cause of this? Furthermore, if I comment out the WSGI_APPLICATION variable I get this error: ModuleNotFoundError: No module named 'allauth.account.middleware' but allauth is installed and allauth.account is present in INSTALLED_APPS
Nema
Hi! maybe you didn't do the migration?
when I run migrate, I get the following: Operations to perform: Apply all migrations: account, admin, auth, authtoken, my_project, my_project_api, contenttypes, sessions, socialaccount Running migrations: No migrations to apply. also with makemigrations I get no changes detected. Same when I specify the migrations of the application
Nema
Paste your code in rhe link
i already did that, if you refer to the quickstart guide
M. Hossein
I have a user model, a user profile model which are linked with one-to-one relationship. I want to create a serializer in which I have a flattened serializer. What should I do? Can I use a model serializer with several models? For example: if user has email and username field and profile has age, height, and country field, I need a serializer with these fields: username, email, password, age, height, country I will use this serializer only for creating resources by admin
Molecule
0 I have a Django view where I am getting the first queryset of 'top_posts' by just fetching all the Posts from database and cutting it in the first four. Within the same view, I want to get "politics_posts" by filtering Posts whose category is "politics". But I want a post appearing in 'top_posts', not to appear in 'politics_posts'. I have tried using exclude but it seems like it`s not working. Below is my view which is currently not working: def homepage(request): top_posts = Post.objects.all()[:4] politics_posts = Post.objects.filter(category='politics').exclude(pk__in=top_posts) for post in politics_posts: print(f"ID: {post.id}") context={"top_posts":top_posts, "politics_posts":politics_posts} return render(request, 'posts/homepage.html', context)
T
exclude_ids = [obj.pk for obj in top_posts] Post.objects.filter(category='politics').exclude(pk__in=exclude_ids)
DeathLikeSilence
Hello, I created a Product model in model.py one of my variables is " is_active" and this variable is Booleanfield is_active = models.Booleanfield(default =True) But I have a problem When I want to add a product to my products, in the admin panel “is_active” is off (I mean it is not checked) although by default is True I would be grateful if you help me I was working with Insomnia
T
Makemigrations and migrate
Still it not work so just delete all the migrations files then do the migrate
Brook
I have a user model, a user profile model which are linked with one-to-one relationship. I want to create a serializer in which I have a flattened serializer. What should I do? Can I use a model serializer with several models? For example: if user has email and username field and profile has age, height, and country field, I need a serializer with these fields: username, email, password, age, height, country I will use this serializer only for creating resources by admin
You have two options. One You can use 3 serializers. 2 for the models and a third one that sub classes serializers.serializers not serializers.modelserializers. and call the two model serializers already created inside the third one. But the other one and the easiest way is to use serializer method fields. Check out the documentation on serializers.SerializerMethodField.
DeathLikeSilence
Hi! Can you add a new product to the database?
In model.py, in my Product model, I have these : Name, slug, description Is_acituve In Insomnia I select POST and that shows me Name, slug, description I filled out and sent All of them are in admin panel but Is_acituve is not check By default it is True but it is not check I don't know what should I do
matija
did you try restarting the server
DeathLikeSilence
Yeah I did all of them
i
Yeah I did all of them
spelli g typo It's BooleanField not Booleanfield F is caps.
DeathLikeSilence
spelli g typo It's BooleanField not Booleanfield F is caps.
I know what you mean In my code that is correct It was my fault type
Jahongir
## Describe your problem https://dpaste.org/your_code_link
Payang
I cannot send the information from the appointment form to my database. It's my first time doing web development so certainly there will be a lot of errors in the code that's why I need help https://dpaste.org/pNLDu
Sarah
How do you import .txt files to the django database
Luis
Hello guys! I have a customer using Firestore, do you know if there is any lib to connect django-admin and firestore?
Luis
How do you import .txt files to the django database
Well... some DB engines support importing .csv files, so you can try to convert those .txt files to .csv Another option is to create a custom python script to read and parse the .txt content, and then use Django's ORM to create records into the DB.
Nerd
Hello guys! I have a customer using Firestore, do you know if there is any lib to connect django-admin and firestore?
Will love to see if this has been done also, but this might result in a lot of customization since firestore is NOSQL
Luis
Will love to see if this has been done also, but this might result in a lot of customization since firestore is NOSQL
Yes, I'm dealing with firestore and it's a nightmare. Some time ago I was able to connect django-admin with mongodb doing some hacks and using pydantic... but this looks more complicated.
Luis
Thanks guys!
T
pip install django-firebase pip install firebase-admin Models.py from django_firebase.models import FirebaseFirestoreModel class MyFirestoreModel(FirebaseFirestoreModel): name = models.CharField(max_length=100) description = models.TextField() admin.py from django.contrib import admin from .models import MyFirestoreModel admin.site.register(MyFirestoreModel) Migration and migrate
Luis
Firestore is a database right?
Yes, from the Google firebase stack
Andrew
Hey guys how to get work as django developer
Luis
I cannot send the information from the appointment form to my database. It's my first time doing web development so certainly there will be a lot of errors in the code that's why I need help https://dpaste.org/pNLDu
Hey buddy! I think you need to simplify your add_appointment method. Backup your project and try to use a different approach. I mean just request the user the required information... rendezvous data, patient.id and medicine.id should be enough to create and appointment. Then you can query the DB to get extra information from persone to fill missing data.
Sarah
Anyone open to helping me import my data.txt files to my database?
Doragonsureiyā
Anyone open to helping me import my data.txt files to my database?
Read this please: http://catb.org/~esr/faqs/smart-questions.html#intro
Luis
Hey guys how to get work as django developer
I think this is offtopic, anyway I think a good idea to practice is to create some apps (look for some ideas on google), that will help you to create a portfolio to show your experience to companies. Then go to LinkedIn and look for Django JR offers. Good luck!
Uzumaki
Can some one tell me how to set up payment gateway correctly in my django project
Uzumaki
I got lots of errors recently
Lk
Hi I’m looking for django training, want to learn, any suggestions here please
Doragonsureiyā
Hi I’m looking for django training, want to learn, any suggestions here please
Looking for Django tutorials? you can follow these three recommended ones: * Official documentation and tutorial * Tutorial from MDN * Tutorial from django-girls
Mohammad
What is Django Rest FRAMEWORK
Eternity
What is Django Rest FRAMEWORK
It is the library for creating API using Django
Mohammad
It is the library for creating API using Django
I reed this on Google but I want to know what is good for
Eternity
Well, do you understand what does "API" mean?
Eternity
Application Programming Interface
Ayariga
What is good for
It's handy when you develop a web app in django and has intensions to develop lets say a mobile app and don't want to create two different database and tools to manage your Django app as well as your mobile app
Ayariga
What is good for
Example: if you develop a django app like Spotify to make sure that when a user Signs up for your website and do stuff, using REST FRAMEWORK API you can create a mobile app for such that the same user from your website can login into your mobile and have access to everything from the Django web app without you the developer having to create different tools and database for the mobile app
Il
Hello every one , im facing a problem , Not Found : /media/post/toto.png
⇆ㅤ◁ㅤ ❚❚ㅤ ▷ㅤ↻
Hello every one , im facing a problem , Not Found : /media/post/toto.png
Bro please check if this file exists in the given directory.
Il
Im using the get_context_data , and rend it in my html template using for in loop
⇆ㅤ◁ㅤ ❚❚ㅤ ▷ㅤ↻
Im using the get_context_data , and rend it in my html template using for in loop
from django.conf import settings from django.conf.urls.static import static urlpatterns = [ # ... the rest of your URL patterns ... ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
Raghu
Can anyone working on django rest framework
Charly
Can anyone working on django rest framework
Many people is working with it, what's your real question?
Eternity
Raghu
I want learn that
Charly
Raghu
I don't have any data
Charly
I don't have any data
Start with the official documentation: https://www.django-rest-framework.org/tutorial/quickstart/
Eternity
I don't have any data
There are so much information about DRF in the Internet. Documentation, different YouTube videos etc.
Raghu
In YouTube not there already searched
Charly
In YouTube not there already searched
I don't know what are you searching because I got tons of videos of it, e.g: https://www.youtube.com/watch?v=tujhGdn1EMI
Eternity
In YouTube not there already searched
https://youtu.be/c708Nf0cHrs?si=fwMZ9cB6chIq2txF
Eternity
There are many videos. Just choose the one you like
Raghu
Thanks for sharing ☺️
Muflone
All right , thank you
That is only for debug, it shouldn't be used in production. Media files have to be served from nginx/caddy
Sebastian
Hello community. I want to use celery in my SAAS which is made in Django Rest Framework but it is a multi-tenant system with django-tenants. Does anyone know of documentation more or less of what I want to do? I don't see this information clearly on the internet. Thank you
Its me
Hi All, Can someone tell me how to use pgbouncer in DRF?