Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Django: show all related many-to-many items for a queryset
I have the following models: class NoteModel(models.Model): note = models.CharField( max_length = 5000, ) note_title = models.CharField( max_length = 500, blank = False, null = True, ) project = models.ForeignKey( IndividualProject, on_delete=models.CASCADE, related_name = "note_projects", blank = False, null = True, ) tags = models.ManyToManyField( NoteTagModel, related_name="tags", blank= False, ) def __str__(self): return f"{self.note_title}" class IndividualProject(models.Model): project = models.CharField( max_length = 64 ) def __str__(self): return f"Project {self.project}" I want to be able to find the tags for each project. So far I have the following: proj = IndividualProject.objects.get(id=2) notes = NoteModel.objects.filter(project = proj) notes is a QuerySet, how do I find all of the tags related to each item of the QuerySet? Ideally I would look to sort this in my views.py so that I could cleanly loop through in my template. Any help is greatly appreciated. -
Django ORM get all fields value. (foreign keys)
class MyUser(models.Model): name = models.CharField(max_length=10) class Foo(models.Model): my_user = models.ForeignKey(MyUser,on_delete=models.CASCADE) text = models.CharField(max_length=25) Let's say we have two models like this. I want to get all fields with an ORM query from the MyUser model. Like this: { "name":"example" "Foo":{ "text":"example-text", "text":"example_text2" } } How should I write a query to do this? MyUser.objects.all() # But give it ALL FIELDS + RELEATED FIELDS -
Best way to mock an RSS news feed endpoint in python?
I am currently implementing a feature which pulls the data from an RSS feed, parses it, does some modifications to it and saves it to our db. I have to specify that this all happens in a Django project. I pull the data from the RSS feed by using the feedparser library. I've also decided to write some tests, to make sure that the news feed is parsed well and that the whole process (from pulling and parsing the data to modifying it to saving it in our db) goes well. In those tests I've even managed to generate a dummy RSS feed using Django's feedgenerator util. However, I do not know how to effectively mock the RSS feed endpoint. I've tried using requests-mock but to no avail. I know for a fact that feedparser uses urllib. Should I mock something from urllib to make it work? Or should I start a server in another process that accepts connections and responds to everything with the mock RSS data? (something made with make_server from this example). The end goal for me would be to have something like this: request_mocker.get(RSS_NEWS_FEED_URL, data=dummy_rss_data, status_code=200) So when feedparser calls that RSS_NEWS_FEED_URL, it gets the dummy_rss_data. -
I am having trouble with logging users in and out of my blog
I am makeing a blog with Django and there is one admin account associated with the program. However, whenever I log in to the admin account and when I open a new window and go to my site, the new instance of my site is logged into my admin account. Does dose anyone know how I can fix this? -
django.db.utils.OperationalError: FATAL: role "user" does not exist
I am trying to authenticate users with django and postgresql. My project is dockerized. When I run docker-compose up --build I get an error saying: django.db.utils.OperationalError: FATAL: role "django2" does not exist I know error says role django2 doesn't exists but it does. If I run CREATE ROLE django2; I get an error saying ERROR: role "django2" already exists. My DATABASE section of settings.py: DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql', 'NAME': 'zane_db', 'USER': 'django2', 'PASSWORD': 'django2', 'HOST': 'db', 'PORT': 5432 } } My registration view: letters = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"] numbers = ["1", "2", "3", "4", "5", "6", "7", "8", "9",] characters = letters + numbers length = 5 token = "".join(random.sample(characters, length)) def signup(request): if request.method == "POST": context = {'has_error': False, 'data': request.POST} global password global password2 global email global username email = request.POST.get('email') username = request.POST.get('username') password = request.POST.get('password') password2 = request.POST.get('password2') body = render_to_string('authentication/email/email_body.html', { 'username': username, 'token': token, }) send_mail( "Email Confirmation", body, 'tadejtilinger@gmail.com', [email] ) return redirect('email-confirmation') return render(request, 'authentication/signup.html') def email_confirmation(request): if request.method == "POST": context = {'has_error': False, … -
Django model data query Exclude objects which are connected to another model by ForeignKey
I have two django models named Quiz and Result class Quiz(models.Model): name = models.CharField(max_length=250) another model class Result(models.Model): quiz = models.ForeignKey(Quiz, on_delete=models.CASCADE, related_name='results') Now i want to query data from this in two ways I want all the Quiz objects which do not have a Result I want all the Quiz objects which have a Result How can I do this? -
DoesNotExist error when using custom User model
I have a Group model in my group/models.py file: class Group(models.Model): leader = models.ForeignKey(User, on_delete=models.CASCADE) name = models.CharField(max_length=55) description = models.TextField() joined = models.ManyToManyField(User, blank=True) and an Account model, which is an extension of django's standard User, in users/models.py: class Account(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE) joined_groups = models.ManyToManyField(Group, related_name='joined_group') created_groups = models.ManyToManyField(Group) in users/admin.py: class AccountInline(admin.StackedInline): model = Account can_delete = False verbose_name_plural = 'Accounts' class CustomUserAdmin(UserAdmin): inlines = (AccountInline,) admin.site.unregister(User) admin.site.register(User, CustomUserAdmin) The issue I'm having trouble understanding is when I create a new User, the Account for that User doesn't seem to really be registering. At the bottom of the new User's page (via django admin site) the new Account looks like this: Now, this new User seems to have an account which contains joined_groups and created_groups but when I try to join or create a Group with that new User, I get an error DoesNotExist - Account matching query does not exist I'm not sure why the new User/Account isn't really registering its Account. In comparison, inside my AdminUser page its Account info looks like this: Account: #1 for the new User vs. Account: Acount object (6) for Admin User. Finally, when I go onto the django … -
What makes my Django/Heroku app allow mobile version of a site?
I am new to web development. I just got my first project online, wich is Django app deployed in Heroku. App uses Bootstrap. When I use any size desktop browser window the app scales as I excpect it to. When I access it from my android phone it uses "mobile site" (if that's what it's called). The mobile site looks like a mess. If I use the "desktop site mode" on mobile it looks what I excpected it to look. I am trying to figure witch part of the stack is responsible for this happening. Is it possibly some of these? Django Bootstrap Heroku Browser I have not made any setting to use mobile site (at least not intentionally) so I am to assume this is the default for the tech responsible for this. Also in general; if I want my app to be usable both in desktop and mobile enviroments is it usually enough just to make site responsive and not bother with the "mobile site"? -
django static file not loading after updating it on production
i just deployed a django web app on azure i have a script which runs when i goes to myapp.com/update url it basically fetches data using bs4 library and convert the data into a pandas df then to show that data i used pd.to_html to convert it in html table format and stores that html file in static folder and then load it in my index.html (which present in templates folder using jquery) and mind you the html loads fine but after the i visit the update url it stops showing the updated html file (panada df one). i even goes to azure panel to see the updated html file (pandas df one) and it was there it got updated but cuz of the update, the site is not loading it anymore but before update it was loading perfectly --script in my views.py (for myapp.com/update url)-- text_file2 = open("staticfiles/album.html", "w") text_file2.write(updatedData) text_file2.close() this is how i'm adding that html file to my main index.html file (this loads the file perfectly but after update url it stops loading it) <script> $(function () { $("#includedAlbums").load("../static/album.html"); }); </script> Help me asap please. Thanks in advance <3 -
Django popup forms - CRUD
Could someone explain from the video below how the user call the "Edit" function? https://www.youtube.com/watch?v=P78-ltyeuVg&t=646s (19:18) Thank you! -
How to stream .webm or .mjpeg from Python Django server?
I have a .webm feed from a 3rd party camera source. I would like to redistribute this to my web clients. I can open the stream in OpenCV then redistribute the .jpg images which works perfectly with img tags. However, I would like to convert this into a .webm or .mjpeg stream for use with video.js or other video tag. I don't have enough experience with HTTP protocol or video formatting and all my research only shows this .jpg streaming method. models.py streamManagerLock = threading.Lock() streamManagers = {} class StreamManager: active = True lastTime = time.time() image = None def __init__(self, cameraObj): self.camera = cameraObj url = "https://" + str(cameraObj.system.systemID) + ".relay-la.vmsproxy.com" self.stream = cv.VideoCapture("{url}/web/media/{camID}.webm?auth={auth}".format(url=url, camID=cameraObj.cam_id, auth=cameraObj.system.getAuth())) self.stream.set(cv.CAP_PROP_BUFFERSIZE, 5) self.killThread = threading.Thread(target=self.selfTerminate, daemon=True) self.lastTime = time.time() self.killThread.start() self.updateThread = threading.Thread(target=self.update_frame, daemon=True) self.updateThread.start() def selfTerminate(self): while True: if time.time() - self.lastTime > 3: break time.sleep(1) self.terminate() def terminate(self): with streamManagerLock: streamManagers.pop(str(self.camera.cam_id)) self.active = False self.stream.release() def update_frame(self): while self.active: ret, image = self.stream.read() if ret: ret, jpeg = cv.imencode('.jpg', image) self.image = jpeg.tobytes() else: ret, img = cv.imencode('.jpg', np.zeros([100, 100, 3], dtype=np.uint8)) return img.tobytes() time.sleep(1/30) def get_frame(self): self.lastTime = time.time() if self.image is None: ret, img = cv.imencode('.jpg', np.zeros([100, 100, 3], … -
How do i use filter to filter multiple radio buttons in django template in Django
How do i use filter to filter multiple radio buttons in django template in Django...I want a situation where when you select multiple buttons it filters the cars based on how many cars you have selected. This is my views.py How do i use filter to filter multiple radio buttons in django template in Django...I want a situation where when you select multiple buttons it filters the cars based on how many cars you have selected. def new_cars(request): if request.method == "POST": car_brand_label = request.POST.getlist('car_brand_label') if not car_brand_label : car_brand_label = "" for car_brand_label_iter in car_brand_label: # print(car_brand_label_iter) image_new_car = Image.objects.filter(car__condition = 'BRAND NEW',car__brand__icontains = car_brand_label_iter ) new_car = Car.objects.filter(condition = 'BRAND NEW',brand__icontains= car_brand_label_iter) new_car_label = Car.objects.filter(condition = 'BRAND NEW') new_cars_list = zip(new_car,image_new_car ) new_car_label = Car.objects.filter(condition = 'BRAND NEW') new_cars_list = zip(new_car,image_new_car ) # new_cars_label = zip(new_car,image_new_car ) context = { 'new_cars_list' : new_cars_list, 'new_cars_label' : new_car_label } return render(request, 'frontend/new_cars.html', context) else: image_new_car = Image.objects.filter(car__condition = 'BRAND NEW') new_car = Car.objects.filter(condition = 'BRAND NEW') new_cars_list = zip(new_car,image_new_car ) new_cars_label = zip(new_car,image_new_car ) context = { 'new_cars_list' : new_cars_list, 'new_cars_label' : new_car } return render(request, 'frontend/new_cars.html', context) and this is my template. <a href="{% url 'new_cars' %}"> <h4>Brand New … -
How to put objects in column in Django templates
I'm developing an ecommerce project. It's my first time with Django, so be patient. I have some objects in a list, whith so many fields. I want to put this object in column in my template. I tried with the but in a for loop it doesn't recognize more than one div. Is there a method to incolumn my object in my template? Here's my code: enter image description here -
Heroku overriding django's errors
I followed the official Django documentation on writing custom error views, that is, handler404, handler500 etc. When set debug to false on on my project's settings, the custom error pages display as expected. Once I deploy to heroku, it seems like heroku overrides the django's error pages and returns its own instead. For example, for a 404 not found, when debug is set to True, the django's error debug page is displayed and the response code is 404. Once debug is set to False, the response code is even no longer 404 but rather 503 which is returned by heroku and not Django. What's happening and how do I solve that? -
unique_together in Meta vs validate_unique function in model
I would like to know the difference between these two methods of checking for unique-ness. I have two fields which I do not want there to be duplicates of - key_name and developer_email - i.e. a developer can not have two keys with the same name. But two developers can have a key with the same name as each other. I found out about unique_together so I added this to KeyDefinitions in models.py: class Meta: verbose_name = "Key Definition" #constraints = [ # models.UniqueConstraint(fields=['key_name', 'developer_email'], name='unique key names for each user') #] unique_together = [['key_name', 'developer_email']] However, when I tested this by inputting a duplicate key_name and hitting "OK" on my form it just gives me back the form filled in and no errors. Although an entry hasn't been added to the database which tells me that this code is doing something. I wanted an error to be raised so I found out about validate_unique and added it to the same model like so: def validate_unique(self, exclude=None): # I feel like this function makes constraints/unique_together option in Meta obsolete ?! qs = KeyDefinition.objects.filter(key_name=self.key_name, developer_email=self.developer_email) # need to filter by developer too print(qs) if qs: raise ValidationError ( {'key_name' : ['This … -
Django liveserver displays as plain text
I ran my server with python manage.py runserver and for some reason it started displaying as plain text. When I run it as a live server it comes out normal. I have no idea what I changed that messed it up. Seems like a longshot but if anyone has encountered the same problem please let me know. For some reason, when I run it in the django liveserver, it is all wrapped in a pre tag -
Getting django.db.utils.ProgrammingError: (1146, “Table ‘password_management.accounts_workspace’ doesn’t exist”) while making db migrations
I am trying to make migrations by running the following command: python manage.py makemigrations But, I am getting the below error: django.db.utils.ProgrammingError: (1146, "Table 'password_management.accounts_workspace' doesn't exist") I am using MySQL Database named as password_management. Earlier my Django app was working fine with all the user migrations and stuff. When I made this new Model Workspace, I am getting the above mentioned error. Full Error Details: Traceback (most recent call last): File "D:\Projects\meistery\venvs\inviteandresetpass\lib\site-packages\django\db\backends\utils.py", line 89, in _execute return self.cursor.execute(sql, params) File "D:\Projects\meistery\venvs\inviteandresetpass\lib\site-packages\django\db\backends\mysql\base.py", line 75, in execute return self.cursor.execute(query, args) File "D:\Projects\meistery\venvs\inviteandresetpass\lib\site-packages\MySQLdb\cursors.py", line 206, in execute res = self._query(query) File "D:\Projects\meistery\venvs\inviteandresetpass\lib\site-packages\MySQLdb\cursors.py", line 319, in _query db.query(q) File "D:\Projects\meistery\venvs\inviteandresetpass\lib\site-packages\MySQLdb\connections.py", line 254, in query _mysql.connection.query(self, query) MySQLdb._exceptions.ProgrammingError: (1146, "Table 'password_management.accounts_workspace' doesn't exist") The above exception was the direct cause of the following exception: Traceback (most recent call last): File "D:\Projects\meistery\projects\pricing_password_management_poc\inviteandresetpass\manage.py", line 22, in <module> main() File "D:\Projects\meistery\projects\pricing_password_management_poc\inviteandresetpass\manage.py", line 18, in main execute_from_command_line(sys.argv) File "D:\Projects\meistery\venvs\inviteandresetpass\lib\site-packages\django\core\management\__init__.py", line 446, in execute_from_command_line utility.execute() File "D:\Projects\meistery\venvs\inviteandresetpass\lib\site-packages\django\core\management\__init__.py", line 440, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "D:\Projects\meistery\venvs\inviteandresetpass\lib\site-packages\django\core\management\base.py", line 414, in run_from_argv self.execute(*args, **cmd_options) File "D:\Projects\meistery\venvs\inviteandresetpass\lib\site-packages\django\core\management\base.py", line 455, in execute self.check() File "D:\Projects\meistery\venvs\inviteandresetpass\lib\site-packages\django\core\management\base.py", line 487, in check all_issues = checks.run_checks( File "D:\Projects\meistery\venvs\inviteandresetpass\lib\site-packages\django\core\checks\registry.py", line 88, in run_checks new_errors = check(app_configs=app_configs, databases=databases) File "D:\Projects\meistery\venvs\inviteandresetpass\lib\site-packages\django\core\checks\urls.py", line … -
Django - Connect to post_init signal on model change form only
I would like to use a post_init signal connection on a model instance to call a remote API which will fetch some data and then use this as a sort of dynamic model property that gets assigned to that instance when the change form is loaded. Specifically, I have another system that uses a completely different framework that has a model that is (mostly) the same as a model I have in Django. The post_init signal should check the remote version to see if there are any images saved to it, and then assign this boolean as a dynamic model property to the Django model instance. This would give me a condition to check during the model's post_save signal that I can use to determine if I need to upload images to the remote model or not. Since this will be calling a remote system, I don't want the API call in post_init to be called for every single model instance when loading the admin model list page, I only want it to happen on the change form. How can I exclude this expensive API call from all post_init signals except for when it is triggered from the model instance's … -
django resource get all fields ( manytomany,foreign key etc.)
As you can see from my question, I want to download data from all other relevant tables from the users table. class UserResource(resources.ModelResource): class Meta: model = User fields = ['__all__'] # But I want ALL FIELDS ( foreign key fields etc.) -
How to debug Request body or attributes from spyne
from spyne import ComplexModel, String, Integer, Date, Boolean, Decimal, DateTime, ByteArray, Array country_code = String(max_len=2).customize( max_occurs=1, min_occurs=0, pattern='[A-Z]') guid = String(max_len=36).customize(min_occurs=0, max_occurs=1, pattern='[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}') send_date_time = DateTime.customize(min_occurs=0, max_occurs=1) status = String.customize(max_occurs=1, min_occurs=0) status_code = Integer.customize(max_occurs=1, min_occurs=0) inspector = String(max_len=255).customize(max_occurs=1, min_occurs=0) class Transport(ComplexModel): __namespace__ = '' name = String(max_len=255).customize(max_occurs=1, min_occurs=0) number = String(max_len=1024).customize(max_occurs=1, min_occurs=0) country_code = country_code declared_type = String(max_len=100).customize(max_occurs=1, min_occurs=0) declared_type_code = Integer arrival_date_time = DateTime() arrival_place = String(max_len=512).customize(max_occurs=1, min_occurs=0) document = String(max_len=255).customize(max_occurs=1, min_occurs=0) document_date = Date() document_number = String(max_len=255).customize(max_occurs=1, min_occurs=0) class Disinfection(ComplexModel): __namespace__ = '' date = DateTime(nillable=True) method = String(max_len=100).customize(max_occurs=1, min_occurs=0) chemical = String(max_len=100).customize(max_occurs=1, min_occurs=0) temperature_times = String(max_len=100).customize( max_occurs=1, min_occurs=0) concentration = String(max_len=100).customize(max_occurs=1, min_occurs=0) additional_info = String(max_len=2000).customize( max_occurs=1, min_occurs=0) class ProductDescription(ComplexModel): __namespace__ = '' name_rus = String(max_len=1024).customize(max_occurs=1, min_occurs=0) name_eng = String(max_len=1024).customize(max_occurs=1, min_occurs=0) name_botanic = String(max_len=1024).customize(max_occurs=1, min_occurs=0) code = String(max_len=1024).customize(max_occurs=1, min_occurs=0) hs = String(max_len=512).customize(max_occurs=1, min_occurs=0) hs_code = String(min_len=4, max_len=10).customize( max_occurs=1, min_occurs=0, pattern='[0-9]') origin_place = String(max_len=512).customize(max_occurs=1, min_occurs=0) origin_country = String(max_len=100).customize(max_occurs=1, min_occurs=0) origin_country_code = String(max_len=2).customize( max_occurs=1, min_occurs=0, pattern='[A-Z]') packages = Integer.customize(max_occurs=1, min_occurs=0) packages_unit = String(max_len=100).customize(max_occurs=1, min_occurs=0) packages_unit_code = String(max_len=3).customize( max_occurs=1, min_occurs=0) marking = String(max_len=255).customize(max_occurs=1, min_occurs=0) expert_opinion_date = Date() expert_opinion_number = String( max_len=255).customize(max_occurs=1, min_occurs=0) expert_samples = String(max_len=4096).customize(max_occurs=1, min_occurs=0) additional_info = String(max_len=1024).customize( max_occurs=1, min_occurs=0) class CertificateMinimumType(ComplexModel): __namespace__ = '' id = Integer.customize(min_occurs=0, max_occurs=1) guid … -
How to make different database settings for local development and using a docker
There is a django project that uses dockerisation to run in a production environment. The settings are as follows docker-compose.yaml version: "3.9" services: web: build: . ports: - "8000:8000" command: python manage.py runserver 0.0.0.0:8000 volumes: - .:/gpanel depends_on: - db db: image: postgres:13 volumes: - postgres_data:/var/lib/postgresql/data environment: - POSTGRES_USER=${DATABASE_USER} - POSTGRES_PASSWORD=${DATABASE_PASS} - POSTGRES_DB=${DATABASE_NAME} volumes: postgres_data: settings.py DATABASES = { "default": { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': env('DATABASE_NAME'), 'USER': env('DATABASE_USER'), 'PASSWORD': env('DATABASE_PASS'), 'HOST': env('HOST'), "PORT": env('PORT'), } } .env DATABASE_NAME=pg_db DATABASE_USER=db_root DATABASE_PASS=12345 PORT=5432 HOST=db So in settings.py the host parameter is passed as services name 'db' in the docker-compose.yaml file. This all works when running via docker, but I need to be able to run the project locally without docker. In the standard way for Django using a virtual environment. For this I created locally new database and user. The problem is that when running the command python manage.py runserver I'm getting error django.db.utils.OperationalError: could not translate host name "db" to address: Temporary failure in name resolution -
How to fix Django Messages Attribute Error
I'm using django messages for handling messages on my django project site. I'm developing cryptography project, whenever I try to run my project while going on decrypt function I get following error enter image description here my Decryption function of views.py is def textDecode(request): form = DecryptForm() if request.method == "POST": form = DecryptForm(request.POST) if form.is_valid(): try: encText = str(request.POST.get("encText")) encText = encText.replace(" ", "") encText = encText.replace("\n", "") q = AllData.objects.filter(finder = request.POST.get("finder"), encText=encText).first() d = ast.literal_eval(q.keys) finderLen = len(request.POST.get("finder")) encTextLen = len(encText) i = 0 data = "" while i <= encTextLen: encText_parts = encText[i : i + finderLen] for key,val in d.items(): if val == encText_parts: data += chr(key) i += finderLen messages.success(request, "Your decrypted text:") messages.success(request, "----------xxx----------") messages.success(request, data) messages.success(request, "----------xxx----------") return redirect('/textDecoded') except: messages.warning(request, 'Incorrect password or text.') return redirect('/textDecode') else: messages.success(request, "Incorrect password or text") return redirect('/textDecode') return render(request, 'home/textDecode.html', {'form': form}) and textDecoded.html, <div class="container"> {% if messages %} <ul class="messages"> {% for message in messages %} <li {% if message.tags %}class="{{message.tags}}"{% endif %}>{{message}}</li> {% endfor %} </ul> {% endif %} </div> I've been trying to fixed this but yet no success. How can I get rid of these error? -
How do i use the ForeignKey in Choices?
Here is my models.py class Devtool(models.Model): name = models.CharField(max_length=50, verbose_name='이름') kind = models.CharField(max_length=50, verbose_name='종류') content = models.TextField(verbose_name="개발툴 설명") class Post(models.Model): # devtool_CHOICES = ( # ('django', 'django'), # ('react', 'react'), # ('spring', 'spring'), # ('node.js', 'node.js'), # ('java', 'java'), # ('C++', 'C++'), devtool = models.ForeignKey(choices=Devtool.name, verbose_name="예상 개발툴", null = True) I want to replace devtool_CHOICES to "Devtool.name" How can I do? -
Nginx static not found 404
I am making an application in django. I added docker today, but I have a problem with static files. After using collectstatic, the files are copied to app_static, but in the console it appears: 2: No such file or directory, and a 404 error pops up in the browser. I can only access to /static/admin/css, but my css file is in /static/css, which also shows 404. nginx.conf: worker_processes 4; events { worker_connections 1024; multi_accept on; use epoll; } http { ## # Basic Settings ## charset utf-8; sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 0; types_hash_max_size 2048; server_tokens off; client_body_timeout 300; client_header_timeout 300; client_max_body_size 64m; send_timeout 300; fastcgi_buffer_size 128k; fastcgi_buffers 256 128k; fastcgi_send_timeout 900s; fastcgi_read_timeout 900s; proxy_read_timeout 900; proxy_ignore_client_abort on; uwsgi_buffer_size 32k; uwsgi_buffers 8 32k; uwsgi_busy_buffers_size 32k; uwsgi_read_timeout 900; uwsgi_send_timeout 900; uwsgi_connect_timeout 60; client_header_buffer_size 10k; large_client_header_buffers 16 10k; ignore_invalid_headers on; underscores_in_headers on; include /etc/nginx/mime.types; default_type application/octet-stream; ## # Logging Settings ## access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log; ## # Gzip Settings ## gzip on; gzip_disable "msie6"; gzip_vary on; gzip_proxied any; gzip_comp_level 7; gzip_buffers 64 8k; #gzip_min_length 1024; gzip_http_version 1.1; gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript image/svg+xml; upstream localhost { server web:8000; } server { listen 80; location / … -
The virtual environment is not activated in the pycharm terminal
I use pycharm, but my power shell does not recognize the virtual environment? What do you think I should do so that he can recognize the virtual environment? And that this happened after I moved my django project folder to another folder terminal setting : And that my virtual environment is recognized by pycharm and the application runs, but when testing the terminal, it does not recognize my virtual environment.