I try use dokku for my web projects - deployment become cool. But I can't find information about two things.
Can I autocreate database from dokku-util? How?
How and where store media files without using AWS? I want use only my vps'.
P.S. Or may be you see good materials about full workflow for dokku?
You can add plugins to dokku. Connect to your VPS, go to the /var/lib/dokku/plugins folder and then you can 'git clone' various plugins from github. There are a list of plugins on the dokku site that will create mysql, postgresql, redis, and other databases.
While the plugins work great, I prefer to run a second VPS that just hosts databases.
There isn't really a good way of serving static files directly from django--even when it's under docker. There is an app called dj-static that will help, but the author appears to be slow to update it for newer django releases. (https://github.com/kennethreitz/dj-static)
Related
So far, the only websites I've put in a hosted domain were with PHP. But since I work with Django I wonder if there would be any "barrier" or trouble when it comes about hosting a project, since Linux and IOS have Python installed by default but Windows not. Also it would be necessary to install tools such as Django itself, pillow, mysqlclient, etc...
I just want to know any possible barrier before going ahead. Thanks!
Everything depends on the server, if you have the necessary permissions to install and configure everything, you will not have any problem. How can be gunicorn, supervisor, nginx, etc.
For example services that you will not have any problem can be Amazon EC2, digitalocean, or any similar provider.
When I started with Django about 4 years ago I didn't know anything about servers, nginx and very little about databases but I found Djangoeurope on which I put my first websites.
They have managed databases (PostgreSQL and MySQL), one-click Django installs, reasonable prices and a very helpful staff.
I've since transitioned to using Docker on GCP, but for a beginner I can't recommend them enough: you can just concentrate on your Django code and you don't have to learn everything else at the same time.
I am hosting a Django site on the Heroku. However, Heroku does not allow databases with over 10 000 records stored for free. Can I store my database locally on a computer I have direct access to and still host the site on Heroku?
It is possible to use external database in Heroku by adding configuration:
heroku config:add DATABASE_URL=mysql://user:pass#server:port/database_name
But the question is what to I write for server in this case?
This is possible, but you will have to open up some ports on your local computer. Please look into port fowarding if you are into this. You are even able to post your whole website on your computer.
Personally I wouldn't recommend doing this, because you computer could become more vulnerable and you have to rely on your own home network and computer speed. Scaling is not easy with this setup.
However, there is (some kind of) an alternative. Django uses SQLite as the default database. You are able to use SQLite on Heroku. Please note that SQLite is not build for websites that interact a lot with your database and you cannot push a new build as easily as you would normally do. You will have to export the database first and then rebuild it later as Heroku creates a fresh website each time it builds (and the new database entries will be gone with that).
In other words: I would recommend to just pay for an upgrade of the database or move to another hosting company. I am sorry.
I'm new to Django and Heliohost and Heroku.
I don't see any guides online to setup and deploy a Django project from bitbucket for Heliohost. Can you guys point me in the right direction?
And I was wondering is hosting a Django project on Heroku free for small projects?
Should I switch from Heliohost to Heroku?
Thanks everybody. I appreciate your help.
I've hosted multiple small (free-heroku) projects with Heroku and Django - They work very well together. Especially if you don't have a lot of server experience.
Heroku has a straightforward django guide, and using git with your projects to push local changes into heroku is fast/easy.
Heroku has lots of plugins (many for free) that can help out even the smallest django application running on the free level. Memcache is a must, to keep your small apps running as quickly as possible.
All in all Heroku is a great way to host a Django Powered application, it's instantly scale-able when your application is ready to grow, but works well enough in the free capacity in order to let it grow !
Just wanted to ask if this was an 'acceptable' use of the django sites framework and heroku - and if there would be any trouble running the two sites:
Main differences between sites will be templates, and some objects only published to one or other (or both) sites - notably users should be able to use both sites using their single account.
I have my one codebase. Any change in my settings.py file is dealt
with by using heroku config variables.
I set up database that can be shared (either on an EC2 or using
Heroku dedicated dbs)
I git push my code to two different Heroku Apps
Hey presto - one codebase, two running instances of Django, two separate sites.
Any issues with that?
I went into great depth to answer this question in another thread, you can see my answer here: Multiple Django sites with shared codebase and DB
The short answer is NO, don't use the sites framework, use git branches.
I am completely new to this Django world. I haven't tried it ever before.
Now the problem is as below;
One of my clients was hosting his site somewhere else that I don't know and they built the site using Django. The host company doesn't allow to make any changes on their server, instead they provided the zip file for all the files in the site to me; so that now I can host my client's site.
As I don't know anything about Django, can someone please shed a light where I should start from?
Thanks in advance.
Cheers.
Sach
First of all, install Django on the development machine. Start by trying to get the development server run on your machine.
Gather requirements: check the settings.py for installed apps against the default Django settings.py file. See if there are any popular django apps that site depends on. If there are any, then you probably will have to install them, too.
In which format was the database provided? Will you move to another more appropriate format? Python bindings for databases are required too.
Considering the fact that you have inherited this project and probably will need to make some changes, consider installing django-south, so you can easily make changes to the database schema.
If you get the site running properly on your own machine, consider deplyoment. Is there a lot of static content? (if so, consider nginx). Set up apache2 and install the mod_wsgi module. Deploy.
Work your way through the Django tutorial first. Then look into Django Book as has been mentioned. Django IRC channel (#django) on Freenode is also great for help.
Your best bet would be to learn about Django before trying to jump in head first - https://www.djangoproject.com/ contains documentation as well as tutorials on creating Django apps.
Django is fairly easy to setup if you already have the code written. You'll need to install the chosen database and then simply follow the tutorial on the Django website
Django comes with a built-in server so it's very easy to run the website for development without needing Apache, nginx or much else.
I learned using the Django Book. Django is an easy-to-use framework, you should be fine.
Also, in the short-term there's a file called views.py and separate folder containing templates. If you're familiar with MVC (MVT in Django) this contains the views for the site in function form. There's probably (but not always) a folder for templates which contains a lot of the HTML for the site. Just a good starting pointing for basic modifications.
You can perhaps start here. https://docs.djangoproject.com/en/dev/howto/deployment/
First, find out the django version required by your client. Install that on a server (not a production one), setup apache and mod_wsgi. The zip files may go to a dir which can be included in the mod_wsgi configuration.
Find about the static files and setup apache or any other lightweight webserver to server it.
You may not be a developer, but have a try with the django book. It can give you a good idea how its structured.