Coder Social home page Coder Social logo

fullstack-student-management-system's Introduction

FullStack Toy Project

Django + React toy project

A project using the Django + React.

This repo consists of a source code of a python script to make an interactive student management system using Django and React

How is it done?

You might be wondering that how the application performs many operations like creation, deletion, and update of assignments. Well, it was not that complicated as you may think. All these were achieved with the help of Database operation.

We all know that computers can store and retrieve data easily, so in order to do this operation, we used the Database. We have used queries to pick and formulate the data in a specific structure from Database.

Getting start

To get started with the code on this repo, you need to either clone or download this repo into your machine just as shown below;

git clone [email protected]:mountblue/cohort-16-python/gopinath_v/fullstack-toy-project.git

Part 1 Running the DRF App (Backend)

Step 1: Create Database and virtualenv

Move to project directory

$ cd fullstack-toy-project
$ cd dataproject-django-rest-framework

Create Database

$ sudo -u postgres psql
postgres=# \i create_db.sql
postgres=# \q

Install the virtualenv package

$ cd ..
$ pip install virtualenv

Create the virtual environment

To create a virtual environment, you must specify a path. You may provide any name in the place of :

$ virtualenv <mypython>

Activate the virtual environment

$ source mypython/bin/activate

Now you can load the requirements.txt.

Dependencies

Before running the application, you need to have some packages preinstalled. So I have provided all the required packages and their versions in requirements.txt file by running the below command you will be able to install all the packages.

$ cd dataproject-django-rest-framework
$ pip install -r requirements.txt

Step 2: Create and provide information to .env file.

To run this, you need to create and provide the environment values in .env file.

Create .env file

create a .env file inside studentapp folder

$ cd api
$ touch .env

provide these information inside .env file.

SECURITY_KEY=GENERATED_ONE
NOTE: Do not provide space inbetween = and key,value inside .env file

open the terminal

SECRET_KEY generation

$ python3
>>> import secrets
>>> secrets.token_hex(16)

Provide secret key in .env file.

for creating and accessing admin operations create superuser

cd ..
python3 manage.py makemigrations
python3 manage.py migrate
python3 manage.py createsuperuser
Note: provide your username and password in required place to create admin user.

Step 3: Running the application on server

$ python3 manage.py runserver

you can create the user by visiting register page http://127.0.0.1:8000/

Now open the new terminal

Part 2 Running the React App (Frontend)

Move to project directory

$ cd react-toy-project

install all dependencies

$ npm install

It will install all the dependencies required for the project.

run the application

$ npm start

Now, you can access your react app in the localhost port 3000 click here

Note : If you want to perform CRUD operation on assignments in app login as a super user and if you login as a normal user you can only able to view assignments.

Now move to the first terminal

Deactivate the virtual environment

if you have followed step1, use this command to get out of virtualenv

$ deactivate

Delete Database

$ sudo -u postgres psql
postgres=# \i delete_db.sql
postgres=# \q

fullstack-student-management-system's People

Contributors

mukund-mountblue avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.