Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/crispengari/python-backend

💎 A quick start for web server development using python flask, django and fastapi.
https://github.com/crispengari/python-backend

css django djangorestframework fastapi flask graphql graphql-api html javascript orm python redis scss server sqlalchemy-python typescript webdevelopment

Last synced: 4 days ago
JSON representation

💎 A quick start for web server development using python flask, django and fastapi.

Awesome Lists containing this project

README

        

### Python Backend

This repository contains some examples of backend applications using:

1. [Flask](https://flask.palletsprojects.com/en/stable/)
2. [Django](https://www.djangoproject.com/)
3. [Fast API](https://fastapi.tiangolo.com/)














### Creating a virtual environment

There are two ways of creating a virtual environment in python.

1. creating a virtual environment from a already exists folder.

- to create a virtual environment in the existing folder you first need to navigate to the folder that you wnt to create virtual environment by running the command:

```shell
cd myv
```

- then you run the following command to create a virtual environment

```shell
virtualenv .
```

> This just means create a virtual environment in the current directory.

2. creating a virtual environment and naming it.

- to create a virtual environment by name you run the following command:

```shell
virtualenv venv
```

### Activating virtual environment

To activate virtual environment you have to run the `activate.bat` file that will be generated in virtual environment that you have created for example:

```shell
.\venv\Scripts\activate
# or
.\venv\Scripts\activate.bat
```

> Activating the first virtual (myv) you will do it as follows:

```shell
.\Scripts\activate
# or
.\Scripts\activate.bat
```

### Deactivating virtual environment

To deactivate virtual environment you have to run the `deactivate.bat` file that will be generated in virtual environment that you have created for example:

```shell
.\venv\Scripts\deactivate
# 1.
.\venv\Scripts\deactivate.bat
```

> Activating the first virtual (myv) you will do it as follows:

```shell
.\Scripts\deactivate
# 1.
.\Scripts\deactivate.bat
```

> I recommend to navigate to the project directory after creating a virtual environment before installing packages:

```shell
📁 root
📁 venv
```

To install the packages after activating the virtual environment you just run the following command:

```shell
pip install

# example

pip install numpy
```

### Getting an error?

If you are getting a command error that says:

```shell
'virtualenv' is not recognized as an internal or external command,
operable program or batch file.
```

You could try to install `virtualenv` using pip as follows:

```shell
pip install virtualenv
```

Or

```shell
python -m pip install virtualenv
```