Coder Social home page Coder Social logo

akshaybabloo / abies Goto Github PK

View Code? Open in Web Editor NEW
0.0 3.0 0.0 2 MB

:evergreen_tree: A Django based all-in-one web creator. (Not in development)

Home Page: https://abies.herokuapp.com/

License: MIT License

Python 4.84% CSS 21.93% JavaScript 67.21% HTML 5.82% PowerShell 0.19% Shell 0.01%
django micro-framework

abies's Introduction

Warning: This repo is not maintained anymore. See gollahalli-com for a different implementation.

Abies

๐ŸŒฒ A Django based all-in-one web creator.

Under development

Table of Contents

1 About the application

viewer is the font-end and editor is the back-end.

2 Additional files needed

The structure of this app is in such a way that it could be used to run on Heroku or on your local machine.

The main focus should be on /settings/ under 'Abies' folder, this folder contains the following files

settings
|
+-- __init__.py
+-- base.py
+-- local.py (ignored)
+-- common.py
+-- secrets.py (ignored)
'-- production.py

2.1 About __init__.py

This file is self-explanatory, if local.py is not found production.py is loaded.

2.2 About base.py

This file acts as a base to the application; this file is loaded when the application starts.

2.3 About local.py

This file is optional, but you will need it if you are planning it to run on your local machine.

This file contains almost everything in base.py, but it is only for your local system. The following is its content, just copy the code, create a file called local.py under /settings/ folder and paste it.

#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2016 Akshay Raj Gollahalli

"""
Django settings for Abies project.

Generated by 'django-admin startproject' using Django 1.10.

For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""

import os
from .secrets import *

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))


# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.10/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
# SECRET_KEY = In secrets.py

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS = ['*']


# Application definition

INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
]

MIDDLEWARE = [
    'django.middleware.security.SecurityMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
]

ROOT_URLCONF = 'Abies.urls'

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [],
        'APP_DIRS': True,
        'OPTIONS': {
            'context_processors': [
                'django.template.context_processors.debug',
                'django.template.context_processors.request',
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
            ],
        },
    },
]

WSGI_APPLICATION = 'Abies.wsgi.application'


# Database
# https://docs.djangoproject.com/en/1.10/ref/settings/#databases

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
    }
}


# Password validation
# https://docs.djangoproject.com/en/1.10/ref/settings/#auth-password-validators

AUTH_PASSWORD_VALIDATORS = [
    {
        'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
    },
]


# Internationalization
# https://docs.djangoproject.com/en/1.10/topics/i18n/

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.10/howto/static-files/

STATIC_URL = '/static/'

# Common stuff
from .common import *

2.4 About common.py

This file contains all the common stuff that needs to be used in local.py and base.py.

2.5 About secrets.py

Before you start the Django app, you would have to create secrets.py file under Abies -> settings -> secrets.py. This file consists of the following

SECRET_KEY = '{{ Your Secret Key }}'# Enter your 50 character secret key

Use 1.5.1 to generate the key.

2.5.1 Generating keys in Django style

Using Django's crypto package, you can generate random 50 character long key.

from __future__ import print_function
from django.utils.crypto import get_random_string

chars = 'abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)'
SECRET_KEY = get_random_string(50, chars)

print(SECRET_KEY)

3 What next?

Once you have all the files in the place, do the following:

Open Terminal (Linux) or Command Prompt (Windows), navigate to Abies folder and type in the following, which will create your database file and create an admin user:

python manage.py migrate
python manage.py createsuperuser

4 Running run.ps1

To run the PowerShell script, do the following:

powershell -ExecutionPolicy ByPass -File run.ps1

5 Running run.sh

To run the Bash script, do the following:

sh run.sh

abies's People

Contributors

akshaybabloo avatar

Watchers

 avatar  avatar  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.