Turn off Execution Policy
Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope Process
Create a Virtual Environment
py -m venv env
Activate the Virtual Environment
env\Scripts\Activate.ps1
Deactivate the Virtual Envirtonment
deactivate
pip install django
cd clubfomo
Dependencies are installed using pip
pip freeze > requirements.txt
pip install -r requirements.txt
The database will be on MySQL
pip install mysqlclient
pip install mysql-connector-python
mysql -u root -p
DROP DATABASE IF EXISTS clubfomo_db;
CREATE DATABASE clubfomo_db;
CREATE USER 'clubfomo_user'@'localhost' IDENTIFIED BY '$password';
GRANT ALL PRIVILEGES ON clubfomo_db . * TO 'clubfomo_user'@'localhost';
USE clubfomo_db;
CREATE TABLE IF NOT EXISTS degenz
(
id
int(11) NOT NULL AUTO_INCREMENT,
title
char(200) NOT NULL,
caption
char(200) NULL,
img
varchar(200) NOT NULL,
is_featured
boolean NOT NULL,
PRIMARY KEY(id
)
)
ENGINE=MyISAM DEFAULT CHARSET=latin1;
USE clubfomo_db;
CREATE TABLE IF NOT EXISTS events
(
id
int(11) NOT NULL AUTO_INCREMENT,
title
char(200) NOT NULL,
date
DATE NOT NULL,
img
varchar(200) NOT NULL,
caption
varchar(1000) NOT NULL,
is_featured
boolean NOT NULL,
PRIMARY KEY(id
)
)
ENGINE=MyISAM DEFAULT CHARSET=latin1;
mysql -h localhost -D clubfomo_db -u clubfomo_user --password=$password;
py manage.py makemigrations
py manage.py migrate
py manage.py runserver