Categories
Mastering Development

Python, Nameko, nameko-sqlalchemy : Error : db_uris = self.container.config[DB_URIS_KEY] KeyError: ‘DB_URIS’

Hi everyone, First of all, I want to let you know that I am just beginning to learn about the python micro service library Nameko. I am trying to create a simple micro service that add a user in Sqlite database using nameko-sqlalchemy extention. When I try to run the micro service using the Nameko […]

Categories
Development

Python script on ubuntu – OSError: [Errno 12] Cannot allocate memory

I am running a script on AWS (Ubunut) EC2 instance. It’s a web scraper that uses selenium/chromedriver and headless chrome to scrape some webpages. I’ve had this script running previously with no problems, but today I’m getting an error. Here’s the script: options = Options() options.add_argument(‘–no-sandbox’) options.add_argument(‘–window-size=1420,1080’) options.add_argument(‘–headless’) options.add_argument(‘–disable-dev-shm-usage’) options.add_argument(‘–disable-gpu’) options.add_argument(“–disable-notifications”) options.binary_location=’/usr/bin/chromium-browser’ driver = webdriver.Chrome(chrome_options=options) […]

Categories
Development

django with celery raise No module named ‘kombu’ when runserver

I made a website with django and I use celery for asynchronous task, when I run: ./manage.py runserver I got the error: Traceback (most recent call last): File “./manage.py”, line 22, in <module> execute_from_command_line(sys.argv) File “/home/rouizi/OC_project13/venv/lib/python3.6/site-packages/django/core/management/__init__.py”, line 401, in execute_from_command_line utility.execute() File “/home/rouizi/OC_project13/venv/lib/python3.6/site-packages/django/core/management/__init__.py”, line 395, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File “/home/rouizi/OC_project13/venv/lib/python3.6/site-packages/django/core/management/base.py”, line 341, in run_from_argv connections.close_all() […]

Categories
Development System & Network

Django 2.2 deployment on RHEL 7 with apache, mod_wsgi, python3.7 venv

Any help is appreciated Here are the error logs I am getting. my django application is resided under /var/www. personality is my project folder [Sat Feb 29 22:28:12.317618 2020] [wsgi:error] [pid 30914] [remote 10.xx.xx.xx:57619] mod_wsgi (pid=30914): Failed to exec Python script file ‘/var/www/new-personality-server-2.0/personality/personality/wsgi.py’. [Sat Feb 29 22:28:12.317679 2020] [wsgi:error] [pid 30914] [remote 10.xx.xx.xx:57619] mod_wsgi (pid=30914): […]

Categories
Development

how do I resolve IndexError: list index out of range?

I am trying to replicate this repository: https://github.com/sujiongming/UCF-101_video_classification. I get the following error when I run the 2_extract_files.py file. Traceback (most recent call last): File “2_extract_files.py”, line 99, in <module> main() File “2_extract_files.py”, line 96, in main extract_files() File “2_extract_files.py”, line 38, in extract_files video_parts = get_video_parts(video_path) File “2_extract_files.py”, line 76, in get_video_parts filename = […]

Categories
Development

Unclear errors when trying to save data while overriding default ‘create’ method

Tried to write custom create method for my model, but run into some unclear errors. Here is my code: # models.py: class ItemModel(models.Model): item_id = models.CharField(max_length=10, primary_key=True) name = models.CharField(max_length=40) active = models.BooleanField(default=True) def __str__(self): return self.item_id class ItemVersion(models.Model): item_ver_id = models.CharField(max_length=13, primary_key=True) item_ver = models.TextField() config = models.TextField() model = models.ForeignKey(ItemModel, on_delete=models.CASCADE, default=0) session_id […]

Categories
Development

Deploying Flask app on NginX / Passenger server on Ubuntu 16.04 LTS in production mode on VPS

Question 1: What is the problem?: Following this tutorial I installed Nginx and Passenger on Ubuntu 16.04 to run Python Flask app and I run into this issue: When I visit my server at http://hXXXXXXX.stratoserver.net/ in the browser I am getting this error: We’re sorry, but something went wrong. Question 2: Passenger version and integration […]

Categories
Development

Django – Import Export – MultiValueDictKeyError at /upload/

Im using django import-export module and Im following this documentation: https://simpleisbetterthancomplex.com/packages/2016/08/11/django-import-export.html#importing-data I want to create an upload-page where the user can upload multiple files. This is how far I got: def upload_data(request): if request.method == ‘POST’: wo_resource = WorkordersResource() pl_resource = PlantResource() se_resource = SeriesResource() re_resource = ResourcesResource() rd_resource = ResourceDemandsResource() dataset = Dataset() wo_data […]

Categories
Development

Error while trying to run dsample project with django

I am getting the error while trying to run a project in django. The error is : Watching for file changes with StatReloader Exception in thread django-main-thread: Traceback (most recent call last): I have installed it in the virtual environment. The detailed error included below (venv) D:\djEnv\t2>python3 manage.py runserver Watching for file changes with StatReloader […]

Categories
Development

Firefox won’t open using geckodriver

I’m running my scripts through Cygwin and everything was working just fine until I had to reinstall it. Now my script freezes as soon as I try to open the browser, not giving any error. I’m using geckodriver v0.25.0 and firefox 66.0.4. Everything is the same as before as far as I know. Traceback (most […]