Backend project in Django for kunaisoft
Follow every command below to put it running in your machine
Requirements: Python
-
Setting Repository in your machine
git clone https://github.com/Rvjonh/RESTFullAPI.git # clone the repository in the actual directory py -m venv .venv # creates a python environment .venv\Scripts\activate.bat # activate the environment (Windows) pip install -r requirements.txt # install dependencies for the project (ej. django)
-
Configure your local variables (Windows)
copy .env-copy .env # Make a copy of the file You need to fill all the variables ... to put it work full correctly
-
Configure your database system
In this section you will have to create a mysql database and add it to in the file django_project/settings, and modify the DATABASES section, if you have MySQL in your computer will easy, just follow these steps: How to connect MySQL to Django
or just change the DATABASE confi to:
DATABASES = { "default": { "ENGINE": "django.db.backends.sqlite3", "NAME": BASE_DIR / "db.sqlite3", } }
-
Start the development server
py manage.py makemigrations py manage.py migrate py manage.py runserver
-
Visit your server website url for development (Example)
Watching for file changes with StatReloader Performing system checks... System check identified no issues (0 silenced). December 25, 0000 - 07:00:00 Django version 4.1.5, using settings 'django_project.settings' Starting development server at http://127.0.0.1:8000/ Quit the server with CTRL-BREAK.
Already added test for user administration and CRUD in task model Django executes test with:
python manage.py test
To create a new Secreat Key for django.settings
python -c "import secrets; print(secrets.token_urlsafe())"