Django + Python 3.4 + WAMP Apache 2.4.23 + Pycharm

Finally worked instance for hosting DEV site code on python and ability to resolve is as «on live» web server just on my laptop. A lot of different configurations changed but this is one working for me, and maybe can help you also. Better use EVERYTHING 32 bit for Window, you will suffer if you try to find some neededShort Read more —>

Gjango, Pycharm — static files Windows

This topic for those who broke his mind trying to understand how to make Pycharm run Django with static files I’ve made it, but be carefull it can break your mind too! The settings I use the most portable way to configure settings — so I can move it into centos web server without paths changes Win\Unix (I HOPE). ThereShort Read more —>

Django fast hints

Here some fast hints to remember: Migration: cd ~/myproject python makemigrations python migrate   Alias /static/ «/var/www/smm_tools/site/»  

Django static files

How to find where def. static stores? [root@test smm_py]# python3 findstatic css/base.css admin/js/core.js No matching file found for ‘css/base.css’. Found ‘admin/js/core.js’ here: /usr/local/lib/python3.4/site-packages/django/contrib/admin/static/admin/js/core.js Then move it into the folder you need. Then update django’s.conf file: Alias /static/ «/var/www/smm_tools/site/» And check the 103 # Static files (CSS, JavaScript, Images) 104 # 105 106 STATIC_URL = ‘/static/’  

Django + Python3.4 + Mysql(MariaDB)

Just hint for future me: [root@test smm_py]# vim [root@test smm_py]# python makemigrations import MySQLdb as Database ImportError: No module named ‘MySQLdb’ django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No module named ‘MySQLdb’ [root@test smm_py]# pip install mysql-python3 Collecting mysql-python Downloading (108kB) 100% || 110kB 812kB/s ImportError: No module named ‘ConfigParser’ —————————————- Command «python egg_info» failed with error codeShort Read more —>

Django + apache2 + mod_wsgi

This is conf file to allow apache run Django applications. # Web site at /var/www/smm_tools # Python scripts at /var/www/smm_tools/smm_py #LoadModule wsgi_module /usr/lib64/httpd/modules/ <VirtualHost *:80> ServerName ServerAlias ServerAdmin DocumentRoot /var/www/smm_tools/ ErrorLog «|/usr/sbin/rotatelogs /var/log/smm_tools/cargo.error.%Y-%m-%d.log 86400» CustomLog «|/usr/sbin/rotatelogs /var/log/smm_tools/cargo.access.%Y-%m-%d.log 86400» combined ServerSignature On Alias /css/ «/var/www/smm_tools/site/css» Alias /js/ «/var/www/smm_tools/site/js/» Alias /templates/ «var/www/smm_tools/site/templates/» Alias /fonts/ «/var/www/smm_tools/fonts/» #WSGIScriptAlias / /var/www/smm_tools/smm_tools.wsgi #WSGIPythonPathShort Read more —>

Вначале ты…

Вначале, ты решаешь поучить Python, начинаешь немного углубляться… … и приходишь в себя в тот момент, когда читаешь о фреймворках.