Django deployment

34 views
Skip to first unread message

Goran Radanovic

unread,
Mar 24, 2018, 12:42:52 PM3/24/18
to Django users
I have set up a server with Ubuntu, Nginx, uwisg, Postgres and Django.  I got this part figured out its running multiple sites with each of its own virtalenv.

My development is on Windows 10 and pycharm, what I haven't figured out is how I can develop in pyCharm and then deploy to my server.

Do the environments have to be the same in development and production?

Is it possible to develop locally with f.ex SQLite and then deploy to the server that runs Postgres?

I don't know if I'm totally out of bounds here, please help me understand deployment.

Regards
Goran
 

graeme

unread,
Mar 24, 2018, 1:21:21 PM3/24/18
to Django users


On Saturday, March 24, 2018 at 12:42:52 PM UTC, Goran Radanovic wrote:
I have set up a server with Ubuntu, Nginx, uwisg, Postgres and Django.  I got this part figured out its running multiple sites with each of its own virtalenv.

My development is on Windows 10 and pycharm, what I haven't figured out is how I can develop in pyCharm and then deploy to my server.

I suggest you set up virtualenvs much as you did on the server.

Do the environments have to be the same in development and production?
 
No. There are advantages to them being the same though. Not necessarily identical, but I develop on Ubuntu and its near enough that things work the same on any Linux distro used for production by clients - I have run into problems with different Postgres versions when copying database dumps from production to development, and that is about it.

Is it possible to develop locally with f.ex SQLite and then deploy to the server that runs Postgres?

Yes, but you cannot use the postgres specific features provided by recent versions of Django: https://docs.djangoproject.com/en/1.11/ref/contrib/postgres/

Why not just install Postgres? 

Dylan Reinhold

unread,
Mar 24, 2018, 5:05:30 PM3/24/18
to django...@googlegroups.com
First off nothing wrong with using your windows 10 box for development.
Now using sqllite for your test could lead to issues when you go to deploy. I am guilty of doing to also some times.

But here is my deployment flow:

Develop on my laptop, check my changes into  git
Push my changes to github or bitbucket (I use both)
My projecst have CircleCI hooks, which will checkout my code and my run test cases (It will run them ageist a postgress DB, so here I get a test using postgress if i'm not using it local)
Then if the test cases pass, it runs a post script.
The post script checks out that branch on my server, and runs migrate, collectstatic, and has my web instances restart.

Dylan


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/0fb28790-e5f8-44e8-a332-7baa42e56ce9%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Derek Zeng

unread,
Mar 25, 2018, 5:31:26 PM3/25/18
to Django users
You may want to check out http://www.fabfile.org

It's a fairly popular deployment tool for Python projects.

It doesn't really matter what your local dev environment, but for the server it's relatively easier if it's Linux.

Reply all
Reply to author
Forward
0 new messages