Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Is the Django JsonResponse API or not?
Can I use json response instead of Django-REST-framework? If I can't, how I can build a web API using Django JsonResponse? -
Django 'str' object is not callable and subuser register
Im try different method for user register. I want to enroll a company staff user: I want to register method "companyname.staffusername" but I cant do register. How can I do it? Im try different way but I have error. I seen this error: "'str' object is not callable" Forms: from django import forms from django.db.models import fields from .models import SubUser class SubUserForm(forms.ModelForm): class Meta: model = SubUser fields = ["Subusername","Subpassword","active","staff","Company"] Views: from article.views import index from user.views import loginUser from django.contrib import messages from django.contrib.auth import authenticate from django.shortcuts import redirect, render from . import forms from .models import SubUser # Create your views here. def RegisterSubUser(request): if request.method=="POST": form = forms.SubUserForm(request.POST) if form.is_valid(): username = form.cleaned_data.get("Subusername") password = form.cleaned_data.get("Subpassword") newUser = SubUser(Subusername = username) newUser.Subpassword(password) newUser.save() loginUser(request,newUser) messages.success(request,"Kayıt Başarılı") messages.warning(request,"DANGER") return render(request,"index.html") context ={ "form":form } return render(request,"register.html",context) else: form = forms.SubUserForm() context ={ "form":form } return render(request,"register.html",context) Models: from django.db import models # Create your models here. class SubUser(models.Model): Subusername = models.CharField(max_length=15,verbose_name="kullanıcı adı") Subpassword = models.CharField(max_length=15,verbose_name="Parola") active = models.BooleanField(default=True) staff = models.BooleanField(default=True) Company = models.ForeignKey("auth.User", on_delete= models.CASCADE,verbose_name="Çalıştığı Firma") def __str__(self): return self.Subusername -
Best method to store alt tags in Django
I am currently building a blog with Django and I would like to add a alt tag to my images for improving my SEO. My model is like this at the moment. My images are inside the Post class in models.py: class Post(models.Model): title = models.CharField(max_length=60) description = models.CharField(max_length=160) thumbnail = models.ImageField() My first thought is to define a separate Image class with the tag as one of its properties: class Image(models.Model): thumbnail = models.ImageField() alt_tag = models.Charfield() class Post(models.Model): title = models.CharField(max_length=60) description = models.CharField(max_length=160) image = models.ForeignKey(Image) So is this a correct or the prefered way of handling alt tags? I am using Amazon S3 to store these images, so maybe I could store alt tag as metadata. Or use a third party package like django-alttext? -
Statics not working with any of my projects after attempting to deploy
I was following for this deployment and at the last step my html will pull up but not any of my CSS styling. The weird part of all this is now none of the projects on my desktop will show their CSS either. So it did not only effect my portfolio but seems "my computer". any ideas? this is the error I get when I inspect it Refused to apply style from 'http://127.0.0.1:5502/projects/templates/%7B%%20static%20'css/styles.css'%20%%7D' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled. Set Up Server You can use something like Linode or Digital Ocean to follow these instruction. Step 1: Create a linode Step 2: Use terminal or any ssh client to login with root and run: ssh root@IP apt update && apt upgrade -y Step 3: Set hostname for server. I used test-server. You can use whatever you want. hostnamectl set-hostname test-server Step 4: Connect host ip and hostname run nano /etc/hosts and add your server ip, click tab and then your hostname (from step 3) Step 5: Install some dependencies run sudo apt install python-pip virtualenv ufw Step 6: Create a limited user and give sudo privlidges run adduser … -
Best way to run django on subdomain and react on main domain
Whenever a user goes to the (main domain), they should be able to navigate to the subdomain.(main domain) which is running the Django app. The main domain will be running the React app. My question is: Should Django and React be running on the same server but on different port numbers? or Should Django and React be running on different servers mapped by A-records? Assuming both approaches work, which would provide the best performance? -
Calling Django custom management command using Celery and Redis outputs "Unknown command" error
I am trying to call a function asynchronously in Django using Celery and Redis as a message broker. I am calling a function that calls call_command() to execute a custom management command I made. @app.task def processVideo(url): management.call_command('analyzevideos', url) However, calling processVideo.delay(url) produces the following error: django.core.management.base.CommandError: Unknown command: 'analyzevideos' I'm not sure why this error is occurring since calling management.call_command('analyzevideos', url) in the Python shell works perfectly fine. This question is similar to this one that has no answers. -
filter select field in django using ajax
I have a form with two fields related to each other and I want the rooms filtered based on the class in the front form this is my code models.py class Class(models.Model): class_name = models.CharField(max_length=100) def __str__(self): return self.class_name class Room(models.Model): room_name = models.CharField(max_length=100) class = models.ForeignKey(Class,related_name='class',on_delete=models.SET_NULL, null=True) def __str__(self): return self.room_name views.py class CustomFormView(LoginMixin, TemplateView): template_name = 'form.html' def get(self, request, *args, **kwargs): context = self.get_context_data(**kwargs) context['class'] = Class.objects.values('pk','class_name') context['rooms'] = Room.objects.all() return self.render_to_response(context) def get_related_rooms(request): class_id = request.GET.get('class_id') rooms = Room.objects.filter(class_id=class_id) return render(request, 'form.html', {'rooms': rooms}) form.html <form id="custom_form" data-rooms-url="{% url 'app:get_related_rooms' %}"> Class Name: <select type="text" class="form-control"id="class_name" onchange="test()" name="class_name"> {% for c in class %} <option value="{{ c.pk }}">{{ c.class_name }}</option> {% endfor %} </select> Room Name: </label> <select type="text" class="form-control" id="room_name" name="room_name"> </select> </form> //here is the ajax call to get the rooms <script> function test() { var classId = document.getElementById("class_name").value; $.ajax({ url: "{% url 'calculator:get_related_rooms' %}" , method: 'GET', data: { 'class_id': classId }, success: function (result) { // console.log(result) $("#room_name").append($('<option></option>').attr("value", 'pk').text('room_name')); } }) }; </script> the option .text('room_name')); is inserted when I select from class drop down , but I want it to come from database -
DURING installation of Django i got problem
The term 'django-admin' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. -
Django get_queryset method executed before dispatch
I have a heir of generic DetailView where I override get_queryset method, say: def get_queryset(self): return User.objects.filter(role=UserRoles.employee, team_leader=self.request.user) and in the same time, I want view to be accessible only to specific users, for example entitled as a leader. So I override a dispatch method: def dispatch(self, request, *args, **kwargs): dispatch = super().dispatch(request, *args, **kwargs) if not request.user.role == UserRoles.leader: raise PermissionDenied return dispatch My problem is that get_queryset method is executed before dispatch. Thus instead of getting 403, users who don't have leader title and thus no employees will receive 404. How to overcome it? -
Django for loop in views.py only gets the last occurence
I am trying to display a different price for each item in a list, based on the logged-in user information. However, my current code seems to overwrite the "price" key with the last occurrence "custom_price" each time... I cannot seem to find a solution. class MenuListView(ListView): model = Menu template_name = 'home.html' def get_context_data(self, **kwargs): if self.request.user.is_authenticated: context = super(MenuListView, self).get_context_data(**kwargs) user=get_object_or_404(Profile, user = self.request.user) coef = user.bmr menus = Menu.objects.all() price = [] for menu in menus: menu_price = menu.price menu_kcal = menu.kcal custom_price = (menu_price/menu_kcal) * (coef*(35/100)) price.append(custom_price) context['menus'] = menus context['price'] = price return context Template: {% for item in menus %} <div class="col-sm-6 col-md-6 col-lg-6"> <div class="food-card food-card--vertical"> <div class="food-card_img"> {% for img in item.photo_set.all %} <img src="{{ img.image.url }}" alt=""> {% endfor %} </div> <div class="food-card_content"> <div class="food-card_title-section"> <span class="food-card_title">{{ item.title }}</span> <span class="food-card_author">{{ item.category }} - {{ item.focus }}</span> </div> <div class="food-card_bottom-section"> <div class="space-between"> <div> <span class="fa fa-fire"></span> {{ item.kcal }} Kcal </div> </div> <hr> <div class="space-between"> <div class="food-card_price"> <span>{{ price }} €</span> </div> </div> </div> </div> </div> </div> {% endfor %} Could someone help ? Many thanks in advance ! -
Django evaluate python code accessing django model instance attributes in model method
I am using Django 3.1 and I want to create a model that allows an admin user to specify custom logic (Python code) as a field on the model. /path/to/app/models.py class FooModel(SomeBaseModel): slug = models.SlugField(max_length=64, blank=False, null=False, db_index=True, unique=True) code = models.TextField(null=False,blank=False) # ... def checkitout(self, **state): user = state["user"] execute_code(user) Example code to be run # django aware code # For each known category for category in Category.objects.all(): value = user.get_profile(category).amount if value > 1: doSomething() else doSomethingElse() Pseudocode for implementation of method def execute_code(self, user): code_to_execute=self.code # how to execute the code and pass user object to it? My question is, how to implement the model method execute_code() which will allow custom django code to be executed by the model? -
CairoSVG - import error happening only on production server
Python version: 3.6 Using Pipenv/Pipfile/Pipfile.lock to manage venvs/dependencies Development environment: Windows Subsystem for Linux (Ubuntu 18.04) Production environment: Ubuntu 18.04 Also using Django: 3.1.4 This project had been working fine on both dev and prod, however, after adding CairoSVG to the venv, I'm now getting an import error only on prod. I've used Pipenv/Pipfile/Pipfile.lock to create the venv on both machines and have verified that both environments are exactly the same. Everything works fine in development after I activate the venv, including this Django-related command: python3 manage.py shell. However, when I activate the venv on production and run python3 manage.py shell, I get the following import error related to the newest dependency, CairoSVG (see the reference to line 6 of models.py below - this is the only cairosvg-related import): Traceback (most recent call last): File "manage.py", line 10, in <module> execute_from_command_line(sys.argv) File "/opt/virtualenvs/project_name-g-miTQT4/lib/python3.6/site-packages/django/core/management/__init__.py", line 401, in execute_from_command_line utility.execute() File "/opt/virtualenvs/project_name-g-miTQT4/lib/python3.6/site-packages/django/core/management/__init__.py", line 377, in execute django.setup() File "/opt/virtualenvs/project_name-g-miTQT4/lib/python3.6/site-packages/django/__init__.py", line 24, in setup apps.populate(settings.INSTALLED_APPS) File "/opt/virtualenvs/project_name-g-miTQT4/lib/python3.6/site-packages/django/apps/registry.py", line 114, in populate app_config.import_models() File "/opt/virtualenvs/project_name-g-miTQT4/lib/python3.6/site-packages/django/apps/config.py", line 211, in import_models self.models_module = import_module(models_module_name) File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 994, in _gcd_import File "<frozen importlib._bootstrap>", line 971, … -
Django - how to retain add order when querying m2m field?
I have a CustomUser model, and a models which refer to it through a m2m relationship: class CustomUser(AbstractUser): ... class Game(models.Model): players = models.ManyToManyField( CustomUser, related_name='games',) When I am getting the list of players, I was expecting to receive the list of players by "adding" order, however, the players always show-up ordered by 'id' of the CustomUser table ...even if CustomUser has no ordering at the model level and I didn't saw anywhere in the Django code that there was any kind of ordering in AbstractUser user1=CustomUser.objects.get(id=1) user2=CustomUser.objects.get(id=2) user3=CustomUser.objects.get(id=3) game=Game.objects.create() game.players.add(user3) game.players.add(user1) game.players.add(user2) game.players.all() gives always user1, user2, user3 How do I do to obtain the list of m2m records in the "adding" order(user3, user1,user2) ? I was thinking to ask to order the queryset by 'id' in the through table, but I wasn't able to figure out how to do that. Can somebody show me how I could do that ? ... or propose me a working solution ? Thanks in advance -
update_or_create in my django rest framework api work wrong
My problem in GIF Instead of updating the user's rating DRF creating new. Maybe i made a mistake in serializer? I wrote documentation but i dont kwon where i wrong. My code: views.py: class CreateReviewView(APIView): def post(self, request): review = CreateReviewSerializer(data= request.data) if review.is_valid(): review.save() return Response(status=201) class CreateRatingView(APIView): def get_user(self, request): user= request.user if user =="AnonymousUser": return "noname in CreateRaringView" return user def post(self, request): serializer = CreateRatingSerializer(data=request.data) if serializer.is_valid(raise_exception=True): serializer.save(user=self.get_user(request)) return Response(status=201) else: return Response(status=400) serializers.py: class Meta: model = Rating fields = ('star','movie') def new(self,validated_data): rating = Rating.objects.update_or_create( user= validated_data.get('user',None), movie= validated_data.get('movie',None), defaults={'start': validated_data.get("star")} ) return rating models.py: class Rating(models.Model): """Рейтинг""" user = models.ForeignKey(User,on_delete=models.CASCADE,verbose_name="Пользователь",related_name='user') star = models.ForeignKey(RatingStar, on_delete=models.CASCADE, verbose_name="Звезда",related_name="star") movie = models.ForeignKey(Movie, on_delete=models.CASCADE, verbose_name="Фильм",related_name="movie") def __str__(self): return f"{self.star} - {self.movie}" class Meta: #unique_together = ['user','movie','star'] verbose_name = "Рейтинг" verbose_name_plural = "Рейтинги" -
How do I Retrieve an Object Instance with Django RetrieveModelMixin
I would like to retrieve and objects instance with this call: http://localhost:8000/api/get-factor/?code=ABC I have the following: models.py from django.db import models class Factor(models.Model): code = models.CharField(max_length=50, unique=True) value = models.DecimalField(max_digits=10, decimal_places=2) def __str__(self): return self.code serializers.py from rest_framework import serializers from .models import Factor class GetFactorSerializer(serializers.ModelSerializer): class Meta: model = Factor fields = ('value',) lookup_field = 'code' urls.py in factors app from django.urls import path, include from factors import views from rest_framework.routers import DefaultRouter router = DefaultRouter() router.register('get-factor', views.RetrieveFactor) urlpatterns = [ path('', include(router.urls)), ] urls.py in project from django.contrib import admin from django.urls import path, include urlpatterns = [ path('admin/', admin.site.urls), path('api/', include('factors.urls')), ] views.py from .models import Factor #api from .serializers import GetFactorSerializer from rest_framework import mixins from rest_framework import generics from rest_framework.viewsets import GenericViewSet class RetrieveFactor(mixins.RetrieveModelMixin, GenericViewSet): queryset = Factor.objects.all() serializer_class = GetFactorSerializer lookup_field = 'code' using postman with this call: http://localhost:8000/api/get-factor/?code=ABC results in a Page not found (404) the routes it shows are: api/ ^get-factor/(?P<code>[^/.]+)/$ [name='factor-detail'] api/ ^get-factor/(?P<code>[^/.]+)\.(?P<format>[a-z0-9]+)/?$ [name='factor-detail'] Any suggestions would be appreciated. -
How do I keep track of the two users who will use the website?
I’m storing user profiles in the db which are linked to the individual liked songs of the user. So when a user logs in, the user’s data is stored in the DB. Then I can log the user out with the signoutroute, then another user can log in, then their data is also stored in the dB. Then can use a different route to perform the comparison and give a response. But the problem occurs when another user also uses the app, and another user also does. Let's we have 4 user profiles existing in the db now, how do I make sure I’m getting the last two users to perform the comparison. Example code below works with two profiles i have stored so I know their individual id views.py def liked(request): try: sp = Spotify(auth_manager=oauth) liked = sp.current_user_saved_tracks(limit=30)['items'] spotify_user = sp.current_user() user__ , created = User.objects.get_or_create(username=spotify_user['uri'], first_name=spotify_user["display_name"]) userprofile = UserProfile.objects.get_or_create(user=user__)[0] a = [] for idx, item in enumerate(liked): track = item['track']["name"] artist= item["track"]["artists"][0]["name"] album_ = item["track"]["album"]["name"] tracks = item['track'] val = tracks['name'] + " - " + tracks['artists'][0]['name'] a.append(val) album = Album.objects.get_or_create( Album_name= album_ )[0].save() song, created = Song.objects.get_or_create(track_name = track, artiste_name = artist, album = album) songs_available = … -
Abstract User and Basic Auth with Django Rest Framework (DRF)
I'm currently experiencing some trouble concerning Basic Auth in the DRF. I am testing this with postman using my credentials. These requests are sent to the development server and the request.META["HTTP_AUTHORIZATION"] contains the correct credentials. However, request.user and request.auth are both set to None, which bothers me since it should have at least the User with those credentials (right?). I fear that it has something to do with my custom User model. I've created a new User class which uses the AbstractUser from Django (according to this). Relevant code: class StatusView(APIView): # authentication_classes = [BasicAuthentication] authentication_classes = [] # permission_classes = [IsAuthenticated] permission_classes = [] def get(self, request, uuid, format=None): auth_header = request.META.get('HTTP_AUTHORIZATION', '') auth_type, credentials = auth_header.split(' ') decoded_creds = base64.b64decode(credentials) print(decoded_creds) # <-- this line spits out the credentials that I sent return HttpReponse("") Am I missing something with DRF? It does work with custom user models right? -
Django query ForeignKey object
Can somebody help me to get the ticket object at my queryset shown below?: replies = sorted( chain( SupportTicketReplies.objects.filter(author=request.user, ticket=?!?!) ), key=attrgetter('creation_date'), reverse=True ) Currently I have no idea how to filter out replies that have been attached to a ticket by a ForeignKey. my models.py class SupportTickets(models.Model): id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False, unique=True) ticket_id = models.IntegerField(default=ticket_id_generator, unique=True, blank=False, null=False, editable=False) requester = models.ForeignKey(User, on_delete=models.CASCADE, null=False, blank=False) category = models.IntegerField(choices=TICKET_CATEGORY, verbose_name='Ticket Category') subject = models.CharField(max_length=35) problem_description = models.TextField(max_length=2000, blank=False) status = models.IntegerField(choices=STATUS_OF_TICKET, verbose_name='Ticket Status', default=2) creation_date = models.DateTimeField(auto_now_add=True, blank=False) class SupportTicketReplies(models.Model): id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) ticket = ForeignKey(SupportTickets, on_delete=models.CASCADE) author = models.ForeignKey(User, on_delete=models.CASCADE, verbose_name='Author', blank=True) content = models.TextField(verbose_name="Content", max_length=2000) creation_date = models.DateTimeField(auto_now_add=True, blank=False) Thanks in advance -
CreateView display multiple form errors?
I am working with a CBV that uses 2 ModelForm instances. I would like to display the individual form errors. It seems like this is a little challenging when using multiple forms in a class based view. Heres a smaller snippet to show what I am working with... class EmployeeCreate(CreateView): form_class = EmployeeCreateForm form_class_2 = AddressCreateForm def post(self, request, *args, **kwargs): employee_form = self.form_class(request.POST) address_form = self.form_class_2(request.POST) # Make sure both forms are validated if employee_form.is_valid() and address_form.is_valid(): employee = employee_form.save(commit=False) address = address_form.save(commit=False) employee.parent = self.request.user employee.save() address.user = employee address.save() return JsonResponse({'message': 'Employee created successfully.'}, status=200) else: return self.form_invalid(**kwargs) def get_context_data(self, **kwargs): # render both forms to create an Account, and Address context = super(EmployeeCreateView, self).get_context_data() context['employee_form'] = self.form_class context['address_form'] = self.form_class_2 return context def form_invalid(self, **kwargs): return JsonResponse({'success': False}) Now when the form is invalid, the form_invalid method is getting called and returning the JsonResponse message, but I would much rather return the specific form error. I am trying to find a way to display each individual form error for the employee_form and the address_form. Is there a possible way to do this override in the form_invalid method? Thank you in advance! -
Django| generate random url based on URl or PATH from urlconfig
I have a question regarding generating example urls according the Django url and path. For example if I have 2 urls like: path('example/<int:example_id>/', views.some_view, name='example') url(r'^example/(?P<example_id>[0-9]+)/$', views.some_view, name='example') Is it possible to generate somehow by Django built-in means example full-urls for tests like: example/234/ example/93/ example/228/ etc… randomly. For different urls based on concrete name + regex or converter parameters? In other words where in source code Django understands that <int:example_id> is an integer and so on. If I have something like : 1) I expect example/ 2) I expect int - I would be able to use it to generate random example url. Hopefully this is clear... These urls are just an example. Real urls will differ. Thank you. -
Could not load auth.Permission(pk=1): Error to DUMP / LOADDATA Django
Well i tried to dumpdata / loaddata from my site but i keeping get this error bellow. I already look out for some couple solutions, but i keeping get the same error at the end of the day python manage.py dumpdata > dbv5.json or python manage.py dumpdata --exclude=contenttypes --exclude=auth.Permission > dbv5.json then i get the same error: (venv) felipecid@vmgcp2:~/projectBlog$ python manage.py loaddata dbv5.json Traceback (most recent call last): File "/home/felipecid/projectBlog/venv/lib/python3.7/site-packages/MySQLdb/connections.py", line 259, in query _mysql.connection.query(self, query) MySQLdb._exceptions.ProgrammingError: (1146, "Table 'blog_django.auth_user' doesn't exist") The above exception was the direct cause of the following exception: Traceback (most recent call last): File "manage.py", line 22, in <module> main() File "manage.py", line 18, in main execute_from_command_line(sys.argv) django.db.utils.ProgrammingError: Problem installing fixture '/home/felipecid/projectBlog/initial_data.json': Could not load auth.User(pk=1): (1146, "Table 'blog_django.auth_user' doesn't exist") -
View did not return a HttpResponse object
def login_view(request): if request.method=='POST': user_name=request.POST['username'] _password=request.POST['password'] user=authenticate(request,username=user_name,password=_password) if user is not None: login(request,user) return HttpResponseRedirect(reverse('index')) else: return render(request,'users/login.html',{'message':'Invalid Credentials'}) I am getting the following error message when i go to users/ url The view users.views.login_view didn't return an HttpResponse object. It returned None instead. -
How to solve NoReverseMatch, no arguments not found? (Django)
I am new to Django. I get the following Error: NoReverseMatch: Reverse for 'edit' with no arguments not found. 1 pattern(s) tried: ['edit/(?P<page>[^/]+)$'] To specify: I am building a wikipedia-like website and now want to allow the feature of editing. Therefore I included path("edit/<str:page>", views.edit, name="edit"), into my urlpatterns at urls.py in my encyclopedia app. For edit, views.py looks like this: def edit(request, page): return render(request, "encyclopedia/edit.html", { "form_newpage": NewPageForm(initial={'content': util.get_entry(page), 'title': page}), "form_searchwiki": SearchWikiForm() }) When I now try to access http://127.0.0.1:8000/edit/CSS - CSS being a valid entry of that encyclopedia - I get the NoReverseMatch Error. In the Traceback the local variable for page is CSS, so I do not understand, why Django does not get CSS as an argument. Traceback get_entry function: def get_entry(title): """ Retrieves an encyclopedia entry by its title. If no such entry exists, the function returns None. """ try: f = default_storage.open(f"entries/{title}.md") return f.read().decode("utf-8") except FileNotFoundError: return None -
How to escape a line from within for loop in django template
I have a for loop in django template where I display items from 3 section by using 'if condition' to filter the 3 sections seperately in the loop. But I want to give a heading to each section but if I add a heading also in the 'if condition' it will be repeated with each item being iterated. Is there any way to escape the for loop for a single line within the forloop in django template so that the title for each section won't keep repeating. My django template code: {% for order in orders_today %} {% if order.pickup_time == 'Now' %} <tr> <td colspan="5" align="center"> Orders now </td> </tr> {% endif %} {% if order.pickup_time == 'Now' %} <tr> <td align="center"> {{order.item}} </td> <td align="center"> {{order.quantity}} </td> <td align="center"> {{order.pickup_time}} </td> <td align="center"> </td> </tr> </tbody> {% if order.pickup_time == 'Lunch Break' %} <tr> <td colspan="5" align="center"> Orders at lunch break </td> </tr> {% endif %} {% if order.pickup_time == 'Lunch Break' %} <tr > <td > {{order.item}} </td> <td > {{order.quantity}} </td> <td > {{order.pickup_time}} </td> <td > <button class="btn btn-danger" >Cancel</button> </td> </tr> </tbody> {% endfor %} thanks in advance to the good soul who's gonna … -
Django CMS + Online Shop & Membership [closed]
I have Wordpress with a WooCommerce shop, that sells online memberships. I would like to change the system to Django. I know there are ready-made projects for all parts of the system (CMS, Store, Memberships, .. ), I'm deciding right now if it will be easier to connect and customize these solutions or to start from the ground up. Basically, i need a very simple CMS with a Drag&Drop Editor (i would like to use https://grapesjs.com), Pages that can be locked behind a membership, that is sold in the store. From the store, i actually need only the checkout & payment part, the product catalog is not needed. For a completely custom solution, I'm not sure only about how to receive payments (PayPal, Stripe), but I'm sure i could figure this out. Would you recommend to customize and connect ready-made Django packages (which ones?) or start from scratch?