Commit 0bde688b authored by nono's avatar nono
Browse files

Merge !68

parents 83c46e5b 6625a44b
Pipeline #2801 failed with stages
in 4 minutes and 21 seconds
......@@ -33,7 +33,7 @@ static build:
- source ./env/bin/activate
- pip install -r requirements.txt
- yarn install
- webpack
- yarn run webpack
- echo "DEBUG = False" > ./project/settings/env.py
- echo "SECRET_KEY = '$(pwgen 20 1)'" >> ./project/settings/env.py
- ./manage.py collectstatic
......
......@@ -4,9 +4,12 @@ This project uses Django 1.11 and python >= 3.5
## Requirements
To run the project, start a virtual environment and install
requirements.txt requirements-dev.txt contains additional dependencies
for development
To run the project, start a virtual environment:
$ virtualenv -p python3 env
$ source ./env/bin/activate
and install all required Python dependencies for development and build:
$ pip install -r requirements.txt
$ pip install -r requirements-dev.txt
......@@ -17,7 +20,7 @@ webpack (to compile local assets)
$ npm install -g yarn webpack
$ yarn install
$ webpack
$ yarn run webpack
In case you want to use the fixtures, you will need to install (git-lfs)[https://git-lfs.github.com/].
......
from url import URL
import urlpy
import re
URL_TRACKERS = [
......@@ -27,13 +27,13 @@ def cleanup_url(url_path, default_scheme="http"):
>>> cleanup_url("ü.com/??")
b'http://\xc3\xbc.com/'
"""
u = URL.parse(url_path)
u.defrag().deparam(URL_TRACKERS).canonical().unpunycode().strip()
u = urlpy.parse(url_path)
u.defrag().deparam(URL_TRACKERS).canonical().unpunycode()
if u.scheme == "":
u.scheme = default_scheme
return u.utf8
return str(u.escape())
def tag_comma_splitter(tag_string):
"""
......
......@@ -16,3 +16,4 @@ pygments
markdown
opengraph_py3
-e git+https://github.com/mariocesar/sorl-thumbnail.git#egg=sorl-thumbnail
urlpy
\ No newline at end of file
const webpack = require('webpack');
const path = require('path');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
module.exports = {
context: path.resolve(__dirname, 'static/src'),
......@@ -11,9 +12,7 @@ module.exports = {
rules: [
{
test: /\.css$/,
use: ExtractTextPlugin.extract({
use: 'css-loader?importLoaders=1!postcss-loader'
}),
use: [MiniCssExtractPlugin.loader, "css-loader"],
},
{
test: /\.(woff|woff2|ttf|eot|svg)(\?v=[a-z0-9]\.[a-z0-9]\.[a-z0-9])?$/,
......@@ -26,7 +25,9 @@ module.exports = {
filename: "./admin.min.js"
},
plugins: [
new ExtractTextPlugin('[name].bundle.css'),
new webpack.optimize.UglifyJsPlugin({minimize: true})
new MiniCssExtractPlugin({'filename': '[name].bundle.css'})
],
optimization: {
minimizer: [new UglifyJsPlugin()],
},
};
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment