Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Django digital ocean droplet isn't showing the website when connected with a namecheap domain
So I'm using a Django Digital Ocean droplet to run a website. I recently tried connecting the IP address of the droplet to a namecheap domain name, but when I connected them it only showed this on the domain: Welcome to nginx! If you see this page, the nginx web server is successfully installed and working. Further configuration is required. For online documentation and support please refer to nginx.org. Commercial support is available at nginx.com. Thank you for using nginx. However, the website was working as intended on the IP address, can anyone tell me how to fix this? my abbreviated /etc/nginx/sites-available/defaultfile server { listen 80 default_server; listen [::]:80 default_server; root /var/www/html; # Add index.php to the list if you are using PHP index index.html index.htm index.nginx-debian.html; server_name sanskarhandicrafts.com; location / { try_files $uri $uri/ =404; } } I'm happy to provide more details -
User Data Posted to Django User Model API Fails Authentication
I have two deployed Django projects: A and B and both have User models for user authentication. But I want users of Project B who sign up to have accounts on Project A as well. So I created an API using DRF for the user model in Project A and I was able to post user data (username and password) from Project B to the API. But when I tried to login to Project A using the newly posted user data, it failed authentication, despite the data now bring present in Project A's API. Please could anyone help me identify what's wrong? I'd love to post code snippets but, cuz of the data, can't really do that, but based on the principle, what do you guys think the problem might be? -
ModuleNotFoundError: No module named 'django-angular'
I have already installed pip3 install django-angular Requirement already satisfied: django-angular in /usr/local/lib/python3.9/site-packages (2.3) Requirement already satisfied: django>=2.1 in /usr/local/lib/python3.9/site-packages (from django-angular) (3.2.12) Requirement already satisfied: asgiref<4,>=3.3.2 in /usr/local/lib/python3.9/site-packages (from django>=2.1->django-angular) (3.4.1) Requirement already satisfied: sqlparse>=0.2.2 in /usr/local/lib/python3.9/site-packages (from django>=2.1->django-angular) (0.4.2) Requirement already satisfied: pytz in /usr/local/lib/python3.9/site-packages (from django>=2.1->django-angular) (2021.3) but on running server it says File "/usr/local/Cellar/python@3.9/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1030, in _gcd_import File "<frozen importlib._bootstrap>", line 1007, in _find_and_load File "<frozen importlib._bootstrap>", line 984, in _find_and_load_unlocked ModuleNotFoundError: No module named 'django-angular' I have already uninstalled & reinstalled it several times but no luck -
Subclassed form doesn't render customized input field in Django
I have a subclassed form which I want to render a custom max attribute on the input field. However, it doesn't return any form instance in the view and thus doesn't render any input field either: # views.py .. custom_max_attribute = qs_aggregates['total_equity'] print(custom_max_attribute) # prints 4000 withdraw_form = WithdrawForm(custom_max_attribute) print(withdraw_form) # prints nothing .. # template .. <div class="field-wrapper"> <div class="field-title">Set your Amount</div> <div class="withdraw-input-field">{{ withdraw_form.withdraw_amount }}</div> <!-- isnt rendered --> </div> .. # forms.py class WithdrawForm(forms.Form): """ A form to withdraw available funds from Farena to the users bank account """ def __init__(self, custom_max_attribute, *args, **kwargs): super().__init__(self, custom_max_attribute, *args, **kwargs) withdraw_amount = forms.FloatField(widget=forms.NumberInput(attrs={'min': 1, 'max': custom_max_attribute, 'step': 0.01})) -
async messages in admin
I created a task in the admin that is costly and should be carried out asynchronously. I would do something like def costly_task(**kwargs): def do_task(id): ## do stuff, you know, that is costly task = ThreadTask.objects.get(pk = id) task.is_done = True task.save() task = ThreadTask() task.save() t = threading.Thread(target = do_task, args = [task.id]) t.setDaemon(True) t.start() return {"id": task.id} With a models.py table: class ThreadTask(models.Model): task = models.CharField(max_length = 30, blank = True, null = True) is_done = models.BooleanField(blank = False, default = False) This works well, but I want to inform the admin of the runnig task, and also when it is finished. There is a very old (django 4.0 incompatible) package called django-async-messages which leverages the normal django-messages package to be used asynchronously. I googled but did not find anything of newer age ... any ideas on how to do this? Can I use djangos async processes to send out two messages: when task started (that one is easy) when task finished Django async send notifications -
I am getting soo many errors on my project please help me
This is my code: def Create_Database_Railway(): import mysql.connector mycon=mysql.connector.connect(host='localhost',user='admin',passwd='12345',port=3307) cursor=mycon.cursor() mycon.autocommit=True s1="create database railway" cursor.execute(s1) Create_Database_Railway() These are error: Create_Database_Railway() File "c:\Users\Admin\OneDrive\Desktop\New Proj\6475-DATABASE CREATION.py", line 3, in Create_Database_Railway mycon=mysql.connector.connect(host='localhost',user='admin',passwd='12345',port=3307) File "C:\Users\Admin\AppData\Local\Programs\Python\Python37-32\lib\site-packages\mysql\connector_init_.py", line 273, in connect return MySQLConnection(*args, **kwargs) File "C:\Users\Admin\AppData\Local\Programs\Python\Python37-32\lib\site-packages\mysql\connector\connection.py", line 114, in init self.connect(**kwargs) File "C:\Users\Admin\AppData\Local\Programs\Python\Python37-32\lib\site-packages\mysql\connector\abstracts.py", line 1009, in connect self._open_connection() File "C:\Users\Admin\AppData\Local\Programs\Python\Python37-32\lib\site-packages\mysql\connector\connection.py", line 422, in _open_connection self._ssl, self._conn_attrs) File "C:\Users\Admin\AppData\Local\Programs\Python\Python37-32\lib\site-packages\mysql\connector\connection.py", line 230, in _do_auth self._auth_switch_request(username, password) File "C:\Users\Admin\AppData\Local\Programs\Python\Python37-32\lib\site-packages\mysql\connector\connection.py", line 377, in _auth_switch_request raise errors.get_exception(packet) mysql.connector.errors.ProgrammingError: 1045 (28000): Access denied for user 'admin'@'localhost' (using password: YES) -
Django LookupError: No installed app with label 'app_name' when running tests
I am trying to set up a test database in a Django project that's a couple of years old. I'm using Postgres and the default database (non-test) works fine. I run it against a database instance in a Docker container. When try I run my tests, however, this is what happens: Got an error creating the test database: database "mytestdatabase" already exists Type 'yes' if you would like to try deleting the test database 'mytestdatabase', or 'no' to cancel: I type yes. I then get a traceback and at the bottom it says LookupError: No installed app with label 'providers'. These are my database settings: DATABASES = { 'default': { 'NAME': os.getenv('POSTGRES_NAME'), 'USER': os.getenv('POSTGRES_USER'), 'PASSWORD': os.getenv('POSTGRES_PASSWORD'), 'HOST': 'db', 'PORT': 5432, 'CONN_MAX_AGE': 0, 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'TEST': { 'NAME': 'mytestdatabase', }, } } These are my installed apps: INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'providers.apps.ProvidersConfig', 'storages', 'accounts', 'sso', 'rest_framework', 'widget_tweaks', 'anymail', 'mailchimp_marketing', 'mailchimp_marketing.api_client', 'analytics', ] This is the entire traceback: Creating test database for alias 'default'... Got an error creating the test database: database "mytestdatabase" already exists Type 'yes' if you would like to try deleting the test database 'mytestdatabase', or 'no' to cancel: yes Destroying old test database … -
Store list variable with Avg function in a Django aggregate
How to store and pass multiple Avg function in an aggregate the code below gives error of type views.py riasec_avg =[Avg('realistic'),Avg('investigative'),Avg('artistic'),Avg('social'),Avg('enterprising'),Avg('conventional')] context['riasec_male'] = Riasec_result.objects.filter(user__profile__gender='M').aggregate(riasec_avg) context['riasec_female'] = Riasec_result.objects.filter(user__profile__gender='F').aggregate(riasec_avg) -
Django self join with ForeignKey (ORM)
I have an Event Model: class Event(models.Model): message = models.CharField(max_length=128) timestamp = models.DateTimeField() cancels_event = models.ForeignKey('self', on_delete=models.CASCADE) I'm analysing lots of event messages, but firstly I need to check if the event has been canceled. Let's say I receive an Event_1, then I receive an Event_2 with Event_2.cancels_event=Event_1, so Event_2 cancels Event_1. I want to find out, given a subset of Events, which Events from this subset have been canceled. In SQL I'd use a join with self: SELECT * FROM Event e1 JOIN Event e2 ON e1.id = e2.cancels_event But I don't know how to do it within Django ORM. -
django 3.2 how to save multiple related model in a single model like inlineformset_factory using django-rest-framework?
I would like to store multiple checklist that belongs to a single declaration using django rest framework but i dunno how to implement it thanks for the help. Here are my models. class Question(models.Model): id = models.BigAutoField(primary_key=True) question = models.CharField(max_length=50) class Declaration(models.Model): id = models.BigAutoField(primary_key=True) user = models.ForeignKey(User, related_name='declarations', on_delete=models.CASCADE) class Checklist(models.Model): id = models.BigAutoField(primary_key=True) declaration = models.ForeignKey(Declaration, related_name='checklist_declarations', on_delete=models.CASCADE) question = models.ForeignKey(Question, related_name='checklist_questions', on_delete='models.CASCADE) is_yes = models.BooleanField() -
Sending image from front end(JavaScript) to backend(Django)
I have a image at the front end and I want to send it to the backend. I have simple JavaScript at the front end and Django-python at the backend. I have tried dozens of different methods and spent weeks but I am not able to figure this out. Can you guys suggest how can I achieve this on front end(sending part) and backend(receiving part). A piece of code with an advice would be really appreciated. I am using function based views on the backend. Can someone help me out with the backend code (if the front end code is right) to handle incoming from the front end. Because I have first converted the image file to base 64 stream in order to send it to the backend through fetch api. Front end code: const { snippet, transform } = anno.getImageSnippetById(annotation.id) //this function returns a DOM canvas element in snippet variable const base64Canvas = snippet.toDataURL("image/jpeg").split(';base64,')[1]; //converting into a base64 stream fetch(url1,{ method:'POST', headers:{ 'Content-type':'application/json', 'X-CSRFToken':csrftoken, }, body: {'snippet':base64Canvas} }) Backend code: def snippetCreate(request): serializer = Annotated_SnippetsSerializer(data=request['snippet']) image = base64_to_image(base64_string=serializer.data) img = Annotated_Snippets(asnippet=image) img.save() return Response({'success':'success'}) ``` base64_to_image: ```def base64_to_image(base64_string): format, imgstr = base64_string.split(';base64,') ext = format.split('/')[-1] return ContentFile(base64.b64decode(imgstr), name=uuid.uuid4().hex + … -
How can I set the `max` attribute of a number inout form widget within the view in Django?
so I have a form that allows the user to input a withdraw amount. I want the form to be rendered with the max attribute according to an aggregated value within a queryset in my view. But how can I actually update the form's attribute in the view before returning it to the client? # views.py def render_dashboard_overview(request): # Get the withdrawal form withdraw_form = WithdrawForm() # How to now set the `max` attr. of the number input to 500 for example? ... # forms.py class WithdrawForm(forms.Form): """ A form to withdraw available funds from Farena to the users bank account """ withdraw_amount = forms.FloatField(required=True, widget=forms.TextInput(attrs={ 'step': 0.01, 'min': 0 })) -
How convert PDF file of CSV file using python web development project
I used may ways in my knowledge to do I know to convert a pdf file to csv but I wanted to know how to do it in a website project i.e by using django framework how we can do it ... -
How to have multiple return statement in python django?
In my Views.py, I try to download the csv file first to client side then only wish to redirect to another page. Below was my code def main(request): ... ... url = '//file1.km.in.com/sd/recipe/' +"/"+ model + "_" + code + ".csv" filename=model + "_" + code + ".csv" download_csv(url,filename) data = {"TableForm": TableForm, "devicelist": devicelist_1} time.sleep(10) return redirect('/ProductList/BetaTest', data) def download_csv(url,filename): csv = process_file(url) response = HttpResponse(csv, content_type='text/csv') response['Content-Disposition'] = 'attachment; filename='+filename return response def process_file(file_handle): df = pd.read_csv(file_handle, index_col=False) return df.to_csv(index=False) However, download function didn't work but it directly redirect to BetaTest page. I try to edit to below code, and now the download function is work but it cannot redirect to another page: def main(request): ... ... data = {"TableForm": TableForm, "devicelist": devicelist_1} csv = process_file(url) response = HttpResponse(csv, content_type='text/csv') response['Content-Disposition'] = 'attachment; filename='+filename return response time.sleep(10) return redirect('/ProductList/BetaTest', data) Is there any ideas to overcome this issue? -
object carousel in django
{% for object in obj %} {{ object.title }} {{ object.sub_title }} Previous Next {% endfor %} -
Django Matching query don't exist in AddProduct.objects.get(Name=productname[i])
I have a model AddProduct and StockIn. When a new stock are purchased from dealer than all purchased product are get added in StockIn model. And Existing products are updated in AddProduct model. My AddProduct models are as follows class AddProduct(models.Model): Name = models.CharField(max_length=120,verbose_name="name") Description = models.CharField(max_length=120, verbose_name="description") Unit = models.ForeignKey(Unit,on_delete=models.CASCADE,max_length=150,verbose_name='unit') purchaseRate = models.DecimalField(max_digits=10, decimal_places=3,verbose_name="purchase rate") AvgRate = models.DecimalField(max_digits=10, decimal_places=3,verbose_name="avg rate") OpnStock = models.DecimalField(max_digits=10, decimal_places=3,verbose_name="Opening stock") ClosingStock = models.DecimalField(max_digits=10, decimal_places=3,verbose_name="closing stock") StoreLocation = models.CharField(max_length=120,verbose_name="store location") MinStock = models.DecimalField(max_digits=10, decimal_places=3,verbose_name="minimum stock") ReOrder = models.DecimalField(max_digits=10, decimal_places=3,verbose_name="reorder") MaxStock = models.DecimalField(max_digits=10, decimal_places=3,verbose_name="maxstock") Group = models.ForeignKey(ProductGroup,on_delete=models.CASCADE,max_length=150,verbose_name='productgroup') CGST = models.DecimalField(max_digits=10, decimal_places=3,verbose_name="CGST") SGST = models.DecimalField(max_digits=10, decimal_places=3,verbose_name="SGST") IGST = models.DecimalField(max_digits=10, decimal_places=3,verbose_name="IGST") Validity = models.IntegerField(verbose_name="validity") Updated = models.DateTimeField(auto_now=True) while my StockIn model are as follows class StockIN(models.Model): GrnNo = models.IntegerField(verbose_name="GrnNo") Date = models.DateTimeField(default=timezone.now) Supplier = models.ForeignKey(AddSupplier,on_delete=models.CASCADE,max_length=150,verbose_name='supplier') InvoiceNo = models.IntegerField(verbose_name="invoice No") InvoiceDate = models.DateTimeField(default=timezone.now, verbose_name="Invoice Date") ProductName = models.CharField(max_length=120,verbose_name="productName") Quantity = models.IntegerField(verbose_name="quantity") Unit = models.ForeignKey(Unit,on_delete=models.CASCADE,max_length=150,verbose_name='unit') Rate = models.CharField(max_length=120,verbose_name="rate") Value = models.CharField(max_length=120,verbose_name="value") DisPer = models.CharField(max_length=120,verbose_name="disper") DisValue = models.CharField(max_length=120,verbose_name="disvalue") Taxable = models.CharField(max_length=120,verbose_name="taxable") CGSTPER = models.CharField(max_length=120,verbose_name="cgstper") CGST = models.CharField(max_length=120,verbose_name="cgst") SGSTPER = models.CharField(max_length=120,verbose_name="sgstper") SGST = models.CharField(max_length=120,verbose_name="sgst") IGSTPER = models.CharField(max_length=120,verbose_name="igstper") IGST = models.CharField(max_length=120,verbose_name="igst") NetAmt = models.CharField(max_length=120,verbose_name="netamt") I recieving a list of product details from template. So after submiting the request i am getting the result … -
Django, editable help texts of form field
I want to edit help texts of each form field on the frontend, is there any method to accomplish this? -
Product sorting based on prize in ecommerce
I am trying to perform a prize sorting(low to high and vice versa)on product varients on my e-commerce website. since I am new to this, I am a bit confused. Here is my model: class Product(models.Model): Name = models.CharField(max_length=250) Description = RichTextField(null=True) Features = RichTextField(null=True,default=None) Varient_Type = models.ForeignKey(VarientType,on_delete=models.CASCADE) Product_Category = models.ForeignKey(Catogory,on_delete=models.CASCADE) Product_Brand = models.ForeignKey(Brand,on_delete=models.CASCADE,blank=True,null=True) related_product=models.ManyToManyField('Product',blank=True,null=True) status = models.CharField(default='Active',max_length=20, choices=( ('Active','Active'), ('Inactive','Inactive') )) created_at = models.DateTimeField(auto_now_add=True) class Meta: db_table = "Products" ordering = ['-created_at'] def __str__(self) -> str: return self.Name class Product_Varients(models.Model): product=models.ForeignKey(Product,on_delete=models.CASCADE) Sku_Code=models.CharField(max_length=100) Varient_Values = models.ForeignKey(VarientValues,on_delete=models.CASCADE) Selling_Prize = models.DecimalField(max_digits=12,decimal_places=2) Display_Prize = models.DecimalField(max_digits=12,decimal_places=2) Product_stock = models.PositiveIntegerField(blank=True,null=True) created_at = models.DateTimeField(auto_now_add=True) status = models.CharField(default='Active',max_length=20, choices=( ('Active','Active'), ('Inactive','Inactive') )) class Meta: db_table = "Product_Varients" ordering = ['-created_at'] class ProductImage(models.Model): product=models.ForeignKey(Product,on_delete=models.CASCADE) Thumbnail_image = models.ImageField(upload_to='Products',null=True) I am passing all products to the template and iterating the product varients of each product and displaying only the first varient. here is my template code: <div class="col-md-9 product-model-sec"> {% for product in products %} {% for pro in product.product_varients_set.all %} {% if forloop.first %} <div class="product-grid love-grid"> <div class="more-product"><span> </span></div> <div class="product-img b-link-stripe b-animate-go thickbox"> <div class="shrt"> <a href="javascript:void(0)" data-id="{{pro.id}}" class="button add-Cart add-to-wish-btn" title="Add to Wishlist"></span>Wishlist</a> </div> {% for img in product.productimage_set.all%} {% if forloop.first %} <a href="{% url … -
django views pass a list in aggregate function
So I have a list and I want to pass it on to .aggregate() so it looks like .aggregate(riasec_avg) but instead I get type error views.py riasec_avg =[Avg('realistic'),Avg('investigative'),Avg('artistic'),Avg('social'),Avg('enterprising'),Avg('conventional')] context['riasec_male'] = Riasec_result.objects.filter(user__profile__gender='M').aggregate(riasec_avg) context['riasec_female'] = Riasec_result.objects.filter(user__profile__gender='F').aggregate(riasec_avg) I also have tried () instead of [] -
How to enforce user permissions using user Groups in Django Class Based Views
In my Django app, I have created Groups and assigned (selectively) Permissions the Groups. And later assigned the Groups to the Users. These steps were carried out in the app's admin. Now I am trying to restrict certain views to the users (using CBV) like as under: class UomListView(LoginRequiredMixin, PermissionRequiredMixin, ListView): template_name = "..." context_object_name = 'unit_meas' model = U_o_M permission_required = 'myapp.view_u_o_m' def get_queryset(self): return U_o_M.objects.order_by('uom') As expected I am able to restrict access to the view to users who are assigned the permission "myApp.view_u_o_m". My understanding of the system is that if a user is attached to a Group which has permission "view_u_o_m" should be automatically assigned the privilege of accessing the view. To quote (from Admin > Change User page): The groups this user belongs to. A user will get all permissions granted to each of their groups. However, when I remove the line permission_required = 'myApp.view_u_o_m', anticipating that the user Permission will hold good but it doesn't and I get an error saying View is missing the permission_required attribute. Define... or override .get_permission_required(). Obviously I am wrong about how defining "Groups" affect the Permissions scenario. May I ask somebody to help clarify the issue here and … -
How can I return multiple values from hidden input when I click the button with jquery?
When I click the button, I want to get the value of the hidden input, but when I write it like this, it only takes the first value. <div> <input type="hidden" name="producecode" class="pdcode" value="{{per.produceCode}}" /> <input type="hidden" name="useremail" class="uponequantity" value=" {{user.username}}" /> <button class="btn btn-sm btn- primary" onclick="upoq()"><i class="fa fa-plus"></i></button> $(".up").click(function(){ $(".prdtd").find("input:first- child").attr("value"); $(".pcode").val()} -
Stop CSS loader spinning if form validation error, django, javascript
How do I stop the loader spinner showing if the forum submit fails and the user has to complete a missing form field. The spinner keeps spinning forever while the user enters the missing information. My submit button in the form: ... <div class="control"> <button type="submit" class="button" onclick="showDiv()">Submit </button> </div> </form> My spinning loader below the form: <span class="loader" id="loadingdisplay" style="display:none;"></span> My javascript on click event to display spinning loader: <script type="text/javascript"> function showDiv() { document.getElementById('loadingdisplay').style.display = "block"; } </script> -
Affect total sum with start date and end date
My views: class CentreRevenue(ListAPIView): permission_classes = [IsAuthenticated, ] pagination_class = CustomPagination serializer_class = serializers.CentreRevenueSerializer def get_queryset(self): self.pagination_class.page_size = page_size id = self.request.query_params.get("id") start_date = self.request.query_params.get("start_date") end_date = self.request.query_params.get("end_date") data = center_models.Centers.objects.filter(center_type__in=['collection_center', 'direct_client'], id__isnull=False) if id: data = data.filter(id=id) # if start_date and end_date: # data = data.filter(created_at__date__range=[start_date, end_date]) return data #Serializer class CentreRevenueSerializer(serializers.BaseSerializer): class Meta: model = package_models.CollectionCenterLedger def to_representation(self, instance): tbc = booking_models.Booking.objects.filter(center=instance, center__isnull=False).values_list('id').count() amount = sum( package_models.CollectionCenterLedger.objects.filter( package__isnull=False, center=instance, ledger_type='debit' if instance.type == 'prepaid' else 'credit' ).values_list('amount', flat=True) ) remove_test_billing_client_billing = sum( package_models.CollectionCenterLedger.objects.filter( package__isnull=False, ledger_type='credit' if instance.type == 'prepaid' else 'debit', center=instance, ).values_list('amount', flat=True) ) add_test_billing = sum( package_models.CollectionCenterLedger.objects.filter( package__isnull=False, ledger_type='debit' if instance.type == 'prepaid' else 'credit',center=instance ).values_list('rcl_share', flat=True) ) remove_test_billing = sum( package_models.CollectionCenterLedger.objects.filter( package__isnull=False, ledger_type='credit' if instance.type == 'prepaid' else 'debit', center=instance ).values_list('rcl_share', flat=True) ) rcl_amount = add_test_billing - remove_test_billing amount = amount - remove_test_billing_client_billing return{ 'ccdc_name':instance.name, 'sales_person':instance.sales_manager.user.username if instance.sales_manager else None, 'centre_type':instance.center_type, 'total_booking_count':tbc, # 'total_revenue':sum([i for i in total_rev if i is not None]), 'total_revenue':amount, 'rcl_share':rcl_amount } Here i am calculating total_booking_count, total_revenue and rcl_share. I want to filter these data with start_date and end_date and accordingly these calculation will affect. Suppose if i selected date range 5 days then it will only show calculation of … -
HOW TO UPDATE DJANGO FORM WITH FILES AND TEXT INPUTS?
I have an update form in django and the code below is working particulary the instance: def edit_project(request, project_id): detail = projectDB.objects.get(pk=project_id) form = projectForm(request.POST or None, instance = detail) if form.is_valid(): form.save() return redirect ('/manage') return render(request, 'edit_project.html', {'detail': detail, 'form':form }) But when I inserted request.FILES as well to save the updated file from the form like this, def edit_project(request, project_id): detail = projectDB.objects.get(pk=project_id) form = projectForm(request.POST or None, request.FILES instance = detail) if form.is_valid(): form.save() return redirect ('/manage') return render(request, 'edit_project.html', {'detail': detail, 'form':form }) the instance seems not working anymore. Im new to django and I want to update a form that contains files and text inputs from users and I dont know how to save both at the same time. Hope you help me, thank you -
Github Actions CI/CD without docker on an -Django-Gunicorn-Nginx
I have a digital ocean server setup with Django-Gunicorn-Nginx. Everything is working as I want but sadly everytime I make a code change I have to manually login to my server pull my changes from github and restart gunicorn. Is it possible to setup a CI/CD workflow by just using Github-Actions? P.S - Docker is not an option right now.