Blogs for tech and beyond from DSC-IEM community. With the help of this project we hope to provide the students of this community a platform to share, showcase and help each other in their exciting journey of learning and building amazing things.
We are using Python 🐍 and Django for our blog server
virtualenv blogenv
blogenv\Scripts\activate
pip install -r requirements.txt
python manage.py collectstatic
python manage.py makemigrations dscblog
python manage.py migrate --run-syncdb
python manage.py runserver 0.0.0.0:8000
(This will only work on linux)
gunicorn -b 0.0.0.0:80 dscblog.wsgi
For local setup, you can also use settings_dev.py
file
DJ_SECRET_KEY
: Django secret keyBASE_URL
: Root url of the server. eg:https://example.com
DATABASE_URL
: eg:postgres://user:password@localhost/dbname
HOST
: eg:example.com
optionals
EMAIL_HOST
: eg:smtp.gmail.com
EMAIL_HOST_USER
: eg:[email protected]
EMAIL_HOST_PASSWORD
: Your email password
To be abe to access the admin page /admin
you need a super user account.
python manage.py createsuperuser
A few features needs to be configured first before they can be used
-
In Django Admin page
/admin
go toSITES
make sure you have the domain name set properly. For local environment useDomain name
andDisplay name
ashttp://localhost:8000
-
In Django Admin page
/admin
go toSOCIAL ACCOUNTS > Social applications
Choosegoogle
as the provider and fill up the required info. Keepkey
field blank. Follow the docs for more info.
Once you have written some blogs, its time to feature some of them in the home page.
To feature a blog, go to Django Admin page /admin
, now go to DSCBLOG > Featureds
use ADD FEATURED
button and fill up the form, you can keep Info
field blank.
Note that your blog post must be public to actually show up in the featured section.