Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Angular django rest framework integration
How to serve angular using Django server? I don't want to host two different server for angular and Django. How to do it with a single django server? -
How can I show specific data un my Django form?
I'm a begginner at Django and I'm making an app for lending books and now I'm trying to make a Form using these models: In my app Books Class CopyB(models.Model): Copy= models.Autofield(primary key=True) Condition= models.Charfield(max_lenght=20) IdBook=models.ForeignKey(Book, blank= false, null= false ,on_delete= models.CASCADE) Also in my app Users Class User(models.Model): Myid= models.Charfield(primary_key=True, max_length=20) Name= models.Charfield(max_length=20) Lastname= models.Charfield(max_length=20) And in my app loans From apps.books.models import CopyB From apps.users.models import User Class loan(models.Model): IdLoan= models.Autofield(primary_key=True) IdB= models.ForeignKey(CopyB,blank=False, null=False) IdU= models.ForeignKey(User,blank=False, null=False) What I want to do is making a Form from the model loan and on that form on the field IdB I only want to show in the select input just Books in the model CopyB that in the field Condition is equal to available But I don't know how to make it! Thanks in advance -
SMTPAuthenticationError - 535, b'5.7.8 Username and Password not accepted. - sending email from docker
I'm trying to send an e-mail from django app in docker on Ubuntu and I'm receiving following message: Request Method: GET Request URL: https://localhost:8001/accounts/mail/ Django Version: 2.2.5 Exception Type: SMTPAuthenticationError Exception Value: (535, b'5.7.8 Username and Password not accepted. Learn more at\n5.7.8 https://support.google.com/mail/?p=BadCredentials x76sm1225174ljb.81 - gsmtp') Exception Location: /usr/local/lib/python3.7/smtplib.py in auth, line 642 Python Executable: /usr/local/bin/python Python Version: 3.7.4 There is no problem to send an e-mail outside docker. I tried every step from Google troubleshooting steps. Currently I have 2-Step verification which works for local app but still doesn't for docker one. I don't necessarily need Google SMTP (I have an account there), but what I what to achive is to send e-mail with activation link to user after registration for django application. -
ModuleNotFoundError: No module named 'rest-framework' with virtualenv and python3.7.4
I'm going though this tutorial: https://github.com/encode/django-rest-framework I make all of the changes, but when I get to the runserver part, I keep getting ModuleNotFoundError: No module named 'rest-framework' error.. | => ./manage.py runserver Watching for file changes with StatReloader Performing system checks... Exception in thread django-main-thread: Traceback (most recent call last): File "/usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/threading.py", line 926, in _bootstrap_inner self.run() File "/usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/threading.py", line 870, in run self._target(*self._args, **self._kwargs) File "/Volumes/thunderb/attic/Projects/VS/maione/env/lib/python3.7/site-packages/django/utils/autoreload.py", line 54, in wrapper fn(*args, **kwargs) File "/Volumes/thunderb/attic/Projects/VS/maione/env/lib/python3.7/site-packages/django/core/management/commands/runserver.py", line 117, in inner_run self.check(display_num_errors=True) File "/Volumes/thunderb/attic/Projects/VS/maione/env/lib/python3.7/site-packages/django/core/management/base.py", line 390, in check include_deployment_checks=include_deployment_checks, File "/Volumes/thunderb/attic/Projects/VS/maione/env/lib/python3.7/site-packages/django/core/management/base.py", line 377, in _run_checks return checks.run_checks(**kwargs) File "/Volumes/thunderb/attic/Projects/VS/maione/env/lib/python3.7/site-packages/django/core/checks/registry.py", line 72, in run_checks new_errors = check(app_configs=app_configs) File "/Volumes/thunderb/attic/Projects/VS/maione/env/lib/python3.7/site-packages/django/core/checks/urls.py", line 40, in check_url_namespaces_unique all_namespaces = _load_all_namespaces(resolver) File "/Volumes/thunderb/attic/Projects/VS/maione/env/lib/python3.7/site-packages/django/core/checks/urls.py", line 57, in _load_all_namespaces url_patterns = getattr(resolver, 'url_patterns', []) File "/Volumes/thunderb/attic/Projects/VS/maione/env/lib/python3.7/site-packages/django/utils/functional.py", line 80, in __get__ res = instance.__dict__[self.name] = self.func(instance) File "/Volumes/thunderb/attic/Projects/VS/maione/env/lib/python3.7/site-packages/django/urls/resolvers.py", line 584, in url_patterns patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module) File "/Volumes/thunderb/attic/Projects/VS/maione/env/lib/python3.7/site-packages/django/utils/functional.py", line 80, in __get__ res = instance.__dict__[self.name] = self.func(instance) File "/Volumes/thunderb/attic/Projects/VS/maione/env/lib/python3.7/site-packages/django/urls/resolvers.py", line 577, in urlconf_module return import_module(self.urlconf_name) File "/Volumes/thunderb/attic/Projects/VS/maione/env/lib/python3.7/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1006, in _gcd_import File "<frozen importlib._bootstrap>", line 983, in _find_and_load File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", … -
How to fix "DLL load failed" error while running Django + Celery with mod_wsgi?
I am trying to run a Django application on a Windows server using the Apache Web Server with mod_wsgi. I am using celery to run some asynchronous tasks and the application runs correctly in localhost, but I get the following error when running on the webserver: [Wed Sep 18 14:12:48.787255 2019] [wsgi:error] [pid 9608:tid 1352] [client 35.xxx.xxx.xx:58389] mod_wsgi (pid=9608): Target WSGI script 'C:/Apache24/htdocs/webapp/djmaccherone/wsgi.py' cannot be loaded as Python module. [Wed Sep 18 14:12:48.787255 2019] [wsgi:error] [pid 9608:tid 1352] [client 35.xxx.xxx.xx:58389] mod_wsgi (pid=9608): Exception occurred processing WSGI script 'C:/Apache24/htdocs/webapp/djmaccherone/wsgi.py'. [Wed Sep 18 14:12:48.792143 2019] [wsgi:error] [pid 9608:tid 1352] [client 35.xxx.xxx.xx:58389] Traceback (most recent call last):\r [Wed Sep 18 14:12:48.792143 2019] [wsgi:error] [pid 9608:tid 1352] [client 35.xxx.xxx.xx:58389] File "C:/Apache24/htdocs/webapp/djmaccherone/wsgi.py", line 35, in <module>\r [Wed Sep 18 14:12:48.792143 2019] [wsgi:error] [pid 9608:tid 1352] [client 35.xxx.xxx.xx:58389] import djcelery\r [Wed Sep 18 14:12:48.792143 2019] [wsgi:error] [pid 9608:tid 1352] [client 35.xxx.xxx.xx:58389] File "C:\\virtualenvs\\webapp\\Lib\\site-packages\\djcelery\\__init__.py", line 34, in <module>\r [Wed Sep 18 14:12:48.792143 2019] [wsgi:error] [pid 9608:tid 1352] [client 35.xxx.xxx.xx:58389] from celery import current_app as celery # noqa\r [Wed Sep 18 14:12:48.792143 2019] [wsgi:error] [pid 9608:tid 1352] [client 35.xxx.xxx.xx:58389] File "C:\\virtualenvs\\webapp\\Lib\\site-packages\\celery\\local.py", line 509, in __getattr__\r [Wed Sep 18 14:12:48.792143 2019] [wsgi:error] [pid 9608:tid 1352] [client 35.xxx.xxx.xx:58389] module = … -
Calling Class Based View (POST) method without going through url.py
we are developing an application backend API end points using Django Rest Framework with class based view approach. Now have an end point like BASE_URL/api/v1/users/posts/ , when called with post method all it does is saves (posts data, ex: {"post_id" : "1", "post_content" : "some_text" ,"posted_username": "user_name"}) into back end database. The above end point will be processed by application urls.py file and will redirect to corresponding view to save the data. Now I want co call the corresponding end point view class post method but not through regular end point [ requests.post(url,data,headers) ], need to invoke this class post method from another python file ( within the same application ), without going through urls.py. All I want to eliminate is network call. Please don't suggest saving directly to database by opening a connection to database, no I want to save data through REST API end point only (class view post method only) but not actually calling end point. Kindly suggest a way to do this. Many Thanks In advance. -
Configure Nginx and Django for Byte Range Request
I am building a web API using Django and Nginx that needs to support Byte-Range requests. Currently, when making a request such as: curl --header "Content-Type: application/json" --header "Authorization: Token 8f25cd3bb5b43a5277f4237b1d1db0273dbe8f6a" --request POST http://myurl/download/ --header "Range: bytes=0-50" -v my Django view (the MyFileAPI class) is called, the user is authenticated, and the correct file path (/code/web/myapp/user_id/user_info.pbf) is fetched. However, the first 50 bytes of the file are not returned. Instead I simply see the error: <html> <head><title>404 Not Found</title></head> <body> <center><h1>404 Not Found</h1></center> <hr><center>nginx/1.15.8</center> </body> </html> How do I configure Nginx to allow redirects to my file? default.conf server { listen 80; server_name localhost; charset utf-8; client_max_body_size 10M; location /static/ { alias /django_static/; } location / { include uwsgi_params; uwsgi_pass web:8000; add_header accept_ranges bytes; } location /myapp { root /code/web; add_header accept_ranges bytes; internal; } } nginx.conf user nginx; worker_processes 1; error_log /var/log/nginx/error.log warn; pid /var/run/nginx.pid; events { worker_connections 1024; } http { include /etc/nginx/mime.types; default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log /var/log/nginx/access.log main; sendfile on; #tcp_nopush on; keepalive_timeout 65; #gzip on; include /etc/nginx/conf.d/*.conf; } views.py class MyFileAPI(APIView): permission_classes = (IsAuthenticated,) def post(self, request): try: user = request.user my_file = … -
Branch is being created without add
Im wanting to create a fresh branch for my repository since I'm having previous problems. However nothing I'm trying is working. When I run (venv) C:\..\..\PycharmProjects\WebP1\DEMOPROJECT>git ls-tree --name-only hope on creation of a new branch, I get .gitignore DEMOAPP DEMOPROJECT __init__.py __pycache__ db.sqlite3 manage.py media static This isnt what i want as i want gitignore to ignore this *.log *.pot *.pyc __pycache__/ local_settings.py db.sqlite3 media I have tried --orphan branch but it seems to always take me back to a bad commit I don't want anymore. DEMOPROJECT folder is also being made a submodular for some reason which I don't want to happen. How can i fix this please? Is there a certain add I need to do? -
How to handle errors in Django
I want to make my django app as user friendly as possible and I want to handle appropriate errors and have it push out an error message sort of like an alert in javascript. I want to do this when there's no file uploaded. So when the upload button is pressed and nothing have been uploaded there would be an alert message sent out. def upload(request): if "GET" == request.method: return render(request, 'uploadpage/upload.html', {}) else: excel_file = request.FILES["excel_file"] # you may put validations here to check extension or file size wb = openpyxl.load_workbook(excel_file) # getting a particular sheet by name out of many sheets worksheet = wb['Summary'] # iterating over the rows and # getting value from each cell in row seller_info = [] for cells in worksheet.iter_rows(min_col=2, max_col=2, min_row=1, max_row=5): for cell in cells: seller_info.append(str(cell.value)) return render(request, 'uploadpage/upload.html', {"excel_data": seller_info}) <!DOCTYPE html> <html> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> <link rel="stylesheet" href="{% static 'css/upload.css' %}"> <head> <div id='banner-container'> <div id='banner'> <h1 id='header'>MY APP</h1> <i class="glyphicon glyphicon-cloud" style="font-size:60px;color:lightblue;text-shadow:2px 2px 4px #000000;"></i> </div> <div> <body> <div id='upload-container' > <span><h1>Upload File !</h1></span> <span><h2>Upload Here</h2></span> <form method="post" enctype="multipart/form-data"> <div id='input'> {% csrf_token %} <input type="file" name="excel_file"> <div id='btn'><button type="submit">Upload File</button> </div> </form> <div> </div> </body> {{ … -
Unable to open xml file in Django python using open()
I am trying to open and .xml file using open() and then convert it into dictionary. I am using it in django application File is also located at correct location.. Problem is "\" is getting replaced with "\\" and file extension ".xml" with ".xmlf" and no such file directory is error as in snapshot Filepath is changing can be seen into image. code for reading file is how to resolve the error in django server -
Extend Behavior of models.Model
In django, I am trying to extend the behavior of the models.Model class. I want to execute code as the model inits, as well as using the default init. Here is the code I so far which looks like what im wanting to do but the behavior is incorrect. class DirtyModel(models.Model): def __init__(self, *args, **kwargs): super(DirtyModel, self).__init__(*args, **kwargs) print("extended") class Foo(DirtyModel): bar = models.TextField() This code tries to make a model called DirtyModel, which I understand why, but I don't suppose I know how to extend the Model class otherwise. How should I go about creating a custom models.Model class to use in my models? -
Django html page does not display a variable i passed in views
i am a beginner with Django and i encountered a problem. I wrote a code which allows me to add different products and categories from admin, and then display them on a html page. However, when i click on any of the displayed products i want my product description to be displayed in another html page. The first page is working just fine( product_list.html), however i am having trouble with the second one (product_detail.html). urls.py ( without the imports): urlpatterns = [ url(r'^category/(?P<categoryid>\d+)/$', views.product_list, name='product_list_by_category'), #url(r'^list/(?P<id>\d+)/$', views.product_detail, name='product_detail'), re_path('^$', views.product_list, name = 'product_list'), url(r'^list/(?P<id>\d+)/$', views.product_detail, name='product_detail'), ] views.py def product_list(request, categoryid = 1): *this one is working* categories = Category.objects.all() products = Product.objects.all().filter(category_id=categoryid) context = {'categories': categories, 'products': products } return render(request, 'shop/product_list.html', context) def product_detail(request, id=1): *this one is not displaying anything* productt = Product.objects.all().filter(id = id) return render(request, 'shop/product_detail.html', {'product': productt}) product_detail.html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> </head> <body> <a href="http://localhost:8000/shop/list/{{product.id}}/">{{product.description}}</a> </body> </html> Do you have any idea why the page rendered by product_detail does not display anything? -
models not showing in django admin page
My models in my admin page are not sowing up. I checked to see if my user was a super user, checked if my directories were good, and checked if my code was written wrong. As far as I know, all of these are correct. However I get this error when I add 'main.templates.admin.InfoAdmin' in settings.py. ...django\apps\registry.py", line 135, in check_apps_ready raise AppRegistryNotReady("Apps aren't loaded yet.") django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet. Without that line there's no error, but the models don't show up on the admin page. admin.py from django.contrib import admin from .models import * class InfoAdmin(admin.ModelAdmin): fields = [ 'site_title', 'site_content', 'site_published' ] class DocumentAdmin(admin.ModelAdmin): fields = [ 'title', 'description', 'document', 'uploaded_at', 'creator' ] admin.site.register(models.Info, InfoAdmin) admin.site.register(models.Document, DocumentAdmin) models.py from django.db import models from datetime import datetime from django.contrib.auth.models import User from django.conf import settings # Create your models here. class Info(models.Model): site_title = models.CharField(max_length=200) site_content = models.TextField() site_published = models.DateTimeField("date published") likes= models.IntegerField(default=0) dislikes= models.IntegerField(default=0) def __str__(self): return self.site_title class Document(models.Model): title = models.CharField(max_length=100, default='NoTitle') description = models.CharField(max_length=255, blank=True) document = models.FileField(upload_to='documents/') uploaded_at = models.DateTimeField(auto_now_add=True) creator = models.ForeignKey('auth.User', on_delete=models.CASCADE, blank=True, null=True) def __str__(self): return self.title urls.py from django.urls import path from . import views from . import … -
How to sync a Many to many relationship on Django
I want to know if there is a function I can call in Django ORM to update the intermediate table by passing an array of IDs Im used to work with Laravel, and that framework has a very useful method called sync. The sync method accepts an array of IDs to place on the intermediate table. Any IDs that are not in the given array will be removed from the intermediate table. So, after this operation is complete, only the IDs in the given array will exist in the intermediate table is there something like that in Django? I was looking through the documentation but I can't find it. If there isn't, what's the best way to do it? -
Why is my django exception handling not working
I want to make my django app as user friendly as possible and I want to handle appropriate exception handling cases and have it push out an error message sort of like an alert in javascript. I want to do this when there's no file uploaded in this case "POST" == request.method is emtpy. So when the upload button is pressed and nothing have been uploaded there would be an alert message sent out. But so far the code that I have keeps pushing out an error message that says "The view uploadpage.views.upload didn't return an HttpResponse object. It returned None instead." def upload(request): try: if "Post" == request.method: excel_file = request.FILES["excel_file"] # you may put validations here to check extension or file size wb = openpyxl.load_workbook(excel_file) # getting a particular sheet by name out of many sheets worksheet = wb['Summary'] # iterating over the rows and # getting value from each cell in row seller_info = [] for cells in worksheet.iter_rows(min_col=2, max_col=2, min_row=1, max_row=5): for cell in cells: seller_info.append(str(cell.value)) return render(request, 'uploadpage/upload.html', {"excel_data": seller_info}) except: if "POST" == None: messages.error(request, 'Need upload file') return render(request, 'uploadpage/upload.html') MYAPP {% if messages %} {% for message in messages %} {{ message … -
What difference it makes when using ' /<int:id>' instead of '/<slug>' in url-patterns(Django)? Which method is more preferable?
I want to use URL-pattern to fetch product view from my products list. But I came across two methods and a bit confused about which to select. 1)<slug> 2) <int:id> -
Which is best? PHP or ASP or Django
From a long time I wanted to know Which is Good? Php or Asp or Django. I have used PHP more than Asp and Django. I would greatly thank the person who answers this. Regards, Dereck Smith Elijah -
How to solve __init__() takes 1 positional argument but 2 were given
views.py from django.views.generic import ListView from django.contrib.auth.models import User class UserListView(ListView): model = User template_name = 'infinitescroll/articles.html' context_object_name = 'users' paginate_by = 10 queryset = User.objects.all() urls.py from django.contrib import admin from django.urls import path from infinitescroll.views import UserListView urlpatterns = [ path('admin/', admin.site.urls), path('home/',UserListView, name='home'), ] articles.html <table class="table table-bordered"> <thead> <tr> <th>Username</th> <th>First name</th> <th>Email</th> </tr> </thead> <tbody> {% for user in users %} <tr> <td>{{ user.username }}</td> <td>{{ user.first_name }}</td> <td>{{ user.email }}</td> </tr> {% endfor %} </tbody> </table> I don't know what causes an error it gives error locations in Exception Location: C:\xampp\htdocs\8moviesdb\infinite\pal\lib\site-packages\django\core\handlers\base.py in _get_response, line 113 -
How to get all log levels in django celery to ELK(logstash) or write to a file
I want to get all logs from Django and celery and send them to logstash or write to a file when an error occurs in celery task it shows in the console but not writing to a file -
How can i give limit in django?
I'm making a project and want to use limit for fetch data how can i use limit if there are any function or any way i can give limit to my fetching data i expect the output of (2019, 12, 27)(2019, 6, 30) to be (2019, 12, 27) but it fetching all records def maintenancefunction(request): #maintenance page function if 'user' not in request.session: return redirect('/login') else: if request.session.has_key('user'): abc=request.session['user'] today = date(2019,1,1) # today= date.today.().strftime('%d/%m/%Y') next_date=today.strftime('%Y-%m-%d') lastdate= today + timedelta(days=180) new_date= lastdate.strftime('%Y-%m-%d') duedate=maintanance_table.objects.values_list('maintanance_todate').filter(user_email=abc).order_by('maintanance_todate').reverse() # # newduedate=duedate.strftime('%Y-%m-%d') print("DueDate:",duedate) checkstatus=maintanance_table.objects.filter(user_email=abc).filter(maintanance_status="PAID").order_by('maintanance_todate').reverse() if checkstatus: lastdate = lastdate + timedelta(days=180) new_date = lastdate.strftime('%Y-%m-%d') else: lastdate=lastdate new_date= lastdate.strftime('%Y-%m-%d') return render(request,"maintenance.html", {'abc':abc,'new_date':new_date}) else: return render(request,"login.html") return render(request,"maintenance.html") -
Django ORM sum prices from 3 level nested
I have these models and managers: class ItemManager(models.Manager): use_for_related_fields = True def get_queryset(self): qs = super().get_queryset() return qs.annotate(total_price=ExpressionWrapper( F('gross_price') * F('qty'), output_field=models.DecimalField()) ) class OrderManager(models.Manager): use_for_related_fields = True def get_queryset(self): qs = super().get_queryset() return qs.annotate(total_price=Sum(items__total_price)) # this doesnt work class Order(models.Model): id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) name = models.CharField(max_length='50') class Item(models.Model): id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) price = models.DecimalField(max_digits=14, decimal_places=2) qty = models.IntegerField() order = models.ForeignKey(Order, related_name='items', on_delete=models.CASCADE) objects = ItemManager() I want to get Sum price of the order, like this: for sale in Order.objects.all(): print(sale.total_price) Error: django.core.exceptions.FieldError: Unsupported lookup 'total_price' for UUIDField or join on the field not permitted. I can get total_price for each item, and I want to use that total_price to get Sum of all items. I need in this way because I will use that sale total_price in a model that have multiple orders as child elements. -
Deploying django app on shared IIS - Script processor could not be found
I am trying to deploy my django app on a shared aws IIS server. First tried on my local machine following this blog:https://www.youtube.com/watch?v=CpFU16KrJcQ and was able to run successfully. However, I cannot install the dependencies on my server machine using pip as I did for my local IIS. So as a workaround I tried to copy all my project files along with the virtual env and other dependent packages files to my server but it did not work. I get the error <handler> scriptProcessor could not be found in <fastCGI> application configuration I guess this error occurs if IIS is not able to find the python/wfastcgi script, but this is only coming for my copied project directory and not the original one. I have updated the paths in web.config for copied proj directory as well though. Do we need to reinstall all the packages in the virtual environment if we just copy the directory? Or is there any easier way to just replicate a virtual env with all its dependencies installed to a different machine? Here is my project directory structure: project_folder -app1 -app2 -static manage.py -virtual_env_folder -lib -site-packages -scripts activate Many thanks in advance! -
Django filter question - How to delete a single item with the most recent date?
I have 1 db, Master that effectively has a composite primary key, of ID and date, My system allows deletion from this db for some users. What I am trying to do is have them enter an ID, and then it deletes the row with that ID, but only the most recent date. I have tried filtering for the ID, and then chaining the latest method, I have also tried using the order by and selecting the first entry. toDelete = Master.objects.filter(Identifier=id).latest('EffectiveDate') toDelete.delete() This statement, when I call delete, deletes all of the entries in the db which match the ID, I am trying to have it only delete the last one to occur. -
App accessible via port 3000 after deploy to server
I have a django app running in docker containers (please see docker compose and dockerfile below). I have removed port exposure from my docker-compose however when i deploy the code onto an ubuntu server, I can still access the app via port 3000. I am also using nginx to do the proxing (see nginx file below). services: rabbitmq: restart: always image: rabbitmq:3.7 ... db: restart: always image: mongo:4 ... cam_dash: restart: always build: . command: python3 manage.py runserver 0.0.0.0:3000 ... celery: restart: always build: . command: celery -A dashboard worker -l INFO -c 200 ... celery_beat: restart: always build: . command: celery beat -A dashboard -l info --scheduler django_celery_beat.schedulers:DatabaseScheduler ... FROM python:3.7 COPY requirements.txt / RUN pip3 install -r /requirements.txt ADD ./ /dashboard WORKDIR /dashboard COPY ./docker-entrypoint.sh /docker-entrypoint.sh RUN chmod +x /docker-entrypoint.sh ENTRYPOINT ["/docker-entrypoint.sh"] EXPOSE 3000 server { listen 80 default_server; listen [::]:80 default_server; server_name _; return 301 https://$host$request_uri; root /var/www/html; index index.html; } server { listen 443; server_name camonitor.uct.ac.za; ssl on; ssl_certificate /etc/ssl/certs/wildcard.crt; ssl_certificate_key /etc/ssl/private/wildcard.key; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; location / { root /var/www/html; index index.html; } location /dash/ { proxy_pass http://127.0.0.1:3000/dash/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $remote_addr; } ... I am expecting that if I … -
Why has this needed folder become a submodule?
I have a folder which has all the main code in it but its been created on Github as a submodule and I don't know how to change it or why it was created that way by Git? Also I'm making new branches and pushing them and every time I do the same "branch" (it seems) is being pushed so the folder is staying the same. git branch new git add . git commit -m "blah" git remote add origin new I take it that this code is wrong to make a completely new branch commit? I've tried numerous ways and seem to be going down a dead end constantly. Is there something wrong with my commits or adds?