Django - share media files during development - django

I want developers to use the same development database while developing a Django project so I've created a remote server with Ubuntu 18.04, created Postgres database and allowed remote access.
The problem is that there are missing pictures - media directory is in .gitignore because of production server. How I make media being shared (and editable) so any developer can see any image and assign image to object?
I was thinking about sharing it through git or to store media on production server where Postgres is but not sure how and if it's the best way to do this.

Funny setup...
2 thoughts:
Shared DB sure you have your reasons but why are you running a centralized dev server vs having developers run local and gain access to terminal logs with a DATABASE configuration that points to the remote DB?
You can stash an empty media directory or any other -- description on how at How can I add an empty directory to a Git repository?

Related

How to store postgresql database in django - project folder?

Where is postgreSQL database saved in a django folder (that which has manage.py)?
If not, I presume it must be stored in postgres folder of root directory.
Then, how to transfer this file to those systems having no postgres installed, so that when they run server, they can see seamlessly all the data/app?
Can we ask DJANGO to create the database file in its project folder itself and does this help in such transfers? Thanks.

How to decouple local directory and Heroku project

I am developing an app with Django and I successfully pushed it on Heroku.
This app has a postgres database and a form to allow users to fill the database.
I have coupled the local directory and Heroku, so that both if I run the server by command prompt, or if I access the app, and submit the form, my database get changed.
Now I want to make some experiments on the local database without changing the one on Heroku.
Is it possible?
Can I do it by just commenting the database URL in settings.py ?
I have searched for this matter on Google but I don't know the name it, so that I cound not find proper answer.
This is not a question of "decoupling" directories. It is because you are trying to use sqlite on Heroku, and you have added the sqlite file to your git repo.
You cannot use sqlite on Heroku; use the postgres add-on. Additionally, your sqlite file must not be in source control.

How to protect my .pyc files wont get extract out from docker

We have built the Django application dockerized till now there was no issue since we were hosting solution for a client, but now we also need to support in-house deployment which means my docker will be installed at the client machine. I see from the root access I can copy the files inside the docker. How we can save the copy issue from inside docker.
How to add such security in my docker? Please suggest.

I've installed django on dreamhost using passenger_wsgi now how do I export my development project onto this?

I followed the wiki on http://wiki.dreamhost.com/Django .
Django is installed in my site's directory and I've even created my first project, now what do I do ?
You can copy your project files to the server and transfer your database to the sql server on dreamhost. Don't forget to make changes in your settings.py to reflect the environment. Should work otherwise me thinks.

Creating a development environment for Django

We are starting a web project with Django (and are pretty new to this), and I was wondering what would been the best way to setup a productive development environment.
Here is some info:
We are 2 developers working on the project
We have a development/production server hosted on Webfactional (using an apache server)
The DB (MySQL) is hosted on this server
We are both using Eclipse with Pydev
The project is hosted on a Github repository
So far, we didn't setup any local development server, we are syncing modifications to the server through Github. But it is not really convenient...
We were thinking of setting up apache servers locally, that uses the remote database, and only sync once in a while.
Do you think it would be better?
Do you have other ideas/additional tips?
Thanks!
Don't try and share servers and databases while you're developing. You'll only get confused.
Each developer should have a local copy of MySQL on their own machine, and run the development server as mipadi recommends. Manage db schema changes via South, and keep data in fixtures or use South's data migrations. Each developer should commit to their local version of the git repository, but only push changes to Github when the particular task is complete and working (or, better, use a remote branch so that changes are synched, but only merge back to master when complete).
A good idea is to have a continuous integration server like Hudson/Jenkins that, after each commit to master, runs the tests and - if they pass - builds an up-to-date version of the site, which you can use for functional/user testing.
Edit to add There's no relationship between the development server and any particular database backend. As I recommend above, it is quite simple to install MySQL or PostgreSQL on your local machine, and use the development server against that. I have been working this way for several years, after initially encountering some of the issues you were worried about when switching between sqlite3 and the production MySQL db.
Django has its own development server that you can use for local testing.