This tutorial will demonstrate how to install Django and MariaDB on CentOS 7
Preferably inside virtual environment execute:
pip3 install django
MariaDB is needed (If you want, you can use mysql instead)
for this you need to enable MariaDB repos.
Inside /etc/yum.repos.d/ create file MariaDB.repo with contents:
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.3/centos7-amd64
gpgkey = http://yum.madiadb.org/RPM-GPG-KEY-MariaDB
gpgcheck = 1
Install required MariaDB packages:
yum install MariaDB-server MariaDB-client
django-admin startproject project_name
This will create a folder with the project_name to the current working directory.
install pymysql (Python MySQL connector)
pip3 install pymysql
Start MariaDB, login as root, create user, add database and add permissions to user (this user will be used to connect django to database):
systemctl enable mariadb <-- makes mariadb start at boot
systemctl start mariadb <-- root user will be created, write your credentials down for later usage.
mysql -u root -p <-- password will be prompted.
Now you should be logged in to mariadb shell as root user. Execute following commands:
CREATE DATABASE example_database;
CREATE USER 'example_username'@'localhost;
GRANT ALL PRIVILEGES ON example_database.* TO 'example_username'@'localhost' IDENTIFIED BY 'example_password';
FLUSH PRIVILEGES;
Now you can quit mysql.
Edit project_name/project_name/__init__.py to include these lines:
import pymysql
pymysql.install_as_MySQLdb()
Go to settings.py file in the same folder. Find DATABASES dictionary and edit it as follows:
DATABASES = {
'default' : {
'ENGINE' : 'django.db.backends.mysql',
'NAME' : 'project_name',
'USER' : 'example_username',
'PASSWORD' : 'example_password',
'HOST' : 'localhost',
'PORT' : '',
}
}
If gods are in our side, you should be able to run:
python3 manage.py runserver
if that passes, you can try to visit your server port 8000 with a web browser
SERVER_IP:8000
if that doesn't go trough, theres probably something wrong with your firewall settings. Fix them and try again.
THX.
Comments
Configuring Django and MariaDB on CentOS 7 | aknnn
It's really a great and useful piece of info.
I am happy that you shared this useful information with us.
Please stay us up to date like this. Thank you for sharing.
My web blog; Judi Jackpot Online
Configuring Django and MariaDB on CentOS 7 | aknnn
Hello There. I found your blog using msn. This is an extremely well written article.
I'll make sure to bookmark it and come back to read
more of your useful information. Thanks for the post. I'll certainly
comeback.
Feel free to surf to my weblog - Judi Jackpot Online
Configuring Django and MariaDB on CentOS 7 | aknnn
Hey there would you mind letting me know which webhost you're
using? I've loaded your blog in 3 different browsers and I must say this blog loads a lot quicker then most.
Can you suggest a good hosting provider at a honest price?
Thanks, I appreciate it!
my web blog Judi Jackpot Online
Configuring Django and MariaDB on CentOS 7 | aknnn
I am actually pleased to glance at this webpage posts which includes lots of useful
data, thanks for providing these information.
Feel free to surf to my web-site ... Judi Jackpot Online
Configuring Django and MariaDB on CentOS 7 | aknnn
Hi there mates, how is everything, and what you desire to say concerning this post, in my view its
actually awesome for me.
Take a look at my blog ... Judi Jackpot Online
Configuring Django and MariaDB on CentOS 7 | aknnn
Hi! I could have sworn I've been to this blog before but after browsing through some of the articles
I realized it's new to me. Regardless, I'm definitely
delighted I discovered it and I'll be bookmarking it and checking
back frequently!
Also visit my website - Judi Jackpot Online
Configuring Django and MariaDB on CentOS 7 | aknnn
This site was... how do I say it? Relevant!! Finally I have
found something that helped me. Thanks a lot!
Also visit my web page; Judi Jackpot Online
Add new comment | aknnn
Very useful, thanks for keeping us all up-to-date relating to your investing
success.
Also visit my homepage: Forex Steam
Configuring Django and MariaDB on CentOS 7 | aknnn
Does your website have a contact page? I'm having problems locating it but, I'd like to shoot you an email.
I've got some suggestions for your blog you might be interested in hearing.
Either way, great blog and I look forward to seeing it expand over time.
my webpage Judi Jackpot Online
Add new comment | aknnn
Very useful, thanks for keeping us all updated pertaining to your
investing success.
Visit my web-site; forex fury ea free download
Configuring Django and MariaDB on CentOS 7 | aknnn
What's Going down i am new to this, I stumbled upon this I've discovered It
positively helpful and it has aided me out loads.
I am hoping to give a contribution & help other customers like
its helped me. Good job.
Feel free to visit my site Judi Jackpot Online
Configuring Django and MariaDB on CentOS 7 | aknnn
Hey there! Someone in my Myspace group shared this site with
us so I came to give it a look. I'm definitely enjoying the information. I'm book-marking and will be tweeting this to my followers!
Outstanding blog and excellent style and design.
Here is my weblog; Judi Jackpot Online
Configuring Django and MariaDB on CentOS 7 | aknnn
Howdy! This is my first visit to your blog! We are a group of volunteers
and starting a new project in a community in the same niche.
Your blog provided us beneficial information to work on. You have done a wonderful job!
My blog Judi Jackpot Online
Configuring Django and MariaDB on CentOS 7 | aknnn
I'm gone to inform my little brother, that he
should also pay a visit this web site on regular basis to obtain updated from latest news.
my page Judi Jackpot Online
Configuring Django and MariaDB on CentOS 7 | aknnn
Greetings! Quick question that's entirely off topic. Do you know how
to make your site mobile friendly? My web site looks weird when browsing from my iphone.
I'm trying to find a template or plugin that might be able to fix this problem.
If you have any suggestions, please share. Many thanks!
Check out my blog post; Judi Jackpot Online
Configuring Django and MariaDB on CentOS 7 | aknnn
you're in reality a just right webmaster.
The website loading speed is amazing. It sort of feels that you're doing any distinctive trick.
Also, The contents are masterwork. you've done a
great activity on this topic!
My web site - Judi Jackpot Online
Configuring Django and MariaDB on CentOS 7 | aknnn
When I initially left a comment I appear to have clicked on the -Notify
me when new comments are added- checkbox and now whenever a comment is added I get four emails with the same
comment. Is there a means you are able to remove me from that service?
Thanks!
Feel free to visit my webpage - Judi Jackpot Online
Configuring Django and MariaDB on CentOS 7 | aknnn
A person essentially assist to make severely posts I'd state.
This is the first time I frequented your web page and to
this point? I amazed with the research you made to make this particular submit incredible.
Magnificent task!
Feel free to surf to my webpage ... Judi Jackpot Online
Configuring Django and MariaDB on CentOS 7 | aknnn
This design is steller! You most certainly
know how to keep a reader entertained. Between your wit and your
videos, I was almost moved to start my own blog (well, almost...HaHa!) Excellent job.
I really loved what you had to say, and more than that, how you
presented it. Too cool!
Also visit my site :: Judi Jackpot Online
Configuring Django and MariaDB on CentOS 7 | aknnn
Everyone loves it when people get together and share ideas.
Great site, continue the good work!
Feel free to visit my weblog Judi Jackpot Online
Configuring Django and MariaDB on CentOS 7 | aknnn
I know this website presents quality based content and
other stuff, is there any other site which gives these things in quality?
Also visit my blog Judi Jackpot Online
Configuring Django and MariaDB on CentOS 7 | aknnn
With havin so much content do you ever run into any issues of plagorism or copyright violation? My
blog has a lot of unique content I've either written myself or outsourced but
it appears a lot of it is popping it up all over the internet without my agreement.
Do you know any solutions to help reduce content from being
ripped off? I'd truly appreciate it.
my page: Judi Jackpot Online
Configuring Django and MariaDB on CentOS 7 | aknnn
I constantly spent my half an hour to read this website's posts all the
time along with a cup of coffee.
Take a look at my web-site: Judi Jackpot Online
Configuring Django and MariaDB on CentOS 7 | aknnn
Howdy! This is my first visit to your blog! We are a team of volunteers and
starting a new initiative in a community in the same niche.
Your blog provided us valuable information to work on. You have done
a extraordinary job!
Here is my web site :: Judi Jackpot Online
Configuring Django and MariaDB on CentOS 7 | aknnn
Hi! Quick question that's entirely off topic. Do you know how to make your site mobile friendly?
My blog looks weird when viewing from my iphone4. I'm trying to find a template
or plugin that might be able to correct this problem.
If you have any recommendations, please share. Appreciate
it!
Also visit my site: Judi Jackpot Online
Configuring Django and MariaDB on CentOS 7 | aknnn
You really make it seem so easy with your presentation but I find this matter to be actually something
that I think I would never understand. It seems too complicated and very
broad for me. I am looking forward for your next post, I will try to get the
hang of it!
my web site - Judi Jackpot Online
Configuring Django and MariaDB on CentOS 7 | aknnn
Incredible points. Great arguments. Keep up the great spirit.
My web site :: Judi Jackpot Online
Add new comment | aknnn
Good write-up. I absolutely appreciate this site. Thanks!
My web site; Agen Casino
Configuring Django and MariaDB on CentOS 7 | aknnn
When some one searches for his essential thing, so he/she
wishes to be available that in detail, therefore that thing is maintained over here.
Feel free to visit my web-site: Judi Jackpot Online
Configuring Django and MariaDB on CentOS 7 | aknnn
Hi there friends, its great article on the topic of tutoringand entirely defined, keep it up all the
time.
my webpage: Judi Jackpot Online
Configuring Django and MariaDB on CentOS 7 | aknnn
I know this web site provides quality dependent articles
and extra data, is there any other web site which
gives such stuff in quality?
My web page ... Judi Jackpot Online
Configuring Django and MariaDB on CentOS 7 | aknnn
It's going to be ending of mine day, however before finish I am reading this impressive piece
of writing to increase my knowledge.
Look at my web blog: Judi Jackpot Online
Add new comment | aknnn
Kitap Fuarı Indirimleri En Son Çıkan Kitaplar Türk Yazarlar
Also visit my web-site: pdf
Configuring Django and MariaDB on CentOS 7 | aknnn
Heya i am for the primary time here. I came across this
board and I to find It really helpful & it helped me
out much. I'm hoping to give something back and
help others such as you helped me.
Also visit my web site ... Judi Jackpot Online
Add new comment | aknnn
Türk Yazarların En Çok Satan Kitapları En Büyük Kitap
Check out my web site; download
Configuring Django and MariaDB on CentOS 7 | aknnn
This paragraph offers clear idea for the new viewers of blogging, that genuinely how to do blogging and
site-building.
Review my web blog: Judi Jackpot Online
Configuring Django and MariaDB on CentOS 7 | aknnn
I could not resist commenting. Very well written!
Stop by my homepage PokerQQ
Configuring Django and MariaDB on CentOS 7 | aknnn
We are a gaggle of volunteers and opening a brand new scheme in our community.
Your web site offered us with valuable info to work on. You've done an impressive
task and our whole neighborhood shall be thankful to you.
my web page :: Nagapoker - www.wyborez.com,
Configuring Django and MariaDB on CentOS 7 | aknnn
Remarkable issues here. I'm very glad to peer your article.
Thanks a lot and I'm having a look forward to contact you.
Will you please drop me a mail?
Check out my homepage Judi Poker [Terrence]
Configuring Django and MariaDB on CentOS 7 | aknnn
Attractive part of content. I just stumbled upon your weblog and in accession capital to say that I get actually loved account your weblog posts.
Any way I will be subscribing for your feeds or even I
success you get right of entry to consistently rapidly.
my website Agen Poker (Victorina)
Configuring Django and MariaDB on CentOS 7 | aknnn
I һave been exploring fοr a littⅼе bit for any hiigh
quality articles οr weblog poszts іn thhis sort of house .
Exploring іn Yahoo I ultimately stumbled սpon thіs website.
Reading tһis informatіon So i'm satisfied
tߋ exhibit that I've an incredibly excellent uncanny feeling I
discovered јust what I needed. І such a lot undoսbtedly wil make sᥙгe to don?t
overlook thіs site and рrovides it a glance regularly.
Ꮮook int᧐ my website ... velvet buzzsaw movie (Alycia)
Configuring Django and MariaDB on CentOS 7 | aknnn
I read this post fully regarding the resemblance of
newest and previous technologies, it's amazing article.
my web site; difference between masticating and centrifugal juicers (Arlene)
Configuring Django and MariaDB on CentOS 7 | aknnn
Just want to say your article is as astonishing. The clarity in your post is just nice and i can assume you are an expert
on this subject. Well with your permission allow me to grab your RSS feed
to keep updated with forthcoming post. Thanks a million and please continue the gratifying work.
my page; Poker88
Configuring Django and MariaDB on CentOS 7 | aknnn
always i used to read smaller articles or reviews which also
clear their motive, and that is also happening
with this post which I am reading now.
Here is my weblog ... Judi Jackpot Online
Configuring Django and MariaDB on CentOS 7 | aknnn
Ηey jսst wanted to give you a brief heɑds up and let you know
a few of the pictuгes aren't loading properly. I'm noot sure why
but I think its a linking issue. I've tried it in two different browsers and
oth shoѡ tthe same outcome.
Rеѵіew my homepage :: Instagram hack
Configuring Django and MariaDB on CentOS 7 | aknnn
I'm now not sure the place you are getting your information, however good topic.
I must spend a while learning more or understanding more.
Thank you for fantastic info I was in search of this info for my mission.
Feel free to visit my site: Chad
Configuring Django and MariaDB on CentOS 7 | aknnn
This design is steller! You definitely know how Where to buy vigrx plus
keep a reader amused. Between your wit and your videos, I was almost moved to start my own blog
(well, almost...HaHa!) Great job. I really enjoyed what you had to say, and more than that, how
you presented it. Too cool!
Configuring Django and MariaDB on CentOS 7 | aknnn
Your style is so unique in comparison to other folks I have read stuff from.
Thanks for posting when you have the opportunity, Guess I will just book mark this web site.
Also visit my blog post ... Agen Sbobet
Configuring Django and MariaDB on CentOS 7 | aknnn
Wonderful blog! I found it while surfing around on Yahoo
News. Do you have any suggestions on how to get listed in Yahoo News?
I've been trying for a while but I never seem to get there!
Appreciate it
Also visit my page best brand centrifugal juicer
This is the perfect web site for everyone who wants to find out about this topic.
You realize a whole lot its almost tough to
argue with you (not that I really would want to…HaHa).
You certainly put a new spin on a topic that has been discussed for
decades. Wonderful stuff, just great!
Review my web-site - Erektionsstörung (www.google.de)