Migrate Django project from one PC to another

-1

Hello first of all, greetings and thanks for your interest, I have the following problem; I have developed a basic django project but I want to pass it from my pc to another new pc that I have bought and I do not know if I do the same as when I installed and copied the project or take a special treatment. If someone gives me some reference is appreciated. I'm using a WAMP server database.

    
asked by Deadpool909105 29.10.2018 в 22:57
source

1 answer

1

To pass your project from one PC to another, you must first analyze if you are interested in carrying the current database or not. In the case of not being it is easy.

  • Install django on your new PC
  • Install the necessary libraries that you have or require your project like ocr, opepyxl, xhtml2pdf ... etc ...

For greater ease of everything you have installed or the necessary libraries you must use the command:

pip freeze

This command will show you the complete list of all your libraries that your django project uses and its respective versions with this list, it is advisable to create a file called:

requirements.txt

this is usually at the height of the root of your project, with this list it is easier to migrate or move your projects from one place to another even for production. example of listing (requirements.txt):

docutils==0.11
Jinja2==2.7.2
MarkupSafe==0.19
Pygments==1.6
Sphinx==1.2.2

Once the project has been copied I have installed django in your new pc, you open a terminal or command console, either windows or linux, and to install the libraries, it would be something like this:

pip install -r requirements.txt

For more detail of this list I recommend you check this: Pip Freeze already with that you should create your superuser, make the makemigrations, migrate and runserver. basically that would be everything ... I hope I can guide and help you ... luck !!

    
answered by 30.10.2018 / 14:53
source