Code Monkey home page Code Monkey logo

locallibrary's People

Contributors

ahayek84 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

locallibrary's Issues

Running Local migrations

1 - Add model to models.py

from django.db import models

class Post(models.Model):
title = models.CharField(max_length=255)
date = models.DateTimeField(auto_now_add=True)
content = models.TextField()

def __str__(self):
    return self.title

2- python manage.py migrate locallibrary

install mod_wsgi on apache server Windows

reference
https://github.com/GrahamDumpleton/mod_wsgi/blob/develop/win32/README.rst

steps
---- this step is just for windows 64bit ---------------------------------
-1-install the visual c++ build tools. vs_buildtools__423186331.1536957503.exe

  • only the first three options + vc++2015.3
  • do not forget to hit install
  • download size can be 5 gigabytes

0- run as administrator
1- set "MOD_WSGI_APACHE_ROOTDIR=C:\wamp64\bin\apache\apache2.4.33"
2- conda install -c anaconda setuptools
3- pip install mod_wsgi
4- conda activate django --- >>> mod_wsgi-express module-config
5- Open httpd.conf using Admin rights.
Now, you will find a list of lines with LoadModule .... Just add the result above to that list.
restart apache.
6- pip install django
7- python -m django --version
8- conda activate django
8- django-admin startproject locallibrary
9- add this to your httpd-vhosts.conf

WSGIPythonHome "C:/Users/Abdullrahman ElHayek/AppData/Local/conda/conda/envs/django"
WSGIPythonPath "C:/wamp64/www/django_projects/locallibrary"

<VirtualHost *:80>
WSGIScriptAlias / C:/wamp64/www/django_projects/locallibrary/locallibrary/wsgi.py

ServerName locallibrary
Alias /static C:/wamp64/www/django_projects/locallibrary/locallibrary/static
<Directory C:/wamp64/www/django_projects/locallibrary/locallibrary>
	<Files wsgi.py>
	Require all granted
	</Files>
</Directory>
============ 10- add this to hosts file ============ 127.0.0.1 locallibrary ::1 locallibrary ============

11- change in the settings.py

ALLOWED_HOSTS = ['127.0.0.1','locallibrary']

reference
https://docs.djangoproject.com/en/2.1/howto/deployment/wsgi/modwsgi/

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.