Skip to content

Enable SQLite db_type in both app and test - #112

Open
AlezHibali wants to merge 1 commit into
hjlarry:masterfrom
AlezHibali:sqlite-enable
Open

AlezHibali wants to merge 1 commit into
hjlarry:masterfrom
AlezHibali:sqlite-enable

Conversation

@AlezHibali

@AlezHibali AlezHibali commented Oct 13, 2024

Copy link
Copy Markdown

This PR aims to enable SQLite db_type in both flask app and pytest. The final code runs without bugs and passes all 16 tests.

Issue:

When running in an environment where no database type (MySQL, Postgresql, etc.) is configured, the project will fail at the database setup. For my Windows11, I did not download MySQL and thus opening my services.msc results in no service on MySQL. This will lead to Can't connect to MySQL server on '127.0.0.1' ([WinError 10061] 由于目标计算机积极拒绝,无法连接。 in English would be The error (2003) Can't connect to MySQL server on 'server' (10061) indicates that the network connection has been refused.

How do I fix:

I modified the settings.py to allow a SQLite database type and I set the default db_type to SQLite. After solving this, users could run the project without downloading any database services.

Below is the code snippet of changes:

image

@Simatwa

Simatwa commented Dec 2, 2024

Copy link
Copy Markdown

Really useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants